# MyPhysicsLab – Dangling Stick

This simulation shows a dangling stick which is a massless rigid stick with a point mass on each end. One end of the stick is attached to a spring, and gravity acts.
Click "show controls" and then you can change parameters in the simulation such as mass, gravity, and damping. You can drag either end of the stick with your mouse to change the starting position. The "reset" button puts the simulation in a motionless equilibrium.

Can you find the bug in this simulation? Play with it for a while and see if you can determine when the bug occurs. Perhaps you can even have a theory for why it occurs. The answer is found below.

คลิกเข้าไปทดลอง  คลิกค่ะ

## Physics

dangling stick variables

The equations of motion are derived by the Lagrangian method. The three independent variables are:

• r = length of spring

• θ = angle of spring (0 = vertical down)

• φ = angle of stick (0 = vertical down)

We use subscript 1 for the mass at the spring-stick intersection, and subscript 2 for the mass at the free end of the stick. The cartesian (x, y) position of the point masses is represented by R1, R2. Note that we use bold and overline to indicate a vector quantity.

Other constants are:

• m1 = mass amount at spring-stick intersection

• m2 = mass amount at free end of stick

• S = length of stick

• k = spring stiffness

• h = spring rest length

• g = gravity constant

## Kinematics of Dangling Stick

First we calculate the kinematics.   That is, we find expressions for the positions R1, R2 of the two masses in terms of the independent variables r, θ, φ.   Then we differentiate to get the velocities. Note that kinematics is purely an exercise in geometry, there is no information about the forces involved at all. R1 = {r sin θ,   −r cos θ} R2 = {r sin θ + S sin φ,   r cos θS cos φ)} The two components of the positions correspond to {x, y} respectively.   Next differentiate to get the velocities of the masses, v1, v2 R1' = v1 = {r θ' cos θ + r' sin θ,   r' cos θ + r θ' sin θ } R2' = v2 = {r θ' cos θ + r' sin θ + S φ' cos φ,   r' cos θ + r θ' sin θ + S φ' sin φ}

## Energy and the Lagrangian

Next we get separate expressions for the kinetic energy T and potential energy V of the system. The difference of the two is the Lagrangian L = TV.

Kinetic energy is given by 12 m v2.   Note that we use the vector dot product to square the velocity vector, v2 = v · v.   So we have T = 12 m1 v1 · v1 + 12 m2 v2 · v2 The potential energy is from the spring energy and the gravitational potential of the two point masses. V = k2 (rh)2m2 g (r cos θ + S cos φ)m1 g r cos θ

## Equations of Motion

To find the equations of motion, we evaluate the Lagrangian equation once for each of the three independent variables. 0 = 0 = 0 = The three Lagrangian equations can now be solved to find expressions for the second derivatives r'', θ'', φ''. After using a computer algebra program such as Mathematica we find the following equations of motion.

 r'' = 1 ( k (2 m1 + m2) (h − r) + 2 m1 (m1 + m2) r θ'2 + 2 g m1 (m1 + m2) cos θ + 2 S m1 m2 φ' 2 cos (θ − φ) − k m2 (h − r) cos(2θ − 2φ) ) 2 m1 (m1 + m2)

 θ'' = 1 ( k m2 (h − r) sin(2θ − 2φ) − 2 g m1 (m1 + m2) sin θ − 4 m1 (m1 + m2) r' θ' + 2 S m1 m2 φ' 2 sin(θ − φ) ) 2 m1 (m1 + m2) r

 φ'' = k (h − r) sin(θ − φ) S m1

This is almost ready for the Runge-Kutta algorithm to numerically solve the equations. All that is needed is to change these 3 second order equations to 6 first order equations by defining separate variables for r', θ', φ'. Let the new variables be respectively vr, vθ, vφ. Then the left-hand side of the above equations of motion become vr', vθ', vφ' and the three additional equations are simply r' = vr
θ' = vθ
φ' = vφ

## A Bug

There is a problem in the equations of motion when the length of the spring r goes to zero, because then one of the second derivatives (the one for θ'' ) goes to infinity.   If you play with the simulation long enough you will likely see this happen.

Here is my idea for why it blows up: The rate that the angle of the spring changes depends on the torque (twist) applied, which is partially dependent on the length of the spring. When the length goes to zero, the torque goes to infinity.

In the real world, springs never reach zero length. To eliminate this bug, we would need to model the spring with a non-linear force. As the spring compressed to near zero (or to near its smallest possible length) the force would go to infinity.

# MyPhysicsLab – Physics Simulation with Java

Click on one of the physics simulations below... you'll see them animating in real time, and be able to interact with them by dragging objects or changing parameters like gravity. Get Java software if you don't already have it.
 single spring double spring pendulum chaotic pendulum double pendulum 2D spring double 2D spring colliding blocks cart with pendulum dangling stick rigid bodycollisions sumo wrestlinggame roller coaster roller coasterwith spring roller coasterwith 2 balls roller coasterwith flight molecule 2 molecule 3 molecule 4 molecule 5 molecule 6

ศัพท์วิทยาศาสตร์ ฉบับราชบัณฑิตสถาน

A  B  D  F  G  H  I  J  K  L  M  N  O  Q  R  S  T  U  V  W  X  Y

ถ                                       อ

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 หมวด : ก | ข | ค | ซ | ฐ | ด | ต | ท | น | ป | ผ | พ | ฟ | ภ | ม | ย | ร | ล | ว | ศ | ส | ห | อ | ฮ |

พจนานุกรมเสียง 1   แมว    วัว 1    วัว 2    วัว 3    เหมียว   แกะ     พจนานุกรมภาพการ์ตูน

 การเรียนการสอนฟิสิกส์ 1  ผ่านทางอินเตอร์เน็ต 1. การวัด 2. เวกเตอร์ 9.  การหมุน 12. ความยืดหยุ่น 17.  คลื่น การเรียนการสอนฟิสิกส์ 2  ผ่านทางอินเตอร์เน็ต 10. ทรานซิสเตอร์ 16. นิวเคลียร์

ครั้งที่

ภาพประจำสัปดาห์