[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-mail] Converting to and from partial fractions
From: |
Martin Rubey |
Subject: |
Re: [Axiom-mail] Converting to and from partial fractions |
Date: |
03 Jun 2007 11:18:39 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
"Alasdair McAndrew" <address@hidden> writes:
> This is an example of where Axiom's handling of domains fries my limited
> brain.
Never say such things.
> ex:=z/(z-1)+2*z/(z-3)
>
> (Result is returned as a single polynomial fraction.)
Yes. That's the "canonical form" for FRAC POLY INT.
> Now, what I want to do is to break this single fraction up into its original
> components. The canonical way to do this (for my purposes), is to divide
> the fraction by z, form partial fractions, and multiply through by z. Here
> goes:
>
> exf:=partialFraction(ex/z::FRAC POLY INT,z)$PFRPAC(INT)
>
> Now, because the result is returned as a partial fraction,if I try
>
> nthFractionalTerm(exf,1)*z
>
> I don't get 2*z/(z-3), but 2+6/(z-3). So I need to remove this term from
> its partialFraction domain.
>
> But none of nthFractionalTerm(exf,1)::FRAC POLY INT,
Look at the type of nthFractionalTerm(exf,1) and you'll see why: axiom is too
stupid to go the long way from
PartialFraction UnivariatePolynomial(z,Fraction Polynomial Integer)
to
FRAC POLY INT
Using HyperDoc, you can browse the operations of PartialFraction, select coerce
(for which :: is syntactic sugar) and find that it has a coercion
PartialFraction R -> Fraction R
Thus
nthFractionalTerm(exf,1)::FRAC UP(z,FRAC POLY INT)
will do what you want.
Martin