Struggling to use ode 45
이전 댓글 표시
So here is my code: sys(m,
A0= 0.03;
m0= [0,0.1,0.3];
p0= [0.1,0.4,0.5];
mdot(1) = -m0(1) + 60*(5-A0)/(1+p0(1)^2) +A0;
mdot(2) = -m0(2) + 60*(5-A0)/(1+p0(2)^2) +A0;
mdot(3) = -m0(3) + 60*(5-A0)/(1+p0(3)^2) +A0;
mdot=[mdot(1),mdot(2),mdot(3)];
pdot(1)=-0.2*(p0(1)-m0(1));
pdot(2)=-0.2*(p0(2)-m0(2));
pdot(3)=-0.2*(p0(3)-m0(3));
pdot=[pdot(1),pdot(2),pdot(3)];
t0=0;
tspan=[0,800];
[y,t]=ode45(@odefun,tspan, m0, options);
plot(t,y);
Been staring at it for hours but it wont run.
?? ?
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!