Differential equations using ODE45

조회 수: 2 (최근 30일)
Star1202
Star1202 2020년 10월 15일
댓글: Md Muzakkir Quamar 2020년 10월 15일
please help me in solving this question..
Q. solve:
dy1/dt = y2
dy2/dt = 1000*y2*(1-y1^2)-y1
given initial conditions : y1(0) = 0 and y2(0) = 1.

채택된 답변

madhan ravi
madhan ravi 2020년 10월 15일
doc ode45 % have a read at the document

추가 답변 (1개)

Md Muzakkir Quamar
Md Muzakkir Quamar 2020년 10월 15일
tspan = [0 20];
Y_int=[0 1];
[t,x] = ode45(@odefcn,tspan,Y_int,[],a, b, c, u);
figure(1)
plot(t,y(:,1),'r',t,y(:,2),'b')
function dydt = odefcn(t,y)
dydt = zeros(2,1);
dydt(1) = y(2);
dydt(2) = 1000*y(2)*(1-y(1)^2)-y(1);
end
  댓글 수: 2
Steven Lord
Steven Lord 2020년 10월 15일
Please don't post the full answers to questions that sound like homework assignments, particularly if the poster has not shown what they've tried first.
Md Muzakkir Quamar
Md Muzakkir Quamar 2020년 10월 15일
Noted.. Thanks

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by