On Mon, 2004-01-26 at 21:09, Stavros Macrakis wrote:
> > As you see, using solve on all the parameters involved in
> > place of linsolve on the real unknowns of the problem would
> > become rather messy
>
> In further testing, I find that in 5.9.0 at least, solve and linsolve
> give an incorrect answer, but algsys gives the correct answer (without
> including the parameters among the variable for which to solve). Just
> be aware that algsys returns a *list* of solutions, not one solution.
>
> Algsys does have known bugs (see the bug list), but if I remember
> correctly, none of them apply to the linear case.
>
> -s
Hello,
I rapidly verified that algsys solves the proposed system,
and I moved on to test another simple case, but this returned a
##########
Type-error in KERNEL::OBJECT-NOT-LIST-ERROR-HANDLER:
#:G4445 is not of type LIST
##########
The "small" code to verify is :
##########
kill (all)$
array(coe,4)$
list_eq : [coe[4]+coe[3]+coe[2]+coe[1] = 1,
-coe[2]*DY/(2*coeff_y)-coe[1]*DY/(2*coeff_y)+coe[4]*DY/2+coe[3]*DY/2 =
0,
-coe[4]*DX/(2*coeff_x)+coe[3]*DX/(2*coeff_x)-coe[2]*DX/(2*coeff_x) +
coe[1]*DX/(2*coeff_x) = 0]$
list_un : [coe[1],coe[2],coe[3],coe[4]]$
sol : linsolve(list_eq,list_un)$
test : ratsimp(subst(sol,list_eq))$
display(test)$
sol_bis : (algsys(list_eq,list_un))[1]$
test_bis : ratsimp(subst(sol_bis,list_eq));
display(test_bis)$
array(coe_2,6)$
list_eq_2 : [coe_2[3]+coe_2[2]+coe_2[1] =
0,coe_2[3]*DX-coe_2[2]*DX+coe_2[6]+coe_2[5]+coe_2[4] = 1,
coe_2[3]*DX^2/2+coe_2[2]*DX^2/2+coe_2[6]*DX-coe_2[5]*DX =
0,
coe_2[3]*DX^3/6-coe_2[2]*DX^3/6+coe_2[6]*DX^2/2+coe_2[5]*DX^2/2 =
0,
coe_2[3]*DX^4/24+coe_2[2]*DX^4/24+coe_2[6]*DX^3/6-coe_2[5]*DX^3/6 = 0]$
list_un_2 : [coe_2[1],coe_2[2],coe_2[3],coe_2[4],coe_2[5],coe_2[6]]$
sol_2 : linsolve(list_eq_2,list_un_2)$
test_2 : ratsimp(subst(sol_2,list_eq_2));
display(test_2)$
sol_2_bis : (algsys(list_eq_2,list_un_2))[1]$
test_2_bis : ratsimp(subst(sol_2_bis,list_eq_2));
display(test_2_bis)$
##########
listp for list_eq_2 and list_un_2 returns true, and
linsolve works.
I rapidly searched the bug database but did not find any
apparent connection.
I will perform a more in deep analysis in the
next days, reading better about algsys. Maybe
I did not used it correctly.
Best Regards