Calcule o valor aproximado de y(0.2), utilizando o método de RK4. Sabendo que: y^{\prime}+2 y=2 x, y(0)=-1, considere \mathrm{h}=0.1.
i x y \mathrm{k}_{1} \mathrm{k}_{2} \mathrm{k}_{3} \mathrm{k}_{4}
\mathrm{k} 1=\mathrm{h} * \mathrm{f}(\mathrm{x}(\mathrm{i}), \mathrm{y}(\mathrm{i}))
\mathrm{k} 2=\mathrm{h} * \mathrm{f}(\mathrm{x}(\mathrm{i})+\mathrm{h} / 2, \mathrm{y}(\mathrm{i})+\mathrm{k} 1 / 2)
\mathrm{k} 3=\mathrm{h} * \mathrm{f}(\mathrm{x}(\mathrm{i})+\mathrm{h} / 2, \mathrm{y}(\mathrm{i})+\mathrm{k} 2 / 2)
\mathrm{k} 4=\mathrm{h} * \mathrm{f}(\mathrm{x}(\mathrm{i})+\mathrm{h}, \mathrm{y}(\mathrm{i})+\mathrm{k} 3)
\mathrm{y}(\mathrm{i}+1)=\mathrm{y}(\mathrm{i})+(1 / 6) *\left(\mathrm{k}_{1}+2 * \mathrm{k} 2+2 * \mathrm{k} 3+\mathrm{k} 4\right)
x(\mathrm{i}+1)=x(\mathrm{i})+\mathrm{h}

Passo 1

O enunciado pede para calcular o valor aproximado de y(0{,}2) usando o método de Runge–Kutta de ordem 4 (RK4). As informações dadas são:
  • Equação diferencial: y^{\prime}+2y=2x.
  • Condição inicial: y(0)=-1.
  • Passo: h=0{,}1.
  • Queremos avançar de x=0 até x=0{,}2 usando RK4 com dois passos ( 0\to0{,}1 e 0{,}1\to0{,}2).

Passo 2

Primeiro deixe a equação no formato y^{\prime}=f(x,y). Subtraindo 2y dos dois lados:
y^{\prime}=2x-2y.
Então definimos a função
f(x,y)=2x-2y.
Iremos aplicar RK4 com passo h=0{,}1. Recordando as fórmulas de RK4 (para cada iteração i):
k_1 = h\,f\big(x_i,y_i\big),
k_2 = h\,f\Big(x_i+\frac{h}{2},\,y_i+\frac{k_1}{2}\Big),
k_3 = h\,f\Big(x_i+\frac{h}{2},\,y_i+\frac{k_2}{2}\Big),
k_4 = h\,f\big(x_i+h,\,y_i+k_3\big),
y_{i+1} = y_i + \frac{1}{6}\big(k_1 + 2k_2 + 2k_3 + k_4\big),
x_{i+1} = x_i + h.
Vou calcular passo a passo as duas iterações necessárias.

Passo 3

Primeira iteração: x_0=0, y_0=-1, h=0{,}1.
Calcule k_1:
k_1 = 0{,}1\cdot f(0,-1)=0{,}1\cdot\big(2\cdot0 - 2\cdot(-1)\big)=0{,}1\cdot 2=0{,}2.
Calcule k_2:
x_0+\frac{h}{2}=0{,}05,\qquad y_0+\frac{k_1}{2}=-1+\frac{0{,}2}{2}=-1+0{,}1=-0{,}9,
k_2 = 0{,}1\cdot f(0{,}05,-0{,}9)=0{,}1\cdot\big(2\cdot0{,}05 - 2\cdot(-0{,}9)\big)
=0{,}1\cdot\big(0{,}1 + 1{,}8\big)=0{,}1\cdot 1{,}9=0{,}19.
Calcule k_3:
y_0+\frac{k_2}{2}=-1+\frac{0{,}19}{2}=-1+0{,}095=-0{,}905,
k_3 = 0{,}1\cdot f(0{,}05,-0{,}905)=0{,}1\cdot\big(2\cdot0{,}05 - 2\cdot(-0{,}905)\big)
=0{,}1\cdot\big(0{,}1 + 1{,}81\big)=0{,}1\cdot 1{,}91=0{,}191.
Calcule k_4:
x_0+h=0{,}1,\qquad y_0+k_3=-1+0{,}191=-0{,}809,
k_4 = 0{,}1\cdot f(0{,}1,-0{,}809)=0{,}1\cdot\big(2\cdot0{,}1 - 2\cdot(-0{,}809)\big)
=0{,}1\cdot\big(0{,}2 + 1{,}618\big)=0{,}1\cdot 1{,}818=0{,}1818.
Agora estime y_1:
y_1 = -1 + \frac{1}{6}\big(0{,}2 + 2\cdot0{,}19 + 2\cdot0{,}191 + 0{,}1818\big).
Calcule a soma interna:
0{,}2 + 2\cdot0{,}19 + 2\cdot0{,}191 + 0{,}1818 = 0{,}2 + 0{,}38 + 0{,}382 + 0{,}1818 = 1{,}1438.
Dividindo por 6:
\frac{1{,}1438}{6}=0{,}190633333\ldots
Portanto
y_1 = -1 + 0{,}190633333\ldots = -0{,}8093666667\approx -0{,}8093667.
E x_1 = 0{,}1.

Passo 4

Segunda iteração: x_1=0{,}1, y_1\approx -0{,}8093666667, h=0{,}1.
Calcule k_1:
k_1 = 0{,}1\cdot f(0{,}1,-0{,}8093666667)
=0{,}1\cdot\big(2\cdot0{,}1 - 2\cdot(-0{,}8093666667)\big)
=0{,}1\cdot\big(0{,}2 + 1{,}6187333334\big)=0{,}1\cdot 1{,}8187333334 = 0{,}18187333334.
Calcule k_2:
x_1+\frac{h}{2}=0{,}15,\qquad y_1+\frac{k_1}{2}=-0{,}8093666667+\frac{0{,}18187333334}{2}
=-0{,}8093666667+0{,}09093666667=-0{,}71843\\ (\text{aprox.}).
k_2 = 0{,}1\cdot f(0{,}15,-0{,}71843)=0{,}1\cdot\big(2\cdot0{,}15 - 2\cdot(-0{,}71843)\big)
=0{,}1\cdot\big(0{,}3 + 1{,}43686\big)=0{,}1\cdot 1{,}73686 = 0{,}173686.
Calcule k_3:
y_1+\frac{k_2}{2}=-0{,}8093666667+\frac{0{,}173686}{2}=-0{,}8093666667+0{,}086843=-0{,}7225236667,
k_3 = 0{,}1\cdot f(0{,}15,-0{,}7225236667)
=0{,}1\cdot\big(0{,}3 - 2\cdot(-0{,}7225236667)\big)=0{,}1\cdot\big(0{,}3 + 1{,}4450473334\big)
=0{,}1\cdot 1{,}7450473334 = 0{,}17450473334.
Calcule k_4:
x_1+h=0{,}2,\qquad y_1+k_3=-0{,}8093666667 + 0{,}17450473334 = -0{,}63486193336,
k_4 = 0{,}1\cdot f(0{,}2,-0{,}63486193336)
=0{,}1\cdot\big(2\cdot0{,}2 - 2\cdot(-0{,}63486193336)\big)
=0{,}1\cdot\big(0{,}4 + 1{,}26972386672\big)=0{,}1\cdot 1{,}66972386672 = 0{,}166972386672.
Agora estime y_2 (que é y(0{,}2)):
y_2 = y_1 + \frac{1}{6}\big(k_1 + 2k_2 + 2k_3 + k_4\big).
Calcule a soma interna:
k_1 + 2k_2 + 2k_3 + k_4
=0{,}18187333334 + 2\cdot0{,}173686 + 2\cdot0{,}17450473334 + 0{,}166972386672
=0{,}18187333334 + 0{,}347372 + 0{,}34900946668 + 0{,}166972386672
=1{,}045227186692.
Dividindo por 6:
\frac{1{,}045227186692}{6}=0{,}1742045311153333\ldots
Somando a y_1:
y_2 = -0{,}8093666667 + 0{,}1742045311153333 = -0{,}6351621355846667\approx -0{,}6351621.

Passo 5

Breve interpretação didática final (pra você lembrar na prova): a cada passo RK4 calcula quatro estimativas de inclinação ( k_1,k_2,k_3,k_4) que correspondem a avaliar f(x,y) no início do passo, em dois pontos mid-point e no fim do passo; então faz uma média ponderada dessas inclinações para atualizar y. Isso dá precisão de quarta ordem sem precisar derivadas complicadas — por isso é muito usado em provas e computadores.

Resposta

-0{,}6351621356

Exercícios relacionados