We have an equation "y'=f(x,y)", a point "(x_o,y_o)" and a step value "h". We determine a sequence of points "(x_1,y_1), (x_2,y_2) \\dots (x_n,y_n)", where "x_{i+1} = x_i + h" and "y_{i+1} = y_i + h\\cdot f(x_i,y_i)".
In our task "f(x,y) = x^2+y^2", point is "(0,3)", and using current step value we want to find the point "(x_n, y_n)", where "x_n = 0.5".
Solution
"x_1 = x_o + h = 0 +0.1 = 0.1"
"y_1 = y_o + h \\cdot f(x_o,y_o) = 3 + 0.1\\cdot(0^2+3^2) = 3.9"
"x_2 = x_1 + h = 0.1 + 0.1 = 0.2"
"y_2 = y_1 + h \\cdot f(x_1,y_1) = 3.9 + 0.1\\cdot(0.1^2+3.9^2) = 5.422"
"x_3 = x_2 + h = 0.2 + 0.1 = 0.3"
"y_3 = y_2 + h \\cdot f(x_2,y_2) = 5.422 + 0.1\\cdot(0.2^2+ 5.422^2) \\approx 8.3658"
"x_4 = x_3 + h = 0.3 + 0.1 = 0.4"
"y_4 = y_3 + h \\cdot f(x_3,y_3) = 8.3658 + 0.1\\cdot(0.3^2+ 8.3658^2) \\approx 15.3735"
"x_5 = x_4 + h = 0.4 + 0.1 = 0.5"
"y_5 = y_4 + h \\cdot f(x_4,y_4) = 15.3735 + 0.1\\cdot(0.4^2+ 15.3735^2) \\approx 39.0240"
Answer: y(0.5) ≈ 39.024
Solution
"x_1 = x_o + h = 0 + 0.05 = 0.05\\\\\ny_1 = y_o + h \\cdot f(x_o, y_o) = 3 + 0.05 \\cdot (0^2 + 3^2) = 3.45\\\\\nx_2 = x_1 + h = 0.05 + 0.05 = 0.1\\\\\ny_2 = y_1 + h \\cdot f(x_1, y_1) = 3.45 + 0.05 \\cdot (0.05^2 + 3.45^2) \\approx 4.0453\\\\\nx_3 = x_2 + h = 0.1 + 0.05 = 0.15\\\\\ny_3 = y_2 + h \\cdot f(x_2, y_2) = 4.0453 + 0.05 \\cdot (0.1^2 + 4.0453^2) \\approx 4.864\\\\\nx_4 = x_3 + h = 0.15 + 0.05 = 0.2\\\\\ny_4 = y_3 + h \\cdot f(x_3, y_3) = 4.864 + 0.05 \\cdot (0.15^2 + 4.864^2) \\approx 6.048\\\\\nx_5 = x_4 + h = 0.2 + 0.05 = 0.25\\\\\ny_5 = y_4 + h \\cdot f(x_4, y_4) = 6.048 + 0.05 \\cdot (0.2^2 + 6.048^2) \\approx 7.8789\\\\\nx_6 = x_5 + h = 0.25 + 0.05 = 0.3\\\\\ny_6 = y_5 + h \\cdot f(x_5, y_5) = 7.8789 + 0.05 \\cdot (0.25^2 + 7.8789^2) \\approx 10.9859\\\\\nx_7 = x_6 + h = 0.3 + 0.05 = 0.35\\\\\ny_7 = y_6 + h \\cdot f(x_6, y_6) = 10.9859 + 0.05 \\cdot (0.3^2 + 10.9859^2) \\approx 17.0249\\\\\nx_8 = x_7 + h = 0.35 + 0.05 = 0.4\\\\\ny_8 = y_7 + h \\cdot f(x_7, y_7) = 17.0249 + 0.05 \\cdot (0.35^2 + 17.0249^2) \\approx 31.5234\\\\\nx_9 = x_8 + h = 0.4 + 0.05 = 0.45\\\\\ny_9 = y_8 + h \\cdot f(x_8, y_8) = 31.5234 + 0.05 \\cdot (0.4^2 + 31.5234^2) \\approx 81.2176\\\\\nx_{10} = x_9 + h = 0.45 + 0.05 = 0.5\\\\\ny_{10} = y_9 + h \\cdot f(x_9, y_9) = 81.2176 + 0.05 \\cdot (0.45^2 + 81.2176^2) \\approx 411.0427\\\\"
Answer: y(0.5) ≈ 411.0427
Comments
Leave a comment