next up previous index
Next: D101 Integration by Up: CERNLIB Previous: C348 Elliptic Integral

C349 Jacobian Theta Functions

Routine ID: C349
Author(s): G.A. ErskineLibrary: MATHLIB
Submitter: K.S. KölbigSubmitted: 07.06.1992
Language: FortranRevised:

Function subprograms RTHETA and DTHETA calculate the Jacobian theta functions

ϑ0(x,q) = 1 + 2 ∑n=1&inf;(-1)nqn2cos2n πx,

ϑ1(x,q) = 2 ∑n=0&inf;(-1)nq( n+{12})2sin(2n+1) πx,

ϑ2(x,q) = 2 ∑n=0&inf;q( n+{12})2cos(2n+1) πx,

ϑ3(x,q) = 1 + 2 ∑n=1&inf;qn2cos2n πx,

ϑ4(x,q) = ϑ0(x,q),

for real arguments x and 0 ≤q<1 . ϑ1(x+{12},1)

and ϑ2(x,1) are undefined if x is an integer; otherwise ϑk(x,1)=0, k=1,2,3,4 .

Note that several conflicting definitions of these functions occur in the literature. In particular, the argument in the trigonometric terms is often defined to be x instead of πx .

On CDC and Cray computers, the double-precision version DTHETA is not available.

Structure:

FUNCTION subprogram
User Entry Names: RTHETA, DTHETA
Files Referenced: Unit 6
External References: MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, RTHETA(K,X,Q) or DTHETA(K,X,Q) has the value ϑK(X,Q) ,

where RTHETA is of type REAL, DTHETA is of type DOUBLE PRECISION, X and Q are of the same type as the function name, and K is of type INTEGER.

Method:

If t (0 ≤t ≤{12}) differs from x or -x by an integer, it follows from the periodicity and symmetry properties of the functions that ϑ1(x,q)=±ϑ1(t,q) and ϑ3(x,q)=ϑ3(t,q) . In a region for which the approximation is sufficiently accurate, ϑ1 is set equal to the first (n=0) term of the transformed series

ϑ1(t,q) = 2(λ/π)1/2e-λt2n=0&inf;(-1)ne-λ(n+{12})2sinh(2n+1)λt,

and ϑ3 is set equal to the first two (i.e. n ≤1 ) terms of

ϑ3(t,q) = (λ/π)1/2e-λt2( 1+2 ∑n=1&inf;e-λn2cosh2nλt ),

where λ= π2/|lnq| . Otherwise the trigonometric series for ϑ1(t,q) and ϑ3(t,q) are used.

For all x, ϑ0 and ϑ2 are computed from ϑ0(x,q)=ϑ3({12}-|x|,q) , ϑ2(x,q)=ϑ1({12}-|x|,q) .

Restrictions:

1. 0 ≤Q ≤1 .
2. K = 0,1,2,3,4 .
3. If Q = 1 and K = 1 , X-{12} must not be an integer.
If Q = 1 and K = 2 , X must not be an integer.

Error handling:

Error C349.1: Restriction 1 is not satisfied.
Error C349.2: Restriction 2 is not satisfied.
Error C349.3: Restriction 3 is not satisfied.
In all cases, the function value is set equal to zero, and a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

Accuracy:

For DTHETA (and for RTHETA on CDC and Cray computers), the error when Q is less than approximately 0.9 does not exceed two decimal digits in the last place. For larger values of Q (provided the computed result is non-zero), the error is at worst comparable in magnitude to the mathematical error which would be caused by one-bit rounding errors in the arguments X and Q.

On computers other than CDC and Cray, non-zero values of RTHETA have full machine accuracy.

Notes:

Successive references using the same value of Q are executed faster than those in which Q changes.

Many functional relations, including relations between the theta functions and the Jacobian elliptic functions, are given in Refs. 1--4.

References:

  1. W. Magnus, F. Oberhettinger and R.P. Soni, Formulas and theorems for the special functions of mathematical physics, Springer-Verlag Berlin (1966) 371--377.
  2. F. Tölke, Praktische Funktionenlehre, Bd. II, Springer-Verlag Berlin (1966) 1--38.
  3. P.F. Byrd and M.D. Friedman, Handbook of elliptic integrals for engineers and scientists, 2nd Edition, Springer-Verlag Berlin (1971) 315--320.
  4. E.T. Whittaker and G.N. Watson, A course of modern analysis, 4th Edition, Cambridge University Press, Cambridge (1946) Chapter 21.

Integration, Minimization, Non-linear Fitting

D101



next up previous index
Next: D101 Integration by Up: CERNLIB Previous: C348 Elliptic Integral


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995