Problem with linsolve?



Kostas,

I get that 2nd, 3rd, and 4th equation are inconsistent. Linsolve
returns a solution if I take out r(2),r(3), and r(4) equations. BTW, I
checked this on Maxima 5.9.0. My  Maxima 5.11 is on a machine that is
not connected to the internet.

HTH,
Milan

* Kostas Oikonomou <ko at research.att.com> [2007-04-01 12:25:43 -0400]:

> Barton,
> 
> Thanks for replying.  I posted a simplified version of the problem, 
> perhaps it was misleading. (By the way, I have 5.11.0 with SBCL 1.0.1)
> 
> Here is the real problem: I have a 3x3 matrix with specified row and 
> column sums, and I want to solve for 3 of the 9 elements:
> 
> X : genmatrix(x,3,3)
> r(i) := sum(X[i,j],j,1,3)$
> c(j) := sum(X[i,j],i,1,3)$
> linsolve(
>   [r(1)=10,r(2)=5,r(3)=3, c(1)=1,c(2)=3,c(3)=13],
>   [x[1,1],x[1,2],x[1,3]]
> )
> 
> Maxima encountered a Lisp error:
> Error during processing of --eval option "(cl-user::run)":
> The value 2 is not of type LIST.
> Automatically continuing.
> To reenable the Lisp debugger set *debugger-hook* to nil.
> 
> Am I doing something wrong?
> 
> 			Kostas
> 
> Barton Willis wrote:
> > I get (Maxima 5.11.0):
> > 
> > Inconsistent equations:  (2)
> >  -- an error.  To debug this try debugmode(true);
> > (%i4) [r(1)=10, r(2)=5];
> > (%o4) [x[1,3]+x[1,2]+x[1,1]=10,x[2,3]+x[2,2]+x[2,1]=5]
> > 
> > Looking at your equations
> > 
> > (%i4) [r(1)=10, r(2)=5];
> > (%o4) [x[1,3]+x[1,2]+x[1,1]=10,x[2,3]+x[2,2]+x[2,1]=5]
> > 
> > I see that the second equation doesn't depend on X[1,1]
> > or X[1,2]. So the error seems okay; for example
> > 
> > (%i7) linsolve([x=6],[y]);
> > Inconsistent equations:  (1)
> > 
> > What is the output of build_info() ?
> > 
> > Barton
> > 
> > -----maxima-bounces at math.utexas.edu wrote: -----
> > 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima

--