Math Insight

Applet: Forward Euler approximation to a pure time differential equation

An approximate solution to the differential equation $\diff{x}{t}=f(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(t)$ and is plotted by the green line segments. Specify $f(t)$ 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$. Checking the “exact” box will plot the exact solution by a thick red curve in cases where $x(t)$ can be found by integrating $f(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_pure_time_differential_equation.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.