Help with code.

31 views
Skip to first unread message

Jon

unread,
Nov 29, 2015, 10:13:45 PM11/29/15
to VPython-users
I realize this isn't the most efficient way to create a pendulum but I'm lost as to why it isn't working, any help?
Moving Pendulum.py

Bruce Sherwood

unread,
Nov 30, 2015, 12:09:53 AM11/30/15
to vpytho...@googlegroups.com
The following statement doesn't make sense, because even if you assume that the force of the rod points along the rod you have to get its magnitude from a vector calculation:

magFarm=(((box.m)*(v**2))/R)-mag(Fg) #magnitude of force of arm

Let w = z component of angular velocity
Neglect mass of rod

dL/dt = torque, around the pivot point
L = md^2w, where L is z component of angular momentum, d is length of rod
md^2 dw/dt = -mgdsin(theta), where w = dtheta/dt

Then:

w = w - ((g/d)*sin(theta))*dt
theta = theta + w*dt

Reply all
Reply to author
Forward
0 new messages