[SciPy-user] ellipk() with negative arguments?
Sun Mar 29 18:58:09 CDT 2009
On Mon, Mar 30, 2009 at 1:14 AM, Iordan Hristov <firstname.lastname@example.org> wrote:
> I'm implementing a Mathematica equation which has EllipticK[x], x<0.
> It seems the domain of ellipk() is between 0 and 1 and anything
> outside gives nan. For example:
> Scipy: ellipk(.1) -> 1.6124413487202192
> Mathematica: N[EllipticK[.1]] -> 1.61244
> Scipy: ellipk(-1) -> nan
> Mathematica: N[EllipticK[-1]] -> 1.31103
> Scipy: ellipk(3) -> nan
> Mathematica: N[EllipticK] -> 1.00108 - 1.17142 I
> How could one get the Mathematica results in Scipy?
A simple workaround would be to use the ellipk function in mpmath:
>>> from mpmath import ellipk
More information about the SciPy-user