Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I can't fix this for you (yet?), but I see why this wasn't detected before - the example you reference uses

f = Piecewise([[(0,1),1*x^0]])

which becomes

sage: f
Piecewise defined function with 1 parts, [[(0, 1), 1]]

so the variables don't come into play. Also, the example (and yours) uses a polynomial variable, which of course (?) becomes non-polynomial once e^x is involved. So there are two strikes against this.

It's not clear to me that there is an easy way to get around this, because there isn't an obvious way to turn the polynomial generator x into an exponential, but the code for convolution relies pretty heavily on having those polynomial generators.


Stock disclaimer: all piecewise material dates from before Sage had any true symbolic capabilities. It has since languished. See the piecewise tag here and questions under it, such as this one.


I'm hoping someone more familiar with some of the numerical tools in Sage can help you with your underlying questions. You can certainly get some convolutions, e.g. discrete ones in Numpy, but your use case might be a little trickier.

Maxima used directly might be of help, or perhaps using its integration as at this Maxima feature request or using its piecewise capabilities.

I can't fix this for you (yet?), but I see why this wasn't detected before - the example you reference uses

f = Piecewise([[(0,1),1*x^0]])

which becomes

sage: f
Piecewise defined function with 1 parts, [[(0, 1), 1]]

so the variables don't come into play. Also, the example (and yours) uses a polynomial variable, which of course (?) becomes non-polynomial once e^x is involved. So there are two strikes against this.

It's not clear to me that there is an easy way to get around this, because there isn't an obvious way to turn the polynomial generator x into an exponential, but the code for convolution relies pretty heavily on having those polynomial generators.


Stock disclaimer: all piecewise material dates from before Sage had any true symbolic capabilities. It has since languished. See the piecewise tag here and questions under it, such as this one.


I'm hoping someone more familiar with some of the numerical tools in Sage can help you with your underlying questions. You can certainly get some convolutions, e.g. discrete ones in Numpy, but your use case might be a little trickier.

Maxima used directly might be of help, or perhaps using its integration as at this Maxima feature request or using its piecewise capabilities.