Solution of "borderline" eqs. in Mathematica, Maple, and Maxima (was "linsolve")
Subject: Solution of "borderline" eqs. in Mathematica, Maple, and Maxima (was "linsolve")
From: Stavros Macrakis
Date: Tue, 3 Apr 2007 17:35:30 -0400
On 4/3/07, Andrej Vodopivec <andrej.vodopivec at gmail.com> wrote:
> The pdf I have on linux is about 50 pages of the description of the
> Solver package,
I have a bunch of comments/criticisms on Solver below, but let me
preface them by first saying that I am aware that the built-in solve
also has problems....
I admit I gave up trying to understand the translated version, but in
a quick look, I didn't find user documentation. The doc starts with
very detailed internal documentation (how it works).
> > Solver([],[x]); => [] ??? should be ALL or equivalent
> > Solver([1=1],[x]) => [] ??? should be ALL
> > Solver([x=x],[x]) => Error: part called on atom: 0
> > Solver([x=1],[y]) => [[]] ??? should be ALL
>
> In all cases Solver computes lsh(eq)-rhs(eq) and tries to solve for
> the variable (x or y in last case). Since there is no equation which
> contains the variable no solution is found. Maybe this could be
> intetrpreted as ALL.
Is it always correct to interpret [] as ALL?
Solver seems to have a variety of ways of reporting inconsistency...
Solver([x=1,x=2],[x]) => [[]]
Solver([x=x+1],[x]) => [[[-1]]]
Solver([x=y,y=x+1],[x,y]) => internal error
Solver([x=y,y=x+1],[x,y]) => internal error
>From the user's point of view, shouldn't these all give the same kind of answer?
> > Solver([a*x=x], [x,a]) => [[x=0]] ??? what happened to a=1?
>
> After a*x=x is solved for x there are no equations left to solve for a
> so no solution for a is returned.
That is an explanation of *why* it doesn't solve this system correctly
in terms of its internal operations. But it is still missing a whole
family of solutions, which doesn't seem acceptable as black-box
behavior, especially since both x and a are explicitly given as
variables (not parameters).
> > Solver([x=x+1],[x]); => [[[- 1]]] ??? what does this mean?
>
> After lhs(eq)-rhs(eq)=-1. Since this equation does not contain x no
> solutions are returned. But since you still have the -1=0 equation, it
> is returned.
Can't Solver detect that this is an inconsistency, and that therefore
*no* values of x will satisfy the equation?
-s