# 1.10: The Mass-Spring System - Solving a 2nd order LTI ODE for Time Response

- Page ID
- 21148

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Suppose that we have a system of the type depicted on Figure 1.9.1 for which the damping force \(c\dot{x}\), in Equation 1.9.6, is negligibly small in comparison with inertial force \(m\ddot{x}\) and structural force \(kx\). Figure \(\PageIndex{1}\) is a photograph of a real system^{1} with so little damping that, under some circumstances, we may neglect the damping force. The mass carriage of this system rides back and forth on low-friction linear ball bearings, which are enclosed underneath the carriage and not visible in the photograph. The entire length of this system, from the left (fixed) end of the spring, to the rightmost edge of the mass carriage is 8\(\frac{1}{2}\) inches (21.6 cm), and each of the three light-colored metal slabs attached to the carriage has mass of \(\frac{1}{2}\) kilogram.

If we may neglect the damping force in a system such as that of Figure \(\PageIndex{1}\), then the term \(c\dot{x}\) drops out of Equation 1.9.6, and we are left with the simpler 2^{nd} order ODE,

\[m \ddot{x}+k x=f_{x}(t)\label{eqn:1.18} \]

If we know ICs (Equation 1.9.5) and excitation force \(f_x(t)\), then we can solve Equation \(\ref{eqn:1.18}\) for \(x(t)\). For future reference, note that mass quantity \(m\) and spring stiffness constant \(k\) are intrinsically positive values. Also, observe that \(f_x(t)\) may be applied to the system of Figure \(\PageIndex{1}\) through the link visible at the right-hand side of the mass carriage.

It will be instructive to determine a time response for this 2^{nd} order mass-spring (\(m-k\)) system, by applying the standard ODE solution procedure described in Section 1.5. We shall find the complete algebraic solution as the sum of homogeneous and particular solutions, \(x(t) = x_h(t)+x_p(t)\). Suppose that at time \(t\) = 0 the spring is undeformed and the mass is at rest, so that ICs Equation 1.9.5 are

\[\dot{x}(0)=0 \text { and } x(0)=0\label{eqn:1.19} \]

Suppose also that the excitation is a force pulse described by the equation \(f_x(t) = F_m(t/t_m)e^{(1-t/t_m)}\); by applying calculus to this function, you can easily prove that it rises from zero at \(t\) = 0 to the maximum value \(F_m\) at time \(t\) = \(t_m\), and, thereafter, it gradually drops back to zero (see Figure \(\PageIndex{2}\)). In dynamics, a linear function of time such as \(t/t_m\) is often called a “ramp” function; since our excitation consists of a declining exponential function multiplied by a ramp function, we call this excitation a “ramped exponential” force pulse.

The homogeneous ODE associated with Equation \(\ref{eqn:1.18}\) is \(m\ddot{x}_h+kx_h=0\). We cast this equation into a familiar form by dividing through by mass \(m\) and defining the positive quantity \(\omega^2_n=k/m\), giving the ODE

\[\ddot{x}_{h}+\omega_{n}^{2} x_{h}=0\label{eqn:1.20} \]

The positive root \(\omega_n = \sqrt{k/m}\) is called the *natural frequency* of this \(m-k\) system, and \(\omega_n\) has physical significance that will be discussed below with the final solution. You might remember from your previous study of ODEs, or you can easily verify by substitution into Equation \(\ref{eqn:1.20}\), that the solution can be expressed as

\[x_{h}(t)=C_{1} \sin \omega_{n} t+C_{2} \cos \omega_{n} t\label{eqn:1.21} \]

Constants \(C_1\) and \(C_2\) are unknown at this point in the solution process.

With excitation by the ramped exponential pulse defined above, any particular solution \(x_p(t)\) must satisfy the non-homogeneous ODE

\[m \ddot{x}_{p}+k x_{p}=F_{m}\left(t / t_{m}\right) e^{\left(1-t / t_{m}\right)}\label{eqn:1.22} \]

To find a particular \(x_p(t)\) that satisfies ODE Equation \(\ref{eqn:1.22}\), we apply the method of undetermined coefficients, just as in Section 1.5. It is easy to show by successive differentiations that all derivatives with respect to time of the function \((t/t_m)e^{(1-t/t_m)}\) produce **only** constant multiples of \((t/t_m)e^{(1-t/t_m)}\) itself, and of \(e^{(1-t/t_m)}\). Therefore, we seek a particular solution that consists of a linear sum of these two functions:

\[x_{p}(t)=P_{1}\left(t / t_{m}\right) e^{\left(1-t / t_{m}\right)}+P_{2} e^{\left(1-t / t_{m}\right)}\label{eqn:1.23} \]

We determine constants \(P_1\) and \(P_2\) by substituting Equation \(\ref{eqn:1.23}\) into Equation \(\ref{eqn:1.22}\), equating the coefficients of \((t/t_m)e^{(1-t/t_m)}\) and \(e^{(1-t/t_m)}\) on the two sides of the resulting algebraic equation, and then solving for \(P_1\) and \(P_2\) [homework Problem 1.10(a)]. This process produces the results

\[P_{1}=\frac{F_{m}}{m / t_{m}^{2}+k} \quad \text { and } \quad P_{2}=\frac{2 m / t_{m}^{2}}{m / t_{m}^{2}+k} P_{1}\label{eqn:1.24} \]

The complete (but not yet final) solution is

\[x(t)=x_{h}(t)+x_{p}(t)=C_{1} \sin \omega_{n} t+C_{2} \cos \omega_{n} t+P_{1}\left(t / t_{m}\right) e^{\left(1-t / t_{m}\right)}+P_{2} e^{\left(1-t / t_{m}\right)}\label{eqn:1.25} \]

We now can determine the remaining unknown constants by substituting Equation \(\ref{eqn:1.25}\) into ICs Equation \(\ref{eqn:1.19}\), \(\dot{x}(0)\) = 0 and \(x(0)\) = 0, and solving algebraically for constants \(C_1\) and \(C_2\) [homework Problem 1.10(b)]. The results are

\[C_{1}=\frac{P_{2}-P_{1}}{\omega_{n} t_{m}} e^{1}, \text { with } \omega_{n}=\sqrt{\frac{k}{m}} \quad \text { and } \quad C_{2}=-P_{2} e^{1}\label{eqn:1.26} \]

The complete and final solution is Equation \(\ref{eqn:1.25}\), with constants \(C_1\), \(C_2\), \(P_1\), and \(P_2\) defined in terms of the basic parameters \(m\), \(k\), \(F_m\), and \(t_m\) by Equations \(\ref{eqn:1.24}\) and \(\ref{eqn:1.26}\). Let us calculate and plot a time response for the system of Figure \(\PageIndex{1}\). The total mass of the carriage plus the three \(\frac{1}{2}\)-kilogram attached metal slabs is \(m\) = 2.20 kg, and the stiffness of the spring is \(k\) = 770 N/m. Suppose that the ramped exponential force pulse has maximum value \(F_m\) = 6 N at the instant \(t_m\) = 1/12 s. The MATLAB command lines on the next page calculate and print out the frequency quantity \(f_n\) = \(\omega_n/2\pi\), and they calculate and plot the time response over the interval 0 \(\leq\) \(t\) \(\leq\) 2 s. Note that it was not necessary to assemble these command lines into a formal M-file; rather, the lines were composed in a text-editing program, then the entire group of lines was copied together and pasted onto the prompt “`>> `

” on the MATLAB command window. Also, since solution Equation \(\ref{eqn:1.25}\) includes the product of two functions of time in the term \((t/t_m)e^{(1-t/t_m)}\), it is necessary to implement this product using MATLAB array multiplication (`.*`

) in the operation `prod=tt.*efun`

.

`>> %Mass-spring response: rest ICs; ramped exponential pulse input m=2.20;k=770; %system mass and stiffness, SI units wn=sqrt(k/m);fn=wn/2/pi; disp('Natural frequency (cycles/sec) fn ='),disp(fn) Fm=6.0;tm=1/12; %excitation parameters t=0:.005:2; %time sequence for excitation/response tt=t/tm;efun=exp(1-tt);prod=tt.*efun;f=Fm*prod; %excitation a1=m/tm^2;a2=a1+k;P1=Fm/a2;P2=2*a1*P1/a2; %P constants C1=(P2-P1)*exp(1)/wn/tm;C2=-P2*exp(1); %C constants wt=wn*t;x=C1*sin(wt)+C2*cos(wt)+P1*prod+P2*efun; %response plot(t,100*f/k,'k.',t,100*x,'k'),grid,xlabel('Time t [sec]'),... ylabel('Translations reference f_x(t)/k and actual x(t) [cm]'),... title('Response of mass-spring system to ramped exponential pulse')`

`Natural frequency (cycles/sec) fn = 2.9775`

Figure \(\PageIndex{2}\) is the MATLAB graph produced by the sequence of commands above. The graph was edited in the MATLAB figure window, mainly to reduce the size and to add the legend.

The reference quantity \(f_x(t)/k\) plotted on Figure \(\PageIndex{2}\) represents the excitation force, but divided by \(k\), so that it has the units of translation. You can see from the basic ODE Equation \(\ref{eqn:1.18}\), \(m \ddot{x}+k x=f_{x}(t)\), that the plotted quantity physically represents the spring deformation that dynamic excitation \(f_{x}(t)\) would produce if mass \(m\) were zero or negligible. Because this reference quantity is calculated by neglect of the entire dynamic inertial force, \(m\ddot{x}\), it is often called the *pseudo-static* response.

Observe on Figure \(\PageIndex{2}\) that the actual dynamic translation \(x(t)\) of the mass greatly overshoots the pseudo-static translation initially (with peak response of about +1.4 cm at about 0.18 s), and that the actual response persists as significant *vibration* after the pulse excitation has died away. These are important dynamic characteristics of many systems that we encounter in engineering practice. In reality, all mechanical systems that consist of purely passive masses and passive structural members have some degree of positive damping; but, if the damping forces are low in comparison with inertial and structural forces, then these real systems will respond to excitation similarly, at least in a qualitative sense, to the “actual” response of Figure \(\PageIndex{2}\). For example, the real system of Figure \(\PageIndex{1}\) is positively but lightly damped; in response to the given force pulse, this system would experience just about the same initial response and overshoot as shown on Figure \(\PageIndex{2}\), but the vibration would die away gradually, and motion would cease completely after three or four seconds.

The terms in Equation \(\ref{eqn:1.25}\) that primarily represent vibration are the sinusoidal functions \(\sin\omega_n t\) and \(\cos\omega_n t\), with the angle (in radians) argument of these periodic functions being \(\theta(t)\) = \(\omega_n t\). The *period* of such a function is the time required for the function to complete a full cycle and begin repeating itself. In this case, let us denote that period as \(T_n\) and observe that its natural physical units are seconds/cycle. The associated *frequency* \(f_n\), in the units cycles/second,^{2} is obviously just the inverse of the period, \(f_n=1/T_n\). Thus, the angle (in radians) argument of the periodic sinusoidal functions can be written in the following equivalent forms: \(\theta (t)\) = \(\omega_n t\) = \(2\pi (t/T_n\) = \(2\pi f_n t\). The important relationship between *circular* natural frequency \(\omega_n\), in radians/second, and *cyclic* natural frequency \(f_n\), in cycles/second, is \(f_n\) = \(\omega_n/2\pi\). For the values of mass \(m\) and stiffness \(k\) used in the MATLAB calculations above, the printed-out value of \(f_n\) is 2.98 cycles per second, and this is the frequency that is most obvious in Figure \(\PageIndex{2}\); for example, as closely as we can detect by eye, almost exactly three complete cycles of vibration occur between \(t\) = 0.7 s and \(t\) = 1.7 s.

^{1}This is part of a Model 210a Rectilinear Plant designed and fabricated by Educational Control Products of Bell Canyon, California, USA.

^{2}More commonly in modern terminology, a cycle/second is designated as a *hertz*, with the abbreviation Hz.