String simulation
The wave equation solved step by step, on a string you pluck with the mouse.
- Status
- live
- Year
- 2024
- Built with
- Svelte · Canvas
Why
I was looking at my guitar thinking that I could not describe what happens on a plucked string. I wrote an article to understand it, and this simulation to check that I had.
How
The string is cut into points. At each time step, the acceleration of a point comes from the local curvature (that is the wave equation in finite differences), plus damping. The wave speed is fixed at 200 m/s and the time step is derived from the space step so that the scheme stays stable. You set the number of points, the damping and the number of steps computed per frame, and you draw the starting shape with the mouse.