You are on page 1of 12

Part III.

Modeling and simulation of multi-degree of freedom systems

3.1. Three Degree of Freedom Spring-Mass-Damper system


There are many mechanical engineering problems that are formulated with broad simplifications
using spring-mass-damper systems.

( ) ( ) ( )

( ) ( )
( ) ( ) ( ) B

̇ ( ̇ ̇ ) ( ̇ ̇ ) ̇
Fig. 3.1. Three degree of freedom system. A) A system with three masses moving on the ground
without any friction in contact areas; B) Free body diagram of the system.

Equation of motion of the three body diagram (Fig. 3.1) can be delineated with the following
expressions:

̈ ( ) ̇ ( ̇ ̇ ) ( )
{ ̈ ( ) ( ) ( ̇ ̇ ) ( ̇ ̇ ) ( ) (E1)
̈ ( ) ( ̇ ̇ ) ( )

The equation (E1) can be re-written in more readable and explicit formulations
̈ ( ) ( ) ( ) ( ) ( ) ̇ ( ) ̇ ( ) ( )
(E1a){ ̈ ( ) ( ) ( ) ( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( ) ( )
̈ ( ) ( ) ( ) ( ) ̇ ( ) ̇ ( ) ( )
(E1a) is a new formulation of (E1) is of second order ODE, linear and time invariant, but coupled by
the coordinate systems of ( ) ( ) ( ) Thus, these equations must be solved
simultaneously. Now we will simulate and analyze this system’s motion using two or three
different approaches by employing MATLAB/Simulink tools.

For our simulations we take the following numeric values:

[ ] [ ] [ ]

1
[ ] [ ] [ ]

[ ] [ ] [ ]

We consider two different cases one of which is forced motion and the other is free motion.

1. Forced motion (vibration) case with zero initial conditions:

( ) ( )[ ] ( ) [ ] ( ) [ ]

Note that ( ) is a step function applied at .

2. Free motion (vibration) case with (small excitation on Mass 2 only):

( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( )

( ) ( ) ( )

3.2. Forced motion case


First simulation model. We have employed MATLAB script writing method with ODE45 solvers
to simulate the given problem. In this case, it is similar to solving a second order ODEs with IVP
covered in the previous chapter – IVPs with only difference in defining
( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( ) as coupled system displacements and velocities. Here are
final scripts of the problem. At first, we have developed a function M-file (third_DOF.m) defining
the equation of motion of the system (E1a).

function dx = third_DOF(t, x)
% HELP: three degree of freedom system
k1=25; k2=5; k3=30; k4=k3;
c1=2.5; c2=.5; c3=3.5;
m1=2.5; m2=2; m3=3;
F1=20*sin(120*t);F2=0; F3=20;
dx=zeros(6,1);
dx(1)=x(2);
dx(2)=(1/m1)*(F1-(k1+k2)*x(1)+k2*x(3)-(c1+c2)*x(2)+c2*x(4));
dx(3)=x(4);
dx(4)=(1/m2)*(F2+k2*x(1)-(k2+k3)*x(3)+k3*x(5)-...
(c2+c3)*x(4)+c2*x(2)+c3*x(6));
dx(5)=x(6);
dx(6)=(1/m3)*(F3+k3*x(3)-(k3+2*k4)*x(5)+c3*x(4)-c3*x(6));
return
Then we have created another M-file (three_MASS.m) to simulate the created system model
(third_DOF.m). (Fig. 3.2) created by the script shows the numerical simulation results
2
(displacements of ( ) ( ) ( )) and Figure (Fig. 3.3) displays movie frames showing
displacements of three masses with respect to each other.

function three_MASS
% HELP. Simulation of highly coupled three degree of freedom
system.
t=0:.01:120; % Simulation time span
IC=[0;0;0;0;0;0];
[t, xyz]=ode45('third_DOF', t, IC, []);
figure(1)
plot(t(1:2000),xyz(1:2000,1),'b-',t(1:2000),xyz(1:2000,3), ...
'r--', t(1:2000), xyz(1:2000,5), 'k:', 'linewidth',1.5), grid on
legend('M_1 x_1(t)','M_2 x_2(t)','M_3 x_3(t)', 0)
title('three degree of freedom system (coupled bodies)')
xlabel('time, [sec]'),
ylabel('Displacement, x_1(t), x_2(t), x_3(t)')
figure(2)
for k=1:t(end)-20
% Note: we have increased displacement magnitudes
% of x1, x2 and x3 by the factor of 5 for better visualization
plot(-20,0,'*', 20,0, '*', -10+5*xyz(k+20,1), 0, 's',...
-5+5*xyz(k+20,3), 0, 's',10+5*xyz(k+20,5), 0,...
's','markersize', 35); grid on
FunM(k)=getframe;
end
movie(FunM)

3
Fig. 3.2. Simulation of the three degree of freedom system (highly coupled) with forced vibration.

Fig. 3.3. Movie frame of the three degree of freedom system in forced vibration.

Second simulation model. We have built a Simulink model (Fig. 3.4) of the given three
degree of freedom and coupled system. Assuming zero initial conditions, we can build the model of
this coupled system in Simulink.

4
Fig. 3.4. A Simulink model (ThreeDOFsys.mdl) of the three DOF system.
Note in the Simulink model ThreeDOFsys.mdl, Sine Wave block is used for a force input
signal with the following parameters (Fig. 3.5): Amplitude =1, Frequency=120, Phase=0, Bias =0,
Sample time=0 and output formulation:
( ) ( )

Fig. 3.5. Model parameter values of the system in Simulink model (ThreeDOFsys.mdl).
5
Fig. 3.6. Simulation results of the system from SIMULINK model (ThreeDOFsys.mdl).

From the output plots (Fig. 3.2 and 3.6) from models created via MATLAB scripts (third_DOF.m,
three_MASS.m) and Simulink model (ThreeDOFsys.mdl) for case 1 with external forces
applied to the system, it is clear that outputs from both models converge precisely. Also, it can be
concluded that the system is over-damped and stable.

3.3. Free motion (vibration) case


Now, we can re-simulate both models for case 2 when external forces are removed and free motion
of the system bodies is observed.

( ) ( ) ( )

( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( )

In this case, we edit out models in MATLAB scripts and Simulink by removing the external
forces or equaling them to zero and adding initial condition on Integrator4 in Simulink model
(ThreeDOFsys.mdl) and editing initial conditions (IC) of the MATLAB script model
(three_MASS.m) as IC=[0;0.5;0;0;0;0];.
Here are outputs (Fig. 3.7 and 3.8) of our simulations after introducing some changes:
6
Fig. 3.7. Simulation results of the system: MATLAB script model (three_MASS.m) as
IC=[0;0.5;0;0;0;0]

Fig. 3.8. A Simulink model (ThreeDOFsys.mdl) simulation results in free motion with
IC=[0;0.5;0;0;0;0].

7
By analyzing the above shown simulation results (Fig. 3.7 and 3.8), we can conclude that our
MATLAB scripts based model and Simulink model results converge very closely in both cases for
forced motion and free motion.

3.4. Alternative method for numerical simulation of time response


Let’s consider the forced response of a damped linear system. The most general formulation of
such cases is written in the following way:

[ ] ̈ [ ] ̇ [ ] [ ] ( ) with initial conditions: ( ) ̇( ) ̇

Where [M], [C], [K] are mass, damper and spring matrices and [B] is a column force matrix of F(t)
applied external force.

We can write divide both sides of the equation by [ ] or multiply [ ] and introduce new
variables to convert second order differential equations into first order ones. Introduction of new
variables ( ̇ ̈ ̇ ) is extensively discussed in the previous chapter in solving
higher order ordinary differential equations. By these substitutions, we obtain this system of two
differential equations.

̇
{
̇ [ ][ ] ( ) [ ][ ] [ ][ ]

with initial conditions ( ) ( ) ̇ ( ) ̇ . Also, we can re-write the above formulated


system of equations in a more explicit form.

̇ [ ] [ ]
̇ [ ] [ ] =
̇ [ ][ ] ( ) [ ][ ] [ ][ ]

[ ] [ ] [ ]
[ ] [ ]
[ ][ ] ( ) [ ][ ] [ ][ ]

This is in a more general form

̇( ) ( ) [ ] ( )

Where A is the state matrix defined by the equation of

[ ]
[ ][ ] [ ][ ]

( ) ( )
( ) [ ] ( ) [ ] [ ] [ ̇ ]
( ) ( ) ( )

Summarizing all, after we evaluate matrix A and force vector if a given system is subject to external
force, we can solve numerically the equation ̇ ( ) ( ) [ ] ( ) which is an ordinary
differential equation.

8
Example. Let’s consider previously solved three mass-damper-spring system.

[ ] [ ], [ ] [ ] [ ],

[ ] [ ] [ ]

We consider two different cases one of which is forced motion and the other is free motion.

1. Forced motion (vibration) case with zero initial conditions:

( ) ( )[ ] ( ) [ ] ( ) [ ]

Note that ( ) is a step function applied at .

2. Free motion (vibration) case with (small excitation on Mass 2 only):

( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( )

( ) ( ) ( )

3.4.1. Forced motion case


Here are final scripts of the problem. At first, we have developed a function M-file (DOF3.m)
defining the equation of motion of the system and then another script (MASS3.m) to simulate the
developed model.

function dx = DOF3(t, x)
% HELP: three-degree-of-freedom system simulation
k1=25; k2=5; k3=30; k4=k3;
c1=2.5; c2=.5; c3=3.5;
m1=2.5; m2=2; m3=3;
M=[m1 0 0; 0 m2 0; 0 0 m3];
K=[k1+k2, -k2, 0; -k2, k2+k3, -k3; 0, -k3, k3+2*k4];
C=[c1+c2, -c2, 0; -c2, c2+c3, -c3; 0, -c3, c3];
F1=20*sin(120*t);F2=0; F3=20; % Case 1: External forces applied
%F1=0;F2=0;F3=0; % Case 2: Free vibration
B=[F1;F2;F3];
A=[zeros(3) eye(3); -inv(M)*K, -inv(M)*C];
f=(M\eye(3))*B;
dx=A*x+[0;0;0;f];
return

9
Note that inverse matrix computing function is computationally costly for large systems;
thus, instead we have employed a backslash (\) operator that is computationally more efficient and
accurate than inverse matrix computation approach. E.g. M\eye(3) is equivalent to inv(M).

function MASS3
% HELP. Simulation of coupled three-degree-of-freedom system.
t=0:.01:20; % Simulation time span
IC=[0;0;0;0;0;0]; % Initial conditions
[t, xyz]=ode45('DOF3', t, IC, []);
figure(1)
plot(t, xyz(:,1), 'b-',t, xyz(:,2), 'r--',...
t, xyz(:,3), 'k:', 'linewidth',1.5), grid on
legend('M_1 x_1(t)','M_2 x_2(t)','M_3 x_3(t)', 0)
title('Three-degree-of-freedom system (coupled bodies)')
xlabel('time, [sec]'),
ylabel('Displacement, x_1(t), x_2(t), x_3(t)')

Fig. 3.9. Forced response simulation of three coupled masses.

10
3.4.2. Free motion (vibration) case
function dx = DOF3_Fee(t, x)
% HELP: three-degree-of-freedom system simulation
k1=25; k2=5; k3=30; k4=k3;
c1=2.5; c2=.5; c3=3.5;
m1=2.5; m2=2; m3=3;
M=[m1 0 0; 0 m2 0; 0 0 m3];
K=[k1+k2, -k2, 0; -k2, k2+k3, -k3; 0, -k3, k3+2*k4];
C=[c1+c2, -c2, 0; -c2, c2+c3, -c3; 0, -c3, c3];
%F1=20*sin(120*t);F2=0; F3=20; % Case 1: External forces applied
F1=0;F2=0;F3=0; % Case 2: Free vibration
B=[F1;F2;F3];
A=[zeros(3) eye(3); -inv(M)*K, -inv(M)*C];
f=(M\eye(3))*B;
dx=A*x+[0;0;0;f];
return

function MASS3_Free
% HELP. Simulation of coupled three-degree-of-freedom system.
t=0:.01:20; % Simulation time span
IC=[0;0.5;0;0;0;0]; % Initial conditions
[t, xyz]=ode45('DOF3', t, IC, []);
figure(1)
plot(t, xyz(:,1), 'b-',t, xyz(:,2), 'r--',...
t, xyz(:,3), 'k:', 'linewidth',1.5), grid on
legend('M_1 x_1(t)','M_2 x_2(t)','M_3 x_3(t)', 0)
title('Three-degree-of-freedom system (coupled bodies)')
xlabel('time, [sec]'),
ylabel('Displacement, x_1(t), x_2(t), x_3(t)')

11
Fig. 3.10. Solution response of three coupled masses with a non-zero initial condition at mass two.

Concluding remarks. To simulate the system behavior of three degree of spring-mass-damper


system with free and forced motion we have developed two different models one of which is
MATLAB scripts with ODE45 and the other is Simulink model. From simulation results of
responses in forced motion and free motion with an alternative method, it is clear that this
approach has also produced the same outputs (Fig. 3.8 and 3.10) as with direct approach of solving
differential equations without matrix operators.

12

You might also like