how to solve this ode:

조회 수: 3 (최근 30일)
Jasneet Singh
Jasneet Singh 2021년 2월 20일
댓글: Jasneet Singh 2021년 2월 20일
hello, this is my script help me withn this please,
[t,y]=ode45('EQ2',[0:1800],[0,0]);
function dydt=EQ2(t,y)
a=1; # pararmeters
k=20;
m=0.5;
F=0.01;
omega=2*pi;
dydt(1)=y(2);
dydt(2)=[(F*cos(omega*t)-c*y(2)-k*y(1))/m];
end
  댓글 수: 2
darova
darova 2021년 2월 20일
WHat is wrong? Do you have any errors?
Jasneet Singh
Jasneet Singh 2021년 2월 20일
Yes I can't run it When I try to it says undefined function y,etc

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

답변 (1개)

darova
darova 2021년 2월 20일
Try this way
[t,y]=ode45(@EQ2,[0:1800],[0,0]);
  댓글 수: 1
Jasneet Singh
Jasneet Singh 2021년 2월 20일
Tried all this methods not working!!

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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by