Loading…

Wave Equation Numerical Solver

Physics Oscillations and Waves • Applications and Capstone (interdisciplinary)

View all topics

Numerically solve the 1D wave equation for a vibrating string using a finite-difference time-marching method. The tool supports fixed or free ends, several initial shapes, draggable zoomable visuals, and a step-by-step explanation.

Wave-equation inputs
The solver uses the explicit finite-difference update \(y_i^{n+1}=2y_i^n-y_i^{n-1}+r^2\!\left(y_{i+1}^n-2y_i^n+y_{i-1}^n\right)\), where \(r=\dfrac{v\Delta t}{\Delta x}\). For stability, you generally want \(r\le 1\).
Visualization
Ready
Ready
String-vibration simulation
This animation shows the finite-difference solution \(y(x,t)\) evolving in time. You can zoom and drag the animation view.
Wheel = zoom Drag = pan
Use Play to animate the string. This is a classic guitar-pluck style model for a 1D string.
Interactive snapshot graph
This graph compares the initial displacement with the computed snapshot at the chosen time. Zoom with the wheel and drag to pan.
Wheel = zoom Drag = pan
The graph shows \(y(x,0)\) and the numerical solution \(y(x,t)\) at the selected snapshot time.
Enter values and click “Calculate”.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does this wave equation numerical solver compute?

It computes a finite-difference approximation to the 1D wave equation for a string and returns the string displacement y(x,t) at the requested time.

What is the CFL number and why does it matter?

The CFL number is r = v dt / dx. For the explicit scheme used here, values above about 1 can make the numerical solution unstable.

What is the difference between fixed and free ends?

Fixed ends force the displacement to remain zero at the boundaries, while free ends enforce zero slope at the boundaries so the ends can move.

Why does this solver use many small time steps?

The wave equation is evolved step by step in time. Smaller time steps improve temporal resolution and help satisfy the stability condition of the explicit method.