River Boat Issue

Activity Information

Learning Goals

  • Use vectors to understand relative motion
    • Determine the correct launch angle of a boat to cross a river analytically and computationally

Prior Knowledge Required

  • Vectors
  • Relative motion
  • SI Units

Code Manipulation

  • Interpreting existing code
  • Editing existing code

Activity

Handout – River Boat Issue

The BLUE arrow represents the flow of the river. The WHITE arrow represents the speed of the boat. (The red dot is just the origin of the screen. Not important) Open the code below in trinket.io and follow the directions below.

  1. Change thetaindegrees value over and over until you get your boat to cross the river. What value lets the boat move straight across the river?
  1. Of the following words in the code, identify what you believe they are short for. What is the computer identifying these things as?
  • sboatwater
  • thetaindegrees
  • vwatershore
  • t
  • tf
  • water.pos
  • boat.pos
  1. Change the speed of the river to be 10 m/s. What angle is needed for the boat to move straight across the river now?
  1. Change the speed of the boat to be 12 m/s. What angle is needed for the boat to cross the river now?
  1. Give your best guess as to WHY the angle you found was different at the different speeds given?

Code

Link

GlowScript 2.9 VPython

get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js')

scene.width = 900
scene.height = 500
scene.range = 20

#Objects
W = 20
origin = cylinder(pos=vector(0,0,0), axis=vector(0,0,0.1), radius=0.2, color=color.red)
water = box(pos=vector(-30,0,0), height=W, width=0, length=200, color=color.blue, opacity=1)
boat = sphere(pos=vector(0,-W/2,0), radius=0.4, color=color.white)


#Parameters and Initial Conditions
sboatwater = 10

thetaindegrees = 90
thetainrad = thetaindegrees*2*pi/360

dirboat = vector(cos(thetainrad),sin(thetainrad),0)

vboatwater = sboatwater*dirboat

vwatershore = vector(5,0,0)


#Time and time step
t=0
tf=10
dt=0.01

#MotionMap/Graph
vboatwaterMotionMap = MotionMap(boat, tf, 15, markerScale=0.5, labelMarkerOrder=False, markerColor=color.orange)

#Vector Arrows
waterspeed = arrow(pos=vector(0,0,0), axis=vwatershore*0.7, shaftwidth=0.35, color=color.blue)
boatvector = arrow(pos=vector(0,-10,0), axis=vboatwater*0.7, shaftwidth=0.35)

#Calculation Loop
while boat.pos.y <= W/2:
    rate(100)
    
    water.pos = water.pos + vwatershore*dt
    boat.pos = boat.pos + vboatwater*dt + vwatershore*dt
    waterspeed.pos = water.pos
    boatvector.pos = boat.pos
      
    t = t + dt

Answer Key

Handout

1. 120 degrees

2.

  • sboatwater: The speed of the boat relative to the water. The computer reads this as a “float,” which means it is just a number. It is a scalar quantity.
  • thetaindegrees: the angle in degrees between the shoreline and the velocity vector of the boat, normal to the right side of the shore. The computer reads this as a float as well.
  • vwatershore: the velocity of the water relative to the shore. The computer reads this as a vector, or three different floats.
  • t: Time, the current time. A float and a scalar quantity.
  • tf: Final Time, the highest t value the model can have. A float.
  • water.pos: The position of the water. A vector.
  • boat.pos: The position of the boat. A vector.

3. This is impossible, when the speed of the water relative to the shore and the velocity of the boat relative to the water are the same, the boat can’t move straight across.

4. About 146 degrees.

5. Its possible to solve for this angle analytically:

We can make a right triangle that has the velocity of the boat relative to the water as the hypotenuse like this:

The x component of the velocity of the boat relative to the water is equal to V(b/w)*cos(θ). If we want the boat to move straight across the river, then this component will be equal to the velocity of the water relative to the shore, which will let us solve for θ:

v(b/w)*cos(θ) = v(w/s) => θ = arccos(v(w/s)/v(b/w))

Plugging in the values from 4 yeilds 33.56 degrees for θ. However, thetaindegrees in the code is the angle from the right, not the left, so to find the appropriate value for thetaindegrees, we must do 180 – θ, which is 146.44 degrees.

Code

Link

GlowScript 2.9 VPython

get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js')

scene.width = 900
scene.height = 500
scene.range = 20

#Objects
W = 20
origin = cylinder(pos=vector(0,0,0), axis=vector(0,0,0.1), radius=0.2, color=color.red)
water = box(pos=vector(-30,0,0), height=W, width=0, length=200, color=color.blue, opacity=1)
boat = sphere(pos=vector(0,-W/2,0), radius=0.4, color=color.white)


#Parameters and Initial Conditions
sboatwater = 12

thetaindegrees = 146.443
thetainrad = thetaindegrees*2*pi/360

dirboat = vector(cos(thetainrad),sin(thetainrad),0)

vboatwater = sboatwater*dirboat

vwatershore = vector(10,0,0)


#Time and time step
t=0
tf=10
dt=0.01

#MotionMap/Graph
vboatwaterMotionMap = MotionMap(boat, tf, 15, markerScale=0.5, labelMarkerOrder=False, markerColor=color.orange)

#Vector Arrows
waterspeed = arrow(pos=vector(0,0,0), axis=vwatershore*0.7, shaftwidth=0.35, color=color.blue)
boatvector = arrow(pos=vector(0,-10,0), axis=vboatwater*0.7, shaftwidth=0.35)

#Calculation Loop
while boat.pos.y <= W/2:
    rate(100)
    
    water.pos = water.pos + vwatershore*dt
    boat.pos = boat.pos + vboatwater*dt + vwatershore*dt
    waterspeed.pos = water.pos
    boatvector.pos = boat.pos
      
    t = t + dt