HomeAlgorithms & AICFL Limit: Adaptive Timestep for Wave Simulation

CFL Limit: Adaptive Timestep for Wave Simulation

Step a 1D wave equation with an explicit finite-difference scheme and watch the Courant-Friedrichs-Lewy condition decide whether your timestep is stable — tune grid resolution, wave speed and timestep to trade accuracy for computational budget, or push the Courant number past 1 and watch it blow up.

Algorithms & AI3DAdvanced60 FPS📱 Mobile-adapted⇄ 2D version
performance-optimization ↗ Open standalone

A row of instanced 3D bars is a 1D wave equation stepped by an explicit finite-difference scheme, and every setting you touch feeds directly into the Courant–Friedrichs–Lewy (CFL) condition that decides whether that scheme is numerically stable. In Adaptive mode the timestep is recomputed from a target Courant number every frame, so a finer grid automatically buys itself a smaller, safe Δt — and a fixed compute budget of substeps per animation frame means that safety is not free: push resolution high enough and the simulation visibly falls behind real time, exactly the resource/accuracy trade-off the article on simulation performance describes. Switch to Manual mode and fix Δt directly instead: raise the grid resolution with nothing else changed and watch the same wave that was perfectly stable start to blow up once the Courant number quietly crosses 1.

⚙ Under the hood

Step a 1D wave equation with an explicit finite-difference scheme and watch the Courant-Friedrichs-Lewy condition decide whether your timestep is stable, trading grid resolution and timestep size against a fixed computational budget.

Three.jsNumerical MethodsPerformanceCFL ConditionComputer ScienceSimulation

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)