axiom-developer
[Top][All Lists]

## Re: [Axiom-developer] Am I posing this solve problem wrong?

 From: Bill Page Subject: Re: [Axiom-developer] Am I posing this solve problem wrong? Date: Sun, 4 May 2008 23:46:16 -0400

```On Sun, May 4, 2008 at 10:23 PM, C Y wrote:
>
> --- Bill Page <address@hidden> wrote:
>
>> I guess you need to be a little more explicit about the variables:
>
> Ah.  Thanks Bill.  I wonder if this is the desired default behavior?
>

Well, Axiom is a strongly typed system so specifying the main
variables of a multivariate polynomial with coefficients from some
other ring is not entirely unexpected. But Axiom also provides a
domain that is more like the expressions in Maxima. Probably this is
more like you expected:

(1) -> E1:Expression Integer := x^2*D1^2+(y-y1)^2*C1^2 - C1^2*D1^2

2  2      2         2 2     2 2     2  2
(1)  C1 y1  - 2C1 y y1 + C1 y  + D1 x  - C1 D1
Type: Expression Integer
(2) -> solve(E1=0,y)

+----------+                 +----------+
|   2     2                  |   2     2
D1\|- x  + C1   + C1 y1    - D1\|- x  + C1   + C1 y1
(2)  [y= -----------------------,y= -------------------------]
C1                          C1
Type: List Equation Expression Integer
(3) ->

This way you can be less specific about the type of expressions you
are working with.

You can analyze in more technical detail what actually happened in
your case by tracing the function selection process with the

)set message bottomup on

as follows:

(1) -> E1:= x^2*D1^2+(y-y1)^2*C1^2 - C1^2*D1^2

2  2      2         2 2     2 2     2  2
(1)  C1 y1  - 2C1 y y1 + C1 y  + D1 x  - C1 D1
Type: Polynomial Integer
(2) -> )set mes bot on
(2) -> solve(E1=0,y)

Function Selection for equation
Arguments: (POLY INT,NNI)

[1]  signature:   (POLY INT,POLY INT) -> EQ POLY INT
implemented: slot \$(Polynomial (Integer))(Polynomial (Integer))
from EQ POLY INT

Function Selection for solve
Arguments: (EQ POLY INT,VARIABLE y)

[1]  signature:   (EQ FRAC POLY INT,SYMBOL) -> LIST EQ FRAC POLY INT
implemented: slot (List (Equation (Fraction (Polynomial
(Integer)))))(Equation (Fraction (Polynomial (Integer))))(Symbol) from
SYSSOLP INT

Function Selection for map by coercion facility (map)
Arguments: ((POLY INT -> FRAC POLY INT),EQ POLY INT)
Target type: EQ FRAC POLY INT

[1]  signature:   ((POLY INT -> FRAC POLY INT),EQ POLY INT) -> EQ FRAC POLY INT
implemented: slot (Equation (Fraction (Polynomial
(Integer))))(Mapping (Fraction (Polynomial (Integer))) (Polynomial
(Integer)))(Equation (Polynomial (Integer))) from EQ2(POLY INT,FRAC
POLY INT)

2  2      2         2 2     2 2     2  2
(2)  [C1 y1  - 2C1 y y1 + C1 y  + D1 x  - C1 D1 = 0]
Type: List Equation Fraction Polynomial Integer
(3) ->

-------------

You can see from this that the interpreter chooses the solve operation
with signature:

(EQ FRAC POLY INT,SYMBOL) -> LIST EQ FRAC POLY INT

Of course this version of solve cannot return something of the form
you were expecting.

Regards,
Bill Page.

```