Professional Documents
Culture Documents
( ) ( ) ( )
( ) ( )
( ) ( ) ( ) 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.
[ ] [ ] [ ]
1
[ ] [ ] [ ]
[ ] [ ] [ ]
We consider two different cases one of which is forced motion and the other is free motion.
( ) ( )[ ] ( ) [ ] ( ) [ ]
( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( )
( ) ( ) ( )
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.
( ) ( ) ( )
( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( )
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.
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.
̇
{
̇ [ ][ ] ( ) [ ][ ] [ ][ ]
̇ [ ] [ ]
̇ [ ] [ ] =
̇ [ ][ ] ( ) [ ][ ] [ ][ ]
[ ] [ ] [ ]
[ ] [ ]
[ ][ ] ( ) [ ][ ] [ ][ ]
̇( ) ( ) [ ] ( )
[ ]
[ ][ ] [ ][ ]
( ) ( )
( ) [ ] ( ) [ ] [ ] [ ̇ ]
( ) ( ) ( )
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.
( ) ( )[ ] ( ) [ ] ( ) [ ]
( ) ( ) ( ) ̇ ( ) ̇ ( ) ̇ ( )
( ) ( ) ( )
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)')
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.
12