Está en la página 1de 9

CATEDRA: SIMULACION NUMERICA

Unidad VII

Ecuaciones Diferenciales Ordinarias


METODO DE EULER

METODO DE HEUN
METODO DE RUNGE KUTTA DE SEGUNDO ORDEN
METODO DE RUNGE KUTTA DE TERCER ORDEN
METODO DE RUNGE KUTTA DE CUARTO ORDEN

Ing. Deny Gonzlez

Ecuaciones Diferenciales Ordinarias

Generalidades.

Sea

dv
c
g v
dt
m

Una ecuacin diferencial de primer orden, donde:

g, c y m son constantes, v es la variable dependiente y t es la


variable independiente.
Las ecuaciones diferenciales se dividen en:

EDO, posee una sola variable independiente.


EDP, poseen dos o mas variables independientes.
En general a las ecuaciones de orden mayor a uno se les conoce
como ecuaciones de orden superior.
Ing. Deny Gonzlez

Ecuaciones Diferenciales Ordinarias

Estimado

error

Verdadero

Tamao del paso h

Consiste en ir aproximando una lnea


recta mediando un paso llamado h o
diferencial infinita a la curva verdadera
de tal que el valor estimado para la
solucin de la EDO de un mnimo error,
mientras mas cerca de cero este h o
mas pequeo sea el paso el error ir
disminuyendo

Ing. Deny Gonzlez

METODO DE EULER
Ecuacin:

y(i 1) yi h * f ( xi , yi )
Ejemplo:

y ' 2 xy
y (0) 1
h 0.2

sol :
ye

N
0
1
2
3
4
5
6
7
8
9
10

x
0
0,2
0,4
0,6
0,8
1
1,2
1,4
1,6
1,8
2

y
1,00000
1,00000
1,08000
1,25280
1,55347
2,05058
2,87082
4,24881
6,62814
10,87015
18,69666

y real
1
1
1,04081077
1,17351087
1,43332941
1,89648088
2,71828183
4,22069582
7,09932707
12,9358173
25,5337217

Error (%)
----0
3,76525943
6,75657388
8,38206376
8,12569019
5,611428
0,66605705
6,63705854
15,9685834
26,7766011

x2

Iteracion 1.

y( i 1) 1 0.2 * 20 1 1
Iteracion 2.

y(i 1) 1 0.2 * 20.21 1.08

24,00000
20,00000
16,00000

Y aprox

12,00000

Y real

8,00000
4,00000
0,00000
0

0,2 0,4 0,6 0,8

1,2 1,4 1,6 1,8

Ing. Deny Gonzlez

METODO DE EULER MEJORADO (HEUM)


Mtodo de Heun.

El mtodo de Heun mejora la estimacin de la pendiente de una curva debido a que


Considera la determinacin de dos derivadas para el intervalo (punto inicial y final) y
su promedio.
El mtodo de Heun es un procedimiento predictor - corrector
Predictor

yio1 yi f ( xi , yi )h

Corrector

f ( xi , yi ) f ( xi 1, yio1)
yi 1 yi
*h
2

f ( xi , yi ) f ( xi 1, yio1 )
yi
*h
2

De forma Grafica

yi 1

El error esta dado por:


Error

Aprox. Actual Aprox. Ante


*100%
Aprox. Actual
Ing. Deny Gonzlez

METODO DE RUNGE KUTTA SEGUNDO ORDEN


Mtodo de Punto Medio (a2=1)

Mtodo de Ralston

y(i 1) yi h * (k 2 )
k1 f ( xi , yi )

1
1
yi1 yi k1 k 2 h
3
3
donde :

1
1
k 2 f ( xi h, yi k1h)
2
2

k1 f xi, yi

Ejemplo (Punto Medio):

y ' 2 xy
y (0) 1

ye

h 0.1
N
0
1
2
3
4
5
6
7
8
9
10

k 2 f xi 3 h, yi 3 k1h
4
4

sol :

x2

k1
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1

0
0,202
0,4162412
0,65620425
0,9380221
1,28227622
1,71645494
2,27847951
3,02191482
4,02383068

k2

0,1
0,30603
0,53070753
0,78853878
1,09748586
1,48102903
1,97106243
2,61211401
3,46764726
4,62964074

1
1,01
1,040603
1,09367375
1,17252763
1,28227622
1,43037912
1,62748536
1,88869676
2,23546149
2,69842556

Real

3
1
1,01005017 2,5
1,04081077
2
1,09417428
1,17351087 1,5
1
1,28402542
1,43332941 0,5
1,63231622
0
1,89648088
2,24790799
2,71828183

Real
Aprox

0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1

Ing. Deny Gonzlez

METODO DE RUNGE KUTTA SEGUNDO ORDEN


Mtodo de Ralston)

y ' yx 2 1.2 y
x(3) 5; h 0.1
Ejemplo (Ralston):

k1 5 * 3 1.2 * 5 39
2

1
1
y i1 y i k 1 k 2 h
3
3
donde :

k 1 f x i , y i

k 2 f x i 34 h, y i 34 k 1h

k 2 f (3 (3 / 4) * 0.1,5 (3 / 4) * 39 * 0.1)
k 2 f (3.075;7.925) 65.4258
1
1
y i1 y i k 1 k 2 h
3
3
1
1

y( i 1) 5 * 39 * 65.4258 * 0.1 8.4808


3
3

Ing. Deny Gonzlez

METODO DE RUNGE KUTTA TERCER Y CUARTO ORDEN


RK3 :

RK4 :

1
yi 1 yi k1 4k 2 k3 h
6
donde :
k1 f xi , yi

k 2 f xi 1 h, yi 1 k1h
2
2

1
( k1 2k 2 2k3 k 4 ) * h
6
k1 f ( xi , yi )
k 2 f ( xi 1 h, yi 1 k1h)
2
2
k3 f ( xi 1 h, yi 1 k 2 h)
2
2
k 4 f ( xi h, yi k3h)
y(i 1) yi

k3 f xi h, yi k1h 2k 2 h

Ejemplo RK4:

N
0
1
2
3
4
5
6
7
8
9
10

x
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
1

y ' 2 xy
y (0) 1

sol :

h 0.1

ye

x2

k1

k2

k3

k4

0
0,20201003
0,41632431
0,65650456
0,93880865
1,28402526
1,71999479
2,28524126
3,03436555
4,04622466

0,1
0,3060452
0,53081349
0,78889965
1,09840612
1,48304917
1,97512735
2,61986588
3,48193447
4,65540626

0,1005
0,30760573
0,53367572
0,79353347
1,10558801
1,49399549
1,99171097
2,64496272
3,51997782
4,71327852

0,20201
0,4163243
0,65650701
0,93882209
1,28406961
1,72010977
2,28550013
3,03489834
4,04725725
5,43846088

1
1,01005017
1,04081077
1,09417427
1,17351081
1,28402526
1,43332899
1,63231519
1,89647847
2,24790259
2,71827018

Real

1 2,5
1,01005017 2
1,04081077
1,09417428 1,5
1,17351087 1
1,28402542 0,5
1,43332941
1,63231622 0
1,89648088
2,24790799
2,71828183

Real
Aprox

0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1

Ing. Deny Gonzlez

METODO DE RUNGE KUTTA TERCER Y CUARTO ORDEN


Ejercicios Propuestos
1) Resuelva Analticamente el siguiente problema de valor inicial en el intervalo x= 0 a
2, donde y(0) = 1. Grafique la solucin.

dy
y * x 2 1.2 * y
dx
a) Utilice el mtodo de Euler con h=0.25. Elabore la grafica y compare con la solucin
real.
b) Utilice el mtodo de Heun y Ralston con h=0.5. Elabore la grafica y compare con la
solucin real.

c) Utilice el mtodo de RK de segundo, tercer y cuarto orden con h=0.25. Elabore la


grafica y compare con la solucin real.

2) Repita los problemas a, b, y c pero ahora para el siguiente problema de valor


inicial sobre el intervalo que va de x= 0 a 1.
y ' (1 x) * y ,

con

y(0)= 1
Ing. Deny Gonzlez

También podría gustarte