We have an equation y′=f(x,y), a point (xo,yo) and a step value h. We determine a sequence of points (x1,y1),(x2,y2)…(xn,yn), where xi+1=xi+h and yi+1=yi+h⋅f(xi,yi).
In our task f(x,y)=x2+y2, point is (0,3), and using current step value we want to find the point (xn,yn), where xn=0.5.
Solution
x1=xo+h=0+0.1=0.1
y1=yo+h⋅f(xo,yo)=3+0.1⋅(02+32)=3.9
x2=x1+h=0.1+0.1=0.2
y2=y1+h⋅f(x1,y1)=3.9+0.1⋅(0.12+3.92)=5.422
x3=x2+h=0.2+0.1=0.3
y3=y2+h⋅f(x2,y2)=5.422+0.1⋅(0.22+5.4222)≈8.3658
x4=x3+h=0.3+0.1=0.4
y4=y3+h⋅f(x3,y3)=8.3658+0.1⋅(0.32+8.36582)≈15.3735
x5=x4+h=0.4+0.1=0.5
y5=y4+h⋅f(x4,y4)=15.3735+0.1⋅(0.42+15.37352)≈39.0240
Answer: y(0.5) ≈ 39.024
Solution
x1=xo+h=0+0.05=0.05y1=yo+h⋅f(xo,yo)=3+0.05⋅(02+32)=3.45x2=x1+h=0.05+0.05=0.1y2=y1+h⋅f(x1,y1)=3.45+0.05⋅(0.052+3.452)≈4.0453x3=x2+h=0.1+0.05=0.15y3=y2+h⋅f(x2,y2)=4.0453+0.05⋅(0.12+4.04532)≈4.864x4=x3+h=0.15+0.05=0.2y4=y3+h⋅f(x3,y3)=4.864+0.05⋅(0.152+4.8642)≈6.048x5=x4+h=0.2+0.05=0.25y5=y4+h⋅f(x4,y4)=6.048+0.05⋅(0.22+6.0482)≈7.8789x6=x5+h=0.25+0.05=0.3y6=y5+h⋅f(x5,y5)=7.8789+0.05⋅(0.252+7.87892)≈10.9859x7=x6+h=0.3+0.05=0.35y7=y6+h⋅f(x6,y6)=10.9859+0.05⋅(0.32+10.98592)≈17.0249x8=x7+h=0.35+0.05=0.4y8=y7+h⋅f(x7,y7)=17.0249+0.05⋅(0.352+17.02492)≈31.5234x9=x8+h=0.4+0.05=0.45y9=y8+h⋅f(x8,y8)=31.5234+0.05⋅(0.42+31.52342)≈81.2176x10=x9+h=0.45+0.05=0.5y10=y9+h⋅f(x9,y9)=81.2176+0.05⋅(0.452+81.21762)≈411.0427
Answer: y(0.5) ≈ 411.0427
Comments