Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I use Groebner's basis in SageMath to solve a nonlinear system?

How do I use Groebner's basis in SageMath to solve a nonlinear system? kindly someone give me an example with this non linear system?

var('N A y a B b C c D d w V v Z z U u')

eq0 = N-4899 == 0

eq1 = (-2 + sqrt(N + (1 - 2*y)^2))/4-A == 0
eq2 = 4*A+1-2*(y-1)-a == 0
eq3 = 8*(A-1)*a-(N-36)-(a-6)^2  == 0
eq4 = ((a-7)-2*(B-1))*((a-5)-2*(B-1))+1-(b-6)^2  == 0
eq5 = ((b-7)-2*(C-1))*((b-5)-2*(C-1))+1-(c-6)^2  == 0
eq6 = ((c-7)-2*(D-1))*((c-5)-2*(D-1))+1-(d-6)^2  == 0
eq7 = 8*(B-1)*a-(a-6)^2+36-(16*B*(B+1)+3) == 0
eq8 = 8*(C-1)*b-(b-6)^2+36-(16*C*(C+1)+3) == 0
eq9 = 8*(D-1)*c-(c-6)^2+36-(16*D*(D+1)+3) == 0
eq10= d-13 == 0

eq11= 8*(A-1)*(4*A+1)-(16*A*(A+1)+3-36)-(w-6)^2 == 0
eq12= ((w-7)-2*(V-1))*((w-5)-2*(V-1))+1-(v-6)^2  == 0
eq13= ((v-7)-2*(Z-1))*((v-5)-2*(Z-1))+1-(z-6)^2  == 0
eq14= ((z-7)-2*(U-1))*((z-5)-2*(U-1))+1-(u-6)^2  == 0
eq15= 8*(V-1)*w-(w-6)^2+36-(16*V*(V+1)+3) == 0
eq16= 8*(Z-1)*v-(v-6)^2+36-(16*Z*(Z+1)+3) == 0
eq17= 8*(U-1)*z-(z-6)^2+36-(16*U*(U+1)+3) == 0
eq18 = u-13 == 0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18],N,A,y,a,B,b,C,c,D,d,w,V,v,Z,z,U,u)
sol = solutions 
print(sol)
click to hide/show revision 2
retagged

How do I use Groebner's basis in SageMath to solve a nonlinear system?

How do I use Groebner's basis in SageMath to solve a nonlinear system? kindly someone give me an example with this non linear system?

var('N A y a B b C c D d w V v Z z U u')

eq0 = N-4899 == 0

eq1 = (-2 + sqrt(N + (1 - 2*y)^2))/4-A == 0
eq2 = 4*A+1-2*(y-1)-a == 0
eq3 = 8*(A-1)*a-(N-36)-(a-6)^2  == 0
eq4 = ((a-7)-2*(B-1))*((a-5)-2*(B-1))+1-(b-6)^2  == 0
eq5 = ((b-7)-2*(C-1))*((b-5)-2*(C-1))+1-(c-6)^2  == 0
eq6 = ((c-7)-2*(D-1))*((c-5)-2*(D-1))+1-(d-6)^2  == 0
eq7 = 8*(B-1)*a-(a-6)^2+36-(16*B*(B+1)+3) == 0
eq8 = 8*(C-1)*b-(b-6)^2+36-(16*C*(C+1)+3) == 0
eq9 = 8*(D-1)*c-(c-6)^2+36-(16*D*(D+1)+3) == 0
eq10= d-13 == 0

eq11= 8*(A-1)*(4*A+1)-(16*A*(A+1)+3-36)-(w-6)^2 == 0
eq12= ((w-7)-2*(V-1))*((w-5)-2*(V-1))+1-(v-6)^2  == 0
eq13= ((v-7)-2*(Z-1))*((v-5)-2*(Z-1))+1-(z-6)^2  == 0
eq14= ((z-7)-2*(U-1))*((z-5)-2*(U-1))+1-(u-6)^2  == 0
eq15= 8*(V-1)*w-(w-6)^2+36-(16*V*(V+1)+3) == 0
eq16= 8*(Z-1)*v-(v-6)^2+36-(16*Z*(Z+1)+3) == 0
eq17= 8*(U-1)*z-(z-6)^2+36-(16*U*(U+1)+3) == 0
eq18 = u-13 == 0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18],N,A,y,a,B,b,C,c,D,d,w,V,v,Z,z,U,u)
sol = solutions 
print(sol)