Package gov.nih.mipav.model.algorithms
Class JacobianElliptic
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.JacobianElliptic
-
public class JacobianElliptic extends java.lang.Object
Calculate Jacobian Elliptic functions.
hk is a modulus between 0.0 and 1.0.
The elliptic function sn is defined as the inverse function of the elliptic integral of the first kind.
The elliptic integral of the first kind is the integral from 0 to x of:
dt/sqrt((1 - t*t)*(1 - hk*hk*t*t))
cn (u, hk) = sqrt(1 - sn(u, hk)**2)
dn (u, hk) = sqrt(1 - hk*hk*sn(u, hk)**2)
sd (u, hk) = sn(u, hk)/dn(u, hk)
The FORTRAN code this class is based upon is from Computation of Special Functions by Shanjie Zhang and Jianming Jin and copyright 1996 John Wiley & Sons, Inc.
From the diskette that the FORTRAN code came on:
DISCLAIMER OF WARRANTY Although we have made a great effort to test and validate the computer programs, we make no warranties, express or implied, that these programs are free of error, or are consistent with any particular standard of merchantability, or that they will meet your requirements for any particular application. They should not be relied on for solving problems whose incorrect solution could result in injury to a person or loss of property. If you do use the programs in such a manner, it is at your own risk. The authors and publisher disclaim all liability for direct or consequential damages resulting from your use of the programs.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CN
static int
COMPLEX_VERSION
static int
DN
private double[]
dph
phi (in degrees)private double[]
ecn
cn (u, hk)private double[]
edn
dn (u, hk)private double[]
esd
sd (u, hk) = sn (u, hk)/ dn(u, hk)private double[]
esn
sn (u, hk)private double
hk
Input modulusprivate double[]
imagResult
private double
imagZ
private int
kind
static int
REAL_VERSION
private double[]
realResult
outputted resultprivate double
realZ
Input argumentstatic int
SD
static int
SN
private double
u
Input argumentprivate int
version
Tells whether real number or complex number version
-
Constructor Summary
Constructors Constructor Description JacobianElliptic()
JacobianElliptic(double u, double hk, double[] esn, double[] ecn, double[] edn, double[] esd, double[] dph)
JacobianElliptic(double realZ, double imagZ, double hk, int kind, double[] realResult, double[] imagResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
complexArgument()
From Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables edited by Milton Abramowitz and Irene A.void
finalize()
Cleanup memory.private void
realArgument()
This is a port of subroutine JELP from Computation of Special Functions by Shanjie Zhang and Jianming Jin, pp. 671-672.void
run()
void
testrealArgument()
private double
zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.private void
zdiv(double ar, double ai, double br, double bi, double[] cr, double[] ci)
complex divide c = a/b.
-
-
-
Field Detail
-
REAL_VERSION
public static final int REAL_VERSION
- See Also:
- Constant Field Values
-
COMPLEX_VERSION
public static final int COMPLEX_VERSION
- See Also:
- Constant Field Values
-
kind
private int kind
-
SN
public static final int SN
- See Also:
- Constant Field Values
-
CN
public static final int CN
- See Also:
- Constant Field Values
-
DN
public static final int DN
- See Also:
- Constant Field Values
-
SD
public static final int SD
- See Also:
- Constant Field Values
-
version
private int version
Tells whether real number or complex number version
-
esn
private double[] esn
sn (u, hk)
-
ecn
private double[] ecn
cn (u, hk)
-
edn
private double[] edn
dn (u, hk)
-
esd
private double[] esd
sd (u, hk) = sn (u, hk)/ dn(u, hk)
-
dph
private double[] dph
phi (in degrees)
-
u
private double u
Input argument
-
hk
private double hk
Input modulus
-
realZ
private double realZ
Input argument
-
imagZ
private double imagZ
-
realResult
private double[] realResult
outputted result
-
imagResult
private double[] imagResult
-
-
Constructor Detail
-
JacobianElliptic
public JacobianElliptic()
-
JacobianElliptic
public JacobianElliptic(double u, double hk, double[] esn, double[] ecn, double[] edn, double[] esd, double[] dph)
- Parameters:
u
- input argumenthk
- input modulus 0 <= hk <= 1sn
- outputted sn functioncn
- outputted cn functiondn
- outputted dn functionsd
- outputted sd functiondphi
- outputted phi in degrees
-
JacobianElliptic
public JacobianElliptic(double realZ, double imagZ, double hk, int kind, double[] realResult, double[] imagResult)
- Parameters:
realZ
- input real part of argumentimagZ
- input imaginary part of argumenthk
- input modulus 0 <= hk <= 1kind
- Type of function to returnrealResult
- real part of outputted resultimagResult
- imaginary part of outputted result
-
-
Method Detail
-
finalize
public void finalize() throws java.lang.Throwable
Cleanup memory.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
run
public void run()
-
testrealArgument
public void testrealArgument()
-
realArgument
private void realArgument()
This is a port of subroutine JELP from Computation of Special Functions by Shanjie Zhang and Jianming Jin, pp. 671-672. Computes Jacobian elliptic functions sn(u, hk), cn(u, hk), dn(u,hk) and sd(u, hk)
-
complexArgument
private void complexArgument()
From Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables edited by Milton Abramowitz and Irene A. Stegun, Chapter 16 Jacobian Elliptic Functions and Theta Functions, Section 16.21 Complex Arguments s = sn(realZ|hk), c = cn(realZ|hk), d = dn(realZ|hk) hkp = sqrt(1 - hk*hk) s1 = sn(imagZ|hkp), c1 = cn(imagZ|hkp), d1 = dn(imagZ|hkp) sn(realZ + i*imagZ|hk) = (s*d1 + i*c*d*s1*c1)/(c1*c1 + m*s*s*s1*s1) cn(realZ + i*imagZ|hk) = (c*c1 - i*s*d*s1*d1)/(c1*c1 + m*s*s*s1*s1) dn(realZ + i*imagZ|hk) = (d*c1*d1 - i*m*s*c*s1)/(c1*c1 + m*s*s*s1*s1)
-
zabs
private double zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.- Parameters:
zr
- doublezi
- double- Returns:
- double
-
zdiv
private void zdiv(double ar, double ai, double br, double bi, double[] cr, double[] ci)
complex divide c = a/b.- Parameters:
ar
- doubleai
- doublebr
- doublebi
- doublecr
- double[]ci
- double[]
-
-