Re: Defining piece-wise functions and drawing, integrating, ...

Martin Rubey <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
"Sumant S.R. Oemrawsingh" <[email protected]> writes:

> Hi,
> 
> Thanks for the reply. Too bad integration over such functions can't be done
> symbolically. I also don't quite understand why for the draw function, the
> function si compiled with type Variable x -> Polynomial Integer, when
> x=-1..1 is a range in R.

yes, that's very strange and should be debugged.  Maybe you could file a report
on IssueTracker?

> I was hoping I could write down all my stuff in Axiom (symbolically), so that
> I would, say, never have to go through stacks of paper, manually calculating
> overlap integrals of two different, piece-wise functions, or stuff like
> that. It would appear that I still have to do all this manually, if I would
> like a symbolic answer :(

But you can still do this, if you know the boundaries of the functions!  Use
something like

-- lf...list of functions
-- x...integration variable
-- lb...list of boundaries
integratePiecewise(lf: List EXPR INT, x: Symbol, lb: List EXPR INT): EXPR INT ==
    reduce(+, [integrate(f, x=b1..b2) for f in lf for b1 in lb for b2 in rest lb], 0)

Maybe you could even take a single f which is a piecewise defined function, and
extract the necessary information, but that will need a little detective work.


Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.