s21cb evaluates the Jacobian elliptic functions snz, cnz and dnz for a complex argument z.

Syntax

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

Parameters

z
Type: NagLibrary..::..Complex
On entry: the argument z of the functions.
Constraints:
  • absRe(z)=λ;
  • absIm(z)λ, where λ=1/x02am.
ak2
Type: System..::..Double
On entry: the value of k2.
Constraint: 0.0ak21.0.
sn
Type: NagLibrary..::..Complex%
On exit: the values of the functions snz, cnz and dnz, respectively.
cn
Type: NagLibrary..::..Complex%
On exit: the values of the functions snz, cnz and dnz, respectively.
dn
Type: NagLibrary..::..Complex%
On exit: the values of the functions snz, cnz and dnz, 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

s21cb evaluates the Jacobian elliptic functions snzk, cnzk and dnzk given by
snzk=sinϕcnzk=cosϕdnzk=1-k2sin2ϕ,
where z is a complex argument, k is a real parameter (the modulus) with k21 and ϕ (the amplitude of z) is defined by the integral
z=0ϕdθ1-k2sin2θ.
The above definitions can be extended for values of k2>1 (see Salzer (1962)) by means of the formulae
snzk=k1snkzk1cnzk=dnkzk1dnzk=cnkzk1,
where k1=1/k.
Special values include
snz0=sinzcnz0=coszdnz0=1snz1=tanhzcnz1=sechzdnz1=sechz.
These functions are often simply written as snz, cnz and dnz, thereby avoiding explicit reference to the parameter k. They can also be expressed in terms of Jacobian theta functions (see s21cc).
Another nine elliptic functions may be computed via the formulae
cdz=cnz/dnzsdz=snz/dnzndz=1/dnzdcz=dnz/cnzncz=1/cnzscz=snz/cnznsz=1/snzdsz=dnz/snzcsz=cnz/snz
(see Abramowitz and Stegun (1972)).
The values of snz, cnz and dnz are obtained by calls to s21ca. Further details can be found in [Further Comments].

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Salzer H E (1962) Quick calculation of Jacobian elliptic functions Comm. ACM 5 399

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,ak2<0.0,
orak2>1.0,
orabsRez>λ,
orabsImz>λ, where λ=1/x02am.
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

The values of snz, cnz and dnz are computed via the formulae
snz=snu,kdnv,k1-dn2u,ksn2v,k+icnu,kdnu,ksnv,kcnv,k1-dn2u,ksn2v,kcnz=cnu,kcnv,k1-dn2u,ksn2v,k-isnu,kdnu,ksnv,kdnv,k1-dn2u,ksn2v,kdnz=dnu,kcnv,kdnv,k1-dn2u,ksn2v,k-ik2snu,kcnu,ksnv,k1-dn2u,ksn2v,k,
where z=u+iv and k=1-k2 (the complementary modulus).

Example

This example evaluates snz, cnz and dnz at z=-2.0+3.0i when k=0.5, and prints the results.

Example program (C#): s21cbe.cs

Example program data: s21cbe.d

Example program results: s21cbe.r

See Also