Why does linsolve not give a solution

Messages in english

Modérateur : xcasadmin

jocaps
Messages : 120
Inscription : lun. avr. 17, 2017 4:32 pm

Why does linsolve not give a solution

Message par jocaps » mar. nov. 20, 2018 9:09 am

Hi,

I have a system of equations which are clearly linear with respect to some of the variables (in my problem these are b_0_8 and b_0_9). So technically one should be able to get the solution using only linsolve for solving only these variables. In giac I am able to arrive to the solution using Groebner basis ellimination, but I think this is too expensive for this system of equations (I don't know whats behind gbasis of giac, but is it correct to assume that it's more expensive to use gbasis than linsolve if both can arrive to the system of solutions?). I tried this both in giacpy and XCas yielding empty solutions with linsolve. In any case, I illustrate the problem here (in giacpy code):

Code : Tout sélectionner

from giacpy import giac, gbasis

vars = giac("[b_0_8,b_0_9,s,t]")
ideal = giac("[64*b_0_8*t^2-32*b_0_8+64*b_0_9*t-64*b_0_9+1280, 12*b_0_8*s^3*t-16*b_0_8*s*t^2+24*b_0_8*s*t-12*b_0_9*s^3*t^2-8*b_0_9*s*t^2+32*b_0_9*s+192*s^3*t^2-96*s^3*t+256*s*t^2-192*s*t, -16*b_0_8*s+12*b_0_9*s^3*t-16*b_0_9*s*t^2+24*b_0_9*s*t+192*s^3*t^2-192*s^3*t+384*s*t^2-384*s*t-384*s, -12*b_0_8*s^3*t^2-8*b_0_8*s*t^2+32*b_0_8*s-32*b_0_9*s+96*s^3*t^2-384*s^3*t+576*s*t^2-768*s*t+256*s, 8*b_0_8+128*t^2-64, 16*b_0_9+256*t-256, 16*b_0_8+256*t^2-128, 16*b_0_9+256*t-256,-4+3*s^4+(-4*t+4)*s^2,t^3-2]")
gb = gbasis(ideal,vars,"plex") #returns the correct solution, [b_0_8+16*t^2-8,b_0_9+16*t-16,3*s^4-4*s^2*t+4*s^2-4,t^3-2]
# print linsolve(ideal, giac("[b_0_8,b_0_9]") # does not return a solution, even if I remove the last two equations in ideal, why? this is linear wrt the given variables)

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Why does linsolve not give a solution

Message par parisse » mar. nov. 20, 2018 12:38 pm

What did you try exactly?
If I run linsolve(gb[0:2],vars[0:2]), I get [-16*t**2+8,-16*t+16]

jocaps
Messages : 120
Inscription : lun. avr. 17, 2017 4:32 pm

Re: Why does linsolve not give a solution

Message par jocaps » mar. nov. 20, 2018 1:47 pm

parisse a écrit :
mar. nov. 20, 2018 12:38 pm
What did you try exactly?
If I run linsolve(gb[0:2],vars[0:2]), I get [-16*t**2+8,-16*t+16]
gb is already the solution. I tried

Code : Tout sélectionner

linsolve(ideal, giac("[b_0_8,b_0_9]")
Technically the solution is already in ideal (so of course I could choose these from ideal), but I guess the extra equations in the beginning will force linsolve to yield an empty solution. So, I think it's my fault. Although I know the equations are linear in terms of b_0_8 and b_0_9, this is deceiving and thinking that linsolve will solve it is wrong, the other terms that are of higher degree cannot be eliminated with linear methods and one has to use gbasis. But my question remains, if I continue using gbasis even for linear systems will I experience more delay in the computation of the solutions? I guess the best way is just to come up with a system of linear equations myself and do a benchmarl linsolve vs. gbasis.
Dernière modification par jocaps le mar. nov. 20, 2018 1:55 pm, modifié 1 fois.

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Why does linsolve not give a solution

Message par parisse » mar. nov. 20, 2018 1:54 pm

Indeed, but then you can run linsolve(ideal[0:2],vars[0:2])
Of course it will return a solution that depends on s.

Répondre