Hi,
I found coeffs does not work with a general function. It would be of
great help for me to have it fixed. Thank you!
I tested 4.7.0, 4.7.2 and 4.8.0alpha5. None of them work, though 4.7.0
gives slightly different result:
# the following is result of 4.7.2 and 4.8alpha5.
sage: g = function('g', var('t'))
sage: f = 3*g + g**2 + t
sage: f.coeff(g)
3
sage: f.coeffs(g)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/wangyi/<ipython console> in <module>()
/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.coefficients
(sage/symbolic/expression.cpp:19003)()
/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/ring.so in
sage.symbolic.ring.SymbolicRing.var (sage/symbolic/ring.cpp:6342)()
/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/ring.so in
sage.symbolic.ring.SymbolicRing.var (sage/symbolic/ring.cpp:6069)()
ValueError: The name "g(t)" is not a valid Python identifier.
# the following is the result of 4.7.0
sage: f.coeffs(g)
[[g(t)^2 + t + 3*g(t), 0]]
--
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