#17553: substitute_function() can leave limits unevaluated
-----------------------------+------------------------
Reporter: wonder | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.4
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-----------------------------+------------------------
Comment (by nbruin):
Replying to [comment:4 wonder]:
> {{{
> limop = limit( SR('f(x)'), x=0 ).operator()
> def simplify_limits( expr ):
> def eval_limit( expr, var, val ):
> kv = { str(var):val }
> return limit( expr, **kv )
> return expr.substitute_function( limop, eval_limit )
> }}}
Smart solution. There is an `eval_limit` with the right interface already
available, though:
{{{
limop = limit( SR('f(x)'), x=0 ).operator()
def simplify_limits( expr ):
return expr.substitute_function( limop, maxima_calculus.sr_limit )
}}}
should do the trick. The fact that
{{{
sage: limsym=sage.symbolic.function_factory.function('limit')
sage: limsym == limop
False
}}}
indicates that we really should be making a symbol for "limit" beforehand
(and equip it with the right translations)
--
Ticket URL: <http://trac.sagemath.org/ticket/17553#comment:5>
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.