You are on page 1of 6

Mag. Jube Portalatino Z.

Mtodos Numricos para Ecuaciones Diferenciales 1


VII. MTODOS NUMRICOS PARA
ECUACIONES DIFERENCIALES
ORDINARIAS

7.1 PROBLEMA. Resolver:
y (x) f (x, y(x)), x [a, b]
(P) :
y(a)
=



7.2 TEOREMA (Existencia y unicidad de la solucin). Sean
{ }
2
D (x, y) / a x b, y = , f : D continua sobre D.
Si
f
L
y

<

en D el problema (P) tiene una nica solucin para x[a,b].



7.3 MTODOS DE UN PASO
Consideremos los puntos de la red:
i
x a ih = + ,
b a
h
n

= == = , i , n = == = 0
Computacionalmente determinaremos
i i
w y(x )

Observar que
i i i
w y(x ) y(x h)
+ +
= +
1 1


7.3.1 MTODO DE EULER
Del problema (P)
y(x h) y(x)
y (x) f (x, y(x))
h
+
=
y(x h) y(x) h f (x, y(x)) + +

i i i i
y(x h) y(x ) hf (x , y(x )) + +

Considerando que
i i
w y(x ) y
i i i
w y(x ) y(x h)
+ +
= +
1 1
obtenemos el siguiente
esquema
i 1 i i i
0
w w hf (x , w )
w
+
= +


para automatizarlo.

7.3.2 MTODO DEL PUNTO MEDIO O MTODO DE EULER
MODIFICADO
La regla de la mitad para calcular integrales es

Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 2
b
a
a b
g(x) dx (b a) g
2
+ | |

|
\




Aplicaremos esta frmula al problema para deducir el esquema respectivo.
y (x) f (x, y) =
x h x h
x x
y (u)du f (u, y(u))du
+ +
=


x h
x
2x h 2x h
y(u) (x h x) f , y( )
2 2
|
+
+ + | |
+
|
\

h h
y(x h) y(x) h f x , y(x )
2 2
| |
+ + + +
|
\


Aplicando el mtodo de Euler a y(x+h/2) se obtiene
h h
y(x h) y(x) h f x , y(x) f (x, y(x))
2 2
| |
+ + + +
|
\

i i i i i i
h h
y(x h) y(x ) h f x , y(x ) f (x , y(x ))
2 2
| |
+ + + +
|
\


Ahora hacemos
i i
w y(x ) y obtenemos
0
i 1 i i i i i
w
h h
w w h f x , w f (x , w )
2 2
+
=

| |
= + + +
|
\
i=0,...,n-1
o
0
1 i i
2 i i 1
i 1 i 2
w
k h f (x , w )
h 1
k h f x , w k
2 2
w w k
+
=

| |
= + +
|
\

= +

i=0,...,n-1

a b
f
a b
2
+

Y
X
Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 3
7.3.3 MTODO DE HEUN O MTODO DE RUNGE-KUTTA DE
SEGUNDO ORDEN
Para deducir este esquema aplicaremos el mtodo de integracin
trapezoidal
b
a
b a
g(x)dx [g(a) g(b)]
2


Del problema (P) tenemos
y (x) f (x, y) =
x h x h
x x
y (u)du f (u, y(u))du
+ +
=


[ ]
h
y(x h) y(x) f (x, y(x)) f (x h, y(x h))
2
+ + + + +

Aplicando el mtodo de Euler a y(x+h) se tiene
[ ]
h
y(x h) y(x) f (x, y(x)) f (x h, y(x) hf (x, y(x)))
2
+ + + + +
[ ]
i i i i i i i i
h
y(x h) y(x ) f (x , y(x )) f (x h, y(x ) hf (x , y(x )))
2
+ + + + +

Haciendo
i i
w y(x ) tenemos
[ ]
0
i 1 i i i i 1 i i i
w
h
w w f (x , w ) f (x , w h f (x , w ))
2
+ +
=

= + + +



o
( )
0
1 i i
2 i i 1
i 1 i 1 2
w
k h f (x , w )
k h f x h, w k
1
w w [k k ]
2
+
=

= + +

= + +

i=0,...,n-1

7.3.4 MTODO DE RUNGE-KUTTA CLSICO DE CUARTO ORDEN
Para deducir este esquema aplicaremos el mtodo de integracin numrica de
Simpson 1/3
b
a
(b a) / 2 a b
g(x)dx g(a) 4g g(b)
3 2
( + | |
+ +
( |
\


b
a
b a a b
g(x)dx g(a) 4g g(b)
6 2
( + | |
+ +
( |
\



Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 4
y (x) f (x, y) =
x h x h
x x
y (u)du f (u, y(u))du
+ +
=


x h
x
y(x h) y(x) f (u, y(u))du
+
+ = +


h h
2 2
h
y(x h) y(x) [f (x, y(x)) 4f (x , y(x )) f (x h, y(x h))]
6
+ = + + + + + + +

Descomponiendo el segundo trmino del corchete
h
h h
y(x h) y(x) [f (x, y(x)) 2f (x , y(x ))
2 2
6
h h
2f (x , y(x )) f (x h, y(x h))]
2 2
+ = + + + + +
+ + + + +
(1)

Al aplicar diferencia hacia adelante a y(x), se tiene
h
y(x ) y(x)
2
y (x)
h / 2
+


Pero y (x) f (x, y(x)) =
Entonces, reemplazando en la ecuacin anterior y despejando, se tiene
h
2
h
y(x ) y(x) f (x, y(x))
2
+ + (2)

Al aplicar diferencia hacia atrs a y(x+h/2) se tiene
h
y(x ) y(x)
h
2
y (x )
2 h / 2
+
+
pero
h h h
y (x ) f (x , y(x ))
2 2 2
+ = + +

Entonces, reemplazando en la ecuacin anterior y despejando se tiene
h
2
h h h
y(x ) y(x) f (x , y(x ))
2 2 2
+ + + +
h
2
h h h
y(x ) y(x) f (x , y(x) f (x, y(x)))
2 2 2
+ + + + (3)

Al aplicar diferencia centra a y(x+h/2) se tiene
h y(x h) y(x)
y (x )
2 h
+
+

Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 5
pero
h h h
y (x ) f (x , y(x ))
2 2 2
+ = + +

Entonces, reemplazando en la ecuacin anterior y despejando se tiene
h h
y(x h) y(x) hf (x , y(x ))
2 2
+ + + +

Es esta ecuacin reemplazamos y(x+h/2) segn (3) y obtenemos
h h h h
y(x h) y(x) h f (x , y(x) f (x , y(x) f (x, y(x))))
2 2 2 2
+ + + + + + (4)

Reemplazando apropiadamente (2), (3) y (4) en (1) se tiene
h
h h
y(x h) y(x) [f (x, y(x)) 2f (x , y(x) f (x, y(x)))
2 2
6
h h h h
2f (x , y(x) f (x , y(x) f (x, y(x)))
2 2 2 2
h h h h
f (x h, y(x) h f (x , y(x) f (x , y(x) f (x, y(x))))]
2 2 2 2
+ = + + + + +
+ + + + +
+ + + + + +


Luego, sustituyendo x=x
i
w
i
.y(x
i
) en la ecuacin anterior y haciendo la asignacin
respectiva se obtiene el esquema de Runge-Kutta
( )
0
1 i i
2 i i 1
3 i i 2
4 i i 3
i 1 i 1 2 3 4
w
k h f (x , w )
h 1
k h f x , w k
2 2
h 1
k h f x , w k
2 2
k h f (x h, w k )
1
w w k 2k 2k k
6
+
=

| |
= + +

|
\

| |
= + +
|
\

= + +

= + + + +

i=0,...,n-1

7.3.5 ALGORITMO DEL MTODO DE RUNGE-KUTTA
Entrada: a, b, valor, n
h=(b-a)/n
w=valor
x=a
Para i=1,...,n hacer
k1=h*f(x,w)
k2=h*f(x+h/2,w+k1/2)
k3=h*f(x+h/2,w+k2/2)
k4=h*f(x+h,w+k3)
Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 6
w=w+(k1+2*k2+2*k3+k4)/6
x=x+h
Salida: i, x, w, e
fin

7.4 MTODOS MULTIPASOS
Sea la ecuacin diferencial
y (x) f (x, y(x)) =

Integrando en
p j p q
[x , x ]
+
, se obtiene
p k
p j
x
p k p j
x
y(x ) y(x ) f (x, y(x))dx
+

+
=

(1)

Consideremos el polinomio interpolante de Lagrange que aproxima a f,
q
q p i p i i
i
P (x) f (x , y(x )) L (x)

=
=

0

donde
q
p l
i
p i p l
l
l i
x x
L (x)
x x

0

Reemplazando en la ecuacin (1):
p k
p j
x
p k p j q
x
y(x ) y(x ) P (x) dx
+

+
=

p k
p j
q
x
p i p i i
x
i
f (x , y(x )) L (x) dx
+


=
=


0


q
qi p i p i
i
h f (x , y(x ))

=
=

0


donde
p k p k
p j p j
q
x x
p m
qi i
x x
p i p m
m
m i
x x
L (x)dx dx
h h x x
+ +

= =


0
1 1


Sea
p m p
x x ( m)h

= +
p k
p j
q
x
p
qi
x
m
m i
x mh x
dx
h (m i)h
+

+
=

0
1

Sea
p
x x
s
h

=
q
p k p j qi p i p i
i
y y h f (x , y(x ))
+
=
= +

0

Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 7
donde
q
k
qi
j
m
m i
s m
ds
m i

+
=

0


1. MTODOS DE ADAMS-BASHFORTH (EXPLCITOS)
k=1, j=0, q=0,1,2,3,..
q
1
qi
0
m 0
m i
s m
ds
m i
=

+
=

qi
\ i 0 1 2 3 4

0i
1

1i
3/2 -1/2

2i
23/12 -16/12 5/12

3i
55/24 -59/24 37/24 -9/24

4i
1901/720 -2774/720 2616/720 -1274/720 251/720

q
p p qi p i p i
i
y y h f (x , y(x ))
+
=
= +

1
0


Para q=0 resulta el mtodo de Euler:
p p p p
y y h f (x , y )
+
= +
1


Para q=1 resulta:
h
p p p p p p
y y f (x , y ) f (x , y )
+
( = +

1 1 1
2


2. MTODOS DE ADAMS-MOULTON (IMPLCITOS)
k=0, j=1, q=0, 1, 2, .
q
qi
m
m i
s m
ds
m i

+
=

0
1
0

qi
\ i 0 1 2 3 4

0i
1

1i
1/2 1/2

2i
5/12 8/12 -1/12

3i
9/24 19/24 -5/24 1/24

4i
251/720 646/720 -264/720 106/720 -19/720

q
p p qi p i p i
i
y y h f (x , y(x ))

=
= +

1
0

Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 8

q
p p qi p i p i
i
y y h f (x , y(x ))
+
=
= +

1
0


3. MTODOS DE NYSTROEM (EXPLCITO)
k=1, j=1, q=0, 1, 2, .
q
qi
m
m i
s m
ds
m i

+
=

1
1
0

qi
\ i 0 1 2 3 4

0i
2

1i
2 0

2i
7/3 -2/3 1/3

3i
8/3 -5/3 4/3 -1/3

4i
269/90 -266/90 294/90 -146/90 29/90

q
p p qi p i p i
i
y y h f (x , y(x ))
+
=
= +

1 1
0


4. MTODOS DE MILNE-THOMPOSON (IMPLCITO)
k=0, j=2, q=0, 1, 2, .
q
qi
m
m i
s m
ds
m i

+
=

0
2
0

qi
\ i 0 1 2 3 4

0i
0

1i
0 2

2i
1/3 4/3 1/3

3i
1/3 4/3 1/3 0

4i
29/90 124/90 24/90 4/90 -1/90

q
p p qi p i p i
i
y y h f (x , y(x ))

=
= +

2
0


q
p p qi p i p i
i
y y h f (x , y(x ))
+
=
= +

1 1
0



Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 9
5. MTODO DE PREDICTOR-CORRECTOR

{ }
p 1 p p p p 1 p 1 p 2 p 2
q 2 (A B)
h
y y 23f (x , y ) f (x , y ) 5f (x , y )
12
+
=
= + +

{ }
p 1 p p 1 p 1 p p p 1 p 1 p 2 p 2
q 3 (A M)
h
y y 9f (x , y ) 19f (x , y ) 5f (x , y ) f (x , y )
24
+ + +
=
= + + +

Esto es una combinacin de los mtodos de Adams-Bashforth para q=2 y Adam-
Moulton para q=3. En cada paso se necesita solamente dos evaluaciones de la
funcin f.

6. OTRO MTODO DE PREDICTOR-CORRECTOR

{ }
p 1 p 1 p p p 1 p 1 p 2 p 2
q 2 (N)
h
y y 7f (x , y ) 2f (x , y ) f (x , y )
3
+
=
= + +

{ }
p 1 p p 1 p 1 p p p 1 p 1
q 3 (M T)
h
y y f (x , y ) 4f (x , y ) f (x , y )
3
+ + +
=
= + + +

7. DEFINICIN DE MTODO MULTIPASO LINEAL EN GENERAL
Son de la forma:
j r r 1 j r 0 j r j r j r 0 j j
w a w a w b f (x , w ) b f (x , w )
+ + + +
= + + + + +

7.5 MTODOS DE DIFERENCIAS FINITAS PARA
ECUACIONES DIFERENCIALES ORDINARIAS CON
CONDICIONES DE FRONTERA

7.5.1 PROBLEMA LINEAL
Sea el problema lineal
y (x) p(x)y (x) q(x)y(x) r(x), a x b
y(a)
y(b)
= + +



Dividamos [a, b] en n+1 subintervalos de igual longitud
x
i
=a+ih, i=0,..., n+1
b a
h
n 1

=
+

y(x
i
) w
i


[ ]
i i 1 i i 1
2
1
y (x ) y(x ) 2y(x ) y(x )
h
+
+

Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 10
[ ]
i i 1 i i 1
2
1
y (x ) w 2w w
h
+
+
[ ]
i i 1 i 1
1
y (x ) y(x ) y(x )
2h
+

[ ]
i i 1 i 1
1
y (x ) w w
2h
+


Al reemplazar estas afirmaciones en la ecuacin diferencial se tiene
i i i i i i
y (x ) p(x )y (x ) q(x )y(x ) r(x ) = + +

i 1 i i 1 i i 1 i 1
i i i
2
w 2w w p(x )[w w ]
q(x )w r(x )
2h h
+ +
+
= + +

Reagrupando se tiene
( ) ( )
2 2 h h
i i 1 i i i i 1 i
2 2
0
n 1
1 p(x ) w (2 h q(x ))w 1 p(x ) w h r(x )
w
w i 1, , n
+
+
+ + + =
=
= =


Al desarrollar este esquema para i=1,...,n se obtiene el siguiente sistema de
ecuaciones lineales
Ax b =


donde
2 h
1 1 2
2 h h
2 2 2 2 2
h
n 1
2
2 h
n n
2
2 h q(x ) 1 p(x ) 0 0
1 p(x ) 2 h q(x ) 1 p(x )
A 0 0
1 p(x )
0 0 1 p(x ) 2 h q(x )

(
+ +
(
+ + (
(
=
(
( +
(
+
(







2 h
1 1 2
2
2
2
n 1
2 h
n n 2
h r(x ) (1 p(x ))
h r(x )
b
h r(x )
h r(x ) (1 p(x ))

(
+ +
(
(
(
=
(
(

(
( +


1
2
n 1
n
w
w
x
w
w

(
(
(
( =
(
(
(



TEOREMA. Sean p, q y r funciones continuas sobre [a, b]. Si q(x)0 sobre [a, b]
el sistema lineal tridiagonal anterior tiene solucin nica siempre que h<2/L,
donde
a x b
L max | p(x) |

=
Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 11
7.5.2 ALGORITMO
ENTRADA: a, b, ,
SALIDA x
i
, w
i
h=(b-a)/(n+1)
x=a+h
a
1
=2+h
2
q(x)
b
1
=-1+(h/2)p(x)
c
1
=-1-(h/2)p(x)
d
1
=-h
2
r(x) )+(1+(h/2)p(x))
Para i=2,..., n-1 hacer
x=a+ih
a
i
=2+h
2
q(x)
b
i
=-1+(h/2)p(x)
c
i
=-1-(h/2)p(x)
d
i
=-h
2
r(x)
fin
x=b-h
a
n
=2+h
2
q(x)
c
n
=-1-(h/2)p(x)
d
n
=-h
2
r(x)+(1-(h/2)p(x))
Resuelve el sistema tridiagonal usando el mtodo de Crout
l
1
=a
1

u
1
=b
1
/a
1

l
n
=a
n
- c
n
u
n-1

z
1
=d
1
/l
1

para i=2,...,n hacer
z
i
=(d
i
- c
i
z
i-1
)/l
i

fin
w
0
=
w
n+1
=
w
n
=z
n

Para i=n-1,...,1 hacer
w
i
=z
i
u
i
w
i+1

fin

7.5.3 PROBLEMA NO LINEAL
Sea el problema no lineal
y (x) f (x, y(x), y (x)) a x b
y(a)
y(b)

=
=
=


Sean
x
i
=a+ih, i=0,..., n+1
Mag. Jube Portalatino Z. Mtodos Numricos para Ecuaciones Diferenciales 12
b a
h
n 1

=
+


y(x
i
) w
i

Luego, de la ecuacin diferencial se tiene
i i i i
y (x ) f (x , y(x ), y (x )) =

i 1 i i 1 i 1 i 1
i i
2
w 2w w w w
f x , w ,
2h h
+ +
+ | |
=
|
\



2 i 1 i 1
i 1 i i 1 i i
0
1
w w
w 2w w h f x , w ,
2h
w
w
+
+
| |
+ =
|
\
=
=
i=1,...,n

Al desarrollar este esquema para i=1,...,n, se obtiene un sistema de ecuaciones NO
lineal de orden nxn.

Este sistema se puede resolver aplicando el mtodo de Newton.

You might also like