Given a differential equation dy/dx = f(x, y) with initial condition y(x0) = y0. Find its approximate solution using Euler method.
Euler Method :
In mathematics and computational science, the Euler method (also called forward
Euler method) is a first-order numerical procedurefor solving ordinary differential
equations (ODEs) with a given initial value.
Consider a differential equation dy/dx = f(x, y) with initialcondition y(x0)=y0
then succesive approximation of this equation can be given by:
y(n+1) = y(n) + h * f(x(n), y(n))
where h = (x(n) – x(0)) / n
h indicates step size. Choosing smaller
values of h leads to more accurate results
and more computation time.
Consider below differential equation dy/dx = (x + y + xy) with initial condition y(0) = 1 and step size h = 0.025. Find y(0.1). Solution: f(x, y) = (x + y + xy) x0 = 0, y0 = 1, h = 0.025 Now we can calculate y1 using Euler formula y1 = y0 + h * f(x0, y0) y1 = 1 + 0.025 *(0 + 1 + 0 * 1) y1 = 1.025 y(0.025) = 1.025. Similarly we can calculate y(0.050), y(0.075), ....y(0.1). y(0.1) = 1.11167
Approximate solution at x = 0.1 is 1.11167
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Predictor-Corrector or Modified-Euler method for solving Differential equation
- Runge-Kutta 4th Order Method to Solve Differential Equation
- Gill's 4th Order Method to solve Differential Equations
- Runge-Kutta 2nd order method to solve Differential equations
- Euler's Factorization method
- Solving f(n)= (1) + (2*3) + (4*5*6) ... n using Recursion
- Data Science | Solving Linear Equations
- Data Science - Solving Linear Equations
- Euler's Four Square Identity
- Euler's Totient Function
- Euclid Euler Theorem
- Check if a number is Euler Pseudoprime
- Count of elements having Euler's Totient value one less than itself
- Euler zigzag numbers ( Alternating Permutation )
- Count integers in a range which are divisible by their euler totient value
- Probability of Euler's Totient Function in a range [L, R] to be divisible by M
- Total nodes traversed in Euler Tour Tree
- Optimized Euler Totient Function for Multiple Evaluations
- Euler's Totient function for all numbers smaller than or equal to n
- Euler's criterion (Check if square root under modulo p exists)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t