Following from some of the other physical simulations I'd made with some friends, in January 2019 we decided to make a simulation of a vibrating string. The string is modelled as hundreds of separate segments joined end to end - one for each pixel. At first, to make the equations simpler, we assumed the nodes joining the segments could only move up and down, but we later improved this to allow for sideways movement. I also later added the ability to grab and drag the string. As with our other simulations, we used the forward Euler method to approximate the solution to the differential equations.

There is a glitch which occurs if you shake the string violently or set a high modulus of elasticity - I reckon it's an overflow error, but I'm going to look into it more.



To do

Related projects