axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Am I posing this solve problem wrong?
Date: Mon, 05 May 2008 17:48:26 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

On 05/05/2008 04:03 PM, Bill Page wrote:
On Mon, May 5, 2008 at 3:43 AM, Ralf Hemmecke wrote:
...
Having types, Axiom should actually allow you to specify what you want.

 R:=MPOLY([C1,D1,y1,x],Integer)
 P:=MPOLY([y],R)
 E1: P := x^2*D1^2+(y-y1)^2*C1^2 - C1^2*D1^2
 solve(E1=0,y)@List(R))

Unfortunately, that doesn't work (yet), but I would expect it to work in an
ideal AXIOM.


I do not think this can work exactly like this since the solution
cannot be expressed in R.

I refer again to what I wrote in
http://lists.gnu.org/archive/html/axiom-developer/2008-05/msg00022.html

--BEGIN quote
Suppose, I consider the above input expression as an element in R[y]] where the coefficient domain R is Z[C1,D1,y1,x]. And I would like

  solve(E1=0,y)

to stand for "find a (or several) z \in R such that E1[y<--z]=0" where E1[y<--z] is my (fancy) notation for substitution of y by z in E1.
--END quote

I have a polynomial E1 in R[y] and I am looking for those z \in R which make this (univariate) Polynomial vanish. If there are no such z \in R then Axiom should return an empty list (or empty set).

You need Expression in order to include
kernels involving 'sqrt'.

I am not looking for the most general expression.

Or did you have something else in mind?

Yep. I was looking for solutions that live in R.

Inspite of that, could you explain a little more about how you think
the ideal AXIOM should work? It seems to me that the way it works now
is rather complex and is a consequence of several interacting factors
such a coercion rules that heuristically start with the most specify
type (i.e. a polynomial type) using coercion to expand the range of
possibilities.  This is affected in a non-trivial and not so easily
predicted manner by the exports exports from the underlying types.
This is built into the Axiom interpreter in a rather deep way. Is
there a different way this could work that might produce less surprise
(and frustration) on the part of the user?

Ideally, I would like to tell "solve" where it should look for solutions. Consider the simple equation.

  x + 1 = 0

What does "solve for x" actually mean? It is ambiguous.
I would like to say

  solve(x+1=0, x)$Set(PositiveInteger)
  solve(x+1=0, x)$Set(Integer)

(or similar) and get different results.

Of course, now one could say, that one first computes the most general expression for the result. And then filters out results that one is not interested in.

So solve polynomials over the complex numbers and filter out all real solutions, if you are only interested in real solutions.
That's a simple case.

But I guess, there are cases where one would simply switch to another (maybe faster) algorithm if it were known at input time that some of the results are not needed anyway. Why should one bother to waste computation time if the result of that computation is thrown away immediately afterwards? Imagine one has given a polynomial (of high degree) with integer coefficients and looks only for integer solutions? Root isolation can stop if the interval is less than 1 since either there is exactly one solution or none in this interval. (Maybe not the best example to demonstrate what I mean.)

Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]