Blame doc/specfunc-mathieu.rst

Packit 67cb25
.. index:: Mathieu functions
Packit 67cb25
Packit 67cb25
The routines described in this section compute the angular and radial
Packit 67cb25
Mathieu functions, and their characteristic values.  Mathieu
Packit 67cb25
functions are the solutions of the following two differential
Packit 67cb25
equations:
Packit 67cb25
Packit 67cb25
.. only:: not texinfo
Packit 67cb25
Packit 67cb25
   .. math::
Packit 67cb25
Packit 67cb25
      {{d^2 y}\over{d v^2}}& + (a - 2q\cos 2v)y  = 0 \\
Packit 67cb25
      {{d^2 f}\over{d u^2}}& - (a - 2q\cosh 2u)f  = 0
Packit 67cb25
Packit 67cb25
.. only:: texinfo
Packit 67cb25
Packit 67cb25
   ::
Packit 67cb25
Packit 67cb25
      d^2y/dv^2 + (a - 2q\cos 2v)y = 0
Packit 67cb25
      d^2f/du^2 - (a - 2q\cosh 2u)f = 0
Packit 67cb25
Packit 67cb25
The angular Mathieu functions :math:`ce_r(x,q)`, :math:`se_r(x,q)` are
Packit 67cb25
the even and odd periodic solutions of the first equation, which is known as Mathieu's equation. These exist
Packit 67cb25
only for the discrete sequence of  characteristic values :math:`a = a_r(q)`
Packit 67cb25
(even-periodic) and :math:`a = b_r(q)` (odd-periodic).
Packit 67cb25
Packit 67cb25
The radial Mathieu functions :math:`Mc^{(j)}_{r}(z,q)` and
Packit 67cb25
:math:`Ms^{(j)}_{r}(z,q)`
Packit 67cb25
are the solutions of the second equation,
Packit 67cb25
which is referred to as Mathieu's modified equation.  The
Packit 67cb25
radial Mathieu functions of the first, second, third and fourth kind
Packit 67cb25
are denoted by the parameter :math:`j`, which takes the value 1, 2, 3
Packit 67cb25
or 4.
Packit 67cb25
Packit 67cb25
.. The angular Mathieu functions can be divided into four types as
Packit 67cb25
.. @tex
Packit 67cb25
.. \beforedisplay
Packit 67cb25
.. $$
Packit 67cb25
.. \eqalign{
Packit 67cb25
.. x & = \sum_{m=0}^\infty A_{2m+p} \cos(2m+p)\phi, \quad p = 0, 1, \cr
Packit 67cb25
.. x & = \sum_{m=0}^\infty B_{2m+p} \sin(2m+p)\phi, \quad p = 0, 1.
Packit 67cb25
.. }
Packit 67cb25
.. $$
Packit 67cb25
.. \afterdisplay
Packit 67cb25
.. @end tex
Packit 67cb25
.. @ifinfo
Packit 67cb25
Packit 67cb25
.. @example
Packit 67cb25
.. x = \sum_(m=0)^\infty A_(2m+p) \cos(2m+p)\phi,   p = 0, 1,
Packit 67cb25
.. x = \sum_(m=0)^\infty B_(2m+p) \sin(2m+p)\phi,   p = 0, 1.
Packit 67cb25
.. @end example
Packit 67cb25
Packit 67cb25
.. @end ifinfo
Packit 67cb25
.. @noindent
Packit 67cb25
.. The nomenclature used for the angular Mathieu functions is :math:`ce_n`
Packit 67cb25
.. for the first solution and :math:`se_n` for the second.
Packit 67cb25
Packit 67cb25
.. Similar solutions exist for the radial Mathieu functions by replacing
Packit 67cb25
.. the trigonometric functions with their corresponding hyperbolic
Packit 67cb25
.. functions as shown below.
Packit 67cb25
.. @tex
Packit 67cb25
.. \beforedisplay
Packit 67cb25
.. $$
Packit 67cb25
.. \eqalign{
Packit 67cb25
.. x & = \sum_{m=0}^\infty A_{2m+p} \cosh(2m+p)u, \quad p = 0, 1, \cr
Packit 67cb25
.. x & = \sum_{m=0}^\infty B_{2m+p} \sinh(2m+p)u, \quad p = 0, 1.
Packit 67cb25
.. }
Packit 67cb25
.. $$
Packit 67cb25
.. \afterdisplay
Packit 67cb25
.. @end tex
Packit 67cb25
.. @ifinfo
Packit 67cb25
Packit 67cb25
.. @example
Packit 67cb25
.. x = \sum_(m=0)^\infty A_(2m+p) \cosh(2m+p)u,   p = 0, 1,
Packit 67cb25
.. x = \sum_(m=0)^\infty B_(2m+p) \sinh(2m+p)u,   p = 0, 1.
Packit 67cb25
.. @end example
Packit 67cb25
Packit 67cb25
.. @end ifinfo
Packit 67cb25
.. @noindent
Packit 67cb25
.. The nomenclature used for the radial Mathieu functions is :math:`Mc_n`
Packit 67cb25
.. for the first solution and :math:`Ms_n` for the second.  The hyperbolic
Packit 67cb25
.. series do not always converge at an acceptable rate.  Therefore most
Packit 67cb25
.. texts on the subject suggest using the following equivalent equations
Packit 67cb25
.. that are expanded in series of Bessel and Hankel functions.
Packit 67cb25
.. @tex
Packit 67cb25
.. \beforedisplay
Packit 67cb25
.. $$
Packit 67cb25
.. \eqalign{
Packit 67cb25
.. Mc_{2n}^{(j)}(x,q) & = \sum_{m=0}^\infty (-1)^{r+k}
Packit 67cb25
..       A_{2m}^{2n}(q)\left[J_m(u_1)Z_m^{(j)}(u_2) +
Packit 67cb25
..                           J_m(u_1)Z_m^{(j)}(u_2)\right]/A_2^{2n} \cr
Packit 67cb25
.. Mc_{2n+1}^{(j)}(x,q) & = \sum_{m=0}^\infty (-1)^{r+k}
Packit 67cb25
..       A_{2m+1}^{2n+1}(q)\left[J_m(u_1)Z_{m+1}^{(j)}(u_2) +
Packit 67cb25
..                               J_{m+1}(u_1)Z_m^{(j)}(u_2)\right]/A_1^{2n+1} \cr
Packit 67cb25
.. Ms_{2n}^{(j)}(x,q) & = \sum_{m=1}^\infty (-1)^{r+k}
Packit 67cb25
..       B_{2m}^{2n}(q)\left[J_{m-1}(u_1)Z_{m+1}^{(j)}(u_2) +
Packit 67cb25
..                           J_{m+1}(u_1)Z_{m-1}^{(j)}(u_2)\right]/B_2^{2n} \cr
Packit 67cb25
.. Ms_{2n+1}^{(j)}(x,q) & = \sum_{m=0}^\infty (-1)^{r+k}
Packit 67cb25
..       B_{2m+1}^{2n+1}(q)\left[J_m(u_1)Z_{m+1}^{(j)}(u_2) +
Packit 67cb25
..                               J_{m+1}(u_1)Z_m^{(j)}(u_2)\right]/B_1^{2n+1}
Packit 67cb25
.. }
Packit 67cb25
.. $$
Packit 67cb25
.. \afterdisplay
Packit 67cb25
.. @end tex
Packit 67cb25
.. @ifinfo
Packit 67cb25
Packit 67cb25
.. @example
Packit 67cb25
.. Mc_(2n)^(j)(x,q) = \sum_(m=0)^\infty (-1)^(r+k) A_(2m)^(2n)(q)
Packit 67cb25
..     [J_m(u_1)Z_m^(j)(u_2) + J_m(u_1)Z_m^(j)(u_2)]/A_2^(2n)
Packit 67cb25
.. Mc_(2n+1)^(j)(x,q) = \sum_(m=0)^\infty (-1)^(r+k) A_(2m+1)^(2n+1)(q)
Packit 67cb25
..     [J_m(u_1)Z_(m+1)^(j)(u_2) + J_(m+1)(u_1)Z_m^(j)(u_2)]/A_1^(2n+1)
Packit 67cb25
.. Ms_(2n)^(j)(x,q) = \sum_(m=1)^\infty (-1)^(r+k) B_(2m)^(2n)(q)
Packit 67cb25
..     [J_(m-1)(u_1)Z_(m+1)^(j)(u_2) + J_(m+1)(u_1)Z_(m-1)^(j)(u_2)]/B_2^(2n)
Packit 67cb25
.. Ms_(2n+1)^(j)(x,q) = \sum_(m=0)^\infty (-1)^(r+k) B_(2m+1)^(2n+1)(q)
Packit 67cb25
..     [J_m(u_1)Z_(m+1)^(j)(u_2) + J_(m+1)(u_1)Z_m^(j)(u_2)]/B_1^(2n+1)
Packit 67cb25
.. @end example
Packit 67cb25
Packit 67cb25
.. @end ifinfo
Packit 67cb25
.. @noindent
Packit 67cb25
.. where @c{$u_1 = \sqrt{q} \exp(-x)$} 
Packit 67cb25
.. @math{u_1 = \sqrt@{q@} \exp(-x)} and @c{$u_2 = \sqrt@{q@} \exp(x)$}
Packit 67cb25
.. @math{u_2 = \sqrt@{q@} \exp(x)} and
Packit 67cb25
.. @tex
Packit 67cb25
.. \beforedisplay
Packit 67cb25
.. $$
Packit 67cb25
.. \eqalign{
Packit 67cb25
.. Z_m^{(1)}(u) & = J_m(u) \cr
Packit 67cb25
.. Z_m^{(2)}(u) & = Y_m(u) \cr
Packit 67cb25
.. Z_m^{(3)}(u) & = H_m^{(1)}(u) \cr
Packit 67cb25
.. Z_m^{(4)}(u) & = H_m^{(2)}(u)
Packit 67cb25
.. }
Packit 67cb25
.. $$
Packit 67cb25
.. \afterdisplay
Packit 67cb25
.. @end tex
Packit 67cb25
.. @ifinfo
Packit 67cb25
Packit 67cb25
.. @example
Packit 67cb25
.. Z_m^(1)(u) = J_m(u)
Packit 67cb25
.. Z_m^(2)(u) = Y_m(u)
Packit 67cb25
.. Z_m^(3)(u) = H_m^(1)(u)
Packit 67cb25
.. Z_m^(4)(u) = H_m^(2)(u)
Packit 67cb25
.. @end example
Packit 67cb25
Packit 67cb25
.. @end ifinfo
Packit 67cb25
.. @noindent
Packit 67cb25
.. where @math{J_m(u)}, @math{Y_m(u)}, @math{H_m^{(1)}(u)}, and
Packit 67cb25
.. :math:`H_m^{(2)}(u)` are the regular and irregular Bessel functions and
Packit 67cb25
.. the Hankel functions, respectively.
Packit 67cb25
Packit 67cb25
For more information on the Mathieu functions, see Abramowitz and
Packit 67cb25
Stegun, Chapter 20.  These functions are defined in the header file
Packit 67cb25
:file:`gsl_sf_mathieu.h`.
Packit 67cb25
Packit 67cb25
Mathieu Function Workspace
Packit 67cb25
--------------------------
Packit 67cb25
Packit 67cb25
The Mathieu functions can be computed for a single order or
Packit 67cb25
for multiple orders, using array-based routines.  The array-based
Packit 67cb25
routines require a preallocated workspace.
Packit 67cb25
Packit 67cb25
.. type:: gsl_sf_mathieu_workspace
Packit 67cb25
Packit 67cb25
   Workspace required for array-based routines
Packit 67cb25
Packit 67cb25
.. function:: gsl_sf_mathieu_workspace * gsl_sf_mathieu_alloc (size_t n, double qmax)
Packit 67cb25
Packit 67cb25
   This function returns a workspace for the array versions of the
Packit 67cb25
   Mathieu routines.  The arguments n and :data:`qmax` specify the
Packit 67cb25
   maximum order and :math:`q`-value of Mathieu functions which can be
Packit 67cb25
   computed with this workspace.  
Packit 67cb25
Packit 67cb25
.. This is required in order to properly
Packit 67cb25
.. terminate the infinite eigenvalue matrix for high precision solutions.
Packit 67cb25
.. The characteristic values for all orders :math:`0 \to n` are stored in
Packit 67cb25
.. the work structure array element @kbd{work->char_value}.
Packit 67cb25
Packit 67cb25
.. function:: void gsl_sf_mathieu_free (gsl_sf_mathieu_workspace * work)
Packit 67cb25
Packit 67cb25
   This function frees the workspace :data:`work`.
Packit 67cb25
Packit 67cb25
Mathieu Function Characteristic Values
Packit 67cb25
--------------------------------------
Packit 67cb25
.. index:: Mathieu Function Characteristic Values
Packit 67cb25
Packit 67cb25
.. function:: int gsl_sf_mathieu_a (int n, double q)
Packit 67cb25
              int gsl_sf_mathieu_a_e (int n, double q, gsl_sf_result * result)
Packit 67cb25
              int gsl_sf_mathieu_b (int n, double q)
Packit 67cb25
              int gsl_sf_mathieu_b_e (int n, double q, gsl_sf_result * result)
Packit 67cb25
Packit 67cb25
   These routines compute the characteristic values :math:`a_n(q)`,
Packit 67cb25
   :math:`b_n(q)` of the Mathieu functions :math:`ce_n(q,x)` and
Packit 67cb25
   :math:`se_n(q,x)`, respectively.
Packit 67cb25
Packit 67cb25
.. function:: int gsl_sf_mathieu_a_array (int order_min, int order_max, double q, gsl_sf_mathieu_workspace * work, double result_array[])
Packit 67cb25
              int gsl_sf_mathieu_b_array (int order_min, int order_max, double q, gsl_sf_mathieu_workspace * work, double result_array[])
Packit 67cb25
Packit 67cb25
   These routines compute a series of Mathieu characteristic values
Packit 67cb25
   :math:`a_n(q)`, :math:`b_n(q)` for :math:`n` from :data:`order_min` to
Packit 67cb25
   :data:`order_max` inclusive, storing the results in the array :data:`result_array`.
Packit 67cb25
Packit 67cb25
Angular Mathieu Functions
Packit 67cb25
-------------------------
Packit 67cb25
.. index::
Packit 67cb25
   single: Angular Mathieu Functions
Packit 67cb25
   single: ce(q,x), Mathieu function
Packit 67cb25
   single: se(q,x), Mathieu function
Packit 67cb25
Packit 67cb25
.. function:: int gsl_sf_mathieu_ce (int n, double q, double x)
Packit 67cb25
              int gsl_sf_mathieu_ce_e (int n, double q, double x, gsl_sf_result * result)
Packit 67cb25
              int gsl_sf_mathieu_se (int n, double q, double x)
Packit 67cb25
              int gsl_sf_mathieu_se_e (int n, double q, double x, gsl_sf_result * result)
Packit 67cb25
Packit 67cb25
   These routines compute the angular Mathieu functions :math:`ce_n(q,x)`
Packit 67cb25
   and :math:`se_n(q,x)`, respectively.
Packit 67cb25
Packit 67cb25
.. function:: int gsl_sf_mathieu_ce_array (int nmin, int nmax, double q, double x, gsl_sf_mathieu_workspace * work, double result_array[])
Packit 67cb25
              int gsl_sf_mathieu_se_array (int nmin, int nmax, double q, double x, gsl_sf_mathieu_workspace * work, double result_array[])
Packit 67cb25
Packit 67cb25
   These routines compute a series of the angular Mathieu functions
Packit 67cb25
   :math:`ce_n(q,x)` and :math:`se_n(q,x)` of order :math:`n` from
Packit 67cb25
   :data:`nmin` to :data:`nmax` inclusive, storing the results in the array
Packit 67cb25
   :data:`result_array`.
Packit 67cb25
Packit 67cb25
Radial Mathieu Functions
Packit 67cb25
------------------------
Packit 67cb25
.. index:: Radial Mathieu Functions
Packit 67cb25
Packit 67cb25
.. function:: int gsl_sf_mathieu_Mc (int j, int n, double q, double x)
Packit 67cb25
              int gsl_sf_mathieu_Mc_e (int j, int n, double q, double x, gsl_sf_result * result)
Packit 67cb25
              int gsl_sf_mathieu_Ms (int j, int n, double q, double x)
Packit 67cb25
              int gsl_sf_mathieu_Ms_e (int j, int n, double q, double x, gsl_sf_result * result)
Packit 67cb25
Packit 67cb25
   These routines compute the radial :data:`j`-th kind Mathieu functions
Packit 67cb25
   :math:`Mc_n^{(j)}(q,x)` and :math:`Ms_n^{(j)}(q,x)` of order :data:`n`.
Packit 67cb25
Packit 67cb25
   The allowed values of :data:`j` are 1 and 2.
Packit 67cb25
   The functions for :math:`j = 3,4` can be computed as 
Packit 67cb25
   :math:`M_n^{(3)} = M_n^{(1)} + iM_n^{(2)}` and
Packit 67cb25
   :math:`M_n^{(4)} = M_n^{(1)} - iM_n^{(2)}`,
Packit 67cb25
   where 
Packit 67cb25
   :math:`M_n^{(j)} = Mc_n^{(j)}` or
Packit 67cb25
   :math:`Ms_n^{(j)}`.
Packit 67cb25
Packit 67cb25
.. function:: int gsl_sf_mathieu_Mc_array (int j, int nmin, int nmax, double q, double x, gsl_sf_mathieu_workspace * work, double result_array[])
Packit 67cb25
              int gsl_sf_mathieu_Ms_array (int j, int nmin, int nmax, double q, double x, gsl_sf_mathieu_workspace * work, double result_array[])
Packit 67cb25
Packit 67cb25
   These routines compute a series of the radial Mathieu functions of
Packit 67cb25
   kind :data:`j`, with order from :data:`nmin` to :data:`nmax` inclusive, storing the
Packit 67cb25
   results in the array :data:`result_array`.