10.3 The Class ellipFun
135
and they solve the following differential equations:
y = sn(z, k) :
0 =
d 2 y
dz 2 + (1 + k
2 )y − 2k
2 y
3
(10.9a)
dy
dz
2
= (1 − y
2 )(1 − k
2 y
2 )
(10.9b)
y = cn(z, k) :
0 =
d 2 y
dz 2 + (1 − k
2 )y + 2k
2 y
3
(10.10a)
dy
dz
2
= (1 − y
2 )(1 − k
2
+ k
2 y
2 )
(10.10b)
y = dn(z, k) :
0 =
d 2 y
dz 2 − (1 − k
2 )y + 2y
3
(10.11a)
dy
dz
2
= −(1 − y
2 )(1 − k
2
− y
2 )
(10.11b)
Computation
To compute the nome q, respectively, the parameter τ of the ϑ functions, the
complete elliptic integral K(k) has to be evaluated. The following infinite product
converges for most k-values very quickly:
K(k) =
π
2
∞
m=1
(1 + k m ), with k 0 = k , k m+1 =
1 −
1 − k 2
m
1 +
1 − k 2
m
.
(10.12)
In case of no convergency, the relation to the hypergeometric function 2 F 1
K(k) = 2 F 1 (
1
2
,
1
2
; 1; k
2 )
(10.13)
will be used. (This is also of numerical interest vice versa.) Thus, by computing
K(k) and K(k ), we could derive the parameter τ and use the relation between the
ϑ functions and the Jacobi elliptic functions.
10.3 The Class ellipFun
The class ellipFun supports the evaluation of the Jacobi elliptic functions, some
derivatives, and the amplitude function. The syntax is obj = ellipFun(wellipfun, z, k). The input variable “wellipfun” has the values “jac” (evaluation of the Jacobi elliptic functions sn, cn, and dn), “djac” (sn, cn, and dn and
its derivatives), “sn” (sn and ns), “cn” (cn and nc), “dn” (dn and nd), “sd” (sd and
ds), “cd” (cd and dc), “sc” (sc and cs), and finally “am” (for evaluating sn and the
135
and they solve the following differential equations:
y = sn(z, k) :
0 =
d 2 y
dz 2 + (1 + k
2 )y − 2k
2 y
3
(10.9a)
dy
dz
2
= (1 − y
2 )(1 − k
2 y
2 )
(10.9b)
y = cn(z, k) :
0 =
d 2 y
dz 2 + (1 − k
2 )y + 2k
2 y
3
(10.10a)
dy
dz
2
= (1 − y
2 )(1 − k
2
+ k
2 y
2 )
(10.10b)
y = dn(z, k) :
0 =
d 2 y
dz 2 − (1 − k
2 )y + 2y
3
(10.11a)
dy
dz
2
= −(1 − y
2 )(1 − k
2
− y
2 )
(10.11b)
Computation
To compute the nome q, respectively, the parameter τ of the ϑ functions, the
complete elliptic integral K(k) has to be evaluated. The following infinite product
converges for most k-values very quickly:
K(k) =
π
2
∞
m=1
(1 + k m ), with k 0 = k , k m+1 =
1 −
1 − k 2
m
1 +
1 − k 2
m
.
(10.12)
In case of no convergency, the relation to the hypergeometric function 2 F 1
K(k) = 2 F 1 (
1
2
,
1
2
; 1; k
2 )
(10.13)
will be used. (This is also of numerical interest vice versa.) Thus, by computing
K(k) and K(k ), we could derive the parameter τ and use the relation between the
ϑ functions and the Jacobi elliptic functions.
10.3 The Class ellipFun
The class ellipFun supports the evaluation of the Jacobi elliptic functions, some
derivatives, and the amplitude function. The syntax is obj = ellipFun(wellipfun, z, k). The input variable “wellipfun” has the values “jac” (evaluation of the Jacobi elliptic functions sn, cn, and dn), “djac” (sn, cn, and dn and
its derivatives), “sn” (sn and ns), “cn” (cn and nc), “dn” (dn and nd), “sd” (sd and
ds), “cd” (cd and dc), “sc” (sc and cs), and finally “am” (for evaluating sn and the
