Menu ▾ ▴

#963 linsolve incorrect result

open
nobody
5
2006-08-26
2006-07-23
No

Maxima 5.9.3cvs. linsolve returns an incorrect result
for this example (adapted from bug report 887025).

array(A,4)$

list_eq :
[A[4]+A[3]+A[2]+A[1] = 1,

-A[2]*DY/(2*coeff_y)-A[1]*DY/(2*coeff_y)+A[4]*DY/2+A[3]*DY/2
= 0,

-A[4]*DX/(2*coeff_x)+A[3]*DX/(2*coeff_x)-A[2]*DX/(2*coeff_x)
+ A[1]*DX/(2*coeff_x) = 0];

list_un : [A[1],A[2],A[3],A[4]];
soln_linsolve : linsolve(list_eq,list_un);

=> [A[1] = ((2*%r1+1)*DX+2*%r1-1)/(2*DX+2),
A[2] = -(2*%r1-1)/2,A[3] = -(%r1*DX+%r1-1)/(DX+1),
A[4] = %r1]

Then

ratsimp(subst(soln_linsolve,list_eq));

=> [1 = 1,-(DX-coeff_y)*DY/(2*coeff_y*DX+2*coeff_y) = 0,
0 = 0]

Discussion

  • Barton Willis

    Barton Willis - 2006-08-24

    Logged In: YES
    user_id=895922

    Two observations:

    (1) array(A,4) has nothing to do with this bug.

    (2) to get the solution, replace DX by coeff_y in
    Maxima's solution.

    I know that none of this helps all that much...

    Barton

     
  • Robert Dodier

    Robert Dodier - 2006-08-26
    • labels: 460522 --> Lisp Core - Solving equations
     

Log in to post a comment.