Algorithms And Data Structures Codexery

Euler method

First-order numerical method for solving ordinary differential equations.

Euler method

The Euler method, also known as the forward Euler method, is a first-order numerical technique used to solve ordinary differential equations (ODEs) when an initial value is given. It is the simplest explicit method for numerically integrating ODEs and is the most basic form of a Runge–Kutta method. The method is named after Leonhard Euler, who introduced it in his work *Institutionum calculi integralis* (published between 1768 and 1770). As a first-order method, the error for each step is proportional to the square of the step size, while the overall error at a specific time is proportional to the step size itself. The Euler method often provides a foundation for developing more advanced techniques, such as the predictor–corrector method.

The geometric idea behind the method involves finding the shape of an unknown curve that starts at a known point and follows a given differential equation. This equation provides a way to calculate the slope of the tangent line at any point on the curve once that point’s position is known. Since the curve is initially unknown, only its starting point, labeled \(A_0\), is given. From the differential equation, the slope at \(A_0\) can be computed, allowing the tangent line to be drawn. A small step is then taken along this tangent line to reach a new point, \(A_1\). Because the step is small, the slope changes little, so \(A_1\) remains close to the true curve. Assuming \(A_1\) lies on the curve, the same process is repeated. After many steps, a polygonal path consisting of points \(A_0, A_1, A_2, A_3, \dots\) is constructed. Generally, this path does not stray far from the actual unknown curve, and the error can be reduced by using a sufficiently small step size over a finite computation interval.

In practice, the method starts with known values for \(t_0\) and \(y(t_0)\), where the derivative of \(y\) with respect to \(t\) is given by the function \(f(t, y(t))\), so \(y'(t) = f(t, y(t))\). The process begins by setting \(y_0 = y(t_0)\). A step size \(h\) is chosen, and points along the \(t\)-axis are defined as \(t_n = t_0 + n h\) (or equivalently \(t_{n+1} = t_n + h\)). The Euler method then computes each successive approximation \(y_{n+1}\) from \(y_n\) and \(t_n\) using the formula \(y_{n+1} = y_n + h f(t_n, y_n)\). The value \(y_n\) is an approximation of the true solution at time \(t_n\).

named_after
Leonhard Euler
type
First-order numerical procedure
field
Mathematics and computational science
known_for
Solving ordinary differential equations with a given initial value

Lore & Background

The Euler method, also known as the forward Euler method, is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. It is the most basic explicit method for numerical integration of ODEs and is the simplest Runge–Kutta method. The method is named after Leonhard Euler, who first proposed it in his book *Institutionum calculi integralis* (published 1768–1770). As a first-order method, the error per step is proportional to the square of the step size, while the global error is proportional to the step size. The method often serves as the basis for constructing more complex methods, such as the predictor–corrector method. Geometrically, the method works by starting at a known point on an unknown curve and using the differential equation to compute the slope of the tangent line at that point. A small step is taken along this tangent line to a new point, which is assumed to be close to the curve. Repeating this process produces a polygonal approximation of the curve. The method is explicit, meaning the solution at each step is a direct function of the previous value. Any higher-order ODE can be represented as a system of first-order ODEs and handled by the Euler method or other first-order schemes. The method’s accuracy improves with smaller step sizes, but achieving high precision often requires many steps, leading to a high computational cost. For this reason, higher-order methods like Runge–Kutta or linear multistep methods are often preferred when high accuracy is desired.

Reader's Guide

The Euler method is a foundational technique in numerical analysis for approximating solutions to ordinary differential equations. Its significance lies in its simplicity and its role as the simplest explicit Runge–Kutta method. The method works by taking small steps along the tangent line of the unknown curve, starting from a known initial point. While the Euler method itself has limited accuracy (first-order), it provides the conceptual basis for more advanced numerical integration techniques. The method is explicit, meaning the solution at each step is a direct function of previous values. Any higher-order ODE can be reduced to a system of first-order ODEs and then solved using the Euler method. Its legacy endures as a teaching tool and a building block for more sophisticated algorithms in computational science.

Did You Know?

More in Algorithms And Data Structures 1-24

Spotted an error? Know more?

This is a living reference — every entry is fact-audited, and reader corrections feed straight into our audit queue. Suggest an edit · See this site's audit record

Comments

Loading…
Open in the interactive codex →