A Byte of PhysicsLogo

Waves as propagating data

A wave simulation is changing data indexed by position and time. The line on screen is one rendering of samples; it is not the solver. Separating these jobs is what lets a reader inspect boundaries, accuracy, energy drift, and stability instead of trusting a convincing animation.

Think like a programmer

Represent a one-dimensional field as an array with a declared spatial step Δx. For a physical string, keep both displacement and velocity arrays; for an analytic fixture, compute samples from a function without pretending it is a numerical solve. Rendering reads a snapshot and never owns the state transition.

Model checklist

Inputs
Domain length, sample count, Δx, Δt, wave speed c, initial displacement and velocity, boundary rule, and update method.
State
Displacement and velocity samples, elapsed time, boundary cells, and diagnostic history.
Rule
Advance samples from neighbouring values or evaluate a declared analytic solution, then enforce boundaries.
Output
Field snapshot, propagation speed estimate, boundary behavior, energy-like diagnostic, and error versus a fixture.
Check
Changing sample count at fixed domain converges toward the same intended speed; boundaries satisfy their rule after every step; time step stays within the method's stability limit.

An analytic travelling-wave fixture is

\[y(x,t)=A\sin(kx-\omega t),\qquad v=\frac{\omega}{k}=\lambda f\]

Its amplitude A changes vertical scale, k sets spatial repetition, and ω sets temporal repetition. A fixed phase such as kx − ωt = 0 moves at ω/k. That makes a good test oracle: sample at two known times, estimate crest displacement, and compare it with the chosen speed. It does not by itself solve a string, because it contains no array coupling, boundaries, or numerical error.

Wave data sampler

Adjust amplitude and wavelength. The plotted line is a view of sampled displacement data; its speed is frequency divided by wave number.

Amplitude 1.0; wavelength 3.0 m; model speed 1.91 m/s.

A minimal finite-difference string model has a different contract. Its acceleration at cell i is proportional to the curvature inferred from neighbours, approximately (y[i+1] − 2y[i] + y[i−1]) / Δx². Integrate that acceleration into velocity and displacement, then overwrite or otherwise enforce endpoint values according to the boundary model. Store Δx, Δt, and the chosen integrator with every output. If an update becomes unstable, a rapidly growing line is evidence of an invalid numerical configuration, not dramatic physics.

Try this experiment

Prediction: Changing amplitude changes an ideal profile's displacement scale but not its phase speed; refining a stable numerical grid should improve agreement with the same analytic fixture.

Use the sampler to double amplitude while holding frequency and wavelength fixed. Then outline the two arrays a string solver needs, the neighbour values used for an interior-cell update, and the assertion for a fixed left endpoint. Finally state which configuration values must be saved to repeat the run.

Where this model breaks

An analytic sinusoid assumes an unbounded, linear, lossless, single-frequency wave. A discrete string can add boundaries and initial conditions but also introduces grid dispersion, time-step limits, roundoff, and numerical damping or growth. Real media may be nonlinear, inhomogeneous, dispersive, lossy, multidimensional, or coupled to other fields. A sampled displacement line does not show unrendered velocity, energy, or uncertainty.

Summary

Store waves as position-indexed state, keep the update rule independent from rendering, and use analytic waves as fixtures rather than substitutes for a solver. Validate speed, boundaries, stability, and refinement from data before interpreting a plot.

Glossary

Self-check

  1. Which state arrays does a physical string model usually need?
  2. Which parameter sets spatial repetition in an analytic sinusoid?
  3. Why is an analytic travelling wave a useful test fixture but not a string solver?
  4. Which values must be recorded to reproduce a numerical run?

Sources

Model contract

Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.

\[\text{observable output} = f(\text{inputs},\,\text{state})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

For Waves as Propagating Data, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Waves I — Mechanical Waves, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.

Guided experiment

Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.

Where this model breaks

This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.

Summary

Treat Waves as Propagating Data as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Waves as Propagating Data into a test

Represent a wave as sampled state over space and keep its rendering separate from the update rule.

  1. Name the inputs and units that the waves i — mechanical waves model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: