Simple questions on Mechanical Vibrations

조회 수: 14 (최근 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 CenterFile Exchange에서 Vibration Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by