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



There is a package solver in maxima for solving equations with
parameters. It has some bugs but with the current cvs you get

Maxima 5.12 + Solver
==================

(%i1) load(solver)$

Everything is assumed to be a variable:

(%i2) Solver([x=2, y=3], [x]);
(%o2) [[x=2]]

Unless you declare it to be a parameter:

(%i3) Solver([x=2, y=3], [x], [y]);
Is  y - 3   positive, negative, or zero? zero;
(%o3) [[x=2]]

(%i4) Solver([x=a, y=b], [x]);
(%o4) [[x=a]]

(%i5) Solver([x=a, y=b], [x], [y, b]);
Is  y - b   positive, negative, or zero? zero;
(%o5) [[x=a]]

(%i6) Solver([x=2, y=3], [y,x]);
(%o6) [[y=3,x=2]]

(%i7) Solver([a*x=x], [x]);
(%o7) [[x=0]]

(%i8) Solver([a*x=x], [x], [a]);
(%o8) [[x=0]]

(%i9) Solver([x/x=1], [x]);
(%o9) []

(%i10) Solver([x=2, y=x+3, y=1], [x,y]);
(%o10) [[x=2,y=1]]

(%i11) MsgLevel : SHORT$
(%i12) Solver([x=2, y=3, y=1], [x,y]);
Checking for inconsistencies...
... none found.
Searching for immediate assignments.
Inconsistent equations: y=1
Solver terminated.
#0: TerminateSolver()(solver.mac line 549)
#1: ImmediateAssignments(solutions=[],remainingeqs=[[],[],y =
1],variables=[x,y],parameters=[])(solver.mac line 1001)
#2: Solver(equations=[x = 2,y = 3,y =
1],solverparams=[[x,y]])(solver.mac line 473)
 -- an error.  To debug this try debugmode(true);

Andrej

On 4/3/07, Kostas Oikonomou <ko at research.att.com> wrote:
> To shed some light on the "linsolve, etc" discussion, I did the
> following experiments in solving simple "borderline" equations with
> Mathematica, Maple, and Maxima.
>
> Mathematica 5
> ==============
>
> Solve[{x==2,y==3}, {x}]
> {{x -> 2}}
>
> Solve[{x==2,y==3}, {x,y}]
> {{x -> 2, y -> 3}}
>
> Solve[{x==a,y==b}, {x}]
> {{x -> a}}
>
> Solve[x==a*x, x]
> {{x -> 0}}
>
> Solve[x==a*x, {a,x}]
> Solve::svars: Equations may not give solutions for all "solve" variables.
> {{a -> 1}, {x -> 0}}
>
> Solve[x/x==1, x]
> {{}}
>
> Solve[{x==2,y==x+3,y==1}, {x,y}]
> {}
>
> Solve[{x==2,y==x+3,y==1}, x]
> {}
>
> Solve[{x==2,y==3,y==1}, x]
> {}
>
>
> Maple 10
> ========
>
> solve([x=2,y=3], [x]);
>
> []
>
> solve([x=2,y=3], [x,y]);
> [[x = 2, y = 3]]
>
> solve([x=a,y=b],[x]);
> []
>
> solve(x=a*x,x);
> 0
>
> solve(x=a*x, [x,a]);
> [[x = 0, a = a], [x = x, a = 1]]
>
> solve(x/x=1,x);
> x
>
> solve(x/x=1,[x]);
> [[x = x]]
>
> solve([x=2,y=x+3,y=1], [x,y]);
> []
>
> solve([x=2,y=x+3,y=1], [x]);
> []
>
> solve([x=2,y=x+3,y=1], [x]);
> []
>
> solve([x=2,y=3,y=1], [x]);
> []
>
>
> Maxima 5.11
> ============
>
> solve([x=2,y=3], [x]);
> Lisp error
>
> solve([x=a,y=b],[x]);
> Lisp error
>
> solve([x=2,y=3], [x,y]);
> [[x = 2, y = 3]]
>
> solve(x=a*x,x);
> [x=0]
>
> solve(x=a*x, [x,a]);
> [[x = 0, a = %r1], [x = %r2, a = 1]]
>
> solve(x/x=1,x);
> all
>
> solve([x=2,y=x+3,y=1], [x,y]);
> Lisp error
>
> solve([x=2,y=x+3,y=1], [x]);
> Lisp error
>
> solve([x=2,y=x+3,y=1], [x]);
> Lisp error
>
> solve([x=2,y=3,y=1], [x]);
> Lisp error
>
>                                 Kostas
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima