Class 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 modulus
      private double[] imagResult  
      private double imagZ  
      private int kind  
      static int REAL_VERSION  
      private double[] realResult
      outputted result
      private double realZ
      Input argument
      static int SD  
      static int SN  
      private double u
      Input argument
      private 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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • kind

        private int kind
      • 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 argument
        hk - input modulus 0
        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
        kind - Type of function to return
        realResult - real part of outputted result
        imagResult - imaginary part of outputted result
    • Method Detail

      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Cleanup memory.
        Overrides:
        finalize in class java.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 - 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[]