Problem generating two graphics when solving a two ODE's system using ODE45.
이전 댓글 표시
Hi there. I have two ode equations placed as followed and I need to plot two different graphs: one for each curve generated. How can I do it? I've tried using subplot, but since I have one only solution (t,f), I've ended having two identical graphs.
initialx = 0;
initialy = 0;
deq1=@(t,x) [(Qi.*Ci)-(ke.*x(1))-(mi.*(x(1)^cu))-(Qs1.*x(1))-(Qs2.*x(1)); (a.*(Os-x(2)).*Se)+(Qi.*Oi)-(Qs1+Qs2).*x(2)-(b.*ke.*x(1))];
[t,f] = ode45(deq1,[0 runtime],[initialx initialy]);
답변 (1개)
Walter Roberson
2017년 6월 5일
plot(t, f)
should give you two lines, one for each column in f
댓글 수: 2
Amanda Cunha
2017년 6월 6일
Walter Roberson
2017년 6월 6일
subplot(1,2,1,);
plot(t, f(:,1));
subplot(1,2,2);
plot(t, f(:,2));
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!