NAG FL Interface
s22caf (mathieu_ang_periodic_real)
1
Purpose
s22caf calculates real-valued periodic angular Mathieu functions ( or ) and/or their first derivatives, where and are solutions to the Mathieu differential equation .
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
ordval, parity, mode, n |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
q, x(n) |
Real (Kind=nag_wp), Intent (Out) |
:: |
f(n), f_deriv(n), a |
|
C Header Interface
#include <nag.h>
void |
s22caf_ (const Integer *ordval, const double *q, const Integer *parity, const Integer *mode, const Integer *n, const double x[], double f[], double f_deriv[], double *a, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
s22caf_ (const Integer &ordval, const double &q, const Integer &parity, const Integer &mode, const Integer &n, const double x[], double f[], double f_deriv[], double &a, Integer &ifail) |
}
|
The routine may be called by the names s22caf or nagf_specfun_mathieu_ang_periodic_real.
3
Description
s22caf calculates an approximation to and/or , or and/or , where and are respectively the even and odd parity real-valued periodic angular Mathieu functions, for an array of values of , and for integer order value , where for even parity, and for odd parity. The routine also returns values of for these periodic Mathieu functions, this is known as the characteristic value or eigenvalue.
The solutions are computed by approximating Mathieu functions as Fourier series, where expansion coefficients are obtained by solving the eigenvalue problem generated from the relevant recurrence relation, see
Chapter 28 in
NIST Digital Library of Mathematical Functions.
4
References
5
Arguments
-
1:
– Integer
Input
-
On entry: , the order number of the Mathieu function to be computed.
Constraints:
- if (even Mathieu function), ;
- if (odd Mathieu function), .
-
2:
– Real (Kind=nag_wp)
Input
-
On entry: , the Mathieu function parameter.
-
3:
– Integer
Input
-
On entry: specifies whether to compute even or odd Mathieu function.
- Compute even Mathieu function, .
- Compute odd Mathieu function, .
Constraint:
or .
-
4:
– Integer
Input
-
On entry: specifies whether the Mathieu function or its derivative is required.
- Compute Mathieu function values.
- Compute derivative values of Mathieu function.
- Compute both Mathieu function and derivative values.
- Compute neither Mathieu functions nor derivative values, returns only a (the characteristic value).
Constraint:
, , or .
-
5:
– Integer
Input
-
On entry: , the number of values to compute.
Constraint:
.
-
6:
– Real (Kind=nag_wp) array
Input
-
On entry: the values of at which to compute Mathieu function or derivative values.
-
7:
– Real (Kind=nag_wp) array
Output
-
On exit: if
or
, the Mathieu function values
or
. If
or
,
f is not used.
-
8:
– Real (Kind=nag_wp) array
Output
-
On exit: if
or
, the Mathieu function derivative values
or
. If
or
,
f_deriv is not used.
-
9:
– Real (Kind=nag_wp)
Output
-
On exit: , the characteristic value for the Mathieu function.
-
10:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, and .
Constraint: if , or if , .
-
On entry, .
Constraint: or .
-
On entry, .
Constraint: , , or .
-
On entry, .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
Not applicable.
8
Parallelism and Performance
s22caf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
s22caf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
10
Example
This example calculates the first four even and odd function and derivative values at for .
10.1
Program Text
10.2
Program Data
10.3
Program Results