Dear all

I have been using the .subs(locals()) functionality extensively, but
now I found out that this does not work for piecewise defined
functions.

Example:

sage: var('x a b')
(x, a, b)
sage: f1=a*sin(x)
sage: f2=b*sin(x)
sage: f = Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
sage: a=1
sage: b=-1
sage: f.subs(locals())
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call
last)

...

AttributeError: PiecewisePolynomial instance has no attribute 'subs'

The python function approach also fails in this case:

sage: def g(x):
....:     return  Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
sage: a=1
sage: b=-1
sage: g(1)
Piecewise defined function with 2 parts, [[(0, pi/2), a*sin(x)], [(pi/
2, pi), b*sin(x)]]

Am I doing something wrong?

Cheers
Stan
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to