Section 1.4 Numerical Solution for a Mass on a Spring
Let’s apply this new method to a system we will be studying more in depth later in this course. The system is a mass which moves under the influence of a force exerted on it by a spring. The spring is a device which exerts a force which is proportional to the displacement of the mass from an equilibrium position. Taking the equilibrium position to be \(x = 0\text{,}\) this implies that the acceleration of the mass is directly proportional to the position \(x(t)\text{.}\) Suppose in our particular system the acceleration is given by
\begin{equation}
a_x(t) = -2.00\, x(t).\tag{1.4.1}
\end{equation}
The minus sign in this expression tells us that the force is always opposite to the displacement. We’ll also assume that time is in seconds, position is in meters, velocity is in meters per second, and acceleration is in meters per second squared
To proceed, we choose time steps of size \(\Delta t = 0.10\) s and start the clock at \(t = 0\text{.}\) We could pick any initial position and velocity; let’s choose to release the mass from rest at a position 0.30 m from equilibrium, i.e. \(x(0) = 0.30\) m and \(v_x(0) = 0\text{.}\) Let’s walk through the first few steps and then show some results from a computer spreadsheet.
\begin{align}
a_x(t) \amp = -2.00\, x(t)\tag{1.4.2}\\
x(t+0.10) \amp = x(t) + 0.10\, v_x(t)\tag{1.4.3}\\
v_x(t+0.10) \amp = v_x(t) + 0.10\, a_x(t).\tag{1.4.4}
\end{align}
First calculate the initial acceleration by setting \(t = 0\) in (1.4.2) to find
\begin{equation}
a_x(0) = -2.00\, x(0) = -2.00 \times 0.30 = -0.60.\tag{1.4.5}
\end{equation}
\begin{align*}
x(0.10) \amp = x(0) + 0.10\, v_x(0) = 0.30 + 0.10\times 0 = 0.30\\
v_x(0.10) \amp = v_x(0) + 0.10\, a_x(0) = 0 + 0.10\times(-0.60) = -0.06.
\end{align*}
Since the mass was initially at rest, a short time later it is still approximately at the same location. However, since the spring is stretched at \(t = 0\text{,}\) a force is acting on the mass immediately, so that a short time later it has already acquired a non-zero velocity.
How would you find \(x(0.20)\) and \(v_x(0.20)\text{?}\) Again use Eqs. (1.4.2) through (1.4.4), this time with the ‘present time’ \(t = 0.10\text{.}\) We find that
\begin{align*}
a_x(0.10) \amp = -2.00\, x(0.10) = -2.00\times 0.30 = -0.60\\
x(0.20) \amp = x(0.10) + 0.10\, v_x(0.10)\\
\amp = 0.30 + 0.10 \times (-0.06)\\
\amp = 0.294\\
v_x(0.20) \amp = v_x(0.10) + 0.10\, a_x(0.10)\\
\amp = -0.06 + 0.10\times(-0.60)\\
\amp = -0.12.
\end{align*}
We can continue this process as long as we like. You will find it convenient to organize the information for the position, velocity and acceleration for each time in the form of a table. Table 13 on the next page lists \(t\text{,}\) \(x\text{,}\) \(v_x\) and \(a_x\) for the motion of this mass. Note that the periodic nature of the motion is manifested in the entries of the table.
There is an unsettling aspect of the entries in Table 13. We started at \(x = 0.30\, \mbox{m}\text{,}\) but at \(t = 2.30\, \mbox{s}\) the position of the mass is \(x = -0.375\,
\mbox{m}\text{,}\) and further down in the table we find that at \(t = 4.5\) s, \(x = 0.468\, \mbox{m}\text{.}\) What should we have expected? If we had a real mass connected to a spring and set it oscillating we would expect the amplitude of the oscillations to gradually decrease because of the presence of dissipative forces (air resistance and the imperfect elasticity of the spring). In an ideal case, with no dissipative effects, we would expect there to be no increase or decrease in the amplitude; that is, the mass should oscillate between \(x = +0.30\,
\mbox{m}\) and \(x = -0.30\, \mbox{m}\text{.}\) But this is not the case if we look at the data in Table 13. The problem is that we used too large a time increment. Why does too large a time increment lead to errors? If you recall, our stepping equations use the approximation that the average velocity is very close to the instantaneous velocity. If the time step is too large, this approximation is no longer valid and leads to errors.
We can improve our calculation of the motion by choosing a smaller time increment \(\Delta t\text{.}\) If we choose \(\Delta t = 0.01\, \mbox{s}\) rather than \(0.10\, \mbox{s}\text{,}\) we would be calculating over a much finer time interval (10 times smaller) and while we will have to do 10 times more computations to evolve the motion out to the same time, the calculations should be more accurate. Table 14 lists \(t\text{,}\) \(x\text{,}\) \(v_x\) and \(a_x\) near a point of maximum displacement for this smaller time increment. The maximum displacement is now about 0.314. This is still larger than the initial displacement but not nearly as bad as before. Further reduction of the time increment would improve the result.
| \(t\) | \(x(t)\) | \(v_x(t)\) | \(a_x(t)\) |
| 0 | 0.300 | 0 | -0.600 |
| 0.100 | 0.300 | -0.060 | -0.600 |
| 0.200 | 0.294 | -0.120 | -0.588 |
| 0.300 | 0.282 | -0.179 | -0.564 |
| 0.400 | 0.264 | -0.235 | -0.528 |
| 0.500 | 0.241 | -0.288 | -0.481 |
| 0.600 | 0.212 | -0.336 | -0.424 |
| 0.700 | 0.178 | -0.379 | -0.356 |
| 0.800 | 0.140 | -0.414 | -0.281 |
| 0.900 | 0.099 | -0.442 | -0.198 |
| 1.000 | 0.055 | -0.462 | -0.109 |
| 1.100 | 0.008 | -0.473 | -0.017 |
| 1.200 | -0.039 | -0.475 | 0.078 |
| 1.300 | -0.086 | -0.467 | 0.173 |
| 1.400 | -0.133 | -0.450 | 0.266 |
| 1.500 | -0.178 | -0.423 | 0.356 |
| 1.600 | -0.220 | -0.387 | 0.440 |
| 1.700 | -0.259 | -0.343 | 0.518 |
| 1.800 | -0.293 | -0.292 | 0.587 |
| 1.900 | -0.322 | -0.233 | 0.645 |
| 2.000 | -0.346 | -0.168 | 0.692 |
| 2.100 | -0.363 | -0.099 | 0.725 |
| 2.200 | -0.373 | -0.027 | 0.745 |
| 2.300 | -0.375 | 0.048 | 0.750 |
| 2.400 | -0.370 | 0.123 | 0.741 |
| 2.500 | -0.358 | 0.197 | 0.716 |
| 2.600 | -0.338 | 0.268 | 0.677 |
| 2.700 | -0.312 | 0.336 | 0.623 |
| 2.800 | -0.278 | 0.398 | 0.556 |
| 2.900 | -0.238 | 0.454 | 0.476 |
| 3.000 | -0.193 | 0.502 | 0.386 |
| 3.100 | -0.143 | 0.540 | 0.285 |
| 3.200 | -0.089 | 0.569 | 0.177 |
| 3.300 | -0.032 | 0.587 | 0.063 |
| 3.400 | 0.027 | 0.593 | -0.054 |
| 3.500 | 0.086 | 0.587 | -0.173 |
| 3.600 | 0.145 | 0.570 | -0.290 |
| 3.700 | 0.202 | 0.541 | -0.404 |
| 3.800 | 0.256 | 0.501 | -0.512 |
| 3.900 | 0.306 | 0.450 | -0.612 |
| 4.000 | 0.351 | 0.388 | -0.702 |
| 4.100 | 0.390 | 0.318 | -0.780 |
| 4.200 | 0.422 | 0.240 | -0.844 |
| 4.300 | 0.446 | 0.156 | -0.892 |
| 4.400 | 0.461 | 0.067 | -0.923 |
| 4.500 | 0.468 | -0.026 | -0.936 |
| 4.600 | 0.465 | -0.119 | -0.931 |
| \(t\) | \(x(t)\) | \(v_x(t)\) | \(a_x(t)\) |
| 4.190 | 0.293 | 0.155 | -0.586 |
| 4.200 | 0.295 | 0.149 | -0.589 |
| 4.210 | 0.296 | 0.143 | -0.592 |
| 4.220 | 0.297 | 0.137 | -0.595 |
| 4.230 | 0.299 | 0.131 | -0.598 |
| 4.240 | 0.300 | 0.125 | -0.600 |
| 4.250 | 0.301 | 0.119 | -0.603 |
| 4.260 | 0.303 | 0.113 | -0.605 |
| 4.270 | 0.304 | 0.107 | -0.607 |
| 4.280 | 0.305 | 0.101 | -0.610 |
| 4.290 | 0.306 | 0.095 | -0.612 |
| 4.300 | 0.307 | 0.089 | -0.614 |
| 4.310 | 0.308 | 0.083 | -0.615 |
| 4.320 | 0.308 | 0.077 | -0.617 |
| 4.330 | 0.309 | 0.071 | -0.619 |
| 4.340 | 0.310 | 0.064 | -0.620 |
| 4.350 | 0.311 | 0.058 | -0.621 |
| 4.360 | 0.311 | 0.052 | -0.622 |
| 4.370 | 0.312 | 0.046 | -0.623 |
| 4.380 | 0.312 | 0.040 | -0.624 |
| 4.390 | 0.313 | 0.033 | -0.625 |
| 4.400 | 0.313 | 0.027 | -0.626 |
| 4.410 | 0.313 | 0.021 | -0.626 |
| 4.420 | 0.313 | 0.014 | -0.627 |
| 4.430 | 0.314 | 0.008 | -0.627 |
| 4.440 | 0.314 | 0.002 | -0.627 |
| 4.450 | 0.314 | -0.004 | -0.627 |
| 4.460 | 0.314 | -0.011 | -0.627 |
| 4.470 | 0.313 | -0.017 | -0.627 |
| 4.480 | 0.313 | -0.023 | -0.627 |
| 4.490 | 0.313 | -0.029 | -0.626 |
| 4.500 | 0.313 | -0.036 | -0.626 |
| 4.510 | 0.312 | -0.042 | -0.625 |
| 4.520 | 0.312 | -0.048 | -0.624 |
| 4.530 | 0.312 | -0.054 | -0.623 |
| 4.540 | 0.311 | -0.061 | -0.622 |
| 4.550 | 0.310 | -0.067 | -0.621 |
| 4.560 | 0.310 | -0.073 | -0.619 |
| 4.570 | 0.309 | -0.079 | -0.618 |
| 4.580 | 0.308 | -0.085 | -0.616 |
| 4.590 | 0.307 | -0.092 | -0.615 |
| 4.600 | 0.306 | -0.098 | -0.613 |
| 4.610 | 0.305 | -0.104 | -0.611 |
| 4.620 | 0.304 | -0.110 | -0.609 |
| 4.630 | 0.303 | -0.116 | -0.607 |
| 4.640 | 0.302 | -0.122 | -0.604 |
| 4.650 | 0.301 | -0.128 | -0.602 |