Conical: an extended module for computing a numerically satisfactory pair of solutions of the differential equation for conical functions
T. M. Dunster, A. Gil, J. Segura, N. M. Temme

TL;DR
This paper introduces an extended computational module for conical functions, enabling accurate calculation of a new companion function crucial for solving boundary value problems in conical domains.
Contribution
The paper presents an extension to the CONICAL module, adding routines to compute a new numerically satisfactory conical function for improved problem-solving.
Findings
Provides a routine for computing ${R}^{m}_{-rac{1}{2}+i au}(x)$
Enables solving Dirichlet problems in conical domains
Enhances the computational tools for conical functions
Abstract
Conical functions appear in a large number of applications in physics and engineering. In this paper we describe an extension of our module CONICAL for the computation of conical functions. Specifically, the module includes now a routine for computing the function , a real-valued numerically satisfactory companion of the function for . In this way, a natural basis for solving Dirichlet problems bounded by conical domains is provided.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Conical: an extended module for computing a numerically satisfactory pair of
solutions of the differential equation for conical functions
T.M. Dunster
A. Gil
J. Segura
N.M. Temme
Department of Mathematics and Statistics. San Diego State University. 5500 Campanile Drive San Diego, CA, USA.
Depto. de Matemática Aplicada y Ciencias de la Comput. Universidad de Cantabria. 39005-Santander, Spain
Depto. de Matemáticas, Estadística y Comput. Universidad de Cantabria. 39005-Santander, Spain
IAA, 1825 BD 18, Alkmaar, The Netherlands111Former address: CWI, 1098 XG Amsterdam, The Netherlands
Abstract
Conical functions appear in a large number of applications in physics and engineering. In this paper we describe an extension of our module Conical [1] for the computation of conical functions. Specifically, the module includes now a routine for computing the function , a real-valued numerically satisfactory companion of the function {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) for . In this way, a natural basis for solving Dirichlet problems bounded by conical domains is provided.
The module also improves the performance of our previous algorithm for the conical function {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) and it includes now the computation of the first order derivative of the function. This is also considered for the function in the extended algorithm.
††journal: Computer Physics Communications
1 Introduction
Conical or Mehler functions are involved in a large number of applications in different areas of physics. In particular, these functions appear when solving the Laplace equation in spherical coordinates for two intersecting cones [2] or for regions bounded by two intersecting spheres, or by one or two confocal hyperboloids of revolution when using toroidal coordinates.
An extended version of our module Conical [1] for the computation of conical functions is presented in this paper. The new module includes now a routine for computing the function , a real-valued numerically satisfactory companion of the function {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) for . The module also improves our previous algorithm for the conical function {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) by considering now more cofficients in some of the asymptotic expansions used for computing the function in the region . The computation of the first order derivatives of {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) and is also included in the new module.
2 Theoretical background
Conical functions are solutions of the second order differential equation
[TABLE]
We will restrict to integer positive values of the parameter ().
When , a real-valued satisfactory pair of solutions of (1) is and . Both functions can be computed using our algorithm for implemented in conicp; for computing the following relation can be used
[TABLE]
When , a real-valued satisfactory pair of solutions of (1) is and (the function is complex-valued).
The Wronskian relation for and , useful for testing, is given by
[TABLE]
The algorithm for computing the conical function was described in [1]. In the new module Conical we also compute the first order derivatives for {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) and : the first order derivative of {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) can be obtained using the relation
[TABLE]
The first order derivative of satisfies the same relation (4) with {\rm R}^{m+1}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) and {\rm R}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x).
A preliminary algorithm for computing the function was presented in [3] although the final algorithm in finite precision arithmetic implemented in the routine conicr presents some differences with respect to the first algorithm. We have also changed the notation of the function with respect to the one used in that reference; we are using now instead of for simplicity.
Next we summarize the methods for computing the conical function .
2.1 Computation of for values of close to
2.1.1 Small or moderate values of
To compute and we will use the expansions
[TABLE]
where and are given by
[TABLE]
and .
The only complex quantity in (5) is the function \psi({{\lower 2.58334pt\hbox{\scriptstyle 1}}\over{\raise 2.1097pt\hbox{\scriptstyle 2}}}+i\tau). For computing this function we use an algorithm which computes separately the real and imaginary parts of \psi({{\lower 2.58334pt\hbox{\scriptstyle 1}}\over{\raise 2.1097pt\hbox{\scriptstyle 2}}}+i\tau) avoiding, in this way, the use of complex arithmetics when computing (5). The algorithm is based on the use of the asymptotic expansion
[TABLE]
valid for in . We use this expansion if with terms of the series (or less), and we use the recurrencence relation for smaller values of .
When we will use the recursion relation
[TABLE]
in the direction of increasing .
2.1.2 Large values of
A representation in terms of Kummer functions is used in this case:
[TABLE]
where , and is given by
[TABLE]
The functions are given in terms of Kummer functions as follows
[TABLE]
The functions can be also written in terms of the Hankel functions . This representation makes simple separating the real and imaginary parts of by using
[TABLE]
For the computation of the Bessel functions , we use an algorithm which combines the use of series expansions, Debye’s asymptotic expansions, asymptotic expansions for large , Airy-type asymptotic expansions and three-term recurrence relations. This algorithm is implemented in the module BesselJY and it is also included in the software package.
The functions , are given by
[TABLE]
For computing for we can use a recurrence relation for the Kummer functions which gives
[TABLE]
From this, the following recurrence relations for both the real and imaginary parts of can be obtained:
[TABLE]
The first coefficients in (9) are given by
[TABLE]
where and .
2.2 Computation of for moderate or large values of
In this case we use the expansion
[TABLE]
where is given in eq.(10), ,
[TABLE]
and
[TABLE]
We can compute , and from the recurrence relations
[TABLE]
with , , .
The real part of (17) can be obtain by writing
[TABLE]
which gives
[TABLE]
where
[TABLE]
The computation of the ratio of two gamma functions in (18) is made using an algorithm for computing the gamma function for complex values of the argument. The algorithm adapts for complex arguments the scheme used for real values described in [4].
3 Overview of the software structure
The Fortran 90 package includes the main module Conical, which includes the routines conicp, conicr and conicpr.
In the module Conical, the auxiliary module Someconstants is used. This is a module for the computation of the main constants used in the different routines. The module BesselJY (for the computation of Bessel functions) and AiryFunction (for the computation of Airy functions) are used. The routines included in auxil.f90 are also used in the module Conical.
4 Description of the individual software components
The Fortran 90 module Conical includes the public routine conicp, which computes the conical functions for , and ; the routine conicr, which computes the function , for , and and the routine conicpr, which computes both functions , and their first order derivatives for , and . The calling sequences of these routines are
CALL conicp(x,mu,tau,pm,ierr)
where the input data are: , and (arguments of the functions). The outputs are the error flag and the function value . The possible values of the error flag are: , successful computation; , computation failed due to overflow/underflow; , arguments out of range.
CALL conicr(x,mu,tau,rm,ierr)
where the input data are: , and (arguments of the functions). The outputs are the error flag and the function value . The possible values of the error flag are: , successful computation; , computation failed due to overflow/underflow; , arguments out of range.
CALL conicpr(x,mu,tau,pm,pmd,rm,rmd,ierr)
where the input data are: , and (arguments of the functions). The outputs are the error flag , the function values , and the first order derivatives , . The possible values of the error flag are: , successful computation; , computation failed.
5 Testing the algorithm
For testing the accuracy of the expansions used to compute the conical function , we have first checked (8) written in the form
[TABLE]
This check fails close to the zeros of ; in this case, we can consider the alternative test
[TABLE]
Because the zeros of and are interlaced, both tests will not fail simultaneously. We can therefore take the minimum of both errors. We have considered these tests for the expansions described in sections 2.1.2 ( small) and 2.2 ( large). Figure 1 shows the points where the minimum value of the error of the tests (24) and (25) when using (9) is greater than . In the algorithm, we have fixed to the number of terms used in the expansion. Random points have been generated in the domain . As can be seen, for (upper figure) the use of the expansion (9) allows to compute the function values with an accuracy better than for values of greater than when is close to . The accuracy of the expansion worsens as increases, as can be seen also in Figure 1 (lower figure) where the same test is considered for . Therefore, one has to use an alternative method of computation for moderate/large values of as, for example, the use of the recurrence relation (8) starting from and .
Figure 2 shows the same tests (24) and (25) for the expansion (17) and for . The domain where the random points have been generated is now . As can be seen in the figure, there is some loss of accuracy when is large and is moderate/large. In any case, we have checked that the accuracy was always better than .
For testing the expansions for and of section 2.1.1, we have used the Wronskian relation given in (3). In this case, we have
[TABLE]
Figure 3 shows the points where the value of the error in the Wronskian relation (26) is greater than .
The accuracy of the final algorithm for has been tested by computing the Wronskian relation given in (3) for a very large number of random points in the parameter domain . The algorithm for the conical function {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x) was improved by considering more cofficients in some of the asymptotic expansions used for computing the function in the region . We have checked that the accuracy of the Wronskian test (3) is close to in the whole parameter domain and better than for a large fraction of the tested parameter values.
6 Test run description
The Fortran 90 test program testcon.f90 includes the computation of 20 values of the functions {\rm P}^{m}_{-{{\lower 1.80835pt\hbox{\scriptstyle 1}}\over{\raise 1.50693pt\hbox{\scriptstyle 2}}}+i\tau}(x), and their first order derivatives and their comparison with the corresponding pre-computed results.
7 Acknowledgements
A.G. acknowledges the Fulbright/MEC Program for support during her stay at SDSU. J.S. acknowledges the Salvador de Madariaga Program for support during his stay at SDSU. The authors acknowledge financial support from Ministerio de Ciencia e Innovación, project MTM2015-67142-P. NMT thanks CWI, Amsterdam, for scientific support.
References
- [1]
A. Gil, J. Segura, N. M. Temme, Comput Phys Commun 183 (2012) 794–799.
- [2]
E. Thebault, J. Schott, M. Mandea, J. Geophys. Research: Solid Earth 111 (2006) B1.
- [3]
T. M. Dunster, A. Gil, J. Segura, N. Temme, Numer. Algo. 68 (2015) 497–509.
- [4]
A. Gil, J. Segura, N. Temme, Comput. Phys. Commun. 191 (2015) 132–139.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] A. Gil, J. Segura, N. M. Temme, Comput Phys Commun 183 (2012) 794–799.
- 2[2] E. Thebault, J. Schott, M. Mandea, J. Geophys. Research: Solid Earth 111 (2006) B 1.
- 3[3] T. M. Dunster, A. Gil, J. Segura, N. Temme, Numer. Algo. 68 (2015) 497–509.
- 4[4] A. Gil, J. Segura, N. Temme, Comput. Phys. Commun. 191 (2015) 132–139.
