Está en la página 1de 3

Método de Runge-Kutta

Ejemplo. Dado el problema de valor inicial:

𝑦´ = 𝑥𝑦 + √𝑦, 𝑦(0) = 1, 𝑦(0.5)

Use el método de Runge-Kutta con ℎ = 0.1 para obtener una aproximación con cuatro cifras
decimales al valor indicado.

Solución:

Hay que encontrar el valor de 𝑦(0.5), el cual se obtiene para 𝑥 = 0.5. Puesto que el valor inicial de
x es 𝑥0 = 0 y puesto que el tamaño de paso es ℎ = 0.1, se llegará a 𝑥 = 0.5 cuando 𝑛 = 5:

𝑛 = 0, 𝑥0 = 0
𝑛 = 1, 𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1
𝑛 = 2, 𝑥2 = 𝑥1 + ℎ = 0.1 + 0.1 = 0.2
𝑛 = 3, 𝑥3 = 𝑥2 + ℎ = 0.2 + 0.1 = 0.3
𝑛 = 4, 𝑥4 = 𝑥3 + ℎ = 0.3 + 0.1 = 0.4
𝑛 = 5, 𝑥5 = 𝑥4 + ℎ = 0.4 + 0.1 = 0.5
Para 𝑛 = 0, los valores de x y y corresponden a los valores iniciales, es decir:

𝑥0 = 0, 𝑦0 = 1
Para estimar los valores de de x y y correspondientes a 𝑛 = 1, primero es necesario calcular los
coeficientes k1, k2, k3 y k4:

𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 )

Como la función es 𝑓(𝑥, 𝑦) = 𝑥𝑦 + √𝑦, se sigue que 𝑓(𝑥0 , 𝑦0 ) = 𝑥0 𝑦0 + √𝑦0 = (0)(1) + √1 = 1

Por lo tanto: 𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = (0.1)(1) = 0.1


1 1
La fórmula para k2 es: 𝑘2 = ℎ𝑓 (𝑥0 + 2 ℎ, 𝑦0 + 2 𝑘1 )
1 1
Donde 𝑥0 + 2 ℎ = 0 + (0.5)(0.1) = 0.05 y 𝑦0 + 2 𝑘1 = 1 + (0.5)(0.1) = 1 + 0.05 = 1.05
1 1
Por lo tanto: 𝑘2 = ℎ𝑓 (𝑥0 + 2 ℎ, 𝑦0 + 2 𝑘1 ) = ℎ𝑓(0.05,1.05) = (0.1)[(0.05)(1.05) + √1.05]

𝑘2 = 0.107719507
1 1
La fórmula para k3 es: 𝑘3 = ℎ𝑓 (𝑥0 + 2 ℎ, 𝑦0 + 2 𝑘2 )
1 1
Donde 𝑥0 + 2 ℎ = 0 + (0.5)(0.1) = 0.05 y 𝑦0 + 2 𝑘2 = 1 + (0.5)(0.107719507) = 1.053859754
1 1
Por lo tanto: 𝑘3 = ℎ𝑓 (𝑥0 + 2 ℎ, 𝑦0 + 2 𝑘2 ) = ℎ𝑓(0.05,1.053859754)
𝑘3 = (0.1)[(0.05)(1.053859754) + √1.053859754] = 0.10792697

La fórmula para k4 es: 𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 )

Donde: 𝑥0 + ℎ = 0.1 y 𝑦0 + 𝑘3 = 1 + 0.10792697 = 1.10792697

Por lo tanto: 𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = ℎ𝑓(0.1,1.10792697) =

𝑘4 = 0.1[(0.1)(1.10792697) + √1.10792697] = 0.116337379

Entonces, para 𝑛 = 1, tenemos:

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1
1
𝑦1 = 𝑦0 + (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 )
6
1
= 1 + (0.1 + 2(0.107719507) + 2(0.10792697) + 0.116337379) = 1.0590
6
Para estimar los valores de de x y y correspondientes a 𝑛 = 2, nuevamente es necesario calcular los
coeficientes k1, k2, k3 y k4:

𝑘1 = ℎ𝑓(𝑥1 , 𝑦1 ) = ℎ𝑓(0.1,1.0590) = 0.1[(0.1)(1.0590) + √1.0590] = 0.113497725


1 1
La fórmula para k2 es: 𝑘2 = ℎ𝑓 (𝑥1 + ℎ, 𝑦1 + 𝑘1 )
2 2
1
Donde 𝑥1 + 2 ℎ = 0.1 + (0.5)(0.1) = 0.15 y
1
𝑦1 + 2 𝑘1 = 1.0590 + (0.5)(0.113497725) = 1.115748863
1 1
Por lo tanto: 𝑘2 = ℎ𝑓 (𝑥1 + 2 ℎ, 𝑦1 + 2 𝑘1 ) = ℎ𝑓(0.15,1.115748863)

𝑘2 = (0.1)[(0.15)(1.115748863) + √1.115748863] = 0.122365247


1 1
La fórmula para k3 es: 𝑘3 = ℎ𝑓 (𝑥1 + ℎ, 𝑦1 + 𝑘2 )
2 2
1
Donde 𝑥1 + 2 ℎ = 0.1 + (0.5)(0.1) = 0.15 y
1
𝑦1 + 2 𝑘2 = 1.0590 + (0.5)(0.122365247) = 1.120182624
1 1
Por lo tanto: 𝑘3 = ℎ𝑓 (𝑥1 + 2 ℎ, 𝑦1 + 2 𝑘2 ) = ℎ𝑓(0.15,1.120182624)

𝑘3 = (0.1)[(0.15)(1.120182624) + √1.120182624] = 0.122641419

La fórmula para k4 es: 𝑘4 = ℎ𝑓(𝑥1 + ℎ, 𝑦1 + 𝑘3 )

Donde: 𝑥1 + ℎ = 0.2 y 𝑦1 + 𝑘3 = 1.0590 + 0.122641419 = 1.181641419

Por lo tanto: 𝑘4 = ℎ𝑓(𝑥1 + ℎ, 𝑦1 + 𝑘3 ) = ℎ𝑓(0.2,1.181641419) =

𝑘4 = 0.1[(0.2)(1.181641419) + √1.181641419] = 0.132336159


Entonces, para 𝑛 = 2, tenemos:

𝑥2 = 𝑥1 + ℎ = 0.1 + 0.1 = 0.2


1
𝑦2 = 𝑦1 + (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 )
6
1
= 1.0590 + 6 (0.113497725 + 2(0.122365247) + 2(0.122641419) + 0.132336159)

= 1.1265

Se continúa de la misma manera hasta llegar a n = 5. Los resultados de las iteraciones se muestran
en la siguiente tabla:

n xn yn k1 k2 k3 k4
0 0.0000 1.0000 0.1000 0.1077 0.1079 0.1163
1 0.1000 1.0590 0.1135 0.1224 0.1226 0.1323
2 0.2000 1.1265 0.1287 0.1389 0.1393 0.1505
3 0.3000 1.2040 0.1458 0.1577 0.1582 0.1712
4 0.4000 1.2929 0.1654 0.1792 0.1798 0.1950
5 0.5000 1.3952 0.1879 0.2039 0.2047 0.2225

El cálculo de los valores de k1, k2, k3 y k4 que aparecen en la última fila de la tabla realmente ya no
es necesario, pero Excel lo hace automáticamente.

Resuelva los siguientes problemas de valor inicial. Use el método de Runge-Kutta con h = 0.1 para
obtener una aproximación con cuatro cifras decimales al valor indicado.

1- 𝑦´ = 𝑥 2 + 𝑦 2 , 𝑦(0) = 1, 𝑦(0.5)

2- 𝑦´ = 𝑒 −𝑦 , 𝑦(0) = 0, 𝑦(0.5)

𝑦
3- 𝑦´ = 𝑥𝑦 2 − 𝑥 , 𝑦(1) = 1, 𝑦(1.5)

También podría gustarte