Evaluation of toroidal harmonics. J. Segura, A. Gil.

PROGRAM SUMMARY
Title of program: DTORH1, DTORH2, DTORH3
Catalogue identifier: ADKV
Ref. in CPC: 124(2000)104
Distribution format: tar gzip file
Operating system: UNIX, Linux
Number of lines in distributed program, including test data, etc: 1439
Keywords: General purpose, Function, Toroidal harmonics, Legendre functions, Laplace's equation, Toroidal coordinates.
Programming language used: Fortran
Computer: HP Model 715/100 , SUN Enterprise 3000 , PC Pentium MMX 200MHz .

Nature of physical problem:
We include three codes to evaluate toroidal harmonics:

The algorithms find their application in problems with toroidal geometry. In particular, the potential problem for a torus is solved using both Ps and Qs.

Method of solution
The codes are based on the application of recurrence relations both over m and n. The recurrence over n is applied forward for the Ps and backward for the Qs while, over m, the situation is the contrary: the Ps are evaluated backwards and the Qs forward. The forward and backward recursions (over n or over m) are linked through continued fractions for the ratio of minimal solutions and Wronskian relations. The recurrences are fed with the two starting values Q0(1/2) and Q1(-1/2), which are evaluated using Carlson's duplication formula for elliptic integrals.

Restrictions on the complexity of the problem
The maximum degree (order) that can be reached with our method, for a given order (degree) m (n) and for a fixed real positive value of x, is provided by the maximum real number defined in our machine. The user can choose two different relative accuracies (10**-8 or 10**-12) in the interval 1.001 < x < 1000 for all available values of the orders and degrees. For more details see text: LONG WRITE-UP, section 3.

Typical running time
Depends on the values of the argument x, the orders (m) and the degrees (n). As an example, to evaluate the set {Pm(n-1/2)(1.1), Qm(n-1/2)(1.1), m = 0,...,10, n = 0,...,50,} the code DTORH3 spends 2.6 ms in a HP 715/100. For more details see text: LONG WRITE-UP, section 5.