b2KIT

Wave Equation Simulator

Simulate 1D and 2D wave equations with pluck, strike, and boundary condition controls. Visualize standing waves and resonant modes.

Tested tool guide Tested browser tools Checked August 16, 2026

What Wave Equation Simulator does, with a checked example

The wave equation, u_tt = c^2 (u_xx + u_yy) in two dimensions, governs strings, membranes, and most other things that vibrate. This tool sets that equation on a one-dimensional string or a two-dimensional rectangular membrane, applies the excitation you choose - a pluck, which sets the initial shape, or a strike, which imparts an initial velocity - animates the result under the boundary condition you select, and shows the standing waves that build up. Everything computes in the browser. The usual surprise: plucking a string fixed at both ends exactly at its center silences every even harmonic.

Worked example

A concrete input and expected output from the current implementation.

Input

1D string: length 1 m, wave speed 2 m/s, both ends fixed, pluck at x = 0.5 m (the center)

Expected output

A symmetric standing wave rings on the string. The fundamental sits at f = v/(2L) = 2/(2 x 1) = 1 Hz with a single antinode at the center; odd harmonics appear at 3 Hz (nodes at x = 1/3 and x = 2/3 of the length) and 5 Hz. Even harmonics, 2 Hz and 4 Hz, never appear.

With both ends fixed, the nth mode has frequency n x v/(2L) = n Hz for these settings, and every even mode has a node at the midpoint - exactly where the pluck never moves the string. A centered pluck can therefore drive only the odd modes.

How the result is produced

1

How the motion is computed

The string or membrane is represented by displacement values at a grid of sample points. Each animation frame advances those values by a small time step, then re-applies the chosen boundary condition at the edges; a pluck initializes the displacements, a strike initializes the velocities. The result is a numerical approximation: fine grids track the analytic modes closely, and the shortest wavelengths are the first to go visibly wrong.

2

Modes and resonance

With both ends fixed, the only 1D motions that persist are half-sine standing modes: wavelength 2L/n, frequency n x v/(2L), with n - 1 interior nodes. In 2D, a fixed-edge membrane of sides a and b supports modes sin(m pi x / a) x sin(n pi y / b) at frequency (v/2) x sqrt((m/a)^2 + (n/b)^2). On a square, the (1,2) and (2,1) modes share one frequency, so square membranes beat and swirl as rectangles do not.

Good uses

  • Verify a textbook formula: set a fixed-fixed string, pluck it, and check that the animated nodes sit at the predicted x = kL/n positions before trusting the math elsewhere.
  • Experiment with excitation points the way instrument makers do: pluck at the center to remove every even partial, or pluck close to a node of one mode and watch that mode weaken.
  • Compare boundary conditions directly: flip one end of the string from fixed to free, or run the same membrane with fixed versus free edges, and watch the node pattern and the fundamental pitch change together.

Limits and checks

  • The numbers are self-consistent rather than calibrated: frequency comes out in units matching the length and speed you enter, so a length of 1 and speed of 2 yield 1 Hz only if the units are meters and meters per second.
  • The animation is a numerical approximation, not the exact solution. On a coarse grid, high harmonics blur or destabilize and measured frequencies drift from n x v/(2L); check a low mode against the formula before trusting the picture.
  • The first frames show traveling waves, not standing ones. The standing pattern builds only after reflections cross the domain, so a pulse early in the animation is correct physics - and any mode whose node sits at your excitation point will simply never appear.

Common questions

I plucked at the exact center and the second harmonic never appears. Is that a bug?

No - symmetry forces it. Every even mode of a fixed-fixed string has a node at the midpoint, and an excitation that never moves the string there cannot drive those modes. Only the odd harmonics ring. Move the pluck off-center and the even harmonics come back.

If I set one end to 'free', shouldn't the string stay motionless there?

No - free means unclamped, not pinned. A free end keeps zero slope, so it moves, and every mode has an antinode at it; a fixed end, by contrast, is a node. Toggle the boundary and both the visible shape and the fundamental frequency change, because the allowed wavelengths change.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools