From: Andrei Z. <zoa...@gm...> - 2024-11-28 13:44:41
|
Hi, Eduardo! There was a PW package by Richard Hennessy. It's still available online if you search, but it's unmaintained and abandoned. The latest version is 6.5. When I tried to use it, it reported a syntax error which I had to fix manually; I removed "_funcs" symbol from the list of block variables inside of 'pwint' function definition. Now it works fine. As to your example, try load(pw)$ f(x) := ''(piecewise( [minf, 0, 0, 1, 1,0, inf], x))$ g(x) := ''(piecewise( [minf, 0, 0, x, 1,0, inf], x))$ pwint(f(t)*g(x-t), t, -2, 2); Best wishes, Andrei Zorine чт, 28 нояб. 2024 г. в 00:59, Eduardo Ochs <edu...@gm...>: > Hi list, > > what is the recommended way to integrate piecewise defined > functions? I tried this, > > f(x) := if x<0 then 0 > elseif x<1 then 1 > else 0; > g(x) := if x<0 then 0 > elseif x<1 then x > else 0; > h(x) := integrate(f(t)*g(x-t), t, -2, +2); > > and I couldn't find a way to make Maxima calculate this > integral... > > integrate(f(x), x, -2, 4); > float(integrate(f(x), x, -2, 4)); > > The convolution left Maxima even more confused, obviously... > Thanks in advance! > Eduardo Ochs > http://anggtwu.net/eev-maxima.html > http://anggtwu.net/eev-qdraw.html > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |