1D Wave Equation Solver
Animated finite-difference solution to the wave equation ∂²u/∂t² = c²∂²u/∂x²
Parameters
Controls
Calculated Values
Examples
Gaussian pulse, c = 1
Pulse splits and travels both directions.
Sine wave
Standing wave pattern with fixed ends.
Visualization
Solving the Wave Equation Numerically
The 1D wave equation ∂²u/∂t² = c²·∂²u/∂x² models how disturbances propagate through a medium — strings, membranes, and electromagnetic waves. c is the wave speed determined by tension and density (or permittivity/permeability).
The leapfrog scheme uses centered differences in both space and time: u_i^{n+1} = 2u_i^n − u_i^{n-1} + C²(u_{i+1}^n − 2u_i^n + u_{i-1}^n), where C = cΔt/Δx is the Courant number.
Stability requires C ≤ 1 (the CFL condition). If violated, high-frequency modes grow unboundedly. The animation shows the initial pulse splitting into left- and right-traveling waves that reflect at boundaries.
Energy is conserved (no damping). The wave returns to its initial shape after reflecting from both ends — unlike the heat equation where energy dissipates.
Key Concepts
- Wave speed c = √(T/μ) for a string
- Leapfrog: second-order in space and time
- CFL condition: C = cΔt/Δx ≤ 1
- Superposition: waves add linearly
- Energy conservation (no dissipation)
Real-World Applications
- Vibrating guitar string
- Seismic wave propagation
- Electromagnetic wave simulation
- Acoustic wave propagation in pipes
Explore Further
- All Computational Physics Calculators
Browse every computational physics solver in this category.
- Statistical & Numerical Methods
Probability and ensemble ideas behind stochastic simulation.
- Statistics in Physics
Why averaging random samples recovers physical expectations.
- Bisection Method
Step in Numerical Methods.
- Newton-Raphson
Step in Numerical Methods.
- ODE Solver
Step in Numerical Methods.
- Monte Carlo Intro
Step in Numerical Methods.
- Physics Constants Reference
SI values for c, G, k_B, ε₀, and more used across solvers.
More computational physics tools
- Gradient Descent
Iteratively minimize f(x) by following the negative gradient with animated path visualization.
- 1D Heat Equation
Finite-difference FTCS solution to the diffusion equation with animated temperature profiles.
- Numerical Integration
Trapezoidal and Simpson rules to approximate definite integrals with error vs exact solutions.
- ODE Solver
Euler and Runge-Kutta 4 methods for first-order ODEs with comparison to analytic solutions.
- Monte Carlo Intro
Estimate π and integrals by random sampling — introduction to stochastic computational physics.
- Newton-Raphson
Solve nonlinear equations f(x) = 0 with tangent-line iterations — fast when the guess is good.
Physics Equations
Step-by-Step Solution
See how the main results are calculated.
Step 1: The wave equation
Wave speed c = 1 m/s on a string of length L = 1 m, starting as a Gaussian pulse with both ends fixed.
Equation:
Step 2: Leap-frog scheme
Equation:
Explanation:
Central differences in space and time; the first step assumes zero initial velocity.
Step 3: Courant (CFL) condition
Equation:
Calculation:
Result:
Explanation:
If the Courant number exceeds 1 the wave scheme is unstable and blows up.
Step 4: Behaviour over t = 0.5 s
By d'Alembert's solution, the initial shape splits into left- and right-traveling waves that reflect off the fixed ends.
Result:
Frequently Asked Questions (FAQ)
What is the CFL condition?
Courant-Friedrichs-Lewy: C = cΔt/Δx ≤ 1 is required for stability of explicit wave equation solvers.
Why does the pulse split in two?
The initial displacement decomposes into left- and right-traveling waves (d'Alembert's solution: u = f(x−ct) + g(x+ct)).
Is energy conserved?
Yes — without damping, the wave amplitude remains constant. The animation shows reflection at boundaries with no loss.
Practice MCQs
- The wave equation is a ___ PDE:
- CFL condition for wave equation requires:
- d'Alembert's solution says waves:
- Fixed boundary conditions cause:
- The wave speed c for a string is:
- The dispersion relation for the 1D wave equation is:
- If the CFL number C > 1, the numerical scheme:
- The leapfrog scheme is ___ in both space and time:
- A Gaussian initial pulse splits because:
- Unlike the heat equation, the wave equation:
Related Calculators
These tools connect to the same physics concepts used in this calculator.