Euler method is used to solve the differential equation. Euler method yields solutions in the form of numerical values of y for discrete values of x at specified intervals. It is based on the idea of linear approximation in which small tangent lines on a short distance are used to get the approximate solution to the initial-value problem.
In order to solve the first-order differential equation:
The solution starts from the initial value at and in the first step it is taken as and then the value of of the solution is computed. Using this value of the next value is computed at .
In a similar way, the value of y is carried out at the discrete values of x
Each step of the Euler method is performed using a formula which is derived from Taylor’s series as follows:
Now we take p = 1, which gives
So, in general, we can say that:
These successive values are calculated using recursion relation.
A function f(x)
The value after differentiating f(x)
Step 1: [Defining f(x,y)] return x × y Step 2: [Euler Method] Read the values of x0, y0 i.e. the initial values to calculate the differentiation. Read h(the step length) Read xn(the ending value to terminate the calculation) While x0 ≤ xn repeat Set y1 ← y0 + h × f(x0,y0) Print x0, y0 Set x0 = x0 + h Set y0 = y1 [End of ‘while’] [End of ‘Euler’ method]
1. It is the easiest method to solve the differential equation in numerical.
2. It can be used for any nonlinear IVPs.
1. It is less accurate.
2. This method is numerically unstable.
3. In this case the approximation is proportional to the step size h. so h is to be taken as very small.
1. It is helpful in estimating the force-deformation in the non-linear range.
2. It is used in solving ODEs.