Ask Your Question
1

Calculation that is possible in Sage 6.3 is not possible in Sage 6.4

asked 2015-01-08 19:05:03 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

The following code:

var('u')

assume(u>0)

fu=1/8*(I*sqrt(2)*(erf(1/2*sqrt(2)*(I*pi + 2*u + 1)) - erf(1/2*sqrt(2)*(-I*pi + 2*u + 1)))*e^(u + 1/2) + sqrt(2)*(-I*erf(1/2*sqrt(2)*(I*pi - 2*u + 1)) + I*erf(1/2*sqrt(2)*(-I*pi - 2*u + 1)))*e^(u + 1/2) - (sqrt(2)*e^(1/8) - sqrt(2)*e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*I*pi + 4*u + 1)) + erf(1/4*sqrt(2)*(-2*I*pi + 4*u + 1))) - (sqrt(2)*e^(1/8) - sqrt(2)*e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*I*pi - 4*u + 1)) + erf(1/4*sqrt(2)*(-2*I*pi - 4*u + 1))))*e^(-u)/sqrt(pi)

fu.nintegral(u,0,2)

returns: ` (1.4275778409741315, 3.656408002774788e-14, 63, 0)' with Sage 6.3

but returns: `TypeError: ECL says: Error executing code in Maxima:' with Sage 6.4

In both cases I am using the notebook interface

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-01-09 16:16:30 +0200

MvG gravatar image

updated 2015-01-09 19:46:17 +0200

The issue is likely due to some Maxima update. You can run sage -maxima to work directly with maxima. Using Maxima 5.29.1 from Sage 6.1 I get

Maxima 5.29.1 http://maxima.sourceforge.net
(%i1) fu:1/8*(%i*sqrt(2)*(erf(1/2*sqrt(2)*(%i*%pi + 2*u + 1)) - erf(1/2*sqrt(2)*(-%i*%pi + 2*u + 1)))*%e^(u + 1/2) + sqrt(2)*(-%i*erf(1/2*sqrt(2)*(%i*%pi - 2*u + 1)) + %i*erf(1/2*sqrt(2)*(-%i*%pi - 2*u + 1)))*%e^(u + 1/2) - (sqrt(2)*%e^(1/8) - sqrt(2)*%e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*%i*%pi + 4*u + 1)) + erf(1/4*sqrt(2)*(-2*%i*%pi + 4*u + 1))) - (sqrt(2)*%e^(1/8) - sqrt(2)*%e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*%i*%pi - 4*u + 1)) + erf(1/4*sqrt(2)*(-2*%i*%pi - 4*u + 1))))*%e^(-u)/sqrt(%pi) $
(%i2) quad_qags(fu,u,0,2,limit=200,epsrel=1e-8) ;
(%o2)         [1.4275778409741315, 3.6564080027747881e-14, 63, 0]

Doing the same on Maxima 5.35.1 from the current Sage 6.5.beta5 I get

(%i2) quad_qags(fu,u,0,2,limit=200,epsrel=1e-8) ;

quad_qags: Cannot numerically evaluate errexp1 at 1.0
 -- an error. To debug this try: debugmode(true);

The expression errexp1 is equal to fu. I know little Maxima myself, but I can tell that ev(subst(1,u,fu),numer); will return an expression with unevaluated erf calls in both versions of Maxima. In any case, there seems to be some change in Maxima between 5.33.0.p0 from Sage 6.3 and the 5.34.1.p0 used in Sage 6.4. Bisecting the Maxima revision history for this, I traced this problem down to Maxima commit 07a0200. That removes some special handling for erf, claiming that it should no longer be required. This assumption appears to be incorrect, judging from your experience.

I took the liberty of reporting this as Maxima bug 2881. If there is urgent need for this, and Maxima fails to react in a timely manner, you could probably also open a Sage ticket asking for this commit to be patched out of the Maxima version used by Sage. But in the long run, the best solution is when Maxima developers deal with this.

edit flag offensive delete link more

Comments

Wow, great sleuthing!

kcrisman gravatar imagekcrisman ( 2015-01-09 21:10:10 +0200 )edit

Update: https://sourceforge.net/p/maxima/bugs... says this has been fixed!

kcrisman gravatar imagekcrisman ( 2015-03-03 03:17:15 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-01-08 19:05:03 +0200

Seen: 367 times

Last updated: Jan 09 '15