Press Solve.
Method
Central differences in space and time (leapfrog): uᵢⁿ⁺¹ = 2uᵢⁿ − uᵢⁿ⁻¹ + (cΔt/Δx)²(uᵢ₊₁ⁿ − 2uᵢⁿ + uᵢ₋₁ⁿ). It is stable when the Courant number cΔt/Δx ≤ 1. The first step uses the initial velocity: u¹ = u⁰ + Δt·v₀ + ½(cΔt/Δx)²δ²u⁰. With Courant number 1 the scheme is exact for the 1D wave equation.
Computed in your browser with double-precision arithmetic; nothing is sent to a server. Check results by substituting them back.