Vibration Analysis Using MATLAB
Vibration Analysis Using MATLAB
OF
VIBRATING SYSTEMS
SUMMARY
This report has successfully demonstrated the analytical derivation of the
governing equations for the vibration of an unforced 6DoF damped mechanism,
using Lagranges equations. MATLAB was successfully implemented in several
instances. The system characteristics were found, namely the six natural
frequencies and modal shapes. A comprehensive modal analysis was performed
with two co-ordinate transformations and proportional damping. A particular use
for MATLAB was performing the impulse response for two separate non-periodic
excitation forces applied to the system. Other types of excitation were discussed,
and finally some of the fundamental assumptions of the system were altered to
observe the effect on damping.
1. INTRODUCTION
In this report, the system in figure 1 with six Degrees of Freedom (DoF) will be
considered. The governing equation will be derived using Lagrangian mechanics
in section 2. Then it will be subject to a number of different analysis procedures.
The matrix method will determine the undamped natural frequencies and modal
shapes in section 3. A kinematic analysis will be performed in section 4, with
modal analysis that uses two co-ordinate transformations and proportional
damping. This process will find estimates for damping ratios, damping factors
and damped frequencies. A kinetic analysis will take place in section 5, where
two separate pre-determined non-periodic excitation forces will be applied to the
system. Numerical and analytical procedures are thereby examined for their
effectiveness in predicting the impulse response. Finally, in sections 6 and 7,
alternative excitation functions, and methods for modelling damping will be
m
m
m
=
=
=
k
m
=
=
==
300
200 N/m
300
400
N/m
cm
x
2 546
3
11
2
3
4
5
6
7
7
1
2
6
5
4
3
20kg
30kg
20kg
40kg
60kg
10kg
discussed.
Figure 1 6DoF Mass-spring-damper model with parameters for mass and spring
constants.
2. SYSTEM EQUATION
The analysis is presented for a purely translational system (where no rotation is
involved). The Lagrange equation for unforced oscillation with damping is given
by:
ddtTqi-Tqi+Vqi+Dqi
=0
(2.1)
Where T is the Kinetic energy (J), V is the Potential energy (J), D is the energy
dissipation due to damping (J), qi is the co-ordinate system, qi is the first
derivative of the co-ordinate qi with respect to time (ms-1).
The Kinetic energy of the system given in figure 1 can be expressed
T=12m1x12+12m2x22+12m3x32+12m4x42+12m5x52+12m6x62 (2.2)
Where mi is the respective mass for each of the masses (kg).
The potential energy can also be expressed thus:
V=12k1x12+12k2(x2-x1)2+12k3(x3-x2)2+12k4(x4-x3)2+12k5(x5x4)2+12k6(x6-x5)2
(2.3)
(2.4)
ddtTq1=m1x1
Vq1=k1x1-k2(x2-x1)
Dq1=c1x1-c2(x2-
x1)
Using the Lagrange equation given in (2.1), the first equation (for i = 1) is
therefore:
m1x1+k1+k2x1-k2x2+c1+c2x1-c2x2=0
(2.5)
ddtTq2=m2x2
Vq2=k2(x2-x1)-k3(x3-x2)
Dq1=c2(x2-x1)-c3(x3-x2)
And hence the equation for i = 2 is given:
m2x2-k2x1+k2+k3x2-k3x3-c2x1+c2+c3x2-c3x3=0
(2.6)
Since the system has 6 DoF, it follows the same pattern through to i = 6, the set
of Lagrange equations can now be presented in matrix format.
m1000000m2000000m3000000m4000000m5000000m6x1x2x3x4x5x6+
(c1+c2)-c20000-c2(c2+c3)-c30000-c3(c3+c4)-c40000-c4(c4+c5)-c50000c5(c5+c6)-c60000-c6(c6+c7)x1x2x3x4x5x6+(k1+k2)-k20000-k2(k2+k3)k30000-k3(k3+k4)-k40000-k4(k4+k5)-k50000-k5(k5+k6)-k60000k6(k6+k7)x1x2x3x4x5x6=0
(2.7)
By substituting the appropriate values from figure 1, Lagranges equations can
be found for this particular system.
100000002000000030000000200000004000000060x1x2x3x4x5x6+(c1+c2)c20000-c2(c2+c3)-c30000-c3(c3+c4)-c40000-c4(c4+c5)-c50000-c5(c5+c6)c60000-c6(c6+c7)x1x2x3x4x5x6+400-2000000-200500-3000000-3006003000000-300600-3000000-300700-4000000-400800x1x2x3x4x5x6=0
(2.8)
Equation (2.8) concludes the derivation of the governing equation for this
particular system in matrix form.
3. SYSTEM CHARACTERISTICS
In order to find the natural frequencies and modal shapes of the system, the
Matrix method was used chosen over the Holzer method because it is more
appropriate for computational analysis.
A-n2Ix=0
(3.1)
A=[m]-1[k]
(3.2)
Where;
Solving the characteristic equation for the eigenvalues of A, and then performing
a square root on the resultant matrix, gives the natural frequencies for the
system. The MATLAB code in figure 2 was used to do this:
K = [400,-200,0,0,0,0;-200,500,-300,0,0,0;0,-300,600,-300,0,0;0,0,300,600,-300,0;0,0,0,-300,700,-400;0,0,0,0,-400,800]
M =
[10,0,0,0,0,0;0,20,0,0,0,0;0,0,30,0,0,0;0,0,0,20,0,0;0,0,0,0,40,0;0,0,0,0
,0,60]
% Mass and stiffness matrices are set up.
A = inv(M)*K
% A is defined and then the eigenvalues & eigenvectors are found in order
% to solve according to the matrix method.
[v,d] = eig(A)
nat_freq = sqrt(d)
% A plot of all the modal shapes is formed
plot(v)
pause;
% Each time the user presses the return key, the modal shapes will appear
% in ascending order of natural frequency.
plot(v(:,5))
pause;
plot(v(:,6))
pause;
plot(v(:,4))
pause;
plot(v(:,3))
pause;
plot(v(:,2))
pause;
plot(v(:,1))
Figure 2 MATLAB code to solve for the natural frequencies and modal shapes
The code in figure 2 produced the following results for the natural frequencies.
n=7.11670000006.45410000005.09760000004.28580000001.45140000002.6
591
6.4541
1.4514
2.6591
4.2858
5.0976
7.1167
rad/s
The modal shapes may be plotted from the corresponding eigenvectors. They
are given on figure 3 combined in one plot, and they are singled out in ascending
order from the lowest to highest frequency in the subsequent figures 4 to 9,
displayed on page 8.
The dynamic characteristics of the system are the properties during its active
and changing states. Therefore discussing these involves noting the order in
which the masses and stiffness elements for that constitute each degree of
freedom hit their natural frequency. The cause of this is due to the surrounding
properties of the system. This information is ordered and summarised in table 1.
Natural Frequency (n
[rad/s])
Mass (m
[kg])
1.4514
m5 40
k5 300; k6 400
2.6591
m6 60
k6 400; k7 400
FIGURE 3 - MODAL SHAPES. THE NATURAL FREQUENCIES ARE COLOUR CODED AS SHOWN
ON THE LEFT OF THE FIGURE.
4.2858
m4 20
k4 300; k5 300
5.0976
m3 30
k3 300; k4 300
6.4541
m2 20
k2 200; k3 300
7.1167
m1 10
k1 200; k2 200
The heavier mass and stiffer spring arrangements tend to have lower values for
n. However, it may be observed from table 1 that the lowest natural frequency
actually occurs for m5, rather than m6. Possible causes for this are the variance in
surrounding stiffness elements for m5 whereas m6 has the same k value on both
sides; and also the fact that m5 has surrounding masses on both sides, whereas
m6 is against a wall on one side. Conversely, lighter masses with lower k values
have higher natural frequencies. This is a trend that loosely matches from m 4 to
m1. The exception occurs at m3, which is located in the middle of the system,
promoting a lower natural frequency. From the tabulation of these results it is
possible to see that the natural frequency for each of the six degrees of freedom
is highly dependent on every other element in the system.
4. MODAL ANALYSIS
This is a kinematic analysis which approaches the 6DoF system assuming that
free damped vibration occurs. The damping will be proportional in order for the
analysis to work, with = 0.1 and = 0.2.
The system equations of 2.8 were given thus:
100000002000000030000000200000004000000060x1x2x3x4x5x6+(c1+c2)c20000-c2(c2+c3)-c30000-c3(c3+c4)-c40000-c4(c4+c5)-c50000-c5(c5+c6)c60000-c6(c6+c7)x1x2x3x4x5x6+400-2000000-200500-3000000-3006003000000-300600-3000000-300700-4000000-400800x1x2x3x4x5x6=0
(2.8 - repeated)
The problem was solved in MATLAB using the code given in figure 10.
% Diagonal matrices for use with the "r" co-ordinates after the second
% transformation
Big_Lambda_K = [P]'*[K_tilda]*[P]
Big_Lambda_C = [P]'*[C_tilda]*[P]
% Used for conversion from r(t) co-ordinates back to x(t) co-ordinates
[S] = M^-0.5*[P]
FIGURE 10 MATLAB CODE TO PERFORM KEY OPERATIONS REQUIRED FOR MODAL
ANALYSIS.
So, the equation of motion in terms of {x(t)} for 6DoF may be stated thus:
100000002000000030000000200000004000000060x1x2x3x4x5x6+81-40000040102-600000-60123-600000-60126-600000-60144-80000080166x1x2x3x4x5x6+400-2000000-200500-3000000-300600-3000000-3006003000000-300700-4000000-400800x1x2x3x4x5x6=0
(4.1)
In order to form a symmetric eigenvalue problem, the mass-normalised stiffness
and damping, K and C, must be found:
K=M-12K[M]-12
C=M-12C[M]-12
These matrices were calculated through the MATLAB calculations shown in figure
10:
K=400-141.42140000-282.8427500-244.94900000-367.4235600-367.42350000244.9490600-212.13200000-424.2641700-326.59860000-489.8979800
C=83-29.69850000-59.3970105-51.43930000-77.1589125-75.9342000050.6228126-45.25480000-90.5097150-70.21870000-105.3281166
The eigenvalues and eigenvectors for K were found with MATLAB. [P] is defined
as the normalised matrix of stiffness eigenvectors, in ascending order of natural
frequency.
P=0.1436-0.18800.28260.4092-0.3943-0.73570.38480.43790.43230.40550.04610.55390.5534-0.4238-0.0922-0.50510.39250.31040.4238-0.0096-0.4446-0.1587-0.74020.22280.47380.46870.38110.52320.3601-0.07540.34570.61110.6180-0.3377-0.10380.0165
K and C will be used in the equation in terms of {r(t)}, the result of the second
co-ordinate transformation. They produce ordered values that relate to natural
frequency and damping, as shown below.
K=[P]TKP=n12000000n22000000n32000000n42000000n52000000n
62
C=[P]TCP=21000000220000002300000024000000250000002
6
C=0.52130000001.51420000003.77350000005.29710000008.431000000010.
2295
100000010000001000000100000010000001r1r2r3r4r5r6+210000002200
000023000000240000002500000026r1r2r3r4r5r6+n12000000n2
2000000n32000000n42000000n52000000n62r1r2r3r4r5r6=0
Substituting in values for K and C gives (4.3):
100000010000001000000100000010000001r1r2r3r4r5r6+0.52130000001.5142
0000003.77350000005.29710000008.431000000010.2295r1r2r3r4r5r6+2.1067
0000007.071000000018.367700000025.985400000041.655200000050.6474r1r
2r3r4r5r6=0
(4.3)
The equivalent 6 sDoF equations are:
r1+0.5213r1+2.1067r1=0
r2+1.5142r2+7.0710r2=0
r3+3.7735r3+18.3677r3=0
r4+5.2971r4+25.9854r4=0
r5+8.4310r5+41.6552r5=0
r6+10.2295r6+50.6474r6=0
(4.4)
In order to tabulate the results for each DoF, each of the sDoF equations found in
terms of {r(t)} must be addressed (equation (4.3)). Therefore the natural
frequencies are calculated from the values of K, where each term is equal to
ni2 :
n1=2.1067=1.4514 rad/s
n2=7.071=2.6591 rad/s
n3=18.3677=4.2858 rad/s
n4=25.9854=5.0976 rad/s
n5=41.6552=6.4541 rad/s
n6=50.6474=7.1167 rad/s
The damping factors are found directly from each value of C. The damping
ratios are found from the each value of C where each term is equal to 2i:
1=0.5213(2*2.1067)=0.1796 Ns/m
2=1.5142(2*7.071)=0.2847 Ns/m
3=3.7735(2*18.3677)=0.4402 Ns/m
4=5.2971(2*25.9854)=0.5196 Ns/m
5=8.4310(2*41.6552)=0.6532 Ns/m
6=10.2295(2*50.6474)=0.7187 Ns/m
Finally, damped frequencies (d) are found from equation (4.5).
d=n1-i2
(4.5)
Natural
frequencies, n
(rad/s)
Damping ratio,
(Ns/m)
Damping Factor
(Ns/m)
Damped
frequencies, d
(rad/s)
1.4514
0.1796
0.5213
1.4279
2.6591
0.2847
1.5142
2.5491
4.2858
0.4402
3.7735
3.8481
5.0976
0.5196
5.2971
4.3555
6.4541
0.6532
8.4310
4.8872
7.1167
0.7187
10.2295
4.9484
5. NON-PERIODIC EXCITATION
5.1 IMPULSE FORCE (FORCE_1.M)
This section performs a kinetic analysis on the system shown in figure 1 for an
impulse force acting specifically on m1. The impulse force is defined as F.
F=Ftdt
(5.1)
F=f
(5.2)
(5.3)
The rectangular pulse can be considered analytically as the sum of two step
functions, where F(t) = F0 for a damped system.
x1t=F0k(1-cosnt)
t<t1
(5.4)
x2t=F0k[1-cosnt-t1]
t=t1
(5.5)
t>t1
(5.6)
xt=1200[-cos(7.1167t)+cos(7.1167t-t1)]
(5.7)
The original excitation files for use with MATLAB are given in Appendix 2. To
apply these forces to the particular system shown in figure 1, additional sections
of code were added to perform the transfer function, impulse response and
convolution integral. In figures 11A and 12A, the original sections are shaded out
in grey, and the added sections are in black.
The parameters for the transfer function were formed thus:
G's=X(s)F(s)=1ms2+2ns+n2
For m1: 1m=0.1, 2n6=10.2295 and n62=50.6474
The impulse solution is given on the next page, using a linear simulation and
convolution integral. The plots are given in order of the corresponding solutions
noted by the code.
dt=0.1;
t=0:dt:50;
f=[zeros(50,1);ones(100,1);zeros(length(t)-150,1)];
subplot(311);
plot(t,f);
title('Square input');
axis([0 50 0 1.5]);
pause;
%Numerical solution impulse response
sys=tf(0.1,[1 10.2295 50.6474]);% using m1 = 10kg and values from sect 4
% in the stiffness and damping matrices in terms of r(t) for nat freq #6
h=impulse(sys,t);
sol_1=lsim(sys,f,t); %linear simulation
sol_2=conv(f,h)*dt; %convolution
subplot(312);
plot(t,sol_1(1:length(t)),t,sol_2(1:length(t)));
title('Impulse response of system');
xlabel('Time');
ylabel('Output');
pause;
%Attempted analytical validation step response
y=0.005.*((-cos(7.1167*t))+(cos(7.1167.*(t-(t-0.1))))) %Using Nat. Freq
#6.
subplot(313);
plot(t,y)
title('System Response to a step input');
xlabel('Time');
ylabel('x(t)');
FIGURE 11A MATLAB CODE FOR THE NON-PERIODIC EXCITATION FORCE_1.M APPLIED
TO m1 IN THE 6DOF SYSTEM.
5.2 HALF-SINE
PULSE
In this case a half-sine pulse was applied to m1 on the system given in figure 1.
The analytical solution in this case is given by:
xt=F0k1-e-nt1-2sin(dt-)
(5.8)
Where:
=tan-11-2
Stating (5.8) with values relevant to this problem:
xt=12001-e-5.1148t1-0.71872sin(4.9484t-0.802)
(5.9)
The solution using MATLAB code for a linear simulation and convolution integral
is given on the following page.
The plots are given in order of the corresponding solutions noted by the code.
DT=0.1;
t=0:DT:50;
%Time (high resolution)
sys=tf(0.1,[1 0.5213 2.1067]);
f=(sin(t).*t+0.1).*(t<8.1);
subplot(311);
plot(t,f,'b');
xlabel('Time');
ylabel('Input');
title('Input vs Time');
pause;
% Impulse response (below)
h=impulse(sys,t);
sol_1=lsim(sys,f,t); %linear simulation
sol_2=conv(f,h)*dt; %convolution
subplot(312);
plot(t,sol_1(1:length(t)),t,sol_2(1:length(t)))
title('Impulse response of system');
xlabel('Time');
ylabel('Output');
pause;
% Attempted Analytical validation - step response (below)
y = 0.2.*(1-(exp(-5.1148*t)/sqrt(1-0.7187^2).*(sin(4.9484*t(atan(0.7187/sqrt(1-0.7187^2)))))))
subplot(313);
plot(t,y)
title('System Response to a step input');
xlabel('Time');
ylabel('x(t)');
axis([0 5 0 0.5]);
FIGURE 12A MATLAB CODE FOR THE NON-PERIODIC EXCITATION FORCE_2.M APPLIED
TO m1 IN THE 6DOF SYSTEM
The system response appears to be valid for the convolution integral approach
(impulse response, middle plot). Here, the vibrations follow the trend of the input
before dying away due to damping in the system. This shows that a numerical
approach can provide accurate results with appropriate conditions for linear
simulation. Unfortunately the validation was not very accurate for the half-sine
pulse (analytical approach, lower plot). This could be due to an error in the
equation or a mistake with the input for MATLAB. However it still shows an initial
transient period followed by stability.
6. OTHER TYPE
OF
EXCITATION
(6.1)
To illustrate the implications of this on the system, the function is plotted for two
different values of , the oscillating frequency, in figures 13 and 14.
(6.2)
Proportional damping would occur in the same way as in section 4, and the coordinate transformations would also be applied to the right hand side of the
equation. [B] is defined here as an identity matrix.
7. EFFECTS
OF
DAMPING
(7.1)
(7.2)
Then, through the relationship given in (7.2), The damping ratios, i , can thus
be found. Proportional values of and can be chosen such that these values of
i are matched.
WITHOUT
HORIZONTAL ROLLERS
If the masses were resting on a flat surface this would introduce additional losses
through friction. Due to the conservation of energy, the governing equation
would follow this form:
Mx+Cx+Kx+Frictional Losses=0
The precise values for frictional losses could either be measured empirically or
from the time taken for the vibrations of the system to diminish. The latter
method assumes that all other damping parameters in the system are known.
8. CONCLUSIONS
The 6DoF system was treated in a number of ways, both computationally and
analytically. The system equations and characteristics were successfully found.
Modal analysis provided a useful way of tackling vibration problem in conjunction
with MATLAB, which computed the co-ordinate transformations. All of the natural
frequencies, damping ratios, damping factors and damped frequencies were
found. Forced, non-periodic excitation was analysed numerically with the
convolution integral, for a rectangular pulse and a half-sine pulse. The results
were accurate using the impulse response in MATLAB. However, the analytical
validation proved to be a challenge and the results were likely to be incorrect.
Forced modal analysis was considered to model an excitation function of Ft=etsint. Overall, the analysis of this 6DoF system proved to be successful and a
good understanding has been formed of its fundamental properties in free and
forced vibration.
9. REFERENCES
[1] TONGUE, B., 1996, Principles of Vibration. Oxford University Press
[2] THOMSON W. T., DAHLEH M. D., 1998, Theory of Vibration with Applications,
5th ed. Prentice Hall.
[3] ES386 Student Resources. Available online:
http://www2.warwick.ac.uk/fac/sci/eng/euo/modules/year3/es386a/resources/
10. APPENDICES
APPENDIX 1
ES386 Assignment handout: Dr. Xian Ping Liu, School of Engineering, Warwick
University. March 2010.
APPENDIX 2
Excitation files for sections 5.1 and 5.2
Force_1.m
dt=0.1;
t=0:dt:50;
f=[zeros(50,1);ones(100,1);zeros(length(t)-150,1)];
subplot(211)
plot(t,f)
title('Square input')
axis([0 50 0 1.5])
%pause
Force_2.m
DT=0.1;
t=0:DT:50;
%Time (high resolution)
f=(sin(t).*t+0.1).*(t<8.1);
plot(t,f,'b');
xlabel('Time');
ylabel('Input');
title('Input vs Time');
pause;