Vous êtes sur la page 1sur 27

8.

EQUAES DIFERENCIAIS ORDINRIAS


Parte 3
8.1 INTRODUO PVIs
8.2 MTODOS DE PASSO SIMPLES
8.2.1 MTODO DE EULER
8.2.2 MTODOS DE TAYLOR
8.2.3 MTODOS DE RUNGE-KUTTA
8.3 MTODOS DE PASSO MLTIPLO
8.4 MTODOS PREVISOR-CORRETOR
8.5 EDOs DE ORDEM SUPERIOR E SISTEMAS DE EDOs
8.6 - PVCs E O MTODO DAS DIFERENAS FINITAS
hoje
8. EDOs
8.2.3 Mtodos de Runge-Kutta
Vimos os mtodos de Euler, Euler
Inverso e Euler Aprimorado para
resolver problemas de valores
iniciais (PVIs)

Estes mtodos so classes de mto-
dos de Runge-Kutta como veremos.

( ) ( )
0 0
com , y x y y x f y = =
'
8. EDOs
8.2.3 Mtodos de Runge-Kutta
Carl David Runge (1856-1927) -
Fsico alemo Trabalho de 1895
sob solues numricas de EDOs.

M. Wilhelm Kutta (1867-1944)
Matemtico alemo Aprimorou o
mtodo em 1901 ao estudar
aerodinmica se aeroflios.
8. EDOs
8.2.3 Mtodos de Runge-Kutta
A idia dos mtodos que estudaremos
aproveitar as qualidades dos mto-
dos das sries de Taylor eliminando o
seu maior defeito que o clculo de
derivadas de f(x,y).
Os mtodos de Runge-Kutta de ordem
p caracterizam-se pelas propriedades:
1- So mtodos de passo um;
2- No calculam derivadas;
3- Em mesma ordem, as frmulas de
Taylor e Runge-Kutta so semelhantes.
8. EDOs
8.2.3 Runge-Kutta de 1 ordem
O mtodo de Runge-Kutta de 1 ordem
o mtodo de Euler ou de Taylor de 1
ordem:



onde

Note que (1) satisfaz as trs porpriedades
dos mtodos de Runge-Kutta.
| | (1)
1
h ,y x f y y
n n n n
+ =
+
| | . ] [ dx ,
1
n n
x
x
,y x f h y x f
n
n
~
}
+
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Os mtodos de Runge-Kutta de 2 or-
dem devem ter frmulas que devem
ser semelhantes s frmulas do Mto-
do de Taylor at termos de segunda
ordem em h.
Consideremos o mtodo de Euler
aprimorado ou frmula de Heun
| | | |
(2)
2
, ,
1 1
1
h
y x f y x f
y y
n n n n
n n
+ +
+
+
+ =
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Reescrevendo a frmula de Heun


1- Observando que para calcular
usamos apenas , ento dize-
mos que o Mtodo de Euler Aprimorado
de Passo Um ou de Passo Simples.
2- O Mtodo de Euler Aprimorado no
tem derivadas de f(x,y).
3- Resta verificar a terceira condio.
| | | | ( ) (2)
2
1
y h y , h x f ,y x f
h
y y
n n n n n n n
'
+ + + + =
+
( )
1 1 + +
=
n n
x y y
( )
n n
x y y =
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Resta verificar se a frmula de Heun


semelhantes s frmulas do Mtodo de Taylor
at termos de segunda ordem em h. Da frmula
de Taylor de y(x) em x=x
n+1



| | | | ( ) (2)
2
1
y h y , h x f ,y x f
h
y y
n n n n n n n
'
+ + + + =
+
! 2
! 2
) ( ) ( ) ( ) (
2
1
2
1
h
y h y y y
h
x y h x y x y x y
n n n n
n n n n
' '
+
'
+ =
' '
+
'
+ ~
+
+
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Calculemos a frmula de Taylor de 2 ordem.
( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) | |
) (
! 3
to truncamen de erro
, , ,
2
,
) ( , ) ( , ) ( ,
) ( ,
2
1
2
1

' ' '


=
: + + + =
+ = + = =
' '
=
'
+
+
y
h
) E(x
y x f y x f y x f
h
y x f h y y
f f f
dx
dy
x y x f x y x f x y x f
dx
d
x y
x y x f x y
n
n n n n y n n x n n n n
y x y x
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
No Mtodo de Euler Aprimorado trabalhamos
Com .
( )
( ) | | ( ) | |
( ) | | ( ) | |
( ) | | | |
( ) ( )
n n
n n xy
n yy n xx
n n n y n n n x n n
n
y y x x
y y x x f
y y f x x f
y y y x f x x y x f y x f y x f
y x y x f
, e , com
,
,
2
1
,
2
1

, , ) , ( ) , (
) , (x de torno em ) ( , Expandindo
2 2
n
e | e o
: | o +
| o + | o +
+ + + =
| |
n n n
y h y , h x f
'
+ +
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Segue que:



e o Mtodo de Euler Aprimorado escreve-se
( ) ( )
( ) ( ) | | ( ) | | | |
2
2
n
, , 2 ,
2

, , ) , ( ) , (x
n yy n xy xx
n n n y n n x n n n n
y f y f f
h
y h y x f h y x f y x f y h y h f
'
| o +
'
| o + | o +
+
'
+ + =
'
+ +
| | | | ( )
( )
n n n
n n n n n n n
,y x f
h
y
y h y , h x f ,y x f
h
y y
{
2

2
1
+ =
'
+ + + + =
+
( ) ( )
( ) ( ) | | ( ) | | | |} , , 2 ,
2

, , ) , (
2
2
n yy n xy xx
n n n y n n x n n
y f y f f
h
y h y x f h y x f y x f
'
| o +
'
| o + | o +
+
'
+ + +
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Enfim




Logo, o Mtodo de Euler Aprimorado um
mtodo de Taylor de 2 ordem e portanto,
devido s 3 propriedades verificadas, tambm
um Mtodo de Runge-Kutta de 2 ordem.



( ) ( ) | |
( ) ( ) ( ) | | | o + | o + | o +
+ + + + =
+
, ) , ( , ) , ( 2 ,
2

, ) , ( ,
2
) , (
2
3
2
1
yy n n xy n n xx
n n y n n n n x n n n n
f y x f f y x f f
h
y x f y x f y x f
h
y x f h y y
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
A Frmula geral de Runge-Kutta de 2 ordem
tem a forma:


No caso do Euler Aprimorado




( ) (3) , ) , (
2 1 2 1 1 n n n n n n n
y h b y h b x f a h y x f a h y y
'
+ + + + =
+
1 ,
2
1
,
2
1
2 1 2 1
= = = = b b a a
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Questo: A expresso (3) sempre seme-
lhante a frmula de Taylor com termos at
segunda ordem em h?


Realizando um procedimento semelhante
quele realizado para o Mtodo de Euler
Aprimorado, verificamos que os parmetos
devem ser tais que
( ) (3) , ) , (
2 1 2 1 1 n n n n n n n
y h b y h b x f a h y x f a h y y
'
+ + + + =
+
2
1
,
2
1
, 1
2 2 1 2 2 1
= = = + b a b a a a
8. EDOs
8.2.3 Runge-Kutta de 2 ordem
Como temos um parmetro arbitrrio, tomamos,
por exemplo,


de modo que a frmula de Runge-Kutta de 2
ordem escreve-se como:
( ) ) , (
2
,
2
) , ( 1
1
|
.
|

\
|
+ + + + =
+ n n n n n n n n
y x f
w
h
y
w
h
x f w h y x f w h y y
w
b b w a w a
2
1
, 1
2 1 1 2
= = = =
8. EDOs
8.2.3 Runge-Kutta de 3 ordem
De forma anloga podemos construir a frmula
de mtodos de Runge-Kutta de 3 ordem. Sejam
PVIs do tipo
ento uma frmula de Runge-Kutta de 3 ordem
escreve-se como:
( )

4
3
,
4
3

2
,
2
) , ( onde
4 3 2
9
2
3
1
2 1
3 2 1 1
|
|
.
|

\
|
+ + =
|
|
.
|

\
|
+ + = =
+ + + =
+
K
y
h
x f K
K
y
h
x f K y x f K
K K K
h
y y
n n
n n n n
n n
( ) ( )
0 0
com , y x y y x f y = =
'
8. EDOs
8.2.3 Runge-Kutta de 4 ordem
De forma anloga podemos construir a frmula
de mtodos de Runge-Kutta de 4 ordem. Sejam
PVIs do tipo
ento uma frmula de Runge-Kutta de 4 ordem
escreve-se como:
( )
( )
3 4
2
3
1
2 1
4 3 2 1 1
, ,
2
,
2
2
,
2
, ) , ( onde
2 2
6
K y h x f K
K
y
h
x f K
K
y
h
x f K y x f K
K K K K
h
y y
n n n n
n n n n
n n
+ + =
|
|
.
|

\
|
+ + =
|
|
.
|

\
|
+ + = =
+ + + + =
+
( ) ( )
0 0
com , y x y y x f y = =
'
8. EDOs
8.2.3 Comentrios sobre Runge-Kutta
FRMULAS DE RUNGE-KUTTA

1 ordem:

2 ordem: particular



3 ordem:


( )
1
h ,y x f y y
n n n n
+ =
+
( ) ( ) ( ) , ,
2
1 1 1 + + +
+ + =
n n n n n n
y x f y x f
h
y y
( ) ) , (
2
,
2
) , ( 1
1
|
.
|

\
|
+ + + + =
+ n n n n n n n n
y x f
w
h
y
w
h
x f w h y x f w h y y
( )

4
3
,
4
3
,
2
,
2
, ) , (
4 3 2
9

2
3
1
2 1
3 2 1 1
|
|
.
|

\
|
+ + =
|
|
.
|

\
|
+ + = =
+ + + =
+
K
y
h
x f K
K
y
h
x f K y x f K
K K K
h
y y
n n n n n n
n n
8. EDOs
8.2.3 Comentrios sobre Runge-Kutta
FRMULAS DE RUNGE-KUTTA

4 ordem:




Com1: As frmulas de Runge-Kutta so mdias
ponderadas de valores de f(x,y) em pontos no
intervalo .
( )
( )
3 4
2
3
1
2 1
4 3 2 1 1
, ,
2
,
2
2
,
2
, ) , ( onde
2 2
6
K y h x f K
K
y
h
x f K
K
y
h
x f K y x f K
K K K K
h
y y
n n n n
n n n n
n n
+ + =
|
|
.
|

\
|
+ + =
|
|
.
|

\
|
+ + = =
+ + + + =
+
1 +
< <
n n
x x x
8. EDOs
8.2.3 Comentrios sobre Runge-Kutta
FRMULAS DE RUNGE-KUTTA

Com2: As somas

;
podem ser interpretadas como um coeficiente angular
mdio.

Com3: Problema do passo fixo pode ser resolvido com o
desenvolvimento de Mtodos de Runge-Kutta adaptativos,
os quais ajustam o passo de modo a manter o erro de trun-
camento local num nvel de tolerncia fixado.
( )
4 3 2 1
2 2
6
K K K K
h
+ + +
( )
3 2 1
4 3 2
9
K K K
h
+ +
8. EDOs
8.2.3 Exemplos de Runge-Kutta
Exemplo 1: Para o PVI dado, estime .
PVI:

a) Runge-Kutta de primeira ordem.



Assim

1000 ) 0 ( com 04 . 0 = =
'
y y y
) 1 ( y
( ) ( )
( )
n n n n
n n n n
y h h y y y
y x,y f h ,y x f y y
04 . 0 1 04 . 0
04 . 0 onde
1
1
+ = + =
= + =
+
+
( )
( ) ( )
( ) .. 3 , 2 , 1 para 1000 04 . 0 1
.......... .......... .......... .......... .......... ..........
1000 04 . 0 1 04 . 0 1
1000 04 . 0 1
2
1 2
1
= + =
+ = + =
+ =
k h y
h y h y
h y
k
k
8. EDOs
8.2.3 Exemplos de Runge-Kutta

Definindo a partio do intervalo (0,1)
( )
( )
( )
( )
8108 . 1040 ) 1 ( : exato Valor
7277 . 1040 1000 1 . 0 04 . 0 1 1 . 0
604 . 1040 1000 25 . 0 04 . 0 1 25 . 0
4 . 1040 1000 5 . 0 04 . 0 1 5 . 0
1040 1000 04 . 0 1 1
10
10
4
4
2
2
1
=
= + = =
= + = =
= + = =
= + = =
y
y h
y h
y h
y h
8. EDOs
8.2.3 Exemplos de Runge-Kutta

b) Runge-Kutta de 2 ordem. Euler aprimorado.





Analogamente ao Runge-Kutta de 1 ordem
( ) ( ) ( ) | |
( ) | |
|
.
|

\
|
+ + =
+ + + =
+ + + + =
+
+
+
2
1
1
1
04 . 0
2
04 . 0 1
04 . 0 04 . 0 04 . 0
2
, , ,
2
h
h y y
y h y y
h
y y
y x f h y h x f y x f
h
y y
n n
n n n n n
n n n n n n n n
1000 04 . 0
2
04 . 0 1
2

|
.
|

\
|
+ + =
k
k
h
h y
8. EDOs
8.2.3 Exemplos de Runge-Kutta

Definindo a partio do intervalo (0,1)
8108 . 1040 ) 1 ( : exato Valor
8107 . 1040 1000 04 . 0
2
1 . 0
1 . 0 04 . 0 1 1 . 0
8101 . 1040 1000 04 . 0
2
25 . 0
25 . 0 04 . 0 1 25 . 0
808 . 1040 1000 04 . 0
2
5 . 0
5 . 0 04 . 0 1 5 . 0
8 . 1040 1000 04 . 0
2
1
04 . 0 1 1
10
2
2
10
4
2
2
4
2
2
2
2
2
1
=
=
|
|
.
|

\
|
+ + = =
=
|
|
.
|

\
|
+ + = =
=
|
|
.
|

\
|
+ + = =
=
|
.
|

\
|
+ + = =
y
y h
y h
y h
y h
8. EDOs
8.2.3 Exemplos de Runge-Kutta

c) Runge-Kutta de 3 ordem.





( )
|
|
.
|

\
|
+ =
|
|
.
|

\
|
+ = =
|
|
.
|

\
|
+ + =
|
|
.
|

\
|
+ + = =
+ + + =
+
4
3
04 . 0 ,
2
04 . 0 , 04 . 0

4
3
,
4
3
,
2
,
2
, ) , (
4 3 2
9

1
3
1
2 1
2
3
1
2 1
3 2 1 1
K
y K
K
y K y K
K
y
h
x f K
K
y
h
x f K y x f K
K K K
h
y y
n n n
n n n n n n
n n
8. EDOs
8.2.3 Exemplos de Runge-Kutta

c) Runge-Kutta de 3 ordem.





( )
( ) 1 para 8107 . 1040 224 . 41 4 8 . 40 3 40 2
9
1
1000 : Logo
224 . 41 8 . 40
4
3
1000 04 . 0
8 . 40
2
40
1000 04 . 0 , 40 1000 04 . 0
4 3 2
9
Sendo
1
3
2 1
3 2 1 0 1
= = + + + =
=
|
.
|

\
|
+ =
=
|
.
|

\
|
+ = = =
+ + + =
h y
K
K K
K K K
h
y y
8.2.3. Mtodos de Runge-Kutta
Exerccios

Exerccio: Utilize o Mtodo de Runge-Kutta de 1,
2, 3 e 4 ordens, para calcular valores
aproximados da soluo y(x) do problema de
valor inicial no intervalo [0,2].


Utilize parties h=0.5 , h=0.25 e h=0.1
1 ) 0 ( com 4 1 = + =
'
y y x y

Vous aimerez peut-être aussi