ELLIPKM1
This function evaluates the complete elliptic integral of the first kind using the complementary parameter p=1-m, which improves numerical behavior when m is close to 1.
K(m)=\int_0^{\pi/2}\frac{1}{\sqrt{1-m\sin^2(t)}}\,dt,\qquad m=1-p
This wrapper computes the same K value by accepting p directly.
Excel Usage
=ELLIPKM1(p)
p(float, required): Complementary elliptic parameter where m equals one minus p (dimensionless).
Returns (float): Complete elliptic integral of the first kind for m equals one minus p.
Example 1: Stable first-kind complete integral with p one-half
Inputs:
| p |
|---|
| 0.5 |
Excel formula:
=ELLIPKM1(0.5)
Expected output:
1.85407
Example 2: Stable first-kind complete integral with small p
Inputs:
| p |
|---|
| 0.01 |
Excel formula:
=ELLIPKM1(0.01)
Expected output:
3.69564
Example 3: Stable first-kind complete integral with p equal to one
Inputs:
| p |
|---|
| 1 |
Excel formula:
=ELLIPKM1(1)
Expected output:
1.5708
Example 4: Stable first-kind complete integral with p greater than one
Inputs:
| p |
|---|
| 2 |
Excel formula:
=ELLIPKM1(2)
Expected output:
1.31103
Python Code
from scipy.special import ellipkm1 as scipy_ellipkm1
def ellipkm1(p):
"""
Compute the complete elliptic integral of the first kind near m equals one.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.ellipkm1.html
This example function is provided as-is without any representation of accuracy.
Args:
p (float): Complementary elliptic parameter where m equals one minus p (dimensionless).
Returns:
float: Complete elliptic integral of the first kind for m equals one minus p.
"""
try:
return float(scipy_ellipkm1(p))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
Complementary elliptic parameter where m equals one minus p (dimensionless).