10.05.2013 Views

texto: metodos numericos para ecuaciones diferenciales ordinarias

texto: metodos numericos para ecuaciones diferenciales ordinarias

texto: metodos numericos para ecuaciones diferenciales ordinarias

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

format long<br />

x=a:h:n*h;<br />

y=zeros(n,1);<br />

y(1)=b;<br />

for k=1:n<br />

end<br />

y1=fl(x(k),y(k));<br />

r1=(((0.06^2)*(pi^2)/2.1)-4/2.1);<br />

r2=4*(-0.06*pi/2.1);<br />

r3=(-1/(2.1*1.1));<br />

y2=r1*exp(-0.06*pi*x(k)).*sin(2*x(k)-pi)+...<br />

r2*exp(-0.06*pi*x(k)).*cos(2*x(k)-pi)+r3*y1;<br />

y3=(-0.06*pi*r1-2*r2)*exp(-0.06*pi*x(k)).*sin(2*x(k)-pi)+...<br />

(2*r1-0.06*pi*r2)*exp(-0.06*pi*x(k)).*cos(2*x(k)-pi)+r3*y2;<br />

y(k+1)=y(k)+h*(y1+(h/2)*(y2+(h/3)*(y3)));<br />

Programa fl.m<br />

function y1=fl(x,y)<br />

y1=(-y/(2.1*1.1))+(-0.06*pi/2.1)*exp(-0.06*pi*x)*sin(2*x-pi)+...<br />

(2/2.1)*exp(-0.06*pi*x)*cos(2*x-pi);<br />

Ejecutamos el programa<br />

>> taylor3(10,0,1,0.2)<br />

ans =<br />

tn<br />

In<br />

0 1.000000000000000<br />

0.2 0.746508916487780<br />

0.4 0.552980151519051<br />

0.6 0.431802748271490<br />

0.8 0.384440494683400<br />

1.0 0.401911779693576<br />

1.2 0.466844369290315<br />

17

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

Saved successfully!

Ooh no, something went wrong!