- #1
TheCanadian
- 367
- 13
Hi, I was recently following an example shown in this link and just had a couple questions:
http://www.scientificpython.net/pyb...e-equation-and-making-a-video-of-the-solution
I believe I understand the steps, but was just not quite understanding the justification. In the link above, to compute values at i = 0 and/or j = 0, the terms corresponding to u at i-1 and j-1 disappear and the terms at i+1 and j+1, respectively, are doubled. The same thing is done at the end of the boundary where i = n and/or j = m; values for i+1 and j+1, respectively, are removed and the existing terms doubled. I was just wondering why exactly the author did this and the error involved in doing so? These values simply don't exist on the grid as they are outside the domain, but are there any alternative approaches possible?
Also, would you happen to have any suggestions for better methods than the central difference scheme shown in the link for solving a 2-dimensional (or higher) wave equation?
http://www.scientificpython.net/pyb...e-equation-and-making-a-video-of-the-solution
I believe I understand the steps, but was just not quite understanding the justification. In the link above, to compute values at i = 0 and/or j = 0, the terms corresponding to u at i-1 and j-1 disappear and the terms at i+1 and j+1, respectively, are doubled. The same thing is done at the end of the boundary where i = n and/or j = m; values for i+1 and j+1, respectively, are removed and the existing terms doubled. I was just wondering why exactly the author did this and the error involved in doing so? These values simply don't exist on the grid as they are outside the domain, but are there any alternative approaches possible?
Also, would you happen to have any suggestions for better methods than the central difference scheme shown in the link for solving a 2-dimensional (or higher) wave equation?