On 05/08/11 18:20, kcrisman wrote:

On Aug 5, 12:07 pm, Nils Bruin<[email protected]>  wrote:
On Aug 5, 8:41 am, Jose Guzman<[email protected]>  wrote:

In either case, Sage returns the same error:
TypeError: unable to make sense of Maxima expression
'v(t)=-e^-(t*gL/cm)*(at(integrate((EL*gL+signum(t-5)-signum(t-13))*e^(t*gL/ 
cm),t),[t=0,v(t)=-65])-integrate((EL*gL+signum(t-5)-signum(t-13))*e^(t*gL/c 
m),t)+65*cm)/cm'
in Sage
That seems a bug to me. It is probably because maxima's "at" function
Hmm.  Maxima's at function IS translated, as you can see in that the
final error has 'at' in it.  In calculus.py:

     delayed_functions = maxima_qp.findall(s)
     if len(delayed_functions)>  0:
         for X in delayed_functions:
             if X == '?%at': # we will replace Maxima's "at" with
symbolic evaluation, not an SFunction
                 pass
             else:
                 syms[X[2:]] = function_factory(X[2:])
         s = s.replace("?%","")

Probably the problem is that this was too naive.  The thing you did
with M(expr).sage() bypasses this, because this 'at' is not
universally imported into the global namespace.  Maybe it should be?

- kcrisman


similar functionality is available in the form of "substitute" and
"call". Here is a more direct way of arriving at a similar error
(requires 4.7.1 for interfacing with the LISP below, but that should
not be essential for exposing the problem):

sage: M=sage.calculus.calculus.maxima
sage: E=sage.libs.ecl.ecl_eval
sage: expr=E("#$at(derivative(f(x),x),[x=0])$")
sage: M(expr)
?%at('diff(f(x),x,1),[x=0])
sage: M(expr).sage()
[...]
TypeError: unable to make sense of Maxima expression 'at(diff(f(x),x,
1),[x=0])' in Sage

You can help sage by filing a bug report.
I would be willing to 1) submit a bug report, and even 2) try to solve it if somebody would assist me with whole process of submitting a track (maybe in #sagemath channel on freenode. That would be a fantastic opportunity to collaborate with the Sage development. I would be very happy to have the option of integrating this kind of functions in Sage.

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to