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
- Predictor-Corrector or Modified-Euler method for solving Differential equation
- Runge-Kutta 4th Order Method to Solve Differential Equation
- Solving f(n)= (1) + (2*3) + (4*5*6) ... n using Recursion
- Euler's Totient Function
- Euclid Euler Theorem
- Euler's Four Square Identity
- Euler zigzag numbers ( Alternating Permutation )
- Optimized Euler Totient Function for Multiple Evaluations
- Euler's Totient function for all numbers smaller than or equal to n
- Count integers in a range which are divisible by their euler totient value
- Total nodes traversed in Euler Tour Tree
- Euler's criterion (Check if square root under modulo p exists)
- Find the missing value from the given equation a + b = c
- Number of solutions for the equation x + y + z <= n
- Sort an array after applying the given equation
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