### MyPhysicsLab – 2-Dimensional Spring

PREV
HOME
NEXT

Instructions: drag square or circle with your mouse

Does the motion look random to you? Watch the graph for a while and you'll see its actually an intricate pattern.

#### Physics of the 2-Dimensional Spring

An immoveable (but draggable) anchor point has a spring and bob hanging below and swinging in two dimensions. We regard the bob as a point mass. We define the following variables:

- θ = angle (0=vertical)
- S = spring stretch (displacement from rest length)
- L = length of spring
- u = position of bob
- v = u'= velocity of bob
- a = u''= acceleration of bob

and some constants:

- R = rest length of spring
- T = position of anchor point
- m = mass of bob
- k = spring constant
- b = damping constant
- g = gravitational constant

Note that for this simulation the vertical dimension increases downwards.

We'll need the standard unit vectors, **i**,**j**. We use bold and overline to indicate a vector.

**i** = unit vector in horizontal direction
**j** = unit vector in vertical (down) direction

There are three vector forces acting on the bob:

**F**_{g} = m g **j** = gravity acting straight down

**F**_{s} = -k S (sin θ **i** + cos θ **j**) = the spring pulling (or pushing) along the line from bob to anchor point.

**F**_{b} = -b (v_{x}**i** + v_{y}**j**) = damping (friction) acting opposite to the direction of motion of the bob, ie. opposite to its velocity vector.

Summing these forces and using Newton's second law we get:

m **a** = **F**_{g} + **F**_{s} + **F**_{b}

m (a_{x}**i** + a_{y}**j**) = m g **j** - k S (sin θ **i** + cos θ **j**) -b (v_{x}**i** + v_{y}**j**)

We can write the vector components of the above equation as separate equations. This gives us two simultaneous equations. We also divide each side by m.

a_{x} = -(k/m) S sin θ - (b/m) v_{x} (eqn 1)

a_{y} = g - (k/m) S cos θ - (b/m) v_{y}

These are essentially the equations of motion. It only remains to show how S sin θ and S cos θ are functions of the position of the bob. The displacement of the spring S is the current length of the spring minus the rest length.

S = L - R

The length is easily derived using the pythagorean theorem from the position of the bob, u, and the position of the anchor point, T.

L = √((u_{x} - T_{x})^{2} + (u_{y} - T_{y})^{2})

The sine and cosine of the angle are given by the following:

sin θ = (u_{x} - T_{x})/L

cos θ = (u_{y} - T_{y})/L

#### Numerical Solution of the 2-Dimensional Spring

To solve the equations of motion numerically, so that we can drive the simulation, we use the Runge-Kutta method for solving sets of ordinary differential equations. We only need to convert the two second order equations (1) to four first order equations.

u_{x}' = v_{x}

u_{y}' = v_{y}

v_{x}' = -(k/m) S sin θ - (b/m) v_{x}

v_{y}' = g - (k/m) S cos θ - (b/m) v_{y}

We also keep in mind that S sin θ and S cos θ are functions of the position of the bob, u_{x}, u_{y}, as given above.