Math Insight

Applet: Forward Euler algorithm

This illustration of the forward Euler algorithm demonstrates the steps of its approximation to the solution of an ordinary differential equation (ODE). The exact solution $x(t)$ to the ODE \begin{align*}\diff{x}{t} &= F(x,t)\\x(t_0)&=x_0\end{align*} is shown by the green curve, for the case where $F(x,t)=\frac{1}{5} (-x + 4e^{-t/5})$ and initial conditions at $t_0=0$ are $x_0=1$. The forward Euler algorithm approximates the solution based on a discretization of time $t$ into steps of size $h$ (adjustable by the green slider), which we denote by $t_i= t_0+ih$ for $i=0,1,2, \ldots.$ The solution $x_{i+1}$ at time step $t_{i+1}$ is computed from the solution $x_{i}$ at the previous time step $t_{i}$ by approximating the right hand side $F(x,t)$ of the ODE as though it were the constant $F(x_{i},t_{i})$, giving $x_{i+1}= x_{i} + h F(x_i,t_i)$. The first 5 steps are

Applet file: forward_euler_algorithm.ggb

Applet links

List of all applets

General information about Geogebra Web applets

This applet was created using Geogebra. In most Geogebra applets, you can move objects by dragging them with the mouse. In some, you can enter values with the keyboard. To reset the applet to its original view, click the icon in the upper right hand corner.

You can download the applet onto your own computer so you can use it outside this web page or even modify it to improve it. You simply need to download the above applet file and download the Geogebra program onto your own computer.