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
- Runge-Kutta 2nd order method to solve Differential equations
- Gill's 4th 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
- Solving Homogeneous Recurrence Equations Using Polynomial Reduction
- Euler's criterion (Check if square root under modulo p exists)
- Optimized Euler Totient Function for Multiple Evaluations
- Euler's Four Square Identity
- Euclid Euler Theorem
- Total nodes traversed in Euler Tour Tree
- Count integers in a range which are divisible by their euler totient value
- Euler zigzag numbers ( Alternating Permutation )
- Check if a number is Euler Pseudoprime
- Count of elements having Euler's Totient value one less than itself
- Probability of Euler's Totient Function in a range [L, R] to be divisible by M
- Check if Euler Totient Function is same for a given number and twice of that number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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