Try using the graph and changing parameters like mass or spring stiffness to answer these questions about the spring simulation:

- What is the relationship between acceleration and position?
- How do mass or spring stiffness affect the relationship between acceleration and position?
- How do mass or spring stiffness affect the period or frequency of the oscillation?

You'll find the answers below.

To show the graph and parameters, click on the "show graph+controls" button above. You can set what variables are shown on the vertical or horizontal axis by selecting from the pop-up menu above. To change a parameter, click on it, type the new value and hit the enter key.

A spring generates a force proportional to how far it is stretched (and acting in the opposite direction to the stretch)

F = -k*stretch

Assume that the origin is at the connection of the wall and spring. Define the following variables and constants

- x = position of the block
- v = velocity of the block
- m = mass of the block
- R = rest length of the spring
- k = spring stiffness

We assume that k>0. The stretch of the spring is given by

stretch = x - R

If we adjust our coordinate system so that

stretch = x

So the force equation becomes

F = - k x

Combining this with Newton's law of motion

-k x = m x''

or equivalently:

x'' = -(k/m)x

If you set the graph on the simulation to plot acceleration against position, you will get a straight line, with slope

To solve this equation numerically (ie. by computer) we use the Runge-Kutta method. To do so we need to convert the second order differential equation

x'' = -(k/m)x

into a set of first order differential equations. First we define a new variable, velocity, as

x' = v

v' = -(k/m)x

This is the form that we need in order to use the Runge-Kutta method for numerically solving the differential equation.

To begin the simulation, we initialize the two variables

Assuming that the initial velocity of the block is zero, the analytic solution is given by

x(t) = x0 cos(sqrt(k/m) t)

where

t = 2π sqrt(m/k)

The frequency is the inverse of the period so,

frequency = (1/2π) sqrt(k/m)

So we predict that

- increasing mass by 4 times doubles the period and halves the frequency;
- increasing spring stiffness by 4 times halves the period and doubles the frequency;

You can check these predictions by modifying the parameters on the simulation (you'll need a stopwatch to time the frequency).

Here is the derivation of the analytic solution.

Question: What is the relationship between acceleration and position?

Answer: It is a *linear* relationship as given by the equation

Question: How do mass or spring stiffness affect the relationship between acceleration and position?

Answer: From the equation

- Increasing mass makes the line
*less steep*. - Increasing spring stiffness makes the line
*steeper*.

Question: How do mass or spring stiffness affect the period or frequency of the oscillation?

Answer: The analytic solution is

x(t) = x0 cos(sqrt(k/m) t)

and the frequency is given by

frequency = (1/2π) sqrt(k/m)

So we predict that

- increasing mass by 4 times doubles the period and halves the frequency;
- increasing spring stiffness by 4 times halves the period and doubles the frequency;