Class JacobianElliptic

java.lang.Object
gov.nih.mipav.model.algorithms.JacobianElliptic

public class JacobianElliptic extends 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 final int
     
    static final int
     
    static final int
     
    private 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 double
    Input modulus
    private double[]
     
    private double
     
    private int
     
    static final int
     
    private double[]
    outputted result
    private double
    Input argument
    static final int
     
    static final int
     
    private double
    Input argument
    private int
    Tells whether real number or complex number version
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    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

    Modifier and Type
    Method
    Description
    private void
    From Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables edited by Milton Abramowitz and Irene A.
    void
    Cleanup memory.
    private void
    This is a port of subroutine JELP from Computation of Special Functions by Shanjie Zhang and Jianming Jin, pp. 671-672.
    void
    run()
     
    void
     
    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.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 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 Details

    • JacobianElliptic

      public JacobianElliptic()
    • JacobianElliptic

      public JacobianElliptic(double u, double hk, double[] esn, double[] ecn, double[] edn, double[] esd, double[] dph)
      Parameters:
      u - input argument
      hk - input modulus 0 invalid input: '<'= hk invalid input: '<'= 1
      sn - outputted sn function
      cn - outputted cn function
      dn - outputted dn function
      sd - outputted sd function
      dphi - 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 argument
      imagZ - input imaginary part of argument
      hk - input modulus 0 invalid input: '<'= hk invalid input: '<'= 1
      kind - Type of function to return
      realResult - real part of outputted result
      imagResult - imaginary part of outputted result
  • Method Details

    • finalize

      public void finalize() throws Throwable
      Cleanup memory.
      Overrides:
      finalize in class Object
      Throws:
      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 - double
      zi - 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 - double
      ai - double
      br - double
      bi - double
      cr - double[]
      ci - double[]