This function evaluates the Jacobi elliptic function cn(x, m).
EJCN — Real or complex function value. (Output)
X — Real or complex argument for which the function value is desired. (Input)
AM — Parameter of the elliptic function (m = k2). (Input)
Generic: EJCN (X, AM)
Specific: The specific interface names are S_EJCN, D_EJCN, C_EJCN, and Z_EJCN.
Single: EJCN (X, AM)
Double: The double precision name is DEJCN.
Complex: The complex name is CEJCN.
Double Complex: The double complex name is ZEJCN.
The Jacobi elliptic function cn(x, m) = cos ɸ, where the amplitude ɸ is defined by the following:
The function cn(x, m) is computed by first applying, if necessary, a Jacobi transformation so that the parameter, m, is between zero and one. Then, a descending Landen (Gauss) transform is applied until the parameter is small. The small parameter approximation is then applied.
Informational errors
Type Code
3 2 The result is accurate to less than one half precision because |X| is too large.
3 2 The result is accurate to less than one half precision because |REAL (Z)| is too large.
3 3 The result is accurate to less than one half precision because |AIMAG (Z)| is too large.
3 5 Landen transform did not converge. Result may not be accurate. This should never occur.
In this example, cn(1.5, 0.5) is computed and printed.
USE EJCN_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NOUT
REAL AM, VALUE, X
! Compute
AM = 0.5
X = 1.5
VALUE = EJCN(X, AM)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) X, AM, VALUE
99999 FORMAT (' EJCN(', F6.3, ',', F6.3, ') = ', F6.3)
END
EJCN( 1.500, 0.500) = 0.250
In this example, cn(1.5 + 0.3i, 0.5) is computed and printed.
USE EJCN_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NOUT
REAL AM
COMPLEX VALUE, Z
! Compute
Z = (1.5, 0.3)
AM = 0.5
VALUE = EJCN(Z, AM)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) Z, AM, VALUE
99999 FORMAT (' EJCN((', F6.3, ',', F6.3, '), ', F6.3, ') = (', &
F6.3, ',', F6.3, ')')
END
EJCN(( 1.500, 0.300), 0.500) = ( 0.251,-0.212)
PHONE: 713.784.3131 FAX:713.781.9260 |