11 views

Skip to first unread message

Mar 7, 2010, 9:54:26 AM3/7/10

to sage-support

Dear support

when I worked on trac http://trac.sagemath.org/sage_trac/ticket/8459

(which has been motivated by [1]) I got problems with parsing

expressions

With patch for #8459 I get the following (note that the function g(x)

cannot be evaluated numerically, unless I use eval, preparse and

_repr_ )

Can you help me to solve this problem? Thanks.

Robert Marik

----------------------------------------------------------------------

| Sage Version 4.3.3, Release Date: 2010-02-21 |

| Type notebook() for the GUI, and license() for information. |

----------------------------------------------------------------------

Loading Sage library. Current Mercurial branch is: polylog

sage: g(x)=integrate(ln(1-x^2)/x,x)

sage: g(1/2).n()

---------------------------------------------------------------------------

TypeError Traceback (most recent call

last)

/opt/sage-4.3.3/<ipython console> in <module>()

/opt/sage-4.3.3/local/lib/python2.6/site-packages/sage/symbolic/

expression.so in

sage.symbolic.expression.Expression.n (sage/symbolic/expression.cpp:

17036)()

TypeError: cannot evaluate symbolic expresssion numerically

sage: g(x)=eval(preparse(integrate(ln(1-x^2)/x,x)._repr_()))

sage: g(1/2).n()

0.688640713882747

sage: g

x |--> log(-x^2 + 1)*log(x) + 1/2*polylog(2, -x^2 + 1)

-----------------------

[1] http://groups.google.cz/group/sage-support/browse_thread/thread/513d8072be409669

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu