<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2020-05-30T00:28:36.113Z
2020-05-30T17:11:26.863Z
2020-05-30T17:11:26.863Z
Nathan Reed
<p>I'm trying to produce wave surface animations, and I came across this paper: <a href="https://www.researchgate.net/publication/220859148_Fast_Water_Animation_Using_the_Wave_Equation_with_Damping" rel="nofollow noreferrer">Fast_Water_Animation_Using_the_Wave_Equation_with_Damping</a>.  In the paper they go to provide the following equation:</p>

<p><a href="https://i.sstatic.net/yCvdb.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yCvdb.png" alt="enter image description here"></a></p>

<p>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 <em>positive</em> 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 <em>the average of the surrounding samples minus the current sample</em>.  </p>

<p>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)
<a href="https://i.sstatic.net/ypr9B.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ypr9B.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/bWYit.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bWYit.png" alt="enter image description here"></a></p>

<p>This is what I changed the equation to:</p>

<p><a href="https://i.sstatic.net/34hPn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/34hPn.png" alt="enter image description here"></a></p>

<p>Was this just some pervasive typo or am I completely missing something here? </p>

<rendering><simulation><fluid-sim><height-field>
Finite difference wave equation shown in paper is wrong?
Krupip
# Finite difference wave equation shown in paper is wrong?

(Asked by: username_0 on 2020-05-29)

I'm trying to produce wave surface animations, and I came across this paper: [Fast\_Water\_Animation\_Using\_the\_Wave\_Equation\_with\_Damping](https://www.researchgate.net/publication/220859148_Fast_Water_Animation_Using_the_Wave_Equation_with_Damping). In the paper they go to provide the following equation:

[![enter image description here](https://i.sstatic.net/yCvdb.png)](https://i.sstatic.net/yCvdb.png)

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](https://i.sstatic.net/ypr9B.png)](https://i.sstatic.net/ypr9B.png)

[![enter image description here](https://i.sstatic.net/bWYit.png)](https://i.sstatic.net/bWYit.png)

This is what I changed the equation to:

[![enter image description here](https://i.sstatic.net/34hPn.png)](https://i.sstatic.net/34hPn.png)

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

**Tags:** rendering, simulation, fluid-sim, height-field


---

## 1 answers

### Answer by username_1 on 2020-05-30. Score: 4 | Accepted answer

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.


---

