Math Insight

Applet: Forward Euler approximation to an autonomous differential equation

An approximate solution to the differential equation $\diff{x}{t}=f(x(t))$ with initial condition $x(t_0)=x_0$ is calculated with the Forward Euler algorithm up to time $t=t_f$. With time step $\Delta t$, the solution $x(t)$ is computed by iterating $x(t+\Delta t) = x(t)+\Delta t \, f(x(t))$ and is plotted by the green line segments. Specify $f(x)$ by entering a function in the box. Enter values for $\Delta t$, $t_0$ and $t_f$ by entering values in their corresponding boxes. Since the number of iterations $n_{\text{iter}}=(t_f-t_0)/\Delta t$ is limited in this applet to be less than 10,000, $\Delta t$ is increased if the current values would lead to too many iterations. You can specify the initial condition $x(t_0)$ by moving the blue point or entering a value in the box. Clearing the “details” checkbox removes the points showing individual time steps, making the plot more readable for small $\Delta t$. You can zoom the vertical axis with the + and - buttons and pan up and down with the buttons labeled by arrows.

Applet file: forward_euler_autonomous_differential_equation.ggb

Applet links

This applet is found in the pages

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.