windowed functions



Daniel,

Robert Dodier has written a share package (boolsimp) which handles many
cases of conditional or piecewise definitions.  I encourage you to load it
and experiment with it.

After quite a few discussions on the mailing list, we have decided NOT to
make boolsimp's handling of "if" part of standard Maxima because of some
unresolved design issues, for example, boolsimp gives an error for
subst(0,x,if equal(x,0) then 0 else 1/x).

There is also a lot of work to be done on simplification and other
operations.  There is not currently support for differentiating and
integrating piecewise functions, for simplifying them in useful ways, etc.
For example, you'd like things like:

          expand(    (if x>0 then x else -x) * (if x>0 then 1/x else 1) ) =>
               if x>0 then 1 else -x

          if x>0 then (if x<0 then 1 else 0) else 2 =>
               if x>0 then 0 else 2

etc., but we need to work on all that....

Another way to approach all this which *does* support some simplification is
using signum to construct algebraic expressions with steps in them.  The
expressions get very messy, but Maxima can currently do more simplifications
on them.

            -s