Program listing fd5.m has an error. The correction is detailed in the errata section for this book.
Also, many of the programs in chapter 9 require the function get_ijk(…).m. This program is found in the folder of programs for chapter 8 on the John Wiley website.
Please see the Errata page under Numerical Electrostatics. Errors in the listing of program fem_2d_1.m are corrected
Equations 3.13 on page 55 shows the creation of an “extra” row and column in the Lij coefficient set for the reference voltage Vr in order to guarantee charge neutrality. In equations 3.13, the extra row and column terms are all set = 1 (except for the diagonal term = 0). Inspection of these equations shows that the value 1 is arbitrary – any number would suffice.
I was experimenting with different values of this number in order to see if the numerical solution accuracy would vary due to these choices. One of the choices I tried was L11. My conclusion was that the choice of this value doesn’t matter at all (non-zero choices of course).
Unfortunately, I forgot to take the experiment out of the program code. In program mom1.m (listed on pages 73-74) new_col and new_row are set = L11. The good news is that, since the value doesn’t matter, the program runs correctly. The bad news is that this is an unfortunate oversight.
In the listing on page 74, if we set
new_col = ones(nr_vars,1)
then the program listing will agree with equations 3.13. As explained above, the resulting solution set (q) won’t change at all.
As of April 9, 2014, www.lawrencedworsky.com is up. The content is preliminary, but everything seems correct and functional.