4
$\begingroup$

I'm trying to produce wave surface animations, and I came across this paper: Fast_Water_Animation_Using_the_Wave_Equation_with_Damping. In the paper they go to provide the following equation:

enter image description here

At first I just blindly implemented this, but soon saw some strange bugs I realized weren't from me. When you evaluate the equation, say, with delta t = 1/60, delta x = 1, c = 0.01, and k = 1.0, on a grid with all zeros except the center point, you realize there's something off about this. If you are at that center grid point, and say your value is 1.0, the acceleration component( the delta t^2 stuff in the above equation) is positive when you assume all the surrounding neighbors are zero. That makes no sense. Peaks in waves do not accelerate upwards when the values around them are smaller. And further more, normally when I see finite difference of the laplacian, it is the average of the surrounding samples minus the current sample.

Indeed, when I reverse the sign on the acceleration component, I get what appears to be the correct result (before vs after on 16x16 grid) enter image description here

enter image description here

This is what I changed the equation to:

enter image description here

Was this just some pervasive typo or am I completely missing something here?

$\endgroup$

1 Answer 1

4
$\begingroup$

Yes, it looks like a sign error in the paper. It looks like it was introduced in equation (4) and then carried through the following ones.

Probably the authors wrote the source code first and the paper after, so did not notice that their equations did not match what their code was doing. Ideally it should have been caught in the paper review, but, mistakes happen.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.