Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Integracion Numerica ODE PDF
Integracion Numerica ODE PDF
Ordinarias
Daniel Meja R1
Instituto de Fsica
Universidad de Antioquia
28 de Septiembre, 2011
1
danielmejia55@gmail.com
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 1 / 47
Contenido
1 Motivacion
2 Problemas de Valor Inicial
Metodo Euler
Metodo Punto Medio
Metodo de Heun
Resumen Comparativo
3 Metodos de Runge-Kutta
Idea General de los Metodos Runge Kutta
El Clasico Runge Kutta Orden 4
Yendo Mas Alla - Runge-Kutta-Fehlberg
4 Aplicacion Practica
Sistemas de EDOs de Primer Orden Acopladas
EDO de Orden Superior
1
E.D. Para Abreviar
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 3 / 47
Motivacion
2
Sin Solucion Analtica
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 4 / 47
Motivacion
2
Sin Solucion Analtica
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 5 / 47
Motivacion
Incluso un problema tan simple como la oscilacion de un pendulo
involucra una EDO sin solucion analtica
d2
g sin = 0 (1)
dt 2
dy
= f (t, y) y(0) = y0 (2)
dt
f (t, y) es una funcion bien comportada, la estrategia es solucionar la
ecuacion en un conjunto suficientemente grande de valores discretos
tj = to + jh (3)
dy
y(t) y(t0 ) + (t t0 ) |t=t0 (4)
dt
Tomando h = t t0 , puedo construir un conjunto de puntos
y1 = y0 + hf (t0 , y0 ) (5)
y2 = y1 + hf (t1 , y1 ) (6)
..
. (7)
yj+1 = yj + hf (tj , yj ) (8)
(9)
dy
= f (t, y) y(0) = y0 (10)
dt
Donde la solucion se obtiene iterando la ecuacion
3
EDG
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 9 / 47
Metodo de Euler - Ejemplo de Aplicacion
d
g sin() = 0; (0) = g (12)
dt
tome f (t, ) = g sin()
1 + e 2gt
" #
(t) = arc cos (15)
1 e 2gt
4
El codigo fuente se proporciona al final
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 11 / 47
Metodo de Euler - Ejemplo de Aplicacion
k1 = f (tj , yj ) (16)
h
yj+ 1 = yj + f (tj , yj ) (17)
2 2
h h
k2 = f (tj + , yj + k1 ) (18)
2 2
Finalmente
k1 = f (tj , yj ) (20)
k1 + k2
yj+1 = yj + h EDG O(h 2 ) (23)
2
Metodo Euler
Evalua pendiente al inicio del intervalo en cada paso
EDG O(h)
Metodo Punto Medio
Evalua pendiente al inicio y en el punto medio del intervalo en cada
paso
EDG O(h 2 )
Metodo Heun
Evalua pendiente al inicio y en el extremo del intervalo en cada
paso
EDG O(h 2 )
N
X
yj+1 = yj + p kp RK orden N (24)
p=1
N
X
p son los coeficientes de peso. En general p = 1
p=1
kp son los valores de las pendientes evaluadas en diferentes
puntos del intervalo, el numero de constantes utilizadas se
conoce como Orden
5
RK para abreviar
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 21 / 47
El Clasico Runge Kutta Orden 4
k1 = f (tj , yj ) (25)
h h
k2 = f (tj + , yj + k1 ) (26)
2 2
h h
k3 = f (tj + , yj + k2 ) (27)
2 2
k4 = f (tj + h, yj + hk3 ) (28)
h
yj+1 = yj + (k1 + 2k2 + 2k3 + k4 ) Metodo RK4 EDG O(h 4 )
6
(29)
k 1 = f tj , y j
1 1
k2 = f tj + h, yj + hk1
4 4
3 3 9
k3 = f tj + h, yj + k1 + k2 h
8 32 32
12 1932 7200 7296
k 4 = f tj + h, yj + k1 k2 + k3 h
13 2197 2197 2197
439 3680 845
k5 = f tj + h, yj + k1 8k2 + k3 k4 h
216 513 4104
1 8 3544 1859 11
k6 = f tj + h, yj + k1 + 2k2 k3 + k4 k5 h
2 27 2565 4104 40
6
Lease Runge Kutta 4,5
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 24 / 47
Yendo Mas Alla - Runge-Kutta-Fehlberg o RK45
El EDG O(h 5 )
dy1
= f1 (t, y1 , y2 , . . . , yn )
dt
dy2
= f2 (t, y1 , y2 , . . . , yn )
dt
.. .
. = ..
dyn
= fn (t, y1 , y2 , . . . , yn )
dt
7
solo para el metodo, aparte vienen las C.I. y parametros
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 27 / 47
Aplicacion - Ataque Zombie
dZ
= 1 SZ 1 (I + S) 1 Z (31)
dt
dS
= 1 SZ + 2 S 2 S (32)
dt
dI
= 2 IZ + 3 (I + S) 3 I (33)
dt
(34)
8
Nombre Tomado de Resident Evil
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 28 / 47
Aplicacion - Ataque Zombie - Primer Scenario - Caos
Colectivo
Ajustando parametros
Ajustando parametros
dy1
y1 = u = y2
dt
du dy2
y2 = = y3
dt dt
.. ..
. = .
dn1 u dyn
yn = = f (t, u)
dt n1 dt
9
GNU Scientific Library
10
Scilab y Octave alternativa a Matlab, Sage y Maxima alternativa a
Mathematica, ademas lenguajes como Python,C y Fortran
11
Tener claro licencias GPL, Copyleft y CreativeCommons
Daniel M.R. (danielmejia55@gmail.com) Integracion Numerica EDO 28 de Septiembre, 2011 45 / 47
Muchas Gracias
Estas diapositivas, al igual que los codigos para generar las imagenes
y simulaciones estaran disponibles en la URL del seminario.
Igualmente estarna alojadas en
http://github.com/Daniel-M/ODE-Seminar
Muchas Gracias