s21ca evaluates the Jacobian elliptic functions sn, cn and dn.

Syntax

C#
public static void s21ca(
	double u,
	double m,
	out double sn,
	out double cn,
	out double dn,
	out int ifail
)
Visual Basic
Public Shared Sub s21ca ( _
	u As Double, _
	m As Double, _
	<OutAttribute> ByRef sn As Double, _
	<OutAttribute> ByRef cn As Double, _
	<OutAttribute> ByRef dn As Double, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void s21ca(
	double u, 
	double m, 
	[OutAttribute] double% sn, 
	[OutAttribute] double% cn, 
	[OutAttribute] double% dn, 
	[OutAttribute] int% ifail
)
F#
static member s21ca : 
        u : float * 
        m : float * 
        sn : float byref * 
        cn : float byref * 
        dn : float byref * 
        ifail : int byref -> unit 

Parameters

u
Type: System..::..Double
On entry: the argument u and the parameter m of the functions, respectively.
Constraints:
  • absuλ, where λ=1/x02am;
  • if absu<1/λ, absmλ.
m
Type: System..::..Double
On entry: the argument u and the parameter m of the functions, respectively.
Constraints:
  • absuλ, where λ=1/x02am;
  • if absu<1/λ, absmλ.
sn
Type: System..::..Double%
On exit: the values of the functions snu, cnu and dnu, respectively.
cn
Type: System..::..Double%
On exit: the values of the functions snu, cnu and dnu, respectively.
dn
Type: System..::..Double%
On exit: the values of the functions snu, cnu and dnu, respectively.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

s21ca evaluates the Jacobian elliptic functions of argument u and parameter m,
snum=sinϕ,cnum=cosϕ,dnum=1-msin2ϕ,
where ϕ, called the amplitude of u, is defined by the integral
u=0ϕdθ1-msin2θ.
The elliptic functions are sometimes written simply as snu, cnu and dnu, avoiding explicit reference to the parameter m.
Another nine elliptic functions may be computed via the formulae
cdu=cnu/dnusdu=snu/dnundu=1/dnudcu=dnu/cnuncu=1/cnuscu=snu/cnunsu=1/snudsu=dnu/snucsu=cnu/snu
(see Abramowitz and Stegun (1972)).
s21ca is based on a procedure given by Bulirsch (1960), and uses the process of the arithmetic-geometric mean (16.9 in Abramowitz and Stegun (1972)). Constraints are placed on the values of u and m in order to avoid the possibility of machine overflow.

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Bulirsch R (1960) Numerical calculation of elliptic integrals and elliptic functions Numer. Math. 7 76–90

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,absu>λ, where λ=1/x02am.
ifail=2
On entry,absm>λ and absu<1/λ.
ifail=-9000
An error occured, see message report.

Accuracy

In principle the method 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 SIN and COS.

Parallelism and Performance

None.

Further Comments

None.

Example

This example reads values of the argument u and parameter m from a file, evaluates the function and prints the results.

Example program (C#): s21cae.cs

Example program data: s21cae.d

Example program results: s21cae.r

See Also