|
|
last edited 17 years ago by kratt6 |
1 2 3 | ||
Editor:
Time: 2007/11/17 22:24:33 GMT-8 |
||
Note: Maybe it's enough to expose PartialFractionPackage |
changed: - This example is from Ulrich Schwardmann: Computeralgebra-Systeme, Addison-Wesley, 1995, p127f. It tries to compute a partial fraction of a fraction with unknown constants. The result is not the expected partial fraction decomposition, and does not seem to have any other senseful interpretation (it is q/x). Following is a verification of the partial fraction that macsyma computes. \begin{axiom} q:=(x+a)/(x*(x**3+(b+c)*x**2+b*c*x)) partialFraction(q,x) (c-a)/((c^3-b*c**2)*(x+c))-(b-a)/((b**2*c-b**3)*(x+b))+((b-a)*c-a*b)/(b**2*c**2*x)+a/(b*c*x**2) - q \end{axiom} From kratt6 Tue Aug 8 08:42:30 -0500 2006 From: kratt6 Date: Tue, 08 Aug 2006 08:42:30 -0500 Subject: workaround Message-ID: <20060808084230-0500@wiki.axiom-developer.org> it seems that it is better to use 'partialFraction\$PartialFraction'. I did it as follows: \begin{axiom} SUP FRAC POLY INT has EUCDOM den := univariate((x*(x**3+(b+c)*x**2+b*c*x)),x)::SUP FRAC POLY INT num := univariate(x+a,x)::SUP FRAC POLY INT partialFraction(num, factor den)$PartialFraction SUP FRAC POLY INT \end{axiom} Does this suggest that the bug is in 'PartialFractionPackage'? From kratt6 Sat Aug 12 05:09:42 -0500 2006 From: kratt6 Date: Sat, 12 Aug 2006 05:09:42 -0500 Subject: Axiom chooses the "wrong" signature Message-ID: <20060812050942-0500@wiki.axiom-developer.org> The reason for the behaviour described above is quite simple to explain - unfortunately... There are two operations 'partialFraction' with two arguments:: partialFraction: (R, FRR) -> % ++ partialFraction(numer,denom) is the main function for ++ constructing partial fractions. The second argument is the ++ denominator and should be factored. from the exposed domain 'PartialFraction' and:: partialFraction: (FPR, Symbol) -> Any ++ partialFraction(rf, var) returns the partial fraction decomposition ++ of the rational function rf with respect to the variable var. from the unexposed package 'PartialFractionPackage'. Of course, the interpreter chooses the exposed domain, which produced the surprising result. This shows that overloading should be done very carefully. I think we should rename the operations in 'PartialFractionPackage'. Martin Martin From ChristianSievers Tue Aug 15 10:48:13 -0500 2006 From: Christian Sievers Date: Tue, 15 Aug 2006 10:48:13 -0500 Subject: Maybe it's enough to expose PartialFractionPackage Message-ID: <20060815104813-0500@wiki.axiom-developer.org> (Sorry for not first testing a simpler example...) I came to the same result this weekend. It seems to me from first tests that it would suffice to just also expose PartialFractionPackage. However I don't know axiom good enough to see if there are any unwanted side effects. \begin{axiom} )expose PFRPAC partialFraction((x+a)/(x*(x**3+(b+c)*x**2+b*c*x)),x) partialFraction(1,10) \end{axiom}
This example is from Ulrich Schwardmann: Computeralgebra-Systeme, Addison-Wesley, 1995, p127f. It tries to compute a partial fraction of a fraction with unknown constants. The result is not the expected partial fraction decomposition, and does not seem to have any other senseful interpretation (it is q/x).
Following is a verification of the partial fraction that macsyma computes.
axiomq:=(x+a)/(x*(x**3+(b+c)*x**2+b*c*x))
![]() | (1) |
axiompartialFraction(q,x)
![]() | (2) |
axiom(c-a)/((c^3-b*c**2)*(x+c))-(b-a)/((b**2*c-b**3)*(x+b))+((b-a)*c-a*b)/(b**2*c**2*x)+a/(b*c*x**2) - q
![]() | (3) |
partialFraction$PartialFraction
. I did it as follows:
axiomSUP FRAC POLY INT has EUCDOM
![]() | (4) |
axiomden := univariate((x*(x**3+(b+c)*x**2+b*c*x)),x)::SUP FRAC POLY INT
![]() | (5) |
axiomnum := univariate(x+a,x)::SUP FRAC POLY INT
![]() | (6) |
axiompartialFraction(num, factor den)$PartialFraction SUP FRAC POLY INT
![]() | (7) |
Does this suggest that the bug is in PartialFractionPackage
?
There are two operations partialFraction
with two arguments:
partialFraction: (R, FRR) -> % ++ partialFraction(numer,denom) is the main function for ++ constructing partial fractions. The second argument is the ++ denominator and should be factored.
from the exposed domain PartialFraction
and:
partialFraction: (FPR, Symbol) -> Any ++ partialFraction(rf, var) returns the partial fraction decomposition ++ of the rational function rf with respect to the variable var.
from the unexposed package PartialFractionPackage
. Of course, the interpreter chooses the exposed domain, which produced the surprising result.
This shows that overloading should be done very carefully. I think we should rename the operations in PartialFractionPackage
.
Martin
Martin
I came to the same result this weekend. It seems to me from first tests that it would suffice to just also expose PartialFractionPackage?. However I don't know axiom good enough to see if there are any unwanted side effects.
axiom)expose PFRPAC PartialFractionPackage is now explicitly exposed in frame initial partialFraction((x+a)/(x*(x**3+(b+c)*x**2+b*c*x)),x)
![]() | (8) |
axiompartialFraction(1,10)
![]() | (9) |