Function Repository Resource:

BulirschCEL

Source Notebook

Evaluate Bulirsch's general complete elliptic integral

Contributed by: Jan Mangaldan

ResourceFunction["BulirschCEL"][m,p,a,b]

gives Bulirsch's general complete elliptic integral .

Details

Mathematical function, suitable for both symbolic and numerical manipulation.
Bulirsch’s general complete elliptic integral is defined as .
Argument conventions for elliptic integrals are discussed in "Elliptic Integrals and Elliptic Functions".
For certain special arguments, ResourceFunction["BulirschCEL"] automatically evaluates to exact values.
ResourceFunction["BulirschCEL"] can be evaluated to arbitrary precision.
ResourceFunction["BulirschCEL"] automatically threads over lists.

Examples

Basic Examples (1) 

Evaluate numerically:

In[1]:=
ResourceFunction["BulirschCEL"][0.1, -4.1, 1.2, 1.1]
Out[1]=

Scope (4) 

Evaluate numerically for complex arguments:

In[2]:=
ResourceFunction["BulirschCEL"][1 - 2. I, 2.5 + I, 0.6, 0.7]
Out[2]=

Evaluate to high precision:

In[3]:=
ResourceFunction["BulirschCEL"][1/2, -2.`30, 3, 4]
Out[3]=

The precision of the output tracks the precision of the input:

In[4]:=
ResourceFunction["BulirschCEL"][1/2, -2.000000000000000000000, 3, 4]
Out[4]=

Simple exact results are generated automatically:

In[5]:=
ResourceFunction["BulirschCEL"][1, 1/4, 2, 3]
Out[5]=
In[6]:=
ResourceFunction["BulirschCEL"][0, p, 1, 0]
Out[6]=

BulirschCEL threads elementwise over lists:

In[7]:=
ResourceFunction["BulirschCEL"][{0.2, 0.3, 0.7}, 2.4, 1/5, 1/3]
Out[7]=

Applications (3) 

Evaluate the mutual inductance of two coaxial circles:

In[8]:=
With[{a = Quantity[2, "Centimeters"], b = Quantity[3, "Centimeters"], h = Quantity[11, "Centimeters"]},
 UnitConvert[
  Sqrt[(a - b)^2 + h^2]
    ResourceFunction[
    "BulirschCEL"][((a + b)^2 + h^2)/((a - b)^2 + h^2), 1, (
    2 a b)/((a - b)^2 + h^2), -((2 a b)/((a - b)^2 + h^2))] Quantity[
    "MagneticConstant"], "Henries"]]
Out[8]=

Compare with the result of NIntegrate:

In[9]:=
With[{a = Quantity[2, "Centimeters"], b = Quantity[3, "Centimeters"], h = Quantity[11, "Centimeters"]},
 UnitConvert[(a b)/
   2 NIntegrate[Cos[\[Theta]]/Sqrt[
    h^2 + a^2 + b^2 - 2 a b Cos[\[Theta]]], {\[Theta], 0, 2 \[Pi]}, WorkingPrecision -> 25] Quantity["MagneticConstant"], "Henries"]]
Out[9]=

Visualize the solid angle subtended by a circular disk:

In[10]:=
With[{L = 2, r0 = 2/5, rm = 1},
 Graphics3D[{EdgeForm[], Polygon[PadRight[N@CirclePoints[rm, 24], {Automatic, 3}]], {Dashed,
     Line[{{r0, 0, 0}, {r0, 0, L}}]}, Sphere[{r0, 0, L}, rm/20]}, Boxed -> False, ViewPoint -> {-2.4, -1.3, 2.}]]
Out[10]=

Evaluate the solid angle:

In[11]:=
With[{L = 2, r0 = 2/5, rm = 1}, N[2 \[Pi] Boole[r0 < rm] - (
    4 L rm)/((rm - r0) Sqrt[L^2 + (rm - r0)^2])
     ResourceFunction["BulirschCEL"][(L^2 + (rm + r0)^2)/(
     L^2 + (rm - r0)^2), ((rm + r0)/(rm - r0))^2, 1, (rm + r0)/(
     rm - r0)], 20]]
Out[11]=

Compare with the result of NIntegrate:

In[12]:=
With[{L = 2, r0 = 2/5, rm = 1}, L NIntegrate[r/(r^2 - 2 r0 r Cos[\[Theta]] + r0^2 + L^2)^(
   3/2), {r, 0, rm}, {\[Theta], 0, 2 \[Pi]}]]
Out[12]=

Visualize the intersection of two cylinders:

In[13]:=
With[{r1 = 1/4, r2 = 1}, Show[{Graphics3D[{Opacity[0.4], Cylinder[{{-3/2, -1, -1/2}, {3/2, 1, 1/2}}, r1], Cylinder[{{0, 0, -1}, {0, 0, 1}}, r2]}], Region[RegionIntersection[
     Cylinder[{{-3/2, -1, -1/2}, {3/2, 1, 1/2}}, r1], Cylinder[{{0, 0, -1}, {0, 0, 1}}, r2]], PlotTheme -> "Web"]}]]
Out[13]=

Compute the volume of the intersection of two cylinders:

In[14]:=
With[{r1 = 1/4, r2 = 1, \[Beta] = VectorAngle[{3/2, 1, 1/2}, {0, 0, 1}]}, N[(8 r2^3)/
   3 Csc[\[Beta]] ResourceFunction["BulirschCEL"][1 - (r1/r2)^2, 1, 2 (r1/r2)^2, (r1/r2)^2 (1 - (r1/r2)^2)], 20]]
Out[14]=

Compare with the result of Volume:

In[15]:=
With[{r1 = 1/4, r2 = 1}, Volume[RegionIntersection[
   Cylinder[{{-3/2, -1, -1/2}, {3/2, 1, 1/2}}, r1], Cylinder[{{0, 0, -1}, {0, 0, 1}}, r2]], WorkingPrecision -> 20]]
Out[15]=

Properties and Relations (3) 

Complete Legendre-Jacobi elliptic integrals of all three kinds can be expressed in terms of BulirschCEL:

In[16]:=
With[{m = 2/3}, N[{EllipticK[m], ResourceFunction["BulirschCEL"][1 - m, 1, 1, 1]}]]
Out[16]=
In[17]:=
With[{m = 2/3}, N[{EllipticE[m], ResourceFunction["BulirschCEL"][1 - m, 1, 1, 1 - m]}]]
Out[17]=
In[18]:=
With[{n = 4/5, m = 2/3}, N[{EllipticPi[n, m], ResourceFunction["BulirschCEL"][1 - m, 1 - n, 1, 1]}]]
Out[18]=

BulirschCEL can be used to represent linear combinations of complete elliptic integrals:

In[19]:=
With[{a = 4, b = 5, m = 2/3}, N[{a EllipticK[m] + b EllipticE[m], ResourceFunction["BulirschCEL"][1 - m, 1, a + b, a + b (1 - m)]}]]
Out[19]=
In[20]:=
With[{a = 4, b = 5, n = -1/8, m = 2/3}, N[{a EllipticK[m] + b EllipticPi[n, m], ResourceFunction["BulirschCEL"][1 - m, 1 - n, a + b, a (1 - n) + b]}]]
Out[20]=

JacobiZeta can be expressed in terms of BulirschCEL:

In[21]:=
With[{\[Phi] = 2, m = 1/3}, N[{JacobiZeta[\[Phi], m], (m Sin[2 \[Phi]])/
    2 ResourceFunction["BulirschCEL"][1 - m, 1 - m Sin[\[Phi]]^2, 0, Sqrt[1 - m Sin[\[Phi]]^2]]/
    ResourceFunction["BulirschCEL"][1 - m, 1, 1, 1]}]]
Out[21]=

Neat Examples (1) 

Magnetic field lines of a cylindrical solenoid:

In[22]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/cec60d94-f28a-4e80-944e-c04ba360be71"]
Out[22]=

Requirements

Wolfram Language 12.3 (May 2021) or above

Version History

  • 1.0.0 – 14 June 2021

Source Metadata

Related Resources

Author Notes

Requires 12.3 or later.
The form of the second argument was changed from the original definition used by Bulirsch, so that BulirschCEL uses the parameter m=k2 instead of the modulus k. This conforms with Mathematica's choice to use the parameter in the built-in elliptic integrals and functions.

License Information