필터 지우기
필터 지우기

Hi every one, can you help me to draw graph Frequency and transmissibility (or Amplitude) from code:

조회 수: 4 (최근 30일)
function main
d1=1;
v=10;
t_end=100*0.5*d1/v;
t=0:0.01:t_end;
y0=[0;0;0;0];
[t,y]=ode45(@daodong,t,y0);
hold on;grid on;
plot(t,y(:,1));
xlabel('Thoi gian (s)')
ylabel('Bien Do dao dong (m)')
title('DAO DONG CUA HANH KHACH')
Fs=10;
freq1 = 0:Fs/length(x1):Fs/2;
hold on;grid on;
plot(freq,abs(xdft),'g')
plot(freq1,abs(xdft1),'r')
xlabel('Hz')
ylabel('Amplitude')
legend('NEM HOI')
end
function yp = daodong(t,y)
c=10;
vt=10;
k1=84.24;
m1=5.265;
I1=0.2322;
a=0.21;
yp = zeros(4,1);
yp(1) = y(2);
yp(2) = ((-(c*(y(2)-0.05*2*pi*vt*(sin(4*pi*vt*t))-(a*y(4)/2))+k1*(y(1)-(0.05*(sin(2*pi*vt*t))^2)-(a*y(3)/2))))/m1);
yp(3) = y(4);
yp(4) = ((-(a*c*(y(2)-0.05*2*pi*vt*(sin(4*pi*vt*t))-(a*y(4)/2))+a*k1*(y(1)-(0.05*(sin(2*pi*vt*t))^2)-(a*y(3)/2))))/(2*I1));
end
Thank you very much.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 9월 8일
In your line
freq1 = 0:Fs/length(x1):Fs/2;
x1 is not defined.
In your line
plot(freq,abs(xdft),'g')
xdft is not defined.
Johnny Vendetta
Johnny Vendetta 2019년 9월 8일
i'm sorry, my code:
function main
d1=1;
v=10;
t_end=100*0.5*d1/v;
t=0:0.01:t_end;
y0=[0;0;0;0];
[t,y]=ode45(@daodong,t,y0);
hold on;grid on;
plot(t,y(:,1));
xlabel('Thoi gian (s)')
ylabel('Bien Do dao dong (m)')
title('DAO DONG CUA HANH KHACH')
end
function yp = daodong(t,y)
c=10;
vt=10;
k1=84.24;
m1=5.265;
I1=0.2322;
a=0.21;
yp = zeros(4,1);
yp(1) = y(2);
yp(2) = ((-(c*(y(2)-0.05*2*pi*vt*(sin(4*pi*vt*t))-(a*y(4)/2))+k1*(y(1)-(0.05*(sin(2*pi*vt*t))^2)-(a*y(3)/2))))/m1);
yp(3) = y(4);
yp(4) = ((-(a*c*(y(2)-0.05*2*pi*vt*(sin(4*pi*vt*t))-(a*y(4)/2))+a*k1*(y(1)-(0.05*(sin(2*pi*vt*t))^2)-(a*y(3)/2))))/(2*I1));
end
Can you help me to draw graph Frequency and transmissibility (or Amplitude).

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by