ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 19 Dec 2011 19:48:59 +0100determine consistency of nonlinear system of equationshttps://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/Hello,
I need to be able to determine the consistency of very large systems of polynomial equations, with 30-40 variables and as many equations. When I put such systems into ``solve``, I get the same system back again. Here are some equations typical of those in the systems I am dealing with:
``2*a0*b0 == 0,``
``2*a0*b5 + 2*a1*b4 + 2*a4*b1 + 2*a5*b0 - 4*a8*b8 == 0,``
``2*a0*b10 + 2*a1*b9 + 2*a10*b0 + 2*a2*b8 + 2*a8*b2 + 2*a9*b1 == 0,``
``3*b0^2*c6 + 6*b0*b1*c5 + 6*b0*b2*c4 + 6*b0*b4*c2 + 6*b0*b5*c1 + 6*b0*b6*c0 - 12*b0*b8*c9 - 12*b0*b9*c8 + 3*b1^2*c4 + 6*b1*b4*c1 + 6*b1*b5*c0 - 12*b1*b8*c8 + 6*b2*b4*c0 - 6*b8^2*c1 - 12*b8*b9*c0 + 2*a0*a6 + 2*a1*a5 + 2*a2*a4 - 4*a8*a9 == 0``
This is not a complete system - just a few equations to show the lengths of equations that tend to come up. Again, I don't care what any solutions are; I just need to know if any exist. Is there a way to do this in sage?
Thanks!Thu, 08 Dec 2011 14:32:48 +0100https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/Answer by Volker Braun for <p>Hello,</p>
<p>I need to be able to determine the consistency of very large systems of polynomial equations, with 30-40 variables and as many equations. When I put such systems into <code>solve</code>, I get the same system back again. Here are some equations typical of those in the systems I am dealing with:</p>
<p><code>2*a0*b0 == 0,</code></p>
<p><code>2*a0*b5 + 2*a1*b4 + 2*a4*b1 + 2*a5*b0 - 4*a8*b8 == 0,</code></p>
<p><code>2*a0*b10 + 2*a1*b9 + 2*a10*b0 + 2*a2*b8 + 2*a8*b2 + 2*a9*b1 == 0,</code></p>
<p><code>3*b0^2*c6 + 6*b0*b1*c5 + 6*b0*b2*c4 + 6*b0*b4*c2 + 6*b0*b5*c1 + 6*b0*b6*c0 - 12*b0*b8*c9 - 12*b0*b9*c8 + 3*b1^2*c4 + 6*b1*b4*c1 + 6*b1*b5*c0 - 12*b1*b8*c8 + 6*b2*b4*c0 - 6*b8^2*c1 - 12*b8*b9*c0 + 2*a0*a6 + 2*a1*a5 + 2*a2*a4 - 4*a8*a9 == 0</code></p>
<p>This is not a complete system - just a few equations to show the lengths of equations that tend to come up. Again, I don't care what any solutions are; I just need to know if any exist. Is there a way to do this in sage?</p>
<p>Thanks!</p>
https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?answer=12984#post-id-12984A good way of thinking about a system of polynomial equations is that the common zero set of polynomials defines an algebraic variety. You want to know its dimension (which might be -1 for the empty set).
sage: R.<x,y> = QQ[]
sage: R.ideal([x*y]).dimension() # solution is x=0 and y=0 plane intersecting at origin
1
sage: R.ideal([x*y,y-1]).dimension() # only solution x=0, y=1
0
sage: R.ideal([x*y,y-1,x-1]).dimension() # inconsistent
-1
Fri, 09 Dec 2011 06:37:41 +0100https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?answer=12984#post-id-12984Comment by mmarco for <p>A good way of thinking about a system of polynomial equations is that the common zero set of polynomials defines an algebraic variety. You want to know its dimension (which might be -1 for the empty set).</p>
<pre><code>sage: R.<x,y> = QQ[]
sage: R.ideal([x*y]).dimension() # solution is x=0 and y=0 plane intersecting at origin
1
sage: R.ideal([x*y,y-1]).dimension() # only solution x=0, y=1
0
sage: R.ideal([x*y,y-1,x-1]).dimension() # inconsistent
-1
</code></pre>
https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?comment=20725#post-id-20725Just a comment for completeness: the groebner basis aproach is the right way to go... if we care about solutions in a field that is algebraically closed. If we are trying to discuss if a system of equations has real solutions, its a much harder problem.Sat, 10 Dec 2011 20:31:35 +0100https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?comment=20725#post-id-20725Comment by Simon King for <p>A good way of thinking about a system of polynomial equations is that the common zero set of polynomials defines an algebraic variety. You want to know its dimension (which might be -1 for the empty set).</p>
<pre><code>sage: R.<x,y> = QQ[]
sage: R.ideal([x*y]).dimension() # solution is x=0 and y=0 plane intersecting at origin
1
sage: R.ideal([x*y,y-1]).dimension() # only solution x=0, y=1
0
sage: R.ideal([x*y,y-1,x-1]).dimension() # inconsistent
-1
</code></pre>
https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?comment=20729#post-id-20729But be warned that computing the (Krull) dimension of an ideal requires a GrÃ¶bner basis computation (that's done internally), which, depending on the problem, might be very very difficult. My experience is that it is always worth trying, but the OP shouldn't be too disappointed if it doesn't work.Fri, 09 Dec 2011 17:02:30 +0100https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?comment=20729#post-id-20729Comment by shacsmuggler for <p>A good way of thinking about a system of polynomial equations is that the common zero set of polynomials defines an algebraic variety. You want to know its dimension (which might be -1 for the empty set).</p>
<pre><code>sage: R.<x,y> = QQ[]
sage: R.ideal([x*y]).dimension() # solution is x=0 and y=0 plane intersecting at origin
1
sage: R.ideal([x*y,y-1]).dimension() # only solution x=0, y=1
0
sage: R.ideal([x*y,y-1,x-1]).dimension() # inconsistent
-1
</code></pre>
https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?comment=20681#post-id-20681Great answer! Thanks.Mon, 19 Dec 2011 19:48:59 +0100https://ask.sagemath.org/question/8540/determine-consistency-of-nonlinear-system-of-equations/?comment=20681#post-id-20681