Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Physics LibreTexts

10.2: Forward Euler Method

( \newcommand{\kernel}{\mathrm{null}\,}\)

The Forward Euler Method is the conceptually simplest method for solving the initial-value problem. For simplicity, let us discretize time, with equal spacings:

t0,t1,t2,wherehtn+1tn.

Let us denote yny(tn). The Forward Euler Method consists of the approximation

yn+1=yn+hF(yn,tn).

Starting from the initial state y0 and initial time t0, we apply this formula repeatedly to compute y1,y2, and so forth. The Forward Euler Method is called an explicit method, because, at each step n, all the information that you need to calculate the state at the next time step, yn+1, is already explicitly known—i.e., you just need to plug yn and tn into the right-hand side of the above formula.

The Forward Euler Method formula follows from the usual definition of the derivative, and becomes exactly correct as h0. We can deduce the numerical error, which is called the local truncation error in this context, by Taylor expanding the left-hand side around t=tn:

yn+1=yn+hdydt|tn+h22d2ydt2|tn+

The first two terms are precisely equal to the right-hand side of the Forward Euler Method formula. The local truncation error is the magnitude of the remaining terms, and hence it scales as O(h2).

10.2.1 Instability

For the Forward Euler Method, the local truncation error leads to a profound problem known as instability. Because the method involves repeatedly applying a formula with a local truncation error at each step, it is possible for the errors on successive steps to progressively accumulate, until the solution itself blows up. To see this, consider the differential equation

dydt=κy.

Given an initial state y0 at time t0=0, the solution is y(t)=y0eκt. For κ>0, this decays exponentially to zero with increasing time. However, consider the solutions produced by the Forward Euler Method:

y1=y0+h(κy0)=(1hκ)y0y2=y1+h(κy1)=(1hκ)2y0=yn=(1hκ)ny0.

clipboard_ea181e7e4426c763d1d13558b20813cdb.png
Figure 10.2.1: The exact solution (blue) and Forward Euler solution (green) for dy/dt=κy(t), for y(0)=1, κ=1, and h=2.1. The numerical solution is unstable; it blows up at large times, even though the exact solution is decaying to zero.

If h>2/κ, then 1hκ<1, and as a result yn± as n. Even though the actual solution decays exponentially to zero, the numerical solution blows up, as shown in Fig. 10.2.1. Roughly speaking, the local truncation error causes the numerical solution to "overshoot" the true solution; if the step size is too large, the magnitude of the overshoot keeps growing with each step, destabilizing the numerical solution.

Stability is a fundamental problem for the integration of ODEs. The equations which tend to destabilize numerical ODE solvers are those containing spring constants which are "large" compared to the time step; such equations are called stiff equations. At first, you might think that it's no big deal: just make the step size h sufficiently small, and the blow-up can be avoided. The trouble is that it's often unclear how small is sufficiently small, particularly for complicated (e.g. nonlinear) ODEs, where F(y,t) is something like a "black box". Unlike the above simple example, we typically don't have the exact answer to compare with, so it can be hard to tell whether the numerical solution blows up because that's how the true solution behaves, or because the numerical method is unstable.


This page titled 10.2: Forward Euler Method is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Y. D. Chong via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?