Possible Typo


ricky
03-07-2003, 08:55 PM
Hello:

I would like to ask whether or not there is a possible typo in Figure 19.0.3 (Page 832 of the NR in C, 2nd ed.). Based on the setup in equations 19.0.4 to 19.0.9, it seems that the matrix should have (J-1) blocks going down and (J-1) blocks going across. In addition, it seems that each block should be
(L-1) X (L-1). However, these are stated as (J+1) blocks going down and (J+1) blocks going across, and each block is stated
as being (L+1) X (L+1).

It seems that if you take the boundary conditions into consideration, we will have (J-1)(L-1) unknowns in this system, and so the matrix may need to have the dimensions I mentioned.

Certainly, I could be be incorrect, and I can only ask for your pardon in that case. If you can respond to this inquiry, I would appreciate it.

Thank you,

Ricky

Saul Teukolsky
03-10-2003, 01:35 PM
Hi Ricky,

You're right there's a problem with the labeling of Fig. 19.0.3, but it's not a simple typo.

The text refers to "...boundary points where either u or its derivative has been specified." In the case where u is specified on the boundary, then pulling the known information over to the rhs leaves the equation to be evaluated only at the interior points. In this case there are J-1 blocks along each dimension of the figure, each block (L-1)x(L-1), as you point out.

In the case where the normal derivative of u is specified on the boundary, one would evaluate the equation on the boundary as well, and use the derivative condition to replace points outside the grid, such as points with index -1 or J+2. For example, du/dy=f(x) at y=0 would give

u(j,1) - u(j,-1) = 2\delta f(j)

In this case the figure would be labeled correctly: J+1 blocks along each dimension, each (L+1)x(L+1).

We'll try to get the labeling fixed in a future reprinting - thanks for writing.

Saul Teukolsky

ricky
03-10-2003, 01:50 PM
Hello:

Thank you for the reply. That clarifies the situation for me.

Cheers,
Ricky