Finding Natural frequencies and Mode shapes of an undamped 2 DOF Systems through Matlab

83 views (last 30 days)
Hello, I'm a student and I look for a solution for Matlab. I'm quite beginner to use Matlab. Could you pls help me to write it through Matlab? I need how to write these codes through Matlab.
Thank you for all your supports and helps!

Answers (3)

AVB
AVB on 10 Dec 2020
Try using below .... change m1, m2 , k1 and k2 with your problem values.
clc;
m1 = 5;
m2 = 10;
k1= 1500;
k2 = 6500;
m = [m1 0; 0 m2];
k = [(k1 + k2) -k2; -k2 k2];
eigsort(k,m);
function [u,wn]=eigsort(k,m)
Omega=sqrt(eig(k,m));
[vtem,~]=eig(k,m);
[wn,isort]=sort(Omega);
il=length(wn);
for i=1:il
v(:,i)=vtem(:,isort(i));
end
disp("The natural frequencies are (rad/sec)")
wn
disp("\nThe eigenvectors of the system are")
v
disp("Ratios of eigenvectors are:\n")
A1_A2_1 = v(1,1)/v(2,1)
A1_A2_2 = v(1,2)/v(2,2)
figure(1)
plot([0,1,2,3], [0,A1_A2_1,1,0],'b-s', 'LineWidth',2, 'MarkerSize',10);
hold on;
plot([0,1,2,3], [0,-A1_A2_2,-1,0],'r-s', 'LineWidth',2, 'MarkerSize',10);
hold off; ylabel('Eigne Vector Ratio'); xlabel('Mass Number'); xticks([1 2]);
legend('Mode 1', 'Mode 2')
end

Bertan Parilti
Bertan Parilti on 10 Dec 2020
Thank you a lot!

Rakesha
Rakesha on 5 Sep 2023
clc;
m1 = 5;
m2 = 10;
k1= 1500;
k2 = 6500;
m = [m1 0; 0 m2];
k = [(k1 + k2) -k2; -k2 k2];
eigsort(k,m);
function [u,wn]=eigsort(k,m)
Omega=sqrt(eig(k,m));
[vtem,~]=eig(k,m);
[wn,isort]=sort(Omega);
il=length(wn);
for i=1:il
v(:,i)=vtem(:,isort(i));
end
disp("The natural frequencies are (rad/sec)")
wn
disp("\nThe eigenvectors of the system are")
v
disp("Ratios of eigenvectors are:\n")
A1_A2_1 = v(1,1)/v(2,1)
A1_A2_2 = v(1,2)/v(2,2)
figure(1)
plot([0,1,2,3], [0,A1_A2_1,1,0],'b-s', 'LineWidth',2, 'MarkerSize',10);
hold on;
plot([0,1,2,3], [0,-A1_A2_2,-1,0],'r-s', 'LineWidth',2, 'MarkerSize',10);
hold off; ylabel('Eigne Vector Ratio'); xlabel('Mass Number'); xticks([1 2]);
legend('Mode 1', 'Mode 2')
end

Categories

Find more on Downloads in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!