JP / EN
Tools / Numerical Analysis

Differential Equation Visualizer

Solve a first-order ordinary differential equation through time and visualise differences in accuracy and stability.

Step 1

Equation and calculation settings

dy/dt =

Variables are t and y. Available: + − * / ^ ( ), pi, e, sin, cos, tan, exp, log, sqrt, abs and more. The step size may be adjusted slightly to land on the end time.

Presets
Guide

Five included methods

Euler method

The basic explicit method, predicting the next value from the current slope alone.

Improved Euler

Averages slopes at the start and predicted end of a step to improve accuracy.

Fourth-order Runge–Kutta

Evaluates four slopes per step for high accuracy on smooth problems.

Backward Euler (BDF1)

An implicit method using the slope at the next time. Newton's method solves the unknown at every step.

Second-order Gear (BDF2)

A second-order backward-difference method using the previous two points. It starts with one Backward Euler step.

Equations

Equations used by each method

Let \(f_n=f(t_n,y_n)\) and \(h=t_{n+1}-t_n\).

Euler method

\[y_{n+1}=y_n+h f(t_n,y_n)\]

Improved Euler (Heun)

\[\tilde y_{n+1}=y_n+h f_n\]\[y_{n+1}=y_n+\frac{h}{2}\{f_n+f(t_{n+1},\tilde y_{n+1})\}\]

Fourth-order Runge–Kutta

\[k_1=f(t_n,y_n),\quad k_2=f(t_n+\tfrac h2,y_n+\tfrac h2k_1)\]\[k_3=f(t_n+\tfrac h2,y_n+\tfrac h2k_2),\quad k_4=f(t_n+h,y_n+hk_3)\]\[y_{n+1}=y_n+\frac h6(k_1+2k_2+2k_3+k_4)\]

Backward Euler (BDF1)

\[y_{n+1}=y_n+h f(t_{n+1},y_{n+1})\]\[R(z)=z-y_n-hf(t_{n+1},z)=0\]

Newton's method finds the unknown \(z=y_{n+1}\).

Second-order Gear (BDF2)

\[\frac{3y_{n+1}-4y_n+y_{n-1}}{2h}=f(t_{n+1},y_{n+1})\]\[R(z)=\tfrac32z-2y_n+\tfrac12y_{n-1}-hf(t_{n+1},z)=0\]

The first point is generated by Backward Euler; later residual equations \(R(z)\) are solved with Newton's method.

This first version handles scalar first-order equations dy/dt = f(t,y) with a fixed step size. The high-accuracy reference is a finer-step RK4 result. Implicit methods, including Gear, use Newton iterations and may fail for some equations or settings. Verify results with specialist software before research or design use.