Download - Ecuaciones Diferenciales Ordinarias
![Page 1: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/1.jpg)
![Page 2: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/2.jpg)
Ecuaciones Diferenciales Ordinarias
Problemas de valor inicial Campo de direcciones Métodos numéricos para el problema de valor
inicial Método de Euler Método de Heun Método de Euler modificado Método de Runge-Kutta
![Page 3: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/3.jpg)
Problemas de valor inicial
Ecuación diferencial
Condición inicial
Ejemplo: modelo de población de Verhulst
y t f t y t t a b( ) ( , ( )) , [ , ]
y a y( ) 0
y t ay t by t y t y( ) ( ) ( ) , ( )20 0
![Page 4: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/4.jpg)
Campo de direcciones
Curvas solución de una ecuación diferencial
Pendiente de las curvas solución
Campo de direcciones
y y t t a b ( ) , [ , ]
m y t f t y t t a b ( ) ( , ( )) , [ , ]
( , ) ( , ( , )), [ , ], [ , ]t y f t y t a b y c d 1
![Page 5: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/5.jpg)
Campo de direcciones
t=a:h:b; y=c:h:d;
[tt,yy] = meshgrid(t,y);
uno = ones(size(tt));
dy = f(tt,yy);
quiver(tt,yy,uno,dy)
![Page 6: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/6.jpg)
Campo de direcciones
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5Ecuación LogísticaEcuación Logística
![Page 7: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/7.jpg)
Métodos numéricos para el P.V.I.
Problema de Valor Inicial
Discretización
Forma integral del problema de valor inicial
y t y t f s y s dst
t
( ) ( ) ( , ( )) 00
y t f t y t t a b y a y( ) ( , ( )), [ , ], ( ) 0
a t t t b
y y t y y t y y tn
n n
0 1
0 0 1 1
( ), ( ), ( )
![Page 8: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/8.jpg)
Métodos numéricos para el P.V.I.
Error local del método iterativo
Error máximo
Convergencia
Método de orden p:
e y y tk k k ( )
E h max ek
k( )
limE hh
0
0( )
E h Mh M constp( ) , .
![Page 9: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/9.jpg)
Método de Euler
Forma integral de la ecuación diferencial
Aproximación (Fórmula de los rectángulos)
Paso fijo
Método de Euler: para k=1,2...,n
y t y t f t y t dtt
t
( ) ( ) ( , ( ))1 00
1
y y t t f t y1 0 1 0 0 0 ( ) ( , )
y y hf t y1 0 0 0 ( , )
y y hf t yk k k k 1 ( , )
![Page 10: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/10.jpg)
Método de Euler
function [t,y]=mieuler(a,b,y0,n)
h=(b-a)/n; t=a:h:b;
y=zeros(size(t)); y(1)=y0;
for k=1:n
y(k+1)=y(k)+h*f(t(k),y(k));
end
![Page 11: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/11.jpg)
Soluciones aproximadas (Euler)
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5Ecuación LogísticaEcuación Logística
![Page 12: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/12.jpg)
Método de Heun
Forma integral de la ecuación diferencial
Aproximación (Fórmula de los trapecios)
Aproximación por Euler (predicción)
Método de Heun (correccción)
y t y t f t y t dtt
t
( ) ( ) ( , ( ))1 00
1
f t y dt h f t y f t yt
t
( , ) / ( ( , ) ( , ))0
1
2 0 0 1 1
y y hf t yp1 0 0 0 ( , )
y y h f t y f t yp1 0 0 0 1 12 / ( ( , ) ( , ))
![Page 13: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/13.jpg)
Método de Heun
function [t,y]=heun(a,b,y0,n) h=(b-a)/n; t=a:h:b; y=zeros(size(t)); y(1)=y0; for k=1:n k1=f(t(k),y(k)); ykp=y(k)+h*k1; k2=f(t(k+1),ykp); y(k+1)=y(k)+h/2*(k1+k2); end
![Page 14: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/14.jpg)
Método de Euler modificado
Forma integral de la ecuación diferencial
Aproximación (Fórmula del punto medio)
Aproximación por Euler
Método de Euler modificado
y t y t f t y t dtt
t
( ) ( ) ( , ( ))1 00
1
f t y dt hf t h y t ht
t
( , ) ( / , ( / ))0
1
0 02 2
y t h y y h f t y( / ) / ( , )/0 1 2 0 0 02 2
y y hf t h y1 0 0 1 22 ( / , )/
![Page 15: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/15.jpg)
Método de Euler modificado
function [t,y]=eulermod(a,b,y0,n)
h=(b-a)/n; t=a:h:b;
y=zeros(size(t)); y(1)=y0;
for k=1:n
yk2=y(k)+h/2*f(t(k),y(k));
y(k+1)=y(k)+h*f(t(k)+h/2,yk2));
end
![Page 16: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/16.jpg)
Método de Runge-Kutta
Forma integral de la ecuación diferencial
Aproximación de la integral (Regla de Simpson)
y t y t f t y t dtt
t
( ) ( ) ( , ( ))1 00
1
f t y dt
hf t y f t y f t y
t
t
( , )
( ( , ) ( , ) ( , ))/ /
0
1
640 0 1 2 1 2 1 1
![Page 17: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/17.jpg)
Método de Runge-Kutta (cont.)
Estimaciones previas
Aplicación de la fórmula
y y h k k k k1 0 1 2 3 46 2 2 / ( )
k f t y
k f t h y h k
k f t h y h k
k f t h y hk
1 0 0
2 0 0 1
3 0 0 2
4 0 0 3
2 2
2 2
( , )
( / , / )
( / , / )
( , )
![Page 18: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/18.jpg)
Método de Runge-Kutta
function [t,y]=rungekut(a,b,y0,n) h=(b-a)/n; t=a:h:b; y=zeros(size(t)); y(1)=y0; for k=1:n k1=f(t(k),y(k)); tk2=t(k)+h/2; k2=f(tk2,y(k)+h/2*k1); k3=f(tk2,y(k)+h/2*k2); k4=f(t(k+1),y(k)+h*k3); y(k+1)=y(k)+h/6*(k1+2*k2+2*k3+k4); end
![Page 19: Ecuaciones Diferenciales Ordinarias](https://reader036.vdocuments.co/reader036/viewer/2022082710/56812d16550346895d92029c/html5/thumbnails/19.jpg)
Comparación de métodos
Método Orden delerror
Evaluacionesfuncionales
Euler h 1
Heun h2 2
Eulermodificado
h2 2
Runge-Kutta h4 4