Spring Motion

An investigation of mathematical models for spring motion and the effect of damping.

Enter the following line to load the necessary package.

<< Statistics`DescriptiveStatistics`

Part 1. The Undamped Spring

Enter your data for the "undamped" spring,starting with the number of readings and the time step between them.  The text within (* *) is a comment and will not affect compilation.

n  =  ?; 
dt  =  ?; 
K  =  ?; 
\(\(m\  = \ ?;\)\  (*\ Total\ mass\ *) 
\)

Enter your distance readings in the list V, separated by commas, and calculate the average of these data.

V  = { };
mean1  =  Mean[V]

Now we graph the data versus time.  We subtract the mean so that the data is centered about 0 on the vertical axis.  The "k - 1" in the plot command reflects the fact that the list numbering starts at 1, but our time starts at t = 0.

graph1  =  
      ListPlot[Table[{(k - 1)*dt, V[[k]] - mean1},  {k, n}],  
        PlotStyle -> PointSize[0.015]]

Complete the definition of the modeling function and enter it.  You will need to enter a value for y0 in place of "?" and complete the definition of the function Y.

y0  =  ?;
Y[t_] :=  ?;

Next we graph the data and the model function together.

graph2  =  
        Plot[Y[t], {t, 0, 7}, PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
Show[graph1, graph2, 
        DisplayFunction -> $DisplayFunction];

Part 2. The Damped Spring

Enter your data for the damped spring,starting with the number of readings and the time step between them.

\(
n\  = \ \(?;\ (*\ Number\ of\ distance\ readings\ *)\)\)
dt  =  ?;

Enter your distance readings in the list Z, separated by commas.  As before, we calculate the average of these data.

Z  = { };
mean2  =  Mean[Z]

Here is a plot of this data.

graph3  =  
        ListPlot[Table[{(k - 1)*dt, Z[[k]] - mean2},  {k, n}],  
          PlotStyle -> PointSize[0.015]];

Enter the components of your approximating function.

R  =  0;
L  =  0;
theta  =  0;
delta  =  0;
Clear[y];
y[t_] :=  R*Exp[-L*t]*Cos[theta*t - delta];

Graph y[t] and the data together.  Adjust the constants until you are satisfied with the fit.

graph4  =  
        Plot[y[t], {t, 0, 7},  PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
Show[graph3, graph4, 
        DisplayFunction -> $DisplayFunction];

Now enter your formula for L in terms of c and m.

Use your value of L to estimate the value of c in the differential equation.

Part 3. Critical Damping

Experiment with the solutions of the initial value problem as you increase c in the differential equation.  In the definition of diffEq below, enter your final value for c (in place of 300), and plot the solution of the resulting initial value problem.  Increase c in steps of 500, and record what happens.

c  =  300;
Clear[y];
diffEq  =  y''[t] + (c/m)*y'[t] + (K/m)*y[t] == 
          0;
solution  =  
        NDSolve[{diffEq,  y[0] == -0.2,  y'[0] == 0},  
          y,  {t, 0, 3}];
intcurve  =  
        Plot[Evaluate[y[t] /. solution],  {t, 0, 3},  
          PlotStyle -> RGBColor[0, 0, 1]];

Part 4. Summary

Answers to the summary questions: