libdspl-2.0
Digital Signal Processing Algorithm Library
Elliptic Jacobi functions of the real and complex arguments.

Functions

int DSPL_API ellip_acd (double *w, int n, double k, double *u)
 Inverse Jacobi elliptic function \( u = \textrm{cd}^{-1}(w, k)\) of the real vector argument. More...
 
int DSPL_API ellip_acd_cmplx (complex_t *w, int n, double k, complex_t *u)
 Inverse Jacobi elliptic function \( u = \textrm{cd}^{-1}(w, k)\) of complex vector argument. More...
 
int DSPL_API ellip_asn (double *w, int n, double k, double *u)
 Inverse Jacobi elliptic function \( u = \textrm{sn}^{-1}(w, k)\) of real vector argument. More...
 
int DSPL_API ellip_asn_cmplx (complex_t *w, int n, double k, complex_t *u)
 Inverse Jacobi elliptic function \( u = \textrm{sn}^{-1}(w, k)\) of complex vector argument. More...
 
int DSPL_API ellip_cd (double *u, int n, double k, double *y)
 Jacobi elliptic function \( y = \textrm{cd}(u K(k), k)\) of real vector argument. More...
 
int DSPL_API ellip_cd_cmplx (complex_t *u, int n, double k, complex_t *y)
 Jacobi elliptic function \( y = \textrm{cd}(u K(k), k)\) of complex vector argument. More...
 
int DSPL_API ellip_landen (double k, int n, double *y)
 Function calculates complete elliptical integral coefficients \( k_i \). More...
 
int DSPL_API ellip_sn (double *u, int n, double k, double *y)
 Jacobi elliptic function \( y = \textrm{sn}(u K(k), k)\) of real vector argument. More...
 
int DSPL_API ellip_sn_cmplx (complex_t *u, int n, double k, complex_t *y)
 Jacobi elliptic function \( y = \textrm{sn}(u K(k), k)\) of complex vector argument. More...
 

Detailed Description

Function Documentation

◆ ellip_acd()

int ellip_acd ( double *  w,
int  n,
double  k,
double *  u 
)

Inverse Jacobi elliptic function \( u = \textrm{cd}^{-1}(w, k)\) of the real vector argument.



Function calculates inverse Jacobi elliptic function
\( u = \textrm{cd}^{-1}(w, k)\) of the real vector w.

Parameters
[in]wPointer to the argument vector \( w \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector w.
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]uPointer to the vector of inverse Jacobi elliptic function \( u = \textrm{cd}^{-1}(w, k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 103 of file ellipj.c.

◆ ellip_acd_cmplx()

int ellip_acd_cmplx ( complex_t w,
int  n,
double  k,
complex_t u 
)

Inverse Jacobi elliptic function \( u = \textrm{cd}^{-1}(w, k)\) of complex vector argument.


Function calculates inverse Jacobi elliptic function
\( u = \textrm{cd}^{-1}(w, k)\) of complex vector w.

Parameters
[in]wPointer to the argument vector \( w \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector w.

[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]uPointer to the vector of inverse Jacobi elliptic function \( u = \textrm{cd}^{-1}(w, k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 211 of file ellipj.c.

◆ ellip_asn()

int ellip_asn ( double *  w,
int  n,
double  k,
double *  u 
)

Inverse Jacobi elliptic function \( u = \textrm{sn}^{-1}(w, k)\) of real vector argument.



Function calculates inverse Jacobi elliptic function
\( u = \textrm{sn}^{-1}(w, k)\) of real vector w.

Parameters
[in]wPointer to the argument vector \( w \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector w.
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]uPointer to the vector of inverse Jacobi elliptic function \( u = \textrm{sn}^{-1}(w, k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 339 of file ellipj.c.

◆ ellip_asn_cmplx()

int ellip_asn_cmplx ( complex_t w,
int  n,
double  k,
complex_t u 
)

Inverse Jacobi elliptic function \( u = \textrm{sn}^{-1}(w, k)\) of complex vector argument.


Function calculates inverse Jacobi elliptic function
\( u = \textrm{sn}^{-1}(w, k)\) of complex vector w.

Parameters
[in]wPointer to the argument vector \( w \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector w.
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]uPointer to the vector of inverse Jacobi elliptic function \( u = \textrm{sn}^{-1}(w, k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 447 of file ellipj.c.

Referenced by ellip_ap_zp().

◆ ellip_cd()

int ellip_cd ( double *  u,
int  n,
double  k,
double *  y 
)

Jacobi elliptic function \( y = \textrm{cd}(u K(k), k)\) of real vector argument.


Function calculates Jacobi elliptic function
\( y = \textrm{cd}(u K(k), k)\) of real vector u and elliptical modulus k.

Parameters
[in]uPointer to the argument vector \( u \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector u.
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]yPointer to the vector of Jacobi elliptic function \( y = \textrm{cd}(u K(k), k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 577 of file ellipj.c.

Referenced by ellip_ap_zp().

◆ ellip_cd_cmplx()

int ellip_cd_cmplx ( complex_t u,
int  n,
double  k,
complex_t y 
)

Jacobi elliptic function \( y = \textrm{cd}(u K(k), k)\) of complex vector argument.


Function calculates Jacobi elliptic function
\( y = \textrm{cd}(u K(k), k)\) of complex vector u and elliptical modulus k.

Parameters
[in]uPointer to the argument vector \( u \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector u.
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]yPointer to the vector of Jacobi elliptic function \( y = \textrm{cd}(u K(k), k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 684 of file ellipj.c.

Referenced by ellip_ap_zp().

◆ ellip_landen()

int ellip_landen ( double  k,
int  n,
double *  y 
)

Function calculates complete elliptical integral coefficients \( k_i \).


Complete elliptical integral \( K(k) \) can be described as:

\[ K(k) = \frac{\pi}{2} \prod_{i = 1}^{\infty}(1+k_i), \]

here \( k_i \) – coefficients which calculated iterative from \( k_0 = k\):

\[ k_i = \left( \frac{k_{i-1}}{1+\sqrt{1-k_{i-1}^2}}\right)^2 \]

This function calculates n fist coefficients \( k_i \), which can be used for Complete elliptical integral.

Parameters
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[in]nNumber of \( k_i \) which need to calculate.
Parameter n is size of output vector y.
[out]ypointer to the real vector which keep \( k_i \).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK – successful exit, else error code.
Example:
#include <stdio.h>
#include <stdlib.h>
#include "dspl.h"
#define N 14
int main()
{
void* handle; /* DSPL handle */
handle = dspl_load(); /* Load DSPL function */
double k[N];
int i, err;
err = ellip_landen(0.93, N, k);
if(err != RES_OK)
{
printf("Error code: %8x\n", err);
return err;
}
printf(" i%8sk[i]\n\n", "");
for(i = 1; i < N; i++)
printf("%2d %11.3e\n", i, k[i]);
dspl_free(handle); /* free dspl handle */
return 0;
}

Result:

 i        k[i]

 1    4.625e-01
 2    6.009e-02
 3    9.042e-04
 4    2.044e-07
 5    1.044e-14
 6    2.727e-29
 7    1.859e-58
 8   8.640e-117
 9   1.866e-233
10    0.000e+00
11    0.000e+00
12    0.000e+00
13    0.000e+00
Note
Complete elliptical integral converges enough fast if modulus \( k<1 \). There are 10 to 20 coefficients \( k_i \) ​​ are sufficient for practical applications to ensure complete elliptic integral precision within EPS.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 872 of file ellipj.c.

Referenced by ellip_acd(), ellip_acd_cmplx(), ellip_asn(), ellip_asn_cmplx(), ellip_cd(), ellip_cd_cmplx(), ellip_sn(), and ellip_sn_cmplx().

◆ ellip_sn()

int ellip_sn ( double *  u,
int  n,
double  k,
double *  y 
)

Jacobi elliptic function \( y = \textrm{sn}(u K(k), k)\) of real vector argument.


Function calculates Jacobi elliptic function
\( y = \textrm{sn}(u K(k), k)\) of real vector u and elliptical modulus k.

Parameters
[in]uPointer to the argument vector \( u \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector u.

[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]yPointer to the vector of Jacobi elliptic function \( y = \textrm{sn}(u K(k), k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 1074 of file ellipj.c.

◆ ellip_sn_cmplx()

int ellip_sn_cmplx ( complex_t u,
int  n,
double  k,
complex_t y 
)

Jacobi elliptic function \( y = \textrm{sn}(u K(k), k)\) of complex vector argument.


Function calculates Jacobi elliptic function
\( y = \textrm{sn}(u K(k), k)\) of complex vector u and elliptical modulus k.

Parameters
[in]uPointer to the argument vector \( u \).
Vector size is [n x 1].
Memory must be allocated.

[in]nSize of vector u.
[in]kElliptical modulus \( k \).
Elliptical modulus is real parameter, which values can be from 0 to 1.

[out]yPointer to the vector of Jacobi elliptic function \( y = \textrm{sn}(u K(k), k)\).
Vector size is [n x 1].
Memory must be allocated.

Returns
RES_OK successful exit, else error code.
Author
Sergey Bakhurin www.dsplib.org

Definition at line 1179 of file ellipj.c.

Referenced by ellip_ap_zp().

#define RES_OK
The function completed correctly. No errors.
Definition: dspl.h:497
int DSPL_API ellip_landen(double k, int n, double *y)
Function calculates complete elliptical integral coefficients .
Definition: ellipj.c:872