Abstract
This is a revised and updated version of a modern Fortran 90 code to compute the regular Plm(x) and irregular Qlm(x) associated Legendre functions for all x∈(−1,+1) (on the cut) and |x|>1 and integer degree (l) and order (m). The necessity to revise the code comes as a consequence of some comments of Prof. James Bremer of the UC//Davis Mathematics Department, who discovered that there were errors in the code for large integer degree and order for the normalized regular Legendre functions on the cut. New version program summaryProgram Title: Associated Legendre FunctionsProgram Files doi:http://dx.doi.org/10.17632/29j2mvwgwt.1Licensing provisions: GPLv2Programming language: Fortran 90Does the new version supersede the previous version?: YesJournal reference of previous version: Comput. Phys. Commun. 181 (2010) 2091Reason for new version: The necessity to revise the code comes as a consequence of some comments of Prof. James Bremer of the UC//Davis Mathematics Department, who discovered that there were errors in the code for large integer degree and order for the normalized regular Legendre functions on the cut. This occurred because renormalization of the un-normalized functions involved the manipulation of factorials of large integer value. The problem was solved by a direct computation of the normalized functions from a revised recursion formula. This completely avoids the manipulation of the factorials that were present in the first version. In re-examining the code we also noticed that there were cases for large degree, order and argument that led to overflows causing the results to display infinities or NaN when printed out, without crashing. There does not appear to be any good approach, other than resorting to extended precision arithmetic, to cure this pathology. Since it was not our original intention to provide such a code, all we can do is to point out that this can happen and that the user should take care not to blindly accept the results of the computation for large degree and order. We have not found a general approach to predict in advance when this will occur in this three dimensional parameter space.Summary of revisions: None of the basic algorithms has been changed. We have eliminated the computation of factorials for large integer values and now calculate the normalized regular Legendre functions on the cut (-1,+1) directly from the recursion relation for those functions rather than computing the unnormalized functions and then normalizing after the computation. This required some modifications of the original Fortran subroutines as well as the addition of a new module.Nature of problem: Compute the regular and irregular associated Legendre functions for integer values of the degree and order and for all real arguments. The computation of the interaction of two electrons, 1∕|r1−r2|, in prolate spheroidal coordinates is used as one example where these functions are required for all values of the argument and we are able to easily compare the series expansion in associated Legendre functions and the exact value.Solution method: The code evaluates the regular and irregular associated Legendre functions using forward recursion when |x|<1 starting the recursion with the analytically known values of the first two members of the sequence. For values of the argument |x|<1, the upward recursion over the degree for the regular functions is numerically stable. For the irregular functions, backward recursion must be applied and a suitable method of starting the recursion is required. The program has two options; a modified version of Miller’s algorithm and the use of the wronskian relation between the regular and irregular functions, which was the method considered in [1]. Both approaches require the computation of a continued fraction to begin the recursion. The wronskian method (which can also be described as a modified Miller’s method) is a convenient method of computations when both the regular and irregular functions are needed.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.