Solution of "borderline" eqs. in Mathematica, Maple, and Maxima (was "linsolve")



> Solver's pdf documentation is 135 (!!!) blank (!!!) pages.  Perhaps it
> uses some special fonts?  The HTML version is not well-formatted, and
> seems to have been automatically translated from the German and is
> hard to understand. From what I can tell, it is a very nice package
> for some difficult problems.  However, I couldn't find a clear
> presentation of its semantics (but I admit I didn't look very hard),
> though there is a detailed presentation of its internals.

The pdf I have on linux is about 50 pages of the description of the
Solver package, after that there are examples and complete code for
Solver (as it was when pdf was written). It is in German, I guess the
HTML is translation of this pdf.

> Here are some strange cases:
>
> 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.

> Solver([x=2, y=3], [x], [y]);
> > Is  y - 3   positive, negative, or zero? pos
> Error: Solver terminated. (backtrace shows that it knows that it is a
> parameter consistency problem, but why did it ask the question in the
> first place?)

If y is a parameter, then the system has a solution only if this
parameter is equal to 3, otherwise the last equation is inconsistent.
Solver always checks if there are any conditions on the parameters and
if there are if they are satisfied.

> 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.

> 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.

A more clear example is perhaps

(%i4) Solver([x+y=3, x-y=sin(x)^2+cos(x)^2], [x,y]);
(%o4) [[x=3-y,[-sin(y-3)^2-cos(y-3)^2-2*y+3]]]

You get x=3-y and y should be computed from the returned equation.

BTW:

(%i5) TransformTrig(Eq,Var,Par) := block([E:trigsimp(Eq)], if E=Eq
then [] else E);
(%o5) TransformTrig(Eq,Var,Par):=block([E:trigsimp(Eq)],if E=Eq then [] else E)
(%i6) Solver_Transforms:[TransformTrig];
(%o6) [TransformTrig]
(%i7) Solver([x+y=3, x-y=sin(x)^2+cos(x)^2], [x,y]);
(%o7) [[x=2,y=1]]


-- 
Andrej