#15219: numerical integral needs an operand for callable symbolic functions
----------------------------+-------------------------
       Reporter:  kcrisman  |        Owner:
           Type:  defect    |       Status:  new
       Priority:  minor     |    Milestone:  sage-5.12
      Component:  calculus  |   Resolution:
       Keywords:            |    Merged in:
        Authors:            |    Reviewers:
Report Upstream:  N/A       |  Work issues:
         Branch:            |       Commit:
   Dependencies:            |     Stopgaps:
----------------------------+-------------------------

Old description:

> I feel like I've seen this before, so close if appropriate...
>
> {{{
>
> sage: h(x) = x
> sage: numerical_integral(h, 1, 2)
> ---------------------------------------------------------------------------
> /Users/.../sage-5.11.rc0/local/lib/python2.7/site-
> packages/sage/symbolic/expression_conversions.pyc in fast_float(ex,
> *vars)
>    1264         1.4142135623730951
>    1265     """
> -> 1266     return FastFloatConverter(ex, *vars)()
>    1267
>    1268 #################
>
> /Users/.../sage-5.11.rc0/local/lib/python2.7/site-
> packages/sage/symbolic/expression_conversions.pyc in __call__(self, ex)
>     206         operator = ex.operator()
>     207         if operator is None:
> --> 208             return self.symbol(ex)
>     209
>     210         if operator in arithmetic_operators:
>
> /Users/.../sage-5.11.rc0/local/lib/python2.7/site-
> packages/sage/symbolic/expression_conversions.pyc in symbol(self, ex)
>    1182             return self.ff.fast_float_constant(float(ex))
>    1183         except TypeError:
> -> 1184             raise ValueError, "free variable: %s" % repr(ex)
>    1185
>    1186     def arithmetic(self, ex, operator):
>
> ValueError: free variable: x |--> x
> }}}
> but
> {{{
> sage: numerical_integral(x, 1, 2)
> (1.5, 1.6653345369377348e-14)
> }}}
> I think this should be easy to fix by catching this somehow.

New description:

 I feel like I've seen this before, so close if appropriate... See
 [http://ask.sagemath.org/question/3029/numerical_integral-throwing-an-
 error this ask.sagemath question].

 {{{

 sage: h(x) = x
 sage: numerical_integral(h, 1, 2)
 ---------------------------------------------------------------------------
 /Users/.../sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/expression_conversions.pyc in fast_float(ex, *vars)
    1264         1.4142135623730951
    1265     """
 -> 1266     return FastFloatConverter(ex, *vars)()
    1267
    1268 #################

 /Users/.../sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/expression_conversions.pyc in __call__(self, ex)
     206         operator = ex.operator()
     207         if operator is None:
 --> 208             return self.symbol(ex)
     209
     210         if operator in arithmetic_operators:

 /Users/.../sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/expression_conversions.pyc in symbol(self, ex)
    1182             return self.ff.fast_float_constant(float(ex))
    1183         except TypeError:
 -> 1184             raise ValueError, "free variable: %s" % repr(ex)
    1185
    1186     def arithmetic(self, ex, operator):

 ValueError: free variable: x |--> x
 }}}
 but
 {{{
 sage: numerical_integral(x, 1, 2)
 (1.5, 1.6653345369377348e-14)
 }}}
 I think this should be easy to fix by catching this somehow.

--

Comment (by kcrisman):

 {{{
 $ hg log -r 12287
 changeset:   12287:d7533ae4895e
 user:        Mike Hansen <[email protected]>
 date:        Tue May 19 16:11:30 2009 -0700
 summary:     Updates for Pynac-0.1.7, main symbolics switch (#5930)
 }}}
 So apparently it's been here for a while.

--
Ticket URL: <http://trac.sagemath.org/ticket/15219#comment:2>
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