Spring Motion

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

> with (plots):

> with(stats):

Warning, new definition for display

Part 1: The Undamped Spring

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

> n:=100; # Number of distance readings

> dt:=.05; # Time step between readings

[Maple Math]

[Maple Math]

> K:=21.7; # Spring constant

> m:=0.550; # Total mass

[Maple Math]

[Maple Math]

Enter your distance readings in the array V, separated by commas. We calculate the average of these data and convert the list to an array so we can index the elements.

> V := [0.811126, 0.773808, 0.729904, 0.681609, 0.634412, 0.591606, 0.556483, 0.533433, 0.523555, 0.531238, 0.550995, 0.58502, 0.625632, 0.672828, 0.721123, 0.765027, 0.80015, 0.824297, 0.835273, 0.829785, 0.811126, 0.780393, 0.74088, 0.693683, 0.646486, 0.602582, 0.566361, 0.542214, 0.529043, 0.531238, 0.547702, 0.577337, 0.616851, 0.661852, 0.709049, 0.752953, 0.790272, 0.816614, 0.829785, 0.828688, 0.814419, 0.785881, 0.746368, 0.704659, 0.65856, 0.61246, 0.575142, 0.5488, 0.532336, 0.532336, 0.546604, 0.571849, 0.60807, 0.650876, 0.696976, 0.741977, 0.780393, 0.807833, 0.825395, 0.826492, 0.815516, 0.791369, 0.757344, 0.714537, 0.669536, 0.626729, 0.588313, 0.558678, 0.540019, 0.535628, 0.544409, 0.567459, 0.600387, 0.642096, 0.684902, 0.729904, 0.76832, 0.799052, 0.818809, 0.824297, 0.816614, 0.79576, 0.763929, 0.724416, 0.680512, 0.637705, 0.598192, 0.566361, 0.546604, 0.538921, 0.544409, 0.564166, 0.593801, 0.632217, 0.676121, 0.718928, 0.758441, 0.790272, 0.812224, 0.819907]:

> mean1:=describe [mean] (V);

> a:=convert(V,array):

[Maple Math]

>

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 array numbering starts at 1, but our time starts at t = 0.

> k:='k':

> graph1:=plot([[(k-1)*dt,a[k]-mean1] $k=1..n],style=point, symbol=box, color=blue, thickness=2):

> display(graph1);

[Maple Plot]

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.

> t:='t':

> y0:=(0.835273-.6787664300);

> Y:=t->y0*cos(sqrt(K/m)*t + Pi/10);

[Maple Math]

[Maple Math]

We add the factor of amplitude of y0 to our model, taking the highest peak from our data and subtracting the mean from it. We do this, instead of merely taking the value at t=0 because at t=0, we see that the spring is not at its peak. Hence, we adjust for the actual amplitude by taking the highest peak of the data. We then had to adjust for the period (knowing that the data graph does not start at its peak at t=0). Thus, we adjusted for this by adding a delay factor of Pi/10, (which seems to be sufficient).

Next we graph the data and the model function together.

> graph2:=plot(Y(t), t=0..7,color=red):

> display({graph1,graph2});

[Maple Plot]

Our model seems to fit the data pretty well. With our adjustments for amplitude and our delay (because the data did not exactly start at the peak for t=0), we have a model that seems to show an undamped spring motion. The only difference comes where as t grows larger, the amplitude of the data graph decreases. This is because the data was not ideally undamped (it had a CD attached to the weight), and so air resistance was damping the spring as time went on.

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:=200; # Number of distance readings

> dt:=0.05; # Time step between readings

[Maple Math]

[Maple Math]

Enter your distance readings in the array Z, separated by commas. As before, w e calculate the average of these data and convert the list to an array.

> Z := [0.669536, 0.748563, 0.816614, 0.869299, 0.901129, 0.913203, 0.900032, 0.866006, 0.819907, 0.758441, 0.693683, 0.619046, 0.545507, 0.488432, 0.451113, 0.452211, 0.451113, 0.452211, 0.453308, 0.5027, 0.563068, 0.632217, 0.701366, 0.766124, 0.821004, 0.861616, 0.883568, 0.885763, 0.870396, 0.836371, 0.789174, 0.729904, 0.66734, 0.601484, 0.542214, 0.491724, 0.456601, 0.450016, 0.452211, 0.455504, 0.490627, 0.537824, 0.593801, 0.655267, 0.715635, 0.769417, 0.812224, 0.841859, 0.856128, 0.853932, 0.835273, 0.801248, 0.755148, 0.700268, 0.643193, 0.587216, 0.537824, 0.49831, 0.473065, 0.463187, 0.468675, 0.490627, 0.52575, 0.571849, 0.623436, 0.678316, 0.729904, 0.774905, 0.806736, 0.826492, 0.83198, 0.8232, 0.80015, 0.765027, 0.720025, 0.671731, 0.621241, 0.572947, 0.532336, 0.5027, 0.487334, 0.484041, 0.496115, 0.52136, 0.55758, 0.602582, 0.649779, 0.699171, 0.743075, 0.780393, 0.805638, 0.818809, 0.816614, 0.801248, 0.773808, 0.737587, 0.693683, 0.647584, 0.602582, 0.561971, 0.53014, 0.508188, 0.49831, 0.501603, 0.519164, 0.546604, 0.582825, 0.625632, 0.669536, 0.712342, 0.748563, 0.778198, 0.79576, 0.802345, 0.79576, 0.7771, 0.750758, 0.712342, 0.670633, 0.630022, 0.591606, 0.556483, 0.532336, 0.518067, 0.514774, 0.522457, 0.542214, 0.571849, 0.605875, 0.644291, 0.682707, 0.718928, 0.748563, 0.769417, 0.781491, 0.780393, 0.770515, 0.74966, 0.72222, 0.687097, 0.649779, 0.61246, 0.58063, 0.554288, 0.536726, 0.529043, 0.531238, 0.544409, 0.566361, 0.597094, 0.63112, 0.666243, 0.699171, 0.729904, 0.752953, 0.765027, 0.769417, 0.763929, 0.748563, 0.725513, 0.696976, 0.66295, 0.630022, 0.599289, 0.571849, 0.552092, 0.541116, 0.538921, 0.546604, 0.564166, 0.588313, 0.617948, 0.650876, 0.682707, 0.71344, 0.737587, 0.754051, 0.762832, 0.761734, 0.750758, 0.732099, 0.707952, 0.678316, 0.646486, 0.615753, 0.589411, 0.566361, 0.552092, 0.546604, 0.549897, 0.561971, 0.581728, 0.606972, 0.63551, 0.665145, 0.69478, 0.720025, 0.738684, 0.750758, 0.755148]:

> mean2:=describe [mean] (Z);

> b:=convert(Z,array):

[Maple Math]

>

Here is a plot of this data.

> k:='k':

> graph3:=plot([[(k-1)*dt,b[k]-mean2] $k=1..n],style=point, symbol=box, color=blue):

> display(graph3);

[Maple Plot]

> R:=0.913203 - .6590535250;

[Maple Math]

The highest peak of the data is 0.913203, subtracting from this the mean, 0.6590535250, we find a value for R, the original amplitude. R = .2541494750

Enter the components of your approximating function.

> t:='t':

> R:=.2541494750;

> L:=0.1;

> theta:=1.82*Pi;

> delta:= Pi/2.8;

> y := t -> R*exp(-L*t)*cos(theta*t-delta);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

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

> graph4:=plot(y(t), t=0..7):

> display({graph3,graph4});

[Maple Plot]

Look above for our values of R, L, theta, and delta. Our approximation is pretty good. It fits the period and the same damping and the same amplitude. One difference is in the first valley, where we see our model goes down farther than the data. However, looking at the graph of the data, we see that this seems to be a data error, since the graph of the data is not very smooth here. The device did not seem to collect enough data here to make the graph smooth.

>