According to Hookeβs law (\(F=-kx\)) and Newtonβs second law (\(F=ma\)), the differential equation for the motion of a mass (\(m\)) on the end of a spring is
\begin{equation*}
m \frac{d^2x}{dt^2}=-kx\text{,}
\end{equation*}
where \(k\) is the spring constant (a measure of the stiffness of the spring). This equation assumes no damping (resistance). The displacement of the mass from equilibrium is denoted by \(x\text{,}\) and thus \(\frac{dx}{dt}\) is the velocity, and \(\frac{d^2x}{dt^2}\) is the acceleration.
If we add damping (resistance) to the spring, then the damping is opposite the direction of the motion and proportional to the velocity. Therefore we have the equation,
\begin{equation*}
m \frac{d^2x}{dt^2}=-kx-c\frac{dx}{dt}\text{,}
\end{equation*}
In the following exercises, you will assume that the mass is \(m=2\) kg and the spring constant is \(k=3\) kg/s\(^2\text{.}\) You will look at the equation of motion with no damping (\(c=0\)), overdamping (\(c=4\) kg/s), and underdamping (\(c=0.5\) kg/s).
The rhs() command may be used to refer to only the right hand side of the differential equation solution. You can use this command to assign a name to the solution.
Consider the equation of motion of a \(2\)-kg mass attached to a spring with \(k=3\) kg/s\(^2\) and a damping constant of \(c=4\) kg/s. This is considered overdamping.
Consider the equation of motion of a \(2\)-kg mass attached to a spring with \(k=3\) kg/s\(^2\) and a damping constant of \(c=0.5\)Β kg/s. This is considered underdamping.
Suppose you wish to force the spring to oscillate at a given frequency. Letβs add a forcing term \(3 \sin(2t)\) to the undamped equation of motion from exerciseΒ 3.13.3.1.