#17606: Calculation involving nintegral works with Sage 6.3 but not with Sage 
6.4
----------------------------------+------------------------
       Reporter:  alyasoff        |        Owner:
           Type:  defect          |       Status:  new
       Priority:  major           |    Milestone:  sage-6.4
      Component:  numerical       |   Resolution:
       Keywords:  nintegral       |    Merged in:
        Authors:  Andrew Lyasoff  |    Reviewers:
Report Upstream:  N/A             |  Work issues:
         Branch:                  |       Commit:
   Dependencies:                  |     Stopgaps:
----------------------------------+------------------------
Description changed by jdemeyer:

Old description:

> 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 with Sage 6.4 returns:
>
> {{{
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "_sage_input_4.py", line 10, in <module>
>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
> -*-\\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("ZnUubmludGVncmFsKHUsMCwyKQ=="),globals())+"\\n");
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in <module>
>
>   File "/tmp/tmpbwhja8/___code___.py", line 3, in <module>
>     exec compile(u'fu.nintegral(u,_sage_const_0 ,_sage_const_2 )
>   File "", line 1, in <module>
>
>   File "sage/symbolic/expression.pyx", line 10244, in
> sage.symbolic.expression.Expression.nintegral
> (build/cythonized/sage/symbolic/expression.cpp:51090)
>   File "/usr/lib/sagemath/local/lib/python2.7/site-
> packages/sage/calculus/calculus.py", line 792, in nintegral
>     raise TypeError(err)
> TypeError: ECL says: Error executing code in Maxima:
> }}}

New description:

 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 with Sage 6.4 returns:

 {{{
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "_sage_input_4.py", line 10, in <module>
     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
 -*-\\n" +
 
_support_.preparse_worksheet_cell(base64.b64decode("ZnUubmludGVncmFsKHUsMCwyKQ=="),globals())+"\\n");
 execfile(os.path.abspath("___code___.py"))
   File "", line 1, in <module>

   File "/tmp/tmpbwhja8/___code___.py", line 3, in <module>
     exec compile(u'fu.nintegral(u,_sage_const_0 ,_sage_const_2 )
   File "", line 1, in <module>

   File "sage/symbolic/expression.pyx", line 10244, in
 sage.symbolic.expression.Expression.nintegral
 (build/cythonized/sage/symbolic/expression.cpp:51090)
   File "/usr/lib/sagemath/local/lib/python2.7/site-
 packages/sage/calculus/calculus.py", line 792, in nintegral
     raise TypeError(err)
 TypeError: ECL says: Error executing code in Maxima:
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/17606#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to