Elise Livingston                                                                    

VPython Momentum Lab

Program

Picture
from visual.graph import *
from visual import *
scene.y = 400 # move animation window down 400 pixels from top of screen
track = box(pos=vector(0,-.05, 0), size=(1.0, 0.05, 1.0), color=color.red)
cart = box(pos=vector(-0.5,0,0), size=(0.1, 0.04, 0.06), color=color.red)
cart.m = 0.80
cart.p = cart.m*vector(0.7, .1, 0)
deltat = 0.01
t = 0

track = box(pos=vector(0, -0.5, 0), size=(1.5, .3, 1.0), color=color.yellow)
track = box(pos=vector(0, 0.5, 0), size=(1.5, .3, 1.0), color=color.yellow)

mgraph = gcurve(color=color.red)
cart.trail = curve(color=color.yellow)
while t<3.0:
    rate(100)
    Fnet = vector(-0.4, 0, 0)
    cart.p = cart.p + Fnet*deltat
    print "t=",t,"cart.p=",cart.p
    cart.pos = cart.pos + (cart.p/cart.m)*deltat
    t = t + deltat
    mgraph.plot( pos=(t, cart.p.x) )
    cart.trail.append(pos=cart.pos)

Analysis Questions

(1) Using the printed list of momentum vectors, calculate p v Δ . That is, pick one of the vectors to be the final momentum, and subtract from it the vector just above it, which is the initial momentum: Δp = p f pi = ?,?,? kg m/s
   p f =  <-0.64, 0.08, 0>
   
pi = <-0.636, 0.08, 0>
   Δp = p f pi = <-0.004, 0, 0> kg m/s


(2) Calculate the vector F netΔ (in the program, this would be Fnet*deltat.) Fnet Δt= (?,?,?) N s
Fnet*deltat=
    (-0.4)(0.01) = -0.004 = J


(3) Do your calculations show that the change in momentum p v Δ is equal to Fnet Δt
         yes. The change in momentum data that I obtained was the same as the impulse that I calculated.

(4) Look at the printed list of momentum vectors again. Why aren’t the y or z components of the momentum changing?
       The x components are the only parts of the vector that change because, in the simulation, the momentum is only in the x-       direction.