Вы находитесь на странице: 1из 5

El método de Runge-Kutta es un método genérico de resolución numérica de

ecuaciones diferenciales. Este conjunto de métodos fue desarrollado alrededor del año
1900 por los matemáticos C. Runge y M. W. Kutta.

Este método puede ser usado para resolver un número grande de ecuaciones
diferenciales.
𝑑𝑦
Dada la ecuación diferencial ordinaria 𝑦 ′ = 𝑑𝑥 = 𝑓(𝑥, 𝑦) con condiciones iniciales
𝑦(𝑥0 ) = 𝑦0 entonces por el segundo teorema fundamenta del cálculo se tiene:
𝑥𝑛+1
∫ 𝑦 ′ 𝑑𝑥 = 𝑦( 𝑥𝑛+1 ) − 𝑦(𝑥𝑛 )
𝑥𝑛
Para aplicar la regla de Simpson de 1/3 a [𝑥𝑛 , 𝑥𝑛+1 ] se le dividió en dos intervalos es
decir:
Entonces
𝑥𝑛+1
ℎ/2 ′ ℎ
∫ 𝑦 ′ 𝑑𝑥 = [𝑦 (𝑥𝑛 ) + 4𝑦 ′ (𝑥𝑛 + ) + 𝑦 ′ (𝑥𝑛+1 )]
𝑥𝑛 3 2
ℎ ℎ ℎ
Al término4𝑦 (𝑥𝑛 + 2) se le expresa como: 2𝑦 ′ (𝑥𝑛 + 2) + 2𝑦 ′ (𝑥𝑛 + 2)

ℎ ℎ
para aproximar la pendiente de 𝑦 ′ (𝑥𝑛 + 2)en el punto promedio (𝑥𝑛 + 2)

ℎ ℎ ℎ
𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + [𝑦 ′ (𝑥𝑛 ) + 2𝑦 ′ (𝑥𝑛 + ) + 2𝑦 ′ (𝑥𝑛 + ) + 𝑦 ′ (𝑥𝑛+1 )]
6 2 2
Pero
𝑦 ′ = 𝑓(𝑥𝑛 , 𝑦𝑛 )

Por EULER se tiene que: 𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


Hacemos cambios de variables:

 Hagamos 𝑘1 = 𝑦 ′ (𝑥𝑛 ) entonces 𝑘1 = 𝑓(𝑥𝑛 , 𝑦𝑛 )


ℎ ℎ ℎ
 Hagamos 𝑘2 = 𝑦 ′ (𝑥𝑛 + 2) entonces 𝑘2 = 𝑓 (𝑥𝑛 + 2 , 𝑦(𝑥𝑛 + 2)) por
ℎ ℎ
euler : 𝑦 (𝑥𝑛 + 2) = 𝑦(𝑥𝑛 ) + 2 𝑓(𝑥𝑛 , 𝑦𝑛 ) entonces
ℎ ℎ
𝑘2 = 𝑓 (𝑥𝑛 + , 𝑦𝑛 + 𝑘1 )
2 2
ℎ ℎ ℎ
 Hagamos 𝑘3 = 𝑦 (𝑥𝑛 + 2) entonces 𝑘3 = 𝑓 (𝑥𝑛 + 2 , 𝑦(𝑥𝑛 + 2))

por
ℎ ℎ
euler 𝑦 (𝑥𝑛 + 2) = 𝑦(𝑥𝑛 ) + 2 𝑦 ′ (𝑥𝑛 , 𝑦𝑛 ) entonces:
ℎ ℎ
𝑘3 = 𝑓 (𝑥𝑛 + , 𝑦𝑛 + 𝑘2 )
2 2
ℎ ℎ
 Hagamos 𝑘4 = 𝑦 ′ (𝑥𝑛 + 1) entonces 𝑘4 = 𝑓 (𝑥𝑛 + 2 , 𝑦(𝑥𝑛 + 2)) por

euler 𝑦(𝑥𝑛 + 1) = 𝑦(𝑥𝑛 ) + ℎ𝑦 ′ (𝑥𝑛 + 2) entonces:
𝑘4 = 𝑓(𝑥𝑛 + 1, 𝑦0 + ℎ𝑘3 )
Por lo tanto:


𝑦(𝑥𝑛 + 1) = 𝑦𝑛 + [𝑘1 + 2𝑘2 + 3𝑘3 + 𝑘4 ]
6
Dónde:
𝑥𝑛+1 − 𝑥𝑛
ℎ= ; 𝑚 𝑒𝑠 𝑒𝑙 𝑛𝑢𝑚𝑒𝑟𝑜 𝑑𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙𝑜𝑠.
𝑚

DIAGRAMA DE FLUJO:
RUNGE KUTTA 4 ORDEN.
Inicio

Leer
f(X), Xo, Yo, b, n

h = (a+b) / n

i = 1, n, 1

K1 = f(Xo, Yo)
K2 = f(Xo+h/2, Yo+h/2*K1)
K3 = f(Xo+h/2, Yo+h/2*K2)
K4 = f(Xo+h, Yo+h*K3)

Y1 = Yo – (h/6)*(K1+ 2*K2+2*K3+K4)

X1 = Xo +h

Xo = X1
Yo = Y1

Escribir
Yo

FIN
DIAGRAMA DEL TRAPECIO.

Inicio

Leer
f(X), a, b, n

h = (a+b) / n

S = f(a) - f(b)

i = 1, n-1, 1

Xi = a +i*h

S = S +2*f(Xi)

AREA = S*h/2

Escribir
AREA

FIN
DIAGRAMA DE REGLA DE SIMPSON 1/3:

Inicio

Leer
f(X), a, b, n

h = (a+b) / n

i = 0, n, 1

Xi = a +h

n par

S=0

i = 2, n, 1

S = S +f(Xi-2) + 4f(Xi+1) + f(Xi)

I = S*h/3

Escribir
AREA

FIN
DIAGRAMA DE NEWTON COTES.

Diagrama.

Inicio

I =0
i=1

I+2< n
i< n Xi+1-Xi=Xi+2-
Xi+1

3
I+3< n
I=I+8 ℎ(yi+3yi+1+3yi+2+ Xi+2-Xi+1=Xi+3-
Xi+2
yi+3)

fin
1
I=I+3 ℎ(yi+4yi+1+yi+2)

1
I=I+2 ℎ(yi+yi+1)

Вам также может понравиться