Package gov.nih.mipav.model.algorithms
Class JacobianElliptic
java.lang.Object
gov.nih.mipav.model.algorithms.JacobianElliptic
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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intprivate double[]phi (in degrees)private double[]cn (u, hk)private double[]dn (u, hk)private double[]sd (u, hk) = sn (u, hk)/ dn(u, hk)private double[]sn (u, hk)private doubleInput modulusprivate double[]private doubleprivate intstatic final intprivate double[]outputted resultprivate doubleInput argumentstatic final intstatic final intprivate doubleInput argumentprivate intTells whether real number or complex number version -
Constructor Summary
ConstructorsConstructorDescriptionJacobianElliptic(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
Modifier and TypeMethodDescriptionprivate voidFrom Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables edited by Milton Abramowitz and Irene A.voidfinalize()Cleanup memory.private voidThis is a port of subroutine JELP from Computation of Special Functions by Shanjie Zhang and Jianming Jin, pp. 671-672.voidrun()voidprivate doublezabs(double zr, double zi) zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.private voidzdiv(double ar, double ai, double br, double bi, double[] cr, double[] ci) complex divide c = a/b.
-
Field Details
-
REAL_VERSION
public static final int REAL_VERSION- See Also:
-
COMPLEX_VERSION
public static final int COMPLEX_VERSION- See Also:
-
kind
private int kind -
SN
public static final int SN- See Also:
-
CN
public static final int CN- See Also:
-
DN
public static final int DN- See Also:
-
SD
public static final int SD- See Also:
-
version
private int versionTells whether real number or complex number version -
esn
private double[] esnsn (u, hk) -
ecn
private double[] ecncn (u, hk) -
edn
private double[] edndn (u, hk) -
esd
private double[] esdsd (u, hk) = sn (u, hk)/ dn(u, hk) -
dph
private double[] dphphi (in degrees) -
u
private double uInput argument -
hk
private double hkInput modulus -
realZ
private double realZInput argument -
imagZ
private double imagZ -
realResult
private double[] realResultoutputted result -
imagResult
private double[] imagResult
-
-
Constructor Details
-
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 invalid input: '<'= hk invalid input: '<'= 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 invalid input: '<'= hk invalid input: '<'= 1kind- Type of function to returnrealResult- real part of outputted resultimagResult- imaginary part of outputted result
-
-
Method Details
-
finalize
Cleanup memory. -
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[]
-