You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
6.4. Ecuat¸ii stiff 143<br />
subplot(1,2,1), plot(ta,ya(:,2),’-*’)<br />
ax = axis; ax(1) = -0.2; axis(ax);<br />
xlabel(’t’), ylabel(’y_2(t)’)<br />
title(’ode45’,’FontSize’,14)<br />
[tb,yb] = ode15s(@chem,tspan,y0,opts,alpha,beta,gamma);<br />
subplot(1,2,2), plot(tb,yb(:,2),’-*’)<br />
axis(ax)<br />
xlabel(’t’), ylabel(’y_2(t)’)<br />
title(’ode15s’,’FontSize’,14)<br />
Graficele lui y2 apar în figura 6.7. Figura 6.8 cont¸ine un zoom pe graficul obt¸inut cu<br />
ode45. Statisticile generate de rezolvitori sunt<br />
y 2 (t)<br />
3.5<br />
3<br />
2.5<br />
2<br />
1.5<br />
1<br />
0.5<br />
x 10−5<br />
4<br />
ode45<br />
0<br />
0 1 2 3<br />
t<br />
y 2 (t)<br />
3.5<br />
3<br />
2.5<br />
2<br />
1.5<br />
1<br />
0.5<br />
x 10−5<br />
4<br />
ode15s<br />
0<br />
0 1 2 3<br />
t<br />
Figura 6.7: Solut¸ia y2 a sistemului lui Robertson, obt¸inută cu ode45 (stânga) s¸i<br />
ode15s<br />
2052 successful steps<br />
440 failed attempts<br />
14953 function evaluations<br />
0 partial derivatives<br />
0 LU decompositions<br />
0 solutions of linear systems<br />
pentru ode45 s¸i<br />
33 successful steps