Found the parameter of the elliptic integral of the first kind

60 Views Asked by At

Suppose I have: $$\frac{p}{[K(p)-K(\frac{-\pi}{2},p)]^2} = x$$

$K(p)$ being the complete elliptic function of the first kind and $K(\theta,p)$ the incomplete elliptic function of the first kind.

How could I determine $p$ as a function of $x$?

I'm using scipy, I'm more of a programmer that a classical mathematician.

I've been looking into the Jacobian elliptic functions but as I understand it, it's used to determine the angle of the elliptic function knowing the parameter.

EDIT 1
As Claude Leibovici noticed, $K(-\frac{\pi}{2},p) = -K(p)$
So now I'm looking for $p$, knowing $y$ in:$$y = \frac{p}{K(p)^2}$$

1

There are 1 best solutions below

0
On

Using Python, you can firstly plot $y$ in function of $p$:

import numpy as np
import matplotlib.pyplot as plt
from scipy.special import ellipk

p = np.linspace(0, 1, 100)
K = ellipk(p)
y = p / K**2
plt.plot(p, y)

enter image description here

Say you want the values $p$ giving $y=0.12$. This graphic allows you to get an idea of the values of $p$, say $0.4$ and $0.9$. Then you can use fsolve

from scipy.optimize import fsolve
ytarget = 0.12
f = lambda x: x / ellipk(x)**2 - ytarget
fsolve(f, [0.4, 0.9])
# output: array([0.37077373, 0.93649696])