finite difference method for wave equation

https://chrisboligprojects.pythonanywhere.com/fdm

FDM matrices update the mesh based on user applied energy and initial conditions. Before every animation loop, a color map is applied based on high and low values. Starts out with Dirichlet boundary conditions (completely reflective, like a string tied to a wall) or you can choose the Nuemann conditions where the mesh is free to move

4 Likes

It is nice.

And it was fun to disturb the symmetry with applying just a few hits. I waited for quite some time to see it calm down, but it appears the energy is not lost, so boiling continues forever…

A small glitch: when the page is reloaded, the checkboxes keep their latest state, but the simulation is reset. So it may happen that [animation] is checked, but there is no animation, as well as [wire frame] is unchecked, but it is actually drawn.

1 Like

hmm, yes that is definitely a glitch…

I tried to keep as true to the math as I could. I think each “hit” or disturbance we need their own (e^-t) attached to it, where t is the “time” the hit occurred. I think that would make the amplitudes decay. I’m sure it’s doable, and probably worth while. Hopefully I’ll add that soon!

(also, I think it would be so neat if you could drag and deform the mesh, and then let it go…)

Thanks for looking at it!

1 Like

Your simulation reminds me of this (you can click on the water surface or drag the ball to cause waves): https://madebyevan.com/webgl-water/

2 Likes