Sumant S.R. Oemrawsingh wrote: > > Say, I wish to define a piece-wise function, > > (1) -> f(x|x<0)==-x**2 > Type: Void > (2) -> f(x)==x**2 > Type: Void > (3) -> draw(f(x),x=-1..1) > Compiling function f with type Variable x -> Polynomial Integer > As an aside I would like to point out that there is an analytic extension from Non-Standard analysis (specifically the Dirac Delta function) that provides a neat uniform framework to describing, transforming, and manipulating piecewise polynomials. It consists of simply writing out the waveforms in terms of the Dirac Delta function of various orders. For instance a ramp that starts at zero, continues for 1.3 units and then goes back to zero is: int(int(Dirac(x))-int(int(Dirac(x-1.5)) -1.5*int(delta(x-1.5)) or d^2(x)-d^2(x-1.5)-1.5*d^1(x-1.5) I haven't seen this approach properly implemented in CAS packages, and don't know if it's of any use. I have used it to do Laplace and Mellin transforms/analysis of discontinuous waveforms though; and found it simplifies the calculations a lot.
Ray _______________________________________________ Axiom-mail mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/axiom-mail
