Simple questions on Mechanical Vibrations

11 ビュー (過去 30 日間)
yung zhen lek
yung zhen lek 2018 年 11 月 13 日
回答済み: Keith Hekman 2020 年 12 月 29 日
For k = 100, c = 2 and m = 1 use Matlab to calculate ωn, ωd and ξ. and Solve the equation of motion for F = F0sin(ωt) where ω = 1 → 20 rad/s and F0 = 10 N and plot the maximum response at steady-state for each frequency.
%Part 2
%Equation of motion
clear all;
clc;
m=1;
c=2;
k=100;
F=0;
Force=[0;0;F];
M=[m 0 0;0 m 0;0 0 m];
K=[2*k -k 0;-k 2*k -k;0 -k k];
C=[2*c c 0;-c 2*c -c;0 -c c];
%Finding values
Z=zeros(3);
I=eye(3);
A=[C M;I Z];
B=[K Z;Z -I];
[V,D]=eig(B,A)
d=diag(D);
r=real(d);
im=imag(d);
wn=abs(d)
wd=im/-1
zeta=sqrt(1-(wd/wn)^2)
%Part 3
%2 equations: (K-Mw^2)a + Cwb=0, -Cwa+(K-Mw^2)=f
F0=10;
f=[0;0;F0];
z=[0;0;0];
w=1:0.1:20;
t=0:0.01:100;
for ii=1:length(w)
G=K-M.*w(ii)^2;
H=C.*w(ii);
T=[G H;-H G];
constants(:,ii)=T^(-1)*[z;f];
a(:,ii)= constants(1:3,ii);
b(:,ii)= constants(4:6,ii);
x=a(:,ii)*cos(w(ii)*t)+b(:,ii)*sin(w(ii)*t);
amp(:,ii)=sqrt((a(:,ii)).^2+(b(:,ii)).^2)
end
plot(w,x)
I am not sure why does MATLAB keeps on responding with vectors are not of the same length. Are there any ways to edit my solution/code?
I cant seem to plot the graph out =( please help!!!

採用された回答

David Goodmanson
David Goodmanson 2018 年 11 月 14 日
Hi y z l, try
plot(w,amp)
which looks pretty good.
  1 件のコメント
yung zhen lek
yung zhen lek 2018 年 11 月 14 日
Hey, thanks a lot for your help =) really saved my life

サインインしてコメントする。

その他の回答 (1 件)

Keith Hekman
Keith Hekman 2020 年 12 月 29 日
NOTE, you are missing the - in front of the c noted by the ""
C=[2*c "-"c 0;-c 2*c -c;0 -c c];

カテゴリ

Help Center および File ExchangeVibration Analysis についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by