1
$\begingroup$

I need to evaluate EllipticK[m] very close to 1. However, when I get too close to 1 the function defaults to the exact solution for 1 , which is ComplexInfinity. I can enter a comparable number in Wolfram|Alpha and get both the exact and the numerical approximation, but nothing I have tried gets me that approximate number in Mathematica:

Wolfram|Alpha:

EllipticK[0.9999999999999999999999999999999999999999999999]
54.3458...

Mathematica:

EllipticK[0.9999999999999999999999999999999999999999999999]
ComplexInfinity
EllipticK[0.9999999999999999999999999999999999999999999999]//N
ComplexInfinity

I've tried various other combinations of precision manipulation as well, so far nothing has worked. Does anyone know how to override the exact answer?

Edit

I discovered half the solution immediately after posting. When I put a 0 at the end of the string of 9s, it will evaluate the decimal approximation. However, I don't know how to implement this for the purpose of, say, plotting the EllipticK.

$\endgroup$
3
  • $\begingroup$ Try EllipticK[0.9999999999999999999999999999999999999950]` $\endgroup$
    – Somos
    Commented Apr 16, 2019 at 23:43
  • $\begingroup$ Somos means EllipticK[0.99999999999999999999999999999999999999`50]. The editing is wonky with the backticks, and I don't remember how to escape them. $\endgroup$
    – march
    Commented Apr 17, 2019 at 0:05
  • 1
    $\begingroup$ @march Use double back-ticks: EllipticK[0.99999999999999999999999999999999999999`50] $\endgroup$
    – Michael E2
    Commented Apr 17, 2019 at 1:12

1 Answer 1

1
$\begingroup$

Your choice to evaluate EllipticK[m] for values of m near the logarithmic singularity at $1$ is doomed from the start. The numerically proper way to go about this is to use the relationship of the complete elliptic integral of the first kind with the arithmetic-geometric mean, so that you are evaluating an argument near $0$:

N[Pi/(2 ArithmeticGeometricMean[1, Sqrt[1*^-46]]), 20]
   54.345751499982941351
$\endgroup$
2
  • $\begingroup$ (I'm not quite back yet, I still don't have my own computer, and I just evaluated this on Wolfram One only to answer this question.) $\endgroup$ Commented Jul 23, 2019 at 2:26
  • 3
    $\begingroup$ Glad you're at least partially back. Looking forward to you being fully back. $\endgroup$
    – JimB
    Commented Jul 23, 2019 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.