If an ODE is given as
(x2+x+1)dx+(y2-y+3)dy=0 with y(0)=1.
Find the numerical solution with h=0.1.
Solution
For the first-order differential equation with the initial value
y’(x) = F(x,y y(x)), y(x0) = y0
according to the Euler method
yn+1 = yn + h*F(xn, yn)
where h – step, xn = h*n, yn = y(xn), n = 0,1,2…N
In this case F(x,y) = -(x2+x+1)/(y2-y+3) , h = 0.1 , x0 = 0 , y0 = 1.
Calculations gives such results:
n xn yn
0 0.0 1.000
1 0.1 0.967
2 0.2 0.929
3 0.3 0.887
4 0.4 0.839
5 0.5 0.785
6 0.6 0.723
7 0.7 0.653
8 0.8 0.574
9 0.9 0.485
10 1.0 0.387
Comments
Leave a comment