nag_jacobian_elliptic (s21cbc) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_jacobian_elliptic (s21cbc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_jacobian_elliptic (s21cbc) evaluates the Jacobian elliptic functions snz , cnz  and dnz  for a complex argument z .

2  Specification

#include <nag.h>
#include <nags.h>
void  nag_jacobian_elliptic (Complex z, double ak2, Complex *sn, Complex *cn, Complex *dn, NagError *fail)

3  Description

nag_jacobian_elliptic (s21cbc) evaluates the Jacobian elliptic functions snzk , cnzk  and dnzk  given by
snzk = sinϕ cnzk = cosϕ dnzk = 1 - k 2 sin 2 ϕ ,
where z  is a complex argument, k  is a real argument (the modulus) with k 2 1  and ϕ  (the amplitude of z ) is defined by the integral
z = 0 ϕ dθ 1 - k 2 sin 2 θ .
The above definitions can be extended for values of k 2 > 1  (see Salzer (1962)) by means of the formulae
snzk = k 1 sn kz k 1 cnzk = dn kz k 1 dnzk = cn kz k 1
where k 1 = 1 / k .
Special values include
snz0 = sinz cnz0 = cosz dnz0 = 1 snz1 = tanhz cnz1 = sechz dnz1 = sechz .
These functions are often simply written as snz , cnz  and dnz , thereby avoiding explicit reference to the argument k . They can also be expressed in terms of Jacobian theta functions (see nag_jacobian_theta (s21ccc)).
Another nine elliptic functions may be computed via the formulae
cdz = cnz / dnz sdz = snz / dnz ndz = 1 / dnz
dcz = dnz / cnz ncz = 1 / cnz scz = snz / cnz nsz = 1 / snz dsz = dnz / snz csz = cnz / snz
(see Abramowitz and Stegun (1972)).

4  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

5  Arguments

1:     zComplexInput
On entry: the argument z  of the functions.
Constraints:
  • abs z.re λ ;
  • if λ = 1 / nag_real_safe_small_number , abs z.im λ .
2:     ak2doubleInput
On entry: the value of k 2 .
Constraint: 0.0 ak2 1.0 .
3:     snComplex *Output
4:     cnComplex *Output
5:     dnComplex *Output
On exit: the values of the functions snz , cnz  and dnz , respectively.
6:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_COMPLEX
On entry, z = value,value .
Constraint: abs z.re λ  and abs z.im λ , where λ = 1 nag_real_safe_small_number .
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL
On entry, ak2=value .
Constraint: 0.0 ak2 1.0 .

7  Accuracy

In principle nag_jacobian_elliptic (s21cbc) is capable of achieving full relative precision in the computed values. However, the accuracy obtainable in practice depends on the accuracy of the C standard library elementary functions such as sin and cos.

8  Further Comments

The values of snz , cnz  and dnz  are computed via the formulae
snz = snu,k dnv, k 1 - dn 2 u,k sn 2 v, k + i cnu,k dnu,k snv, k cnv, k 1 - dn 2 u,k sn 2 v, k cnz = cnu,k cnv, k 1 - dn 2 u,k sn 2 v, k - i snu,k dnu,k snv, k dnv, k 1 - dn 2 u,k sn 2 v, k dnz = dnu,k cnv, k dnv, k 1 - dn 2 u,k sn 2 v, k - i k 2 snu,k cnu,k snv, k 1 - dn 2 u,k sn 2 v, k ,
where z = u + iv  and k = 1 - k 2  (the complementary modulus).

9  Example

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

9.1  Program Text

Program Text (s21cbce.c)

9.2  Program Data

Program Data (s21cbce.d)

9.3  Program Results

Program Results (s21cbce.r)


nag_jacobian_elliptic (s21cbc) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012