Achar aproximações para a solução do PVI \left\{\begin{array}{l}y^{\prime}=x-y+2 \\\ y(0)=2\end{array}\right. na malha [0,1] \operatorname{com} h=0,1 usando o método da equação (10).

Resolução:

x_{0}=0, y_{0}=2, a=0, b=1, m=\frac{1-0}{0,1} \rightarrow m=10
Usar equação (10) para j=0,1, \ldots, 9.
  • j=0 :
  • j=1 :
  • TABELA:
j x_{j} y_{j} y\left(x_{j}\right) y_{j}-y\left(x_{j}\right)=e_{j}
0 0 2 2
1 2,004837
2 2,018731
3 2,040818
4 2,07032
5 2,106531
6 2,148812
7 2,196585
8 2,249329
9 2,30657
10 2,367879

Passo 1

O problema pede: aproximar a solução do PVI
\begin{cases} y'=x-y+2,\\[4pt] y(0)=2, \end{cases}
na malha [0,1] com passo h=0,1 (logo m=10), usando a equação (10) para j=0,1,\ldots,9.
Dados relevantes fornecidos (peguei esses valores da tabela do enunciado, coluna y(x_j) — solução exata):
\begin{array}{l} x_{0}=0,\;y(x_{0})=2,\\\ x_{1}=0,1,\;y(x_{1})=2,004837,\\\ x_{2}=0,2,\;y(x_{2})=2,018731,\\\ x_{3}=0,3,\;y(x_{3})=2,040818,\\\ x_{4}=0,4,\;y(x_{4})=2,07032,\\\ x_{5}=0,5,\;y(x_{5})=2,106531,\\\ x_{6}=0,6,\;y(x_{6})=2,148812,\\\ x_{7}=0,7,\;y(x_{7})=2,196585,\\\ x_{8}=0,8,\;y(x_{8})=2,249329,\\\ x_{9}=0,9,\;y(x_{9})=2,30657,\\\ x_{10}=1,0,\;y(x_{10})=2,367879. \end{array}
A função do PVI é f(x,y)=x-y+2. A construção das aproximações começa com x_0=0,\;y_0=2. A resolução numérica procede calculando y_{j+1} para j=0,\dots,9.]

Passo 2

A equação (10) indicada no enunciado corresponde ao método de Runge–Kutta clássico de 4ª ordem (RK4). Vou escrever a fórmula e explicar cada termo com calma:
\begin{aligned} k_{1} &= f(x_j,y_j),\\[4pt] k_{2} &= f\Bigl(x_j+\tfrac{h}{2},\,y_j+\tfrac{h}{2}k_{1}\Bigr),\\[4pt] k_{3} &= f\Bigl(x_j+\tfrac{h}{2},\,y_j+\tfrac{h}{2}k_{2}\Bigr),\\[4pt] k_{4} &= f(x_j+h,\,y_j+h k_{3}), \end{aligned}
y_{j+1}=y_j+\tfrac{h}{6}\bigl(k_{1}+2k_{2}+2k_{3}+k_{4}\bigr).
O que cada coisa significa, de forma bem prática:
  • k_1 é a inclinação no ponto inicial (x_j,y_j).
  • k_2 e k_3 estimam inclinações no ponto médio usando as informações obtidas antes.
  • k_4 é a inclinação no ponto final do passo.
  • A combinação \tfrac{1}{6}(k_1+2k_2+2k_3+k_4) dá uma média ponderada das inclinações para avançar y_j até y_{j+1}.
    Vamos aplicar isso passo a passo com h=0,1 e f(x,y)=x-y+2.]

Passo 3

Dados iniciais: x_0=0,\;y_0=2,\;h=0,1.
\begin{aligned} k_1 &= f(0,2)=0-2+2=0,\\[4pt] k_2 &= f(0{,}05,\;2+0{,}05\cdot 0)=f(0{,}05,2)=0{,}05-2+2=0{,}05,\\[4pt] k_3 &= f(0{,}05,\;2+0{,}05\cdot 0{,}05)=f(0{,}05,2{,}0025)=0{,}05-2{,}0025+2=0{,}0475,\\[4pt] k_4 &= f(0{,}1,\;2+0{,}1\cdot 0{,}0475)=f(0{,}1,2{,}00475)=0{,}1-2{,}00475+2=0{,}09525. \end{aligned}
Agora
y_1=2+\tfrac{0{,}1}{6}\bigl(0+2\cdot 0{,}05+2\cdot 0{,}0475+0{,}09525\bigr) =2+0{,}0048375=2{,}0048375.]

Passo 4

x_1=0{,}1,\;y_1=2{,}0048375.
\begin{aligned} k_1 &= f(0{,}1,2{,}0048375)=0{,}1-2{,}0048375+2=0{,}0951625,\\[4pt] k_2 &= f(0{,}15,\;2{,}0048375+0{,}05\cdot 0{,}0951625)=f(0{,}15,2{,}009595625)=0{,}140404375,\\[4pt] k_3 &= f(0{,}15,\;2{,}0048375+0{,}05\cdot 0{,}140404375)=f(0{,}15,2{,}01185771875)=0{,}13814228125,\\[4pt] k_4 &= f(0{,}2,\;2{,}0048375+0{,}1\cdot 0{,}13814228125)=f(0{,}2,2{,}018651728125)=0{,}181348271875. \end{aligned}
y_2=2{,}0048375+\tfrac{0{,}1}{6}(0{,}0951625+2\cdot0{,}140404375+2\cdot0{,}13814228125+0{,}181348271875) =2{,}01873090140625.]

Passo 5

x_2=0{,}2,\;y_2=2{,}01873090140625.
\begin{aligned} k_1 &= 0{,}2-2{,}01873090140625+2=0{,}18126909859375,\\[4pt] k_2 &= f(0{,}25,\,2{,}01873090140625+0{,}05\cdot k_1)=0{,}2222056436640625,\\[4pt] k_3 &= f(0{,}25,\,2{,}01873090140625+0{,}05\cdot k_2)=0{,}22015881641054688,\\[4pt] k_4 &= f(0{,}3,\,2{,}01873090140625+0{,}1\cdot k_3)=0{,}2592532169526953. \end{aligned}
y_3=2{,}01873090140625+\tfrac{0{,}1}{6}\cdot 1{,}3252512356956641 =2{,}0408184220011776.]

Passo 6

x_3=0{,}3,\;y_3=2{,}0408184220011776.
\begin{aligned} k_1 &= 0{,}2591815779988224,\\[4pt] k_2 &= 0{,}2962224990988813,\\[4pt] k_3 &= 0{,}2943704530438783,\\[4pt] k_4 &= 0{,}3297445326944346. \end{aligned}
y_4=2{,}0408184220011776+\tfrac{0{,}1}{6}\cdot 1{,}7701120149787762 =2{,}0703202889174905.]

Passo 7

x_4=0{,}4,\;y_4=2{,}0703202889174905.
\begin{aligned} k_1 &= 0{,}3296797110825095,\\[4pt] k_2 &= 0{,}3631957255283843,\\[4pt] k_3 &= 0{,}3615199248060903,\\[4pt] k_4 &= 0{,}3935277186019003. \end{aligned}
y_5=2{,}0703202889174905+\tfrac{0{,}1}{6}\cdot 2{,}172638730353359 =2{,}1065309344233797.]

Passo 8

x_5=0{,}5,\;y_5=2{,}1065309344233797.
\begin{aligned} k_1 &= 0{,}3934690655766203,\\[4pt] k_2 &= 0{,}4237956122977893,\\[4pt] k_3 &= 0{,}422279284961731,\\[4pt] k_4 &= 0{,}4512411370804473. \end{aligned}
y_6=2{,}1065309344233797+\tfrac{0{,}1}{6}\cdot 2{,}5368599971761084 =2{,}148811934376315.]

Passo 9

x_6=0{,}6,\;y_6=2{,}148811934376315.
\begin{aligned} k_1 &= 0{,}451188065623685,\\[4pt] k_2 &= 0{,}4786286623425007,\\[4pt] k_3 &= 0{,}47725663250655995,\\[4pt] k_4 &= 0{,}503462402373029. \end{aligned}
y_7=2{,}148811934376315+\tfrac{0{,}1}{6}\cdot 2{,}8664210576948357 =2{,}1965856186712288.]

Passo 10

x_7=0{,}7,\;y_7=2{,}1965856186712288.
\begin{aligned} k_1 &= 0{,}5034143813287712,\\[4pt] k_2 &= 0{,}5282436622623325,\\[4pt] k_3 &= 0{,}5270021982156546,\\[4pt] k_4 &= 0{,}5507141615072057. \end{aligned}
y_8=2{,}1965856186712288+\tfrac{0{,}1}{6}\cdot 3{,}164620263791951 =2{,}2493292897344278.]

Passo 11

x_8=0{,}8,\;y_8=2{,}2493292897344278.
\begin{aligned} k_1 &= 0{,}5506707102655722,\\[4pt] k_2 &= 0{,}5731371747522935,\\[4pt] k_3 &= 0{,}5720138515279574,\\[4pt] k_4 &= 0{,}5934693251127764. \end{aligned}
y_9=2{,}2493292897344278+\tfrac{0{,}1}{6}\cdot 3{,}4344420879388506 =2{,}3065699912000753.]

Passo 12

x_9=0{,}9,\;y_9=2{,}3065699912000753.
\begin{aligned} k_1 &= 0{,}5934300087999247,\\[4pt] k_2 &= 0{,}6137585083599285,\\[4pt] k_3 &= 0{,}6127420833819283,\\[4pt] k_4 &= 0{,}6321558004617319. \end{aligned}
y_{10}=2{,}3065699912000753+\tfrac{0{,}1}{6}\cdot 3{,}6785869927453702 =2{,}367879774412498.]

Resposta

j=0:\;x_{0}=0,\;y_{0}=2,\;y(x_{0})=2,\;e_{0}=0
j=1:\;x_{1}=0{,}1,\;y_{1}=2{,}0048375,\;y(x_{1})=2{,}004837,\;e_{1}=5\cdot10^{-7}
j=2:\;x_{2}=0{,}2,\;y_{2}=2{,}01873090140625,\;y(x_{2})=2{,}018731,\;e_{2}=-9{,}859375\times10^{-8}
j=3:\;x_{3}=0{,}3,\;y_{3}=2{,}0408184220011776,\;y(x_{3})=2{,}040818,\;e_{3}=4{,}220011776\times10^{-7}
j=4:\;x_{4}=0{,}4,\;y_{4}=2{,}0703202889174905,\;y(x_{4})=2{,}07032,\;e_{4}=2{,}889174905\times10^{-7}
j=5:\;x_{5}=0{,}5,\;y_{5}=2{,}1065309344233797,\;y(x_{5})=2{,}106531,\;e_{5}=-6{,}55766203\times10^{-8}
j=6:\;x_{6}=0{,}6,\;y_{6}=2{,}148811934376315,\;y(x_{6})=2{,}148812,\;e_{6}=-6{,}5623685\times10^{-8}
j=7:\;x_{7}=0{,}7,\;y_{7}=2{,}1965856186712288,\;y(x_{7})=2{,}196585,\;e_{7}=6{,}186712288\times10^{-7}
j=8:\;x_{8}=0{,}8,\;y_{8}=2{,}2493292897344278,\;y(x_{8})=2{,}249329,\;e_{8}=2{,}897344278\times10^{-7}
j=9:\;x_{9}=0{,}9,\;y_{9}=2{,}3065699912000753,\;y(x_{9})=2{,}30657,\;e_{9}=-8{,}7999247\times10^{-9}
j=10:\;x_{10}=1{,}0,\;y_{10}=2{,}367879774412498,\;y(x_{10})=2{,}367879,\;e_{10}=7{,}74412498\times10^{-7}

Exercícios relacionados