#14821: Weird error in exponential integral
----------------------------+-----------------------------------------------
       Reporter:  ppurka    |         Owner:  burcin   
           Type:  defect    |        Status:  new      
       Priority:  major     |     Milestone:  sage-5.12
      Component:  calculus  |    Resolution:           
       Keywords:            |   Work issues:           
Report Upstream:  N/A       |     Reviewers:           
        Authors:            |     Merged in:           
   Dependencies:            |      Stopgaps:           
----------------------------+-----------------------------------------------

Old description:

> This is so trivial that I am surprised this bug even exists. :) Present
> since at least sage-5.2 till present versions.
>
> The following integral works
> {{{
> H = exp(-10^-1*x)
> H.integral(x, 0, 1)
>
> -10*e^(-1/10) + 10
> }}}
>
> But the following integral errors out
> {{{
> H = exp(-1.0 * 10^-1*x)
> H.integral(x, 0, 1)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "_sage_input_19.py", line 10, in <module>
>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
> -*-\\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("SCA9IGV4cCgtMS4wKjEwXi0xKngpCkguaW50ZWdyYWwoeCwgMCwgMSk="),globals())+"\\n");
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in <module>
>
>   File "/tmp/tmpE7_LAK/___code___.py", line 4, in <module>
>     exec compile(u'H.integral(x, _sage_const_0 , _sage_const_1 )
>   File "", line 1, in <module>
>
>   File "expression.pyx", line 9058, in
> sage.symbolic.expression.Expression.integral
> (sage/symbolic/expression.cpp:37991)
>   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
> packages/sage/symbolic/integration/integral.py", line 683, in integrate
>     return definite_integral(expression, v, a, b)
>   File "function.pyx", line 432, in
> sage.symbolic.function.Function.__call__
> (sage/symbolic/function.cpp:4941)
>   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
> packages/sage/symbolic/integration/integral.py", line 173, in _eval_
>     return integrator(*args)
>   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
> packages/sage/symbolic/integration/external.py", line 21, in
> maxima_integrator
>     result = maxima.sr_integral(expression, v, a, b)
>   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
> packages/sage/interfaces/maxima_lib.py", line 746, in sr_integral
>     raise error
> RuntimeError: ECL says: In function GCD, the value of the second argument
> is
>   1.0
> which is not of the expected type INTEGER
> }}}

New description:

 This is so trivial that I am surprised this bug even exists. :) Present
 since at least sage-5.2 till present versions.

 The following integral works
 {{{
 H = exp(-x)
 H.integral(x, 0, 1)

 -e^(-1) + 1
 }}}

 But the following integral errors out
 {{{
 H = exp(-1.0 * x)
 H.integral(x, 0, 1)

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

   File "/tmp/tmpE7_LAK/___code___.py", line 4, in <module>
     exec compile(u'H.integral(x, _sage_const_0 , _sage_const_1 )
   File "", line 1, in <module>

   File "expression.pyx", line 9058, in
 sage.symbolic.expression.Expression.integral
 (sage/symbolic/expression.cpp:37991)
   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
 packages/sage/symbolic/integration/integral.py", line 683, in integrate
     return definite_integral(expression, v, a, b)
   File "function.pyx", line 432, in
 sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:4941)
   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
 packages/sage/symbolic/integration/integral.py", line 173, in _eval_
     return integrator(*args)
   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
 packages/sage/symbolic/integration/external.py", line 21, in
 maxima_integrator
     result = maxima.sr_integral(expression, v, a, b)
   File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-
 packages/sage/interfaces/maxima_lib.py", line 746, in sr_integral
     raise error
 RuntimeError: ECL says: In function GCD, the value of the second argument
 is
   1.0
 which is not of the expected type INTEGER
 }}}

--

Comment (by ppurka):

 Even simpler example.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14821#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/groups/opt_out.


Reply via email to