Use Euler and modified Euler method with one step find the value of y at x=0.1 for given dy/dx=x^2 +y and y=0.94 when x=0
f(x, y) = x2 + y; x0=0; y0=0.94; h=0.1 The task is to find y1=y(x1), where x1=x0+h
1 Euler method:
y1 = y0 + h f(x0, y0) = 0.94 + 0.1 (02 + 0.94) = 1.034
2 Modified Euler method:
y1/2 = y0 + h/2 f(x0, y0) = 0.94 + 0.05 (02 + 0.94) = 0.987
x1/2 = x0 + h/2 = 0 + 0.05 = 0.05
y1 = y0 + h f(x1/2, y1/2) = 0.94 + 0.1 (0.052 + 0.987) = 1.03895
Comments
Leave a comment