Sunteți pe pagina 1din 8

Example 1

Solution
The natural frequencies ,normal modes and the free-vibration responses of m1 and m2 were found as:

The MATLAB program to plot the responses is given below


%% Undamped twodegree of freedom system
clear all
clf
%Mass Matrix
M=[10 0;0 1]

M = 2x2 double

10 0
0 1

% Stifness Matrix
K=[35 -5;-5 5]

K = 2x2 double

35 -5
-5 5

C=inv(M)*K;
[v,d]=eig(C)

v = 2x2 double

-0.4472 0.1961
-0.8944 -0.9806
d = 2x2 double

2.5000 0
0 6.0000

w_1n=sqrt(d(1,1))

w_1n = 1.5811

w_2n=sqrt(d(2,2))

w_2n = 2.4495

x2_11=v(2,2)/v(1,2) % first mode shape corresponding to w_1n

x2_11 = -5

x2_12=v(2,1)/v(1,1) % second mode shape corresponding to w_2n

x2_12 = 2

% t = 0:1/25:20;
% x1 = (5/7) * cos(1.5811*t) + (2/7) * cos(2.4495*t);
% x2 = (10/7) * cos(1.5811*t) - (10/7) * cos(2.4495*t);
%OR USE
for i = 1: 501
t(i) = (i-1)/25;
x1(i) = (5/7) * cos(1.5811*t(i)) + (2/7) * cos(2.4495*t(i));
x2(i) = (10/7) * cos(1.5811*t(i)) - (10/7) * cos(2.4495*t(i));
end
subplot(221);
plot(t, x1);
xlabel('t');
ylabel('x1(t)');
subplot(224);
plot(t, x2);
xlabel('t');
ylabel('x2(t)');

 
 

Example 2
A simplified model of an automobile suspension system is shown as a two degree of freedom system.
Write a MATLAB script to determine the natural frequencies of this model.
Fig. Simplified model of an automobile

The parameters given are:

Automobile mass, m = 2268 kg

Centroidal moment of inertia, I = 544 kg/m^2

Spring stiffness, k1= k2=k = 36500 N/m

l1 = 1.04 m

l2 = 1.4 m

Solution:
The force and the moment equilibrium equations:
Substituting the value of k, it reduces to:

% The MATLAB program for theTwo-degree-of-freedom system


clear all
clf
m=input('Vehicle mass in kg');
I=input('Mass moment of inertia in kg/m^2')
k=input('Stiffness in N/m')
a=input('Distance from rear springs to cg in m')
b=input('Distance from front springs to cg in m')
% mass matrix
M=[m,0;0,I];
% stiffness matrix
K=[2*k,(b-a)*k;(b-a)*k,(b^2+a^2)*k];
% eigenvalues and eigenvectors calculation
C=inv(M)*K;
[V,D]=eig(C)
wn_1=sqrt(D(1,1));
wn_2=sqrt(D(2,2));
X1=[V(1,1);V(2,1)];
X2=[V(1,2);V(2,2)];
% Output
disp('Vehicle mass in kg ='); disp(m)
disp('Moment of inertia in kg/m^2 ='); disp(I)
disp('Stiffness in N/m ='); disp(k)
disp('Distance from rear springs to cg in m ='); disp(a)
disp('Distance from front springs to cg in m ='); disp(b)
disp('Mass-matrix');disp(M)
disp('Stiffness-matrix');disp(K)
disp('Natural frequencies in rad/s=');
disp (wn_1)
disp(wn_2)
disp('Mode shape vectors'); disp(X1)
disp(X2)

Example 3
Solution:

%%METHOD 1
clc
clf
clear all
m=30; % Mass
k=20000; % Stiffness
c=150; % Damping
% 4 x 4 matrices
disp('4 x 4 Mass matrix');
mt=[0,0,m,0;0,0,0,2*m;m,0,0,0;0,2*m,0,c];
disp('4 x 4 stiffness matrix');
kt=[-m,0,0,0;0,-2*m,0,0;0,0,3*k,-2*k;0,0,-2*k,2*k];
Z=inv(mt)*kt;
[V,D]=eig(Z);
disp('Eigenvalues');
V
disp('Initial conditions');
x0=[0;0;0.005;0]
disp('Integration constants');
S=inv(V)*x0
tk=linspace(0,2,101);
% Evaluation of time dependent response
% Recall that x1=y3 and x2=y4
for k=1:101
t=tk(k);
for i=3:4
x(k,i-2)=0;
for j=1:4
x(k,i-2)=x(k,i-2)+(real(S(j))*real(V(i,j))-imag(S(j))*imag(V(i,j)))...
*cos(imag(D(j,j))*t);
x(k,i-2)=x(k,i-2)+(imag(S(j))*real(V(i,j))-real(S(j))...
*imag(V(i,j)))*sin(imag(V(i,j))*t);
x(k,i-2)=x(k,i-2)*exp(-real(D(j,j))*t);
end
end
end
plot(tk,x(:,1),'-',tk,x(:,2),':')
title('2_DOF with damping')
xlabel('t[sec]')
ylabel('x(m)')
legend('x1(t)','x2(t)')

 
 

Assignment 1
Assignment 2

S-ar putea să vă placă și