Question 5.4: A Single-Degree-of-Freedom Mass–Spring–Damper System Conside...
A Single-Degree-of-Freedom Mass-Spring-Damper System
Consider the simple mass-spring-damper system subjected to an input force f, as shown in Figure 5.29a.
a. Apply Newton’s second law to derive the differential equation of motion.
b. Determine the transfer function form. Assume that the system output is the displacement x and the initial conditions are x(0)=0 and \dot{x}(0)=0.
c. Determine the state-space representation. Assume that the system output is the displacement x and the state variables are x_{1}=x and x_{2}=\dot{x}.
d. Use Simulink and Simscape to construct block diagrams to find the displacement output x(t) of the system subjected to an applied force f(t)=10 u(t), where u(t) is the unit-step function. The parameter values are m=1 \mathrm{~kg}, b=2 \mathrm{~N} \cdot \mathrm{s} / \mathrm{m}, and k=5 \mathrm{~N} / \mathrm{m}. Assume zero initial conditions.

Learn more on how we answer questions.
a. Let us choose the displacement of the mass as the coordinate x. The free-body diagram of the mass is shown in Figure 5.29b. Applying Newton’s second law in the x direction gives
\begin{gathered} +\rightarrow x: \sum F_{x}=m a_{x} \\ f(t)-k x-b \dot{x}=m \ddot{x} \end{gathered}
which can be rearranged into the standard input-output differential equation form
m \ddot{x}+b \dot{x}+k x=f(t) .
b. Taking the Laplace transform of both sides of the preceding equation with zero initial conditions results in
\left(m s^{2}+b s+k\right) X(s)=F(s) .
Thus, the transfer function relating the input f(t) to the output x(t) is
\frac{X(s)}{F(s)}=\frac{1}{m s^{2}+b s+k} .
c. As specified, the state, the input, and the output are
\mathbf{x}=\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}=\left\{\begin{array}{c} x \\ \dot{x} \end{array}\right\}, \quad u=f, \quad y=x
The state-variable equations are thus formed as
\begin{aligned} \dot{x}_{1} & =\dot{x}=x_{2} \\ \dot{x}_{2} & =\ddot{x}=-\frac{k}{m} x-\frac{b}{m} \dot{x}+\frac{1}{m} f=-\frac{k}{m} x_{1}-\frac{b}{m} x_{2}+\frac{1}{m} u . \end{aligned}
The output equation is
y=x=x_{1} .
Writing the state-variable equations and the output equation in matrix form yields
\begin{gathered} \left\{\begin{array}{l} \dot{x}_{1} \\ \dot{x}_{2} \end{array}\right\}=\left[\begin{array}{cc} 0 & 1 \\ -\frac{k}{m} & -\frac{b}{m} \end{array}\right]\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}+\left[\begin{array}{c} 0 \\ \frac{1}{m} \end{array}\right] u, \\ y=\left[\begin{array}{ll} 1 & 0 \end{array}\right]\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}+0 \cdot u . \end{gathered}
d.We start with building a Simulink block diagram using the mathematical model obtained in Part (a). Solving for the highest derivative of the output x gives
\ddot{x}=\frac{1}{m}(f-k x-b \dot{x})
which can be represented using the block diagram shown in Figure 5.30. Two Integrator blocks are used to form the velocity \dot{x} and the displacement x, both of which are fed back to form the acceleration \ddot{x}. Note that a step input causes the motion of the system. Doubleclick on the block with the name step and type 0 for the step time and 10 for the Final value to define the input f(t)=10 u(t).
We can also build a Simscape block diagram to simulate the physical system shown in Figure 5.29a. The mass, translational damper, and translational spring blocks can be found in Simscape/Foundation Library/Mechanical/Translational Elements. In the same library, the Mechanical Translational Reference block is used to represent a rigidly clamped end. To apply a force input, the Ideal Force Source block is included, which can be found in …/Mechanical/Mechanical Sources. To obtain a displacement output, the Ideal Translational Motion Sensor block is included, which can be found in …/Mechanical/Mechanical Sensors. Figure 5.31 is the resulting Simscape block diagram. Note that port symbols (e.g., C for “case,” R for “rod,” P for “position,” V for “velocity,” S for “signal”) are useful for making a correct connection.
Define the values of the parameters m, b, and k in the MATLAB Command window. Run both simulations and the same curve as shown in Figure 5.32 can be obtained, which is the resulting displacement output x(t) of the mass-spring-damper system in Figure 5.29a subjected to a step input force. More examples of using Simulink and Simscape to build a mechanical system will be given in Section 5.6.


