Mathematics / Euler & Heun Methods
FREE TO EXPLORE
LABORATORY 31 · MATHEMATICS

Euler Methods (Forward, Backward, Heun) & Global Error Truncation

Implement explicit Forward Euler, implicit Backward Euler, and predictor-corrector Heun's method for initial value ordinary differential equations, evaluate numerical stability regions, and verify first-order O(h) global truncation error convergence. Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.

COMPUTE · CONVERGE · ANALYSE

Your virtual mathematics laboratory.

GLOBAL TRUNCATION ERROR ||Y - Y_NUM||_∞—
COMPUTATION STATUS

Ready to execute Step = 1.

1 step
Test IVP system: dy/dt = -2y + t, y(0) = 1.0 on t ∈ [0, 2] with exact solution y(t) = 0.5 t - 0.25 + 1.25 e^{-2t}

Adjust Step, then execute computation.

Mathematical operations are computed deterministically using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations.

Numerical assumptions and limits

Forward Euler requires very small step sizes to maintain accuracy and stability, making it computationally inefficient for precision applications. The simulation executes Forward Euler for time steps h = 0.20 / 2^{k-1} on the test IVP y' = -2y + t. The maximum trajectory error is measured against the exact analytic solution. The logarithmic regression ln(E) = α·ln(h) + ln(C) extracts the asymptotic order α = 1.000 with R² = 1.000000.

Computational tools & numerical modules.

Initial Value Problem Simulator

Configures and evaluates Cauchy initial value ODEs y' = f(t, y) with exact closed-form reference solutions.

Forward Euler Stepper

Executes explicit time integration y_{n+1} = y_n + h f(t_n, y_n) with O(h) global accuracy.

Backward Euler Implicit Engine

Solves implicit algebraic equations y_{n+1} = y_n + h f(t_{n+1}, y_{n+1}) via Newton iteration for A-stable integration.

Heun Predictor-Corrector Module

Implements explicit trapezoidal Heun stepping: y~_{n+1} = y_n + h f_n, y_{n+1} = y_n + (h/2)(f_n + f(t_{n+1}, y~_{n+1})).

Dahlquist Stability Visualizer

Maps the complex stability function R(z) on the complex plane z = λh and displays stability boundaries |R(z)| ≤ 1.

Global Error Telemetry Logger

Evaluates the maximum absolute deviation ||y(t_n) - y_n||_∞ across the entire trajectory to verify O(h) convergence.

FOLLOW THE METHOD

A reason behind every step.

Implement explicit Forward Euler, implicit Backward Euler, and predictor-corrector Heun's method for initial value ordinary differential equations, evaluate numerical stability regions, and verify first-order O(h) global truncation error convergence. Standardized input settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 step.

01

Define Benchmark IVP & Exact Solution

Set up dy/dt = -2y + t with initial condition y(0) = 1.0 on t ∈ [0, 2], recording the exact solution y(t) = 0.5 t - 0.25 + 1.25 e^{-2t}.

02

Initialize Step Size Schedule

For test levels k = 1 to 6, assign time step h = 0.20 / 2^{k-1} yielding total step counts N = 2 / h.

03

Execute Forward Euler Trajectory

March from t = 0 to t = 2 using y_{n+1} = y_n + h (-2 y_n + t_n), storing computed ordinates at each discrete time node.

04

Compute Supremum Global Error

Calculate absolute errors |y(t_n) - y_n| across all steps and extract the global maximum error E_max = ||y - y_num||_∞.

05

Compare Implicit Backward Euler and Heun

Execute Heun's method on the same grid to observe the transition from first-order O(h) to second-order O(h²) error attenuation.

06

Fit Logarithmic Convergence Slope

Perform linear regression on (ln(h), ln(E_max)) to empirically confirm the theoretical first-order slope α = 1.000.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into mathematical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Euler & Heun Methods mathematical scaling.

LINEAR ASYMPTOTIC FIT · y = mx + b
ln(E_max) = α · ln(h) + ln(C)
#Time Step Setting (k) (step)Global Truncation Error ||y - y_num||_∞ (error)Logarithmic Time Step ln(h)Logarithmic Global Error ln(E_max)Remove

No readings yet. Execute a computation and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the mathematical metrics mean.

What is the global truncation error order of convergence α for the explicit Forward Euler method?

For the test equation y' = -10 y, what is the maximum step size h for which Forward Euler remains numerically stable?

What mathematical property characterizes the stability region of the implicit Backward Euler method?

What is the global order of accuracy of Heun's predictor-corrector method?