Bug in z_transform.mac?



>FYI, I'm currently adding support for a Heaviside step function
>hstep(x) such that hstep(0)=1/2.  Perhaps we should support all three
>common variants of unit_step: left-continuous, right-continuous, and
>hstep.  It should not be too hard to search for all occurrences of
>unit_step in the code and incorporate support for the other variants.
>
>What do you think?

"There are simplifications  involving sums and products of these functions
that would be difficult to detect; for example

  x * (left_continuous_step(x) -  right_continuous_step(x)) = 0.

Some days I think we should concentrate on making Maxima conditionals (if 
then else)
better instead of appending more step-like functions. It be great if Maxima 
do

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

and

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

At least for linear inequalities, I think this is algorithmically possible."

I have made small changes to pw.mac which makes this possible for simple 
cases.

Now you can do this.

(%i2) load(pw)$
(%i3) (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1);
(out3)                                                            (if x < 0 
then 0 else 1) - (if x <= 0 then 0 else 1)
(%i4) iif2ifthen(pwsimp(%,x,iif));
(out4) 
if equal(x, 0) then 1 else 0

"I think this is algorithmically possible."

Yes, it is possible but maybe it should not be part of pw.mac.  Pw does it 
by converting to iif() then to signum() expressions and then simplifying 
them and then converting back to if then.  You could start there.

Rich