ID-2021HT30157 Name-Deepak Walwadkar Class Assignment 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

ID-2021HT30157

Name-Deepak Walwadkar
Class Assignment 2
Write a MATLAB code for finding the natural frequencies and modes of a three degree of freedom
system using the following methods.
1. Matrix Iteration method (3 marks)
2. Holzer’s method (2 marks)

1. Matrix Iteration method.

w1=0.4450 w2=1.2482 w3=1.3954


MATLAB Code
% To clear the workspace and command window;
clear all;
close;
clc;
m=[1,0,0;0,1,0;0,0,1];
k=[2,-1,0;-1,2,-1;0,-1,1];
D=inv(k)*m;
X=[1,1,1];
x1=D*X';
x11=x1/3;
x2=D*x11;
x12=x2/4.6667;
x3=D*x12;
x13=x3/5;
x4=D*x13;
x14=x4/5.0428;
x5=D*x14;
x15=x5/5.0482;
x6=D*x15;
x16=x6/5.0488;
x7=D*x16;
x17=x7/5.0489;
x8=D*x17;
x18=x8/5.0489;
w1=sqrt(1/5.04890)
x19=x18'*m*x18;
A=1/sqrt(9.2960);
Xo=A*x18;
D2=D-5.0489*Xo*Xo'*m;
x20=D2*X';
x201=x20/0.25780;
x21=D2*x201;
x202=x21/0.599999999;
x22=D2*x202;
x203=x22/0.6209;
x23=D2*x203;
x204=x23/0.6322;
x24=D2*x204;
x205=x24/0.6377;
x25=D2*x205;
x206=x25/0.6406;
x26=D2*x206;
x207=x26/0.6418;
x27=D2*x207;
x208=x207'*m*x207;
A2=1/sqrt(1.8348);
w2=sqrt(1/0.6418)
Xo2=A*x207;
D3=D2-0.6418*Xo2*Xo2'*m;
x31=D3*X';
x209=x31/0.2134;
x32=D3*x209;
x210=x32/0.4839;
x33=D3*x210;
x211=x33/0.4957;
x34=D3*x211;
x212=x34/0.5036;
x35=D3*x212;
x213=x35/0.5086;
x36=D3*x213;
x214=x36/0.5116;
x37=D3*x214;
x215=x37/0.5136;
x38=D3*x215;
w3=sqrt(1/0.5136)
2. Holzer’s method.

w1=0 w2=1 w3=1.7


MATLAB Code:- % To clear the workspace and command window
clear all
close
clc
m1=input('Enter value of mass 1=');
m2=input('Enter value of mass 2=');
m3=input('Enter value of mass 3=');
k1=input('Enter value of stiffness 1=');
k2=input('Enter value of stiffness 2=');
k3=input('Enter value of stiffness 3=');
for i=1:50;
w(i)=1*(i/20)
x1(i)=1;
A=(w(i)^2*m1*x1(i));
B=A/k1;
x2(i)=x1(i)-B;
C=(m2*x2(i)*(w(i)^2));
D=A+C;
E=D/k2;
x3(i)=x2(i)-D;
F=x3(i)*m3*(w(i)^2);
G(i)=F+D
H=G/k3;
J(i)=0;
end
plot(w,G,w,J)
xlabel ('w');
ylabel ('Inertia force');

You might also like