Hi, I am trying to solve an equation of motion using ode45. I saw others work, and how they implement the method, however, I did not get a reasonable answer. It seems so simple, but I do not know why I got such weird answers! Could anyone help me figure it out? My code is as follows:
main body:
t=0:.02:5;
X=[.002 ; 0];
[t,y]=ode45(@YP,t, X);
figure(1)
plot(t,y(1), '+')
figure(2)
plot(t,y(2), 'o')
Function:
function ydot= YP(t,x)
m=2459;k=107.178;zeta=.005;
wn=sqrt(k/m);
c=zeta*(2*m*wn);
ydot=[x(2);(-1/m)*(c*x(2)+k*x(1))];

댓글 수: 2

James Tursa
James Tursa 2017년 12월 11일
What is the ode you are trying to solve?
Alaa Hameed
Alaa Hameed 2017년 12월 11일
the free vibration : m*A+ c*V+ k*x=0 where, A:acceleration V:velocity x:displacement m:mass; c:damping coefficient; k:stiffness

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

 채택된 답변

James Tursa
James Tursa 2017년 12월 12일

0 개 추천

figure;plot(t,y(:,1));grid on
figure;plot(t,y(:,2));grid on

댓글 수: 1

Alaa Hameed
Alaa Hameed 2017년 12월 12일
Yes! how I did not pay attention to it! Thanks...

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

추가 답변 (0개)

카테고리

질문:

2017년 12월 11일

편집:

2017년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by