Package xal.tools.math
Class EllipticIntegral
java.lang.Object
xal.tools.math.EllipticIntegral
Utility class for numerical computation of elliptic integrals.
- Since:
- Aug 17, 2006
- Author:
- Christopher K. Allen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
formFactorD
(double s) Evaluates the value of the "form factor" which is an analytic means for approximating the Carlson elliptic integral RD(x,y,z).static void
Testing Driverstatic double
rd
(double x, double y, double z) Compute and return the Carlson Elliptic integral RD(x,y,z).static double
symmetricRDr
(double r, double z) Axis-symmetric Carlson elliptic integral RD(z,r,r) (permuted arguments) Compute and return the Carlson elliptic integral for the "axis-symmetric" situation where x = y = r.static double
symmetricRDz
(double r, double z) Axis-symmetric Carlson elliptic integral RD(r,r,z) Compute and return the Carlson elliptic integral for the "axis-symmetric" situation where x = y = r.
-
Constructor Details
-
EllipticIntegral
public EllipticIntegral()
-
-
Method Details
-
rd
public static double rd(double x, double y, double z) Compute and return the Carlson Elliptic integral RD(x,y,z). This is the "degenerate form" of Carlson's Elliptic integral of the third kind, a special case of his elliptic integral RJ(x,y,z,p) where p == z. The definition of this function is RD(x,y,z) := (3/2)Integral_dt{ 1.0/( (t+x)^1/2*(t+y)^1/2*(t+z)^3/2 ) } where the integral is from zero to infinity.- Parameters:
x
- real number > 0y
- real number > 0z
- real number > 0- Returns:
- the value of RD(x,y,z)
-
symmetricRDz
Axis-symmetric Carlson elliptic integral RD(r,r,z) Compute and return the Carlson elliptic integral for the "axis-symmetric" situation where x = y = r. In this case there is an analytic formula for the integral involving inverse cosines and inverse hyperbolic cosines. The value of this function is actually computed by a call to theEllipticIntegral.formFactorD()
function. The definition for symmetricRDz(r,z) is given by the following RDz(r,z) := (3/2)Integral_dt{ 1.0/( (t+r)*(t+z)^3/2 ) } = (3/ (r*z^1/2))*formFactorD( (z/r)^1/2 ) where the integral is from zero to infinity. NOTE: Depending upon the algorithm used to compute theMath.acos()
andElementaryFunction.acosh()
functions it may actually be faster to use the functionEllipticIntegral.RD(r,r,z)
.- Parameters:
r
- real number > 0 (i.e., radius)z
- real number > 0 (i.e., length)- Returns:
- value of RD(r,r,z)
- Throws:
IllegalArgumentException
- argument less than zero- See Also:
-
symmetricRDr
Axis-symmetric Carlson elliptic integral RD(z,r,r) (permuted arguments) Compute and return the Carlson elliptic integral for the "axis-symmetric" situation where x = y = r. In this case there is an analytic formula for the integral involving inverse cosines and inverse hyperbolic cosines. The value of this function is actually computed by a call to theEllipticIntegral.formFactorD()
function. The definition for symmetricRDr(z,r) is given by the following RDr(r,z) := (3/2)Integral_dt{ 1.0/( (t+z)^1/2*(t+r)^2 ) } = (1/2)*(3/(r*z^1/2) - *RD(r,r,z) where the integral is from zero to infinity. NOTE: Depending upon the algorithm used to compute theMath.acos()
andElementaryFunction.acosh()
functions it may actually be faster to use the functionEllipticIntegral.RD(r,r,z)
.- Parameters:
r
- real number > 0 (i.e., radius)z
- real number > 0 (i.e., length)- Returns:
- value of RD(z,r,r)
- Throws:
IllegalArgumentException
- argument less than zero- See Also:
-
formFactorD
public static double formFactorD(double s) Evaluates the value of the "form factor" which is an analytic means for approximating the Carlson elliptic integral RD(x,y,z). I believe this notion was introduced by Lapostalle in the early 1970s. I have the definition of the form factor f(s) as f(s) := (s/2)Integral_dt{1/( (t+1)*(t+s^2)^3/2 ) } where the integral is from zero to infinity.- Parameters:
s
- a real number in the interval (0,inf)- Returns:
- value of the form factor at s
-
main
Testing Driver
-