21.06.2014 Aufrufe

Beispiel - SAM - ETH Zürich

Beispiel - SAM - ETH Zürich

Beispiel - SAM - ETH Zürich

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

8 tg = h*(0:N);<br />

9<br />

0 % Plotting of trajectories in phase space<br />

1 f i g u r e(’name’,’pendeul’);<br />

2 ph = p l o t(s(:,1),s(:,2),’g--’,...<br />

3 y_expl(1,:),y_expl(2,:),’r-+’,...<br />

4 y_imp(1,:),y_imp(2,:),’b-+’,...<br />

5 y_mid(1,:),y_mid(2,:),’m-*’); hold on;<br />

6 set(ph(1),’linewidth’,2);<br />

7 ax = axis;<br />

8 p l o t([ax(1) ax(2)],[0 0],’k-’);<br />

9 p l o t([0 0],[ax(3) ax(4)],’k-’);<br />

0 x l a b e l(’{\bf \alpha}’,’fontsize’,14);<br />

1 y l a b e l(’{\bf p}’,’fontsize’,14);<br />

2 legend(’exact solution’,’explicit Euler’,’implicit Euler’,...<br />

3 ’implicit midpoint’,’location’,’southwest’);<br />

4 t i t l e( s p r i n t f(’%d timesteps on [0,%f]’,N,T));<br />

5<br />

6 i f (nargin > 3)<br />

7 p r i n t(’-depsc2’, s p r i n t f(’%s.eps’,filename));<br />

8 end<br />

9<br />

0 % Tracking energies for explicit Euler<br />

Numerische<br />

Mathemtik<br />

R. Hiptmair<br />

rev 35327,<br />

25. April<br />

2011<br />

1.4<br />

p. 92

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

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!