2
$\begingroup$

I am trying to follow the numerical approach on how to calculate EllipticE and EllipticK following this paper. In there on approach uses the EllipticNomeQ, namely

$$q(m) = \exp\left({{ -\pi K(m)}\over{ K(1 - m) }}\right)$$

but with

$$\lambda(m) = { {1 - \sqrt{k'}} \over { 1 + \sqrt{k'}}}$$

and

$$k' = \sqrt{1 - m}$$

what is required is a series expansion of $q(m(\lambda))$ with respect to $\lambda$. The paper suggests to use

Series[ EllipticNomeQ[ 1 - ((1 - 2x) / (1 + 2x))^4 ], {x, 0, 30}]

Unfortunately, this does not provide useful coefficients. For the expansion to order 1 it provides

SeriesData[x, 0, { InverseSeries[0, 0]^4, 64 InverseSeries[0, 0]^3 Derivative[0, 1][InverseSeries][ 0, 0]}, 0, 2, 1]  

Obviously, it was working in 2012 which also can be seen on the OEIS. Fortunately, the OEIS provides code to calculate the coefficients directly, but the fact that the expansion is not working is unsatisfying.

The expected result (see OEIS) is $x + 2 x^5 + 15 x^9 + 150 x^{13} + 1707 x^{17} + \mathcal{O}(x^{21})$

Which trick am I missing?

Additional Info

$\endgroup$
6
  • 2
    $\begingroup$ I get the expected result in V13.0.1. (I'm confused about which version you're using and which is the older one referred to in the title, assuming "Mathematic" is a typo for "Mathematica".) $\endgroup$
    – Michael E2
    Commented Jun 14, 2022 at 14:29
  • $\begingroup$ I also get the expected result in version 13; this might have been a bug that got fixed. $\endgroup$ Commented Jun 14, 2022 at 15:21
  • 1
    $\begingroup$ V11.3.0 also gives the correct result. $\endgroup$
    – Tom6639
    Commented Jun 14, 2022 at 15:53
  • $\begingroup$ @MichaelE2 lol, changed the title. By old version I am referring to the version that was used at the time the paper was written. 2011 it was likely version 8 and most likely working. $\endgroup$ Commented Jun 15, 2022 at 6:17
  • $\begingroup$ @J.M. I checked at home on version 13.0.1 for Linux ARM and it works as well. So It might be a "bug" similar to the one linked above $\endgroup$ Commented Jun 15, 2022 at 6:21

1 Answer 1

3
$\begingroup$

EDIT: For revised question:

With v13.0.1 or 12.0.0 I get the same result as shown below. I don't have access to earlier versions.

Clear["Global`*"]

$Version

(* "13.0.1 for Mac OS X x86 (64-bit) (January 28, 2022)" *)

f[x_] = EllipticNomeQ[1 - ((1 - 2 x)/(1 + 2 x))^4];

f2[x_] = Series[f[x], {x, 0, 30}] // Normal

(* x + 2 x^5 + 15 x^9 + 150 x^13 + 1707 x^17 + 20910 x^21 + 
 268616 x^25 + 3567400 x^29 *)

Plot[{f[x], f2[x]}, {x, -.75, .75},
 PlotStyle -> {Automatic, Dashed},
 PlotLegends -> Placed["Expressions", {.8, .2}]]

enter image description here

$\endgroup$
4
  • $\begingroup$ Sorry, my mistake from fiddling around with the problem (copied some intermediate stuff). Series is actually around 0 not 1. Changed the post accordingly $\endgroup$ Commented Jun 14, 2022 at 14:23
  • $\begingroup$ In 13 on Windows 10 Series[EllipticNomeQ[1 - ((1 - 2 x)/(1 + 2 x))^4], {x, 0, 30}] results in $$x+2 x^5+15 x^9+150 x^{13}+1707 x^{17}+20910 x^{21}+268616 x^{25}+3567400 x^{29}+O\left(x^{31}\right) .$$ $\endgroup$
    – user64494
    Commented Jun 14, 2022 at 14:34
  • $\begingroup$ I have $Version ->"11.1.1 for Microsoft Windows (64-bit) (April 18, 2017)"...putting your code I get the InverseSeries[0,0] stuff from above. Well, screams for an update. I'll check on my Pi4 at home. :) $\endgroup$ Commented Jun 14, 2022 at 14:47
  • $\begingroup$ Checked on my Pi4: Version 13.0.1. for Linux ARM 32-bit and also got the expected result. So it seems to be a problem with 11.1. $\endgroup$ Commented Jun 15, 2022 at 6:12

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.