On Mon, Sep 17, 2012 at 5:55 PM, Dan Aldrich <daldr...@earthlink.net> wrote: > Can't seem to get the convolution of these two functions. > > f(t) = unit_step(t) - unit_step(t-3) > > g(t) = unit_step(t) - unit_step(t-1)
Sorry, the Piecewise class is very clunky and old. Is something like this helpful? sage: x = PolynomialRing(QQ,'x').gen() sage: f1 = 1*x^0 sage: f2 = -x^0 sage: f = Piecewise([[(0,3),f1],[(3,100),f2]]) sage: g = Piecewise([[(0,1),f1],[(1,100),f2]]) sage: f.convolution(g) Piecewise defined function with 7 parts, [[(0, 1), x], [(1, 3), -x + 4], [(3, 4), -3*x + 8], [(4, 100), x - 200], [(100, 101), 3*x - 208], [(101, 103), x - 4], [(103, 200), -x + 200]] sage: I think maxima has this capability but I've forgotten which libraries to load for it. > > Matlab (argggggghh...) does it simply: conv(f,g). I tried the methods in the > documentation: z = f.convolution(g), but no no luck getting it to work in > sage. > > Thanks, > -d > > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To post to this group, send email to sage-support@googlegroups.com. > To unsubscribe from this group, send email to > sage-support+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to sage-support@googlegroups.com. To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support?hl=en.