21.06.2014 Aufrufe

Beispiel - SAM - ETH Zürich

Beispiel - SAM - ETH Zürich

Beispiel - SAM - ETH Zürich

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

2 % Ricatti differential equation for Example 1.1.3<br />

3 f u n c t i o n Ricatti<br />

4<br />

5 % define the right hand side of the differential equation as function handle<br />

6 fn = @(t,x) x.^2+t^2;<br />

7<br />

8 % plot solution curves<br />

9 f i g u r e(’Name’,’Ricatti’); hold on;<br />

0 % run ode45 and plot resuts for different starting values on y-axis<br />

1 f o r v = 0.05:0.1:1.4<br />

2 [t,y] = ode45(fn,[0 1.5],v);<br />

3 p l o t(t,y,’r-’);<br />

4 end<br />

5 % run ode45 and plot resuts for different starting values on x-axis<br />

6 f o r v = [0.4 0.7 1.0 1.2 1.4]<br />

7 [t,y] = ode45(fn,[v 1.5],0);<br />

8 p l o t(t,y,’r-’);<br />

9 end<br />

0 % set axes, labels, ...<br />

1 set(gca,’fontsize’,14); axis([0 1.5 0 1.5]);<br />

2 x l a b e l(’{\bf t}’); y l a b e l(’{\bf y}’);<br />

3 % Create EPS output file<br />

4 p r i n t -depsc2 ’riccatti1.eps’<br />

Numerische<br />

Mathemtik<br />

R. Hiptmair<br />

rev 35327,<br />

25. April<br />

2011<br />

1.1<br />

p. 16

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!