usage of program sphoot (p. 780)
apatruduque
06-18-2002, 02:41 AM
I was trying to run the example program that uses shooting to compute eigenvalues of spheroidal harmoics (p. 780). The thing is that it compiles OK but the only message I can get from the program is:
shoot failed: bad initial guess
I've tryed changing the initial guess (v[1]) but i allways get the same message. We have the subroutines from the 1992 release. I've also looked for possible erratas but found nothing. Is this a bug related to an old release? what am I doing wrong...?
thanks in advance for your help.
William Vetterling
06-18-2002, 07:56 AM
Actually, the program sphoot has been a very solid performer, and I believe the 1992 version works fine. The error message you are seeing results when the call to the subroutine newt(), the n-dimensional root finder, fails to converge. Personally, I have never seen this happen in sphoot(), but there are unquestionably some isolated input values that will trigger this condition. I do not think you will stumble on them by accident.
This suggest to me that one or more of the routines that sphoot() uses may have been modified in your copy. (I am presuming that you are working with one of our code distributions and not with code you have entered manually. In the latter case, all bets are off!).
The routines involved are newt(), fdjac(), lnsrch(), fmin(), ludcmp() and lubksb(), shoot(). It is possible that in the 10 years that you have had the code, someone may have accidentally or purposefully modified one or more of these. I recommend that you check the file-modification dates to see if they are all the same. If you have a version of the Recipes that allows you to extract a fresh, unmodified copy of the routines from an archive file, then do so for each routine. If not, then you might try the Example Routines xnewt, xludcmp, xlubksb to check the fundamental operation of the routines newt(), ludcmp() and lubksb().