Main Content

ellipj

Jacobi elliptic functions

Description

[SN,CN,DN] = ellipj(u,m) returns the Jacobi sn, cn, and dn elliptic functions evaluated for the corresponding elements of u and m. Inputs u and m must be the same size, or either u or m must be scalar.

example

Examples

collapse all

Compute the Jacobi elliptic functions for u = 0.75 and m = 0.5. Because these numbers are not symbolic objects, you get floating-point results.

[SN,CN,DN] = ellipj(0.75,0.5)
SN = 
0.6585
CN = 
0.7526
DN = 
0.8850

Compute the Jacobi elliptic functions for the same numbers converted to symbolic objects. For most symbolic (exact) numbers, ellipj returns results using the jacobiSN, jacobiCN, and jacobiDN functions.

[SN,CN,DN] = ellipj(sym(3/4),sym(1/2))
SN = 

snjacobiSN(34|12)

CN = 

cnjacobiCN(34|12)

DN = 

dnjacobiDN(34|12)

Use vpa to approximate the symbolic results with floating-point numbers.

vpa([SN,CN,DN],10)
ans = (0.65851474410.75256782540.8849741046)

If the argument m is not in [0 1], then convert that argument to a symbolic object before using ellipj.

[SN,CN,DN] = ellipj(1,sym(pi/2))
SN = 

snjacobiSN(1|π2)

CN = 

cnjacobiCN(1|π2)

DN = 

dnjacobiDN(1|π2)

Alternatively, use jacobiSN, jacobiCN, and jacobiDN to compute the Jacobi elliptic functions separately.

SN = jacobiSN(1,sym(pi/2))
SN = 

snjacobiSN(1|π2)

CN = jacobiCN(1,sym(pi/2))
CN = 

cnjacobiCN(1|π2)

DN = jacobiDN(1,sym(pi/2))
DN = 

dnjacobiDN(1|π2)

Call ellipj for symbolic matrix input. When the input arguments are matrices with the same size, ellipj computes the Jacobi elliptic functions for each element.

[SN,CN,DN] = ellipj(sym([-1 0; 1 1/2]),sym([1 pi/2; -1 0]))
SN = 

(-tanh(1)0snjacobiSN(1|-1)sin(12))

CN = 

(1cosh(1)1cnjacobiCN(1|-1)cos(12))

DN = 

(1cosh(1)1dnjacobiDN(1|-1)1)

Input Arguments

collapse all

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

Output Arguments

collapse all

Jacobi sn elliptic function, returned as a symbolic expression.

Jacobi cn elliptic function, returned as a symbolic expression.

Jacobi dn elliptic function, returned as a symbolic expression.

More About

collapse all

Jacobi Elliptic Functions

The Jacobi elliptic functions are defined as

sn(u,m)=sinϕcn(u,m)=cosϕdn(u,m)=1msin2ϕ

where ϕ satisfies the incomplete elliptic integral of the first kind

u=0ϕdθ1msin2θ.

Tips

  • Calling ellipj for numbers that are not symbolic objects invokes the MATLAB® ellipj function. This function accepts only 0 <= m <= 1. To compute the Jacobi elliptic functions for values out of this range, use sym or vpa to convert the numbers to symbolic objects, and then call ellipj for those symbolic objects. Alternatively, use the jacobiSN, jacobiCN, and jacobiDN functions to compute the elliptic functions separately.

  • For most symbolic (exact) numbers, ellipj returns results using the jacobiSN, jacobiCN, and jacobiDN functions. You can approximate such results with floating-point numbers using vpa.

References

[1] Abramowitz, M. and I. A. Stegun, Handbook of Mathematical Functions, Dover Publications (1965), 17.6.

Version History

Introduced in R2017b