103 views

Skip to first unread message

Feb 19, 2024, 3:25:51 PMFeb 19

to sage-support

D(r)=-1/2*((3*r^2 - 1)*elliptic_ec((4*r/(r^2 + 2*r + 1)))^2 + (r^2 - 2*r + 1)*elliptic_ec((4*r/(r^2 + 2*r + 1)))*elliptic_kc((4*r/(r^2 + 2*r + 1))))/(pi^2*r^8 - 2*pi^2*r^7 - pi^2*r^6 + 4*pi^2*r^5 - pi^2*r^4 - 2*pi^2*r^3 + pi^2*r^2)

D(r).limit(r=0)

The limit should be -0.125 (or -1/8) but it seems maxima doesnt know the limit of elliptic_ec(x) for x->0

Sympy also fails giving -5/8.

The other algorithms cant evaluate it either.

Feb 20, 2024, 2:40:13 AMFeb 20

to sage-support

Indeed. That’s probably an oversight :

sage: elliptic_kc(x).limit(x=0) 1/2*pi sage: elliptic_ec(x).limit(x=0) limit(elliptic_ec(x), x, 0)Curioisly :

sage: elliptic_ec(0) 1/2*piFWIW :

sage: D(r)._mathematica_().Limit(mathematica.Rule(r, 0)) -1/8HTH,

Feb 20, 2024, 7:29:12 AMFeb 20

to sage-s...@googlegroups.com

On Mon, Feb 19, 2024 at 11:40:13PM -0800, Emmanuel Charpentier wrote:

>

> Indeed. That’s probably an oversight :

> sage: elliptic_kc(x).limit(x=0) 1/2*pi sage: elliptic_ec(x).limit(x=0)

> limit(elliptic_ec(x), x, 0)

>

this looks like a maxima bug:
>

> Indeed. That’s probably an oversight :

> sage: elliptic_kc(x).limit(x=0) 1/2*pi sage: elliptic_ec(x).limit(x=0)

> limit(elliptic_ec(x), x, 0)

>

(%i17) elliptic_ec(0);

%pi

(%o17) ---

2

(%i18) limit(elliptic_ec(x),x,0);

(%o18) limit elliptic_ec(x)

x -> 0

(%i19) elliptic_kc(0);

%pi

(%o19) ---

2

(%i20) limit(elliptic_kc(x),x,0);

%pi

(%o20) ---

2

No idea why limit(elliptic_ec(x),x,0) is a problem for Maxima.

> Curioisly :

> sage: elliptic_ec(0) 1/2*pi

>

> FWIW :

> sage: D(r)._mathematica_().Limit(mathematica.Rule(r, 0)) -1/8

>

> HTH,

>

> Le lundi 19 février 2024 à 21:25:51 UTC+1, Mark “Essa King” Sukaiti a

> écrit :

>

> > D(r)=-1/2*((3*r^2 - 1)*elliptic_ec((4*r/(r^2 + 2*r + 1)))^2 + (r^2 - 2*r +

> > 1)*elliptic_ec((4*r/(r^2 + 2*r + 1)))*elliptic_kc((4*r/(r^2 + 2*r +

> > 1))))/(pi^2*r^8 - 2*pi^2*r^7 - pi^2*r^6 + 4*pi^2*r^5 - pi^2*r^4 -

> > 2*pi^2*r^3 + pi^2*r^2)

> >

> > D(r).limit(r=0)

> >

> > The limit should be -0.125 (or -1/8) but it seems maxima doesnt know the

> > limit of elliptic_ec(x) for x->0

> > [image: 2024-02-20_00-22.png]

> > Sympy also fails giving -5/8.

> >

> > The other algorithms cant evaluate it either.

> >

>

> You received this message because you are subscribed to the Google Groups "sage-support" group.

> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/25c243ea-fa2c-489e-93c8-ec9c946d3779n%40googlegroups.com.

Feb 24, 2024, 6:28:17 AMFeb 24

to sage-s...@googlegroups.com

On Mon, 19 Feb 2024 at 20:25, Mark “Essa King” Sukaiti <xzark....@gmail.com> wrote:

D(r)=-1/2*((3*r^2 - 1)*elliptic_ec((4*r/(r^2 + 2*r + 1)))^2 + (r^2 - 2*r + 1)*elliptic_ec((4*r/(r^2 + 2*r + 1)))*elliptic_kc((4*r/(r^2 + 2*r + 1))))/(pi^2*r^8 - 2*pi^2*r^7 - pi^2*r^6 + 4*pi^2*r^5 - pi^2*r^4 - 2*pi^2*r^3 + pi^2*r^2)D(r).limit(r=0)The limit should be -0.125 (or -1/8) but it seems maxima doesnt know the limit of elliptic_ec(x) for x->0

Sympy also fails giving -5/8.

To follow up on this the SymPy bug is now fixed in master:

In [1]: e = ((1 - 3*x**2)*elliptic_e(4*x/(x**2 + 2*x + 1))**2/2 - (x**2 - 2*x + 1)*elliptic_e(4*x/(x*

...: *2 + 2*x + 1))*elliptic_k(4*x/(x**2 + 2*x + 1))/2)/(pi**2*x**8 - 2*pi**2*x**7 - pi**2*x**6 +

...: 4*pi**2*x**5 - pi**2*x**4 - 2*pi**2*x**3 + pi**2*x**2)

In [2]: e.limit(x, 0)

Out[2]: -1/8

...: *2 + 2*x + 1))*elliptic_k(4*x/(x**2 + 2*x + 1))/2)/(pi**2*x**8 - 2*pi**2*x**7 - pi**2*x**6 +

...: 4*pi**2*x**5 - pi**2*x**4 - 2*pi**2*x**3 + pi**2*x**2)

In [2]: e.limit(x, 0)

Out[2]: -1/8

Oscar

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu