The Python script simulates the behavior of a plucked, oscillating string using the Finite Difference Method (FDM) to solve the one-dimensional wave equation. The simulation features mixed boundary conditions: a fixed end at $x=0$ (Dirichlet) and a mass-loaded end at $x=L$. This dynamic boundary condition, derived from Newton's Second Law applied to the ring $\left(m u_{t t}=-S u_x\right)$, is numerically implemented to show how the ring's inertia influences wave reflection. Crucially, the mass of the ring ( $M_{R I N G}$ ) acts as a tunable parameter; a large mass causes the wave to reflect as if the end were fixed (inverted), while a negligible mass results in a free-end reflection (upright, or Neumann condition). The simulation tracks the string's displacement over time and uses Matplotlib to generate an animation visualizing this wave propagation and the dynamic motion of the red mass marker at the end.

Narrated Video

using the Finite Difference Method to solve the 1D wave equation with the mass-loaded boundary condition-L.mp4

🪔Thought-Provoking

The Secret of the Sliding Ring: Deriving a Wave Boundary Condition

🗒️how a mass-loaded string endpoint leads to a specific type of boundary condition for the wave equation