PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_specfun_ellipint_general_2 (s21da)
Purpose
nag_specfun_ellipint_general_2 (s21da) returns the value of the general elliptic integral of the second kind for a complex argument , via the function name.
Syntax
Description
nag_specfun_ellipint_general_2 (s21da) evaluates an approximation to the general elliptic integral of the second kind
given by
where
and
are real arguments,
is a complex argument whose real part is non-negative and
is a real argument (the
complementary modulus). The evaluation of
is based on the Gauss transformation. Further details, in particular for the conformal mapping provided by
, can be found in
Bulirsch (1960).
Special values include
or
(the
elliptic integral of the first kind) and
or
(the
elliptic integral of the second kind). Note that the values of
and
are equal to
in the trivial case
.
nag_specfun_ellipint_general_2 (s21da) is derived from an Algol 60 procedure given by
Bulirsch (1960). Constraints are placed on the values of
and
in order to avoid the possibility of machine overflow.
References
Bulirsch R (1960) Numerical calculation of elliptic integrals and elliptic functions Numer. Math. 7 76–90
Parameters
Compulsory Input Parameters
- 1:
– complex scalar
-
The argument of the function.
Constraints:
- ;
- , where .
- 2:
– double scalar
-
The argument of the function.
Constraint:
.
- 3:
– double scalar
-
The argument of the function.
- 4:
– double scalar
-
The argument of the function.
Optional Input Parameters
None.
Output Parameters
- 1:
– complex scalar
The result of the function.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, | , |
or | , |
or | , |
or | , where . |
-
-
The iterative procedure used to evaluate the integral has failed to converge. The result is returned as zero.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
In principle the function is capable of achieving full relative precision in the computed values. However, the accuracy obtainable in practice depends on the accuracy of the standard elementary functions such as atan2 and log.
Further Comments
None.
Example
This example evaluates the elliptic integral of the first kind
given by
where
and
, and prints the results.
Open in the MATLAB editor:
s21da_example
function s21da_example
fprintf('s21da example results\n\n');
z = 1.2 + 3.7i;
kp = 0.5;
a = 1;
b = 1;
[result, ifail] = s21da(z, kp, a, b);
fprintf('%6s%13s%7s%7s%18s\n','z','k''','a','b','F(z,k'',a,b)');
fprintf('%5.1f%+5.1fi %7.2f%7.2f%7.2f%10.5f%+10.5fi\n', real(z), imag(z), ...
kp, a, b, real(result), imag(result));
s21da example results
z k' a b F(z,k',a,b)
1.2 +3.7i 0.50 1.00 1.00 1.97126 +0.50538i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015