06.12.2016 Views

Taylor Series Expansion

2016+Week4

2016+Week4

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Programming Euler Method<br />

f=inline('1-2*v^2-t','t','v')<br />

h=0.01<br />

t=0<br />

v=1<br />

T(1)=t;<br />

V(1)=v;<br />

for i=1:100<br />

v=v+h*f(t,v)<br />

t=t+h;<br />

T(i+1)=t;<br />

V(i+1)=v;<br />

end<br />

Definition of the ODE<br />

Initial condition<br />

Main loop<br />

Euler method<br />

Storing information<br />

42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!