Boundaries determine how a field interacts with a domain edge: it may be fixed, free, absorbing, periodic, or connected to another model. They are physical assumptions and numerical rules at the same time. An unexpected reflection often comes from an unrecorded edge policy, not a new discovery in the interior equations.
For a fixed string endpoint at x = 0, displacement is constrained by
An incident displacement pulse on an ideal fixed string reflects with inversion so the sum remains zero at the endpoint. A free string end instead has approximately zero spatial slope, while a periodic computational domain identifies opposite edges. These are different rules and should never share an undocumented default. In a two-dimensional grid, periodic wrapping means an out-of-range index is mapped with modular arithmetic; a fixed-zero policy instead supplies zero outside the finite domain.
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.
The wave sampler is an analytic view, not a boundary solver. A solver must make edge state visible. For a fixed endpoint, assert the first and last displacement cells immediately after every update. For a periodic grid, assert that a neighbour read left of index zero returns the last column, and test it with distinct values rather than a symmetric pattern that could conceal an indexing error.
Prediction: A fixed string end reflects displacement with inversion; periodic wrapping returns the opposite edge's state without changing the interior stencil.
Write tests for the first and last cells of a fixed-end string after one update. Put distinct values in the leftmost and rightmost grid cells, then state the expected read at index−1 for fixed-zero and wrap policies. Explain why an absorbing boundary needs a measured reflection diagnostic rather than a label.Boundaries are model inputs and part of numerical reproducibility. Implement them explicitly after the interior update, test them with asymmetric fixtures, and separate a known constraint from an approximate absorber or physical interface.
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})\]For Boundary Conditions, 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.
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.
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.
Treat Boundary Conditions 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.
Treat edge behavior as explicit, testable model input for a numerical wave solver.