ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 22 Dec 2010 12:09:42 -0600Limitation of solve?http://ask.sagemath.org/question/7796/limitation-of-solve/I am using (or trying to use) the solve function to solve a system of 10 nonlinear equations in 10 variables. However, solve simply outputs the 10 equations after some time computing. Is this running into a limit of the solve function, or is there some other way to economize my input to make it more solve-function-friendly? Would it help to know the algorithm which solve uses?
EDIT: At a suggestion from niles, I am putting up the equations that I am solving. I have a version that is simplified, but it is not a problem to solve. In the equations below it is legal to set any combination of the variables equal to zero, and the resulting solutions will be a subset of the solution set of the full collection of equations.
var('a b c d e f g h i j')
eq1 = a == a^2 + b*a + 2*a*c + 2*a*d + 2*a*e + 2*a*f + g*a + h*a + i*a + j*a + b^2 + d*b + g*b + b*c + d*c + g*c
eq2 = b == c*b + 2*b*e + h*b + b*d + c*d
eq3 = c == c^2 + 2*e*c + h*c + b*f + c*f
eq4 = d == f*b + d^2 + 2*e*d + f*d
eq5 = e == e^2
eq6 = f == f*c + i*c + 2*f*e + d*f + f^2
eq7 = g == i*b + j*b + 2*g*d + 2*h*d + i*d + j*d + 2*g*e + a*g + b*g + c*g + f*g + g^2 + 2*h*g + i*g + j*g + a*h + b*h + a*i
eq8 = h == 2*h*e + c*h + h^2 + b*i + c*i
eq9 = i == 2*i*e + f*h + i*h + d*i + f*i
eq10 = j == 2*j*e + g*f + h*f + j*f + 2*j*h + g*i + h*i + i^2 + j*i + a*j + b*j + c*j + d*j + f*j + g*j + i*j + j^2
For those who are curious, the simplified version is this set of equations with a, b, c, g, h, i, j == 0.
If there is anything more that anybody would like to know about these equations or where I am getting them from, just say so in a comment.Tue, 07 Dec 2010 16:21:47 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/Comment by Eric A Bunch for <p>I am using (or trying to use) the solve function to solve a system of 10 nonlinear equations in 10 variables. However, solve simply outputs the 10 equations after some time computing. Is this running into a limit of the solve function, or is there some other way to economize my input to make it more solve-function-friendly? Would it help to know the algorithm which solve uses?</p>
<p>EDIT: At a suggestion from niles, I am putting up the equations that I am solving. I have a version that is simplified, but it is not a problem to solve. In the equations below it is legal to set any combination of the variables equal to zero, and the resulting solutions will be a subset of the solution set of the full collection of equations. </p>
<pre><code>var('a b c d e f g h i j')
eq1 = a == a^2 + b*a + 2*a*c + 2*a*d + 2*a*e + 2*a*f + g*a + h*a + i*a + j*a + b^2 + d*b + g*b + b*c + d*c + g*c
eq2 = b == c*b + 2*b*e + h*b + b*d + c*d
eq3 = c == c^2 + 2*e*c + h*c + b*f + c*f
eq4 = d == f*b + d^2 + 2*e*d + f*d
eq5 = e == e^2
eq6 = f == f*c + i*c + 2*f*e + d*f + f^2
eq7 = g == i*b + j*b + 2*g*d + 2*h*d + i*d + j*d + 2*g*e + a*g + b*g + c*g + f*g + g^2 + 2*h*g + i*g + j*g + a*h + b*h + a*i
eq8 = h == 2*h*e + c*h + h^2 + b*i + c*i
eq9 = i == 2*i*e + f*h + i*h + d*i + f*i
eq10 = j == 2*j*e + g*f + h*f + j*f + 2*j*h + g*i + h*i + i^2 + j*i + a*j + b*j + c*j + d*j + f*j + g*j + i*j + j^2
</code></pre>
<p>For those who are curious, the simplified version is this set of equations with a, b, c, g, h, i, j == 0. </p>
<p>If there is anything more that anybody would like to know about these equations or where I am getting them from, just say so in a comment.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22416#post-id-22416Ah, much better. Thanks for the tipMon, 13 Dec 2010 06:06:16 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22416#post-id-22416Comment by niles for <p>I am using (or trying to use) the solve function to solve a system of 10 nonlinear equations in 10 variables. However, solve simply outputs the 10 equations after some time computing. Is this running into a limit of the solve function, or is there some other way to economize my input to make it more solve-function-friendly? Would it help to know the algorithm which solve uses?</p>
<p>EDIT: At a suggestion from niles, I am putting up the equations that I am solving. I have a version that is simplified, but it is not a problem to solve. In the equations below it is legal to set any combination of the variables equal to zero, and the resulting solutions will be a subset of the solution set of the full collection of equations. </p>
<pre><code>var('a b c d e f g h i j')
eq1 = a == a^2 + b*a + 2*a*c + 2*a*d + 2*a*e + 2*a*f + g*a + h*a + i*a + j*a + b^2 + d*b + g*b + b*c + d*c + g*c
eq2 = b == c*b + 2*b*e + h*b + b*d + c*d
eq3 = c == c^2 + 2*e*c + h*c + b*f + c*f
eq4 = d == f*b + d^2 + 2*e*d + f*d
eq5 = e == e^2
eq6 = f == f*c + i*c + 2*f*e + d*f + f^2
eq7 = g == i*b + j*b + 2*g*d + 2*h*d + i*d + j*d + 2*g*e + a*g + b*g + c*g + f*g + g^2 + 2*h*g + i*g + j*g + a*h + b*h + a*i
eq8 = h == 2*h*e + c*h + h^2 + b*i + c*i
eq9 = i == 2*i*e + f*h + i*h + d*i + f*i
eq10 = j == 2*j*e + g*f + h*f + j*f + 2*j*h + g*i + h*i + i^2 + j*i + a*j + b*j + c*j + d*j + f*j + g*j + i*j + j^2
</code></pre>
<p>For those who are curious, the simplified version is this set of equations with a, b, c, g, h, i, j == 0. </p>
<p>If there is anything more that anybody would like to know about these equations or where I am getting them from, just say so in a comment.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22417#post-id-22417If you highlight the code and press the "code" formatting button (little pictures of 0's and 1's), then the asterisks will print correctly. This will make it easier to read, and easy to copy/paste into sage for people who want to try working with your example.Mon, 13 Dec 2010 01:19:33 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22417#post-id-22417Answer by kcrisman for <p>I am using (or trying to use) the solve function to solve a system of 10 nonlinear equations in 10 variables. However, solve simply outputs the 10 equations after some time computing. Is this running into a limit of the solve function, or is there some other way to economize my input to make it more solve-function-friendly? Would it help to know the algorithm which solve uses?</p>
<p>EDIT: At a suggestion from niles, I am putting up the equations that I am solving. I have a version that is simplified, but it is not a problem to solve. In the equations below it is legal to set any combination of the variables equal to zero, and the resulting solutions will be a subset of the solution set of the full collection of equations. </p>
<pre><code>var('a b c d e f g h i j')
eq1 = a == a^2 + b*a + 2*a*c + 2*a*d + 2*a*e + 2*a*f + g*a + h*a + i*a + j*a + b^2 + d*b + g*b + b*c + d*c + g*c
eq2 = b == c*b + 2*b*e + h*b + b*d + c*d
eq3 = c == c^2 + 2*e*c + h*c + b*f + c*f
eq4 = d == f*b + d^2 + 2*e*d + f*d
eq5 = e == e^2
eq6 = f == f*c + i*c + 2*f*e + d*f + f^2
eq7 = g == i*b + j*b + 2*g*d + 2*h*d + i*d + j*d + 2*g*e + a*g + b*g + c*g + f*g + g^2 + 2*h*g + i*g + j*g + a*h + b*h + a*i
eq8 = h == 2*h*e + c*h + h^2 + b*i + c*i
eq9 = i == 2*i*e + f*h + i*h + d*i + f*i
eq10 = j == 2*j*e + g*f + h*f + j*f + 2*j*h + g*i + h*i + i^2 + j*i + a*j + b*j + c*j + d*j + f*j + g*j + i*j + j^2
</code></pre>
<p>For those who are curious, the simplified version is this set of equations with a, b, c, g, h, i, j == 0. </p>
<p>If there is anything more that anybody would like to know about these equations or where I am getting them from, just say so in a comment.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?answer=11829#post-id-11829If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for
sage: x.solve?
for more information on some keywords that may also help, such as `to_poly_solve`. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!
At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems.
In your specific case, even with `to_poly_solve=True`, we get (in Maxima):
(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that `e==e^2` usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.
Wed, 08 Dec 2010 00:58:45 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?answer=11829#post-id-11829Comment by Eric A Bunch for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22434#post-id-22434What other information about my problem would be useful? And I do need algebraic solutions, not numeric approximates.Thu, 09 Dec 2010 06:42:06 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22434#post-id-22434Comment by Eric A Bunch for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22418#post-id-22418Alright, I have updated and added the equations. Sorry, the simplified version was too simple so I put up the full version.Sun, 12 Dec 2010 16:34:42 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22418#post-id-22418Comment by Eric A Bunch for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22405#post-id-22405This answer has already been extremely helpful, thanks. I guess at this point I'll have start using my brain as well as the computer to solve this problem :)Tue, 14 Dec 2010 13:24:21 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22405#post-id-22405Comment by niles for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22428#post-id-22428that's amazing -- thanks!!Fri, 10 Dec 2010 15:32:54 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22428#post-id-22428Comment by Eric A Bunch for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22367#post-id-22367@Jason: Mathematica had trouble with the simplified version? That's surprising. I wonder why, since sage had no problem with it.Wed, 22 Dec 2010 12:09:42 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22367#post-id-22367Comment by Jason Grout for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22368#post-id-22368Just for fun, I plugged your simplified example in Mathematica and asked for a solution. It's been chugging for at least 5-10 minutes now, with no end in sight.Tue, 21 Dec 2010 22:20:34 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22368#post-id-22368Comment by niles for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22430#post-id-22430you could update your question with a simplified example of what you're trying to do . . . or if you can't simplify it, the list of equations you're trying to solve might be useful.Fri, 10 Dec 2010 15:17:19 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22430#post-id-22430Comment by Evgeny for <p>If you are trying to solve symbolic equations (that is, with symbolic coefficients), it is likely that we are using Maxima, and that certainly will take a while for a fairly large one - if there is a solution it can find. You may want to check the documentation for </p>
<pre><code>sage: x.solve?
</code></pre>
<p>for more information on some keywords that may also help, such as <code>to_poly_solve</code>. See ticket 10444 for a request to enhance the documentation of the global solve function so you guys know it's there!</p>
<p>At the same time, if you have things over a specific ring, especially if you are looking for approximate solutions, there are many methods to do this, though I am not sure about the commands for nonlinear systems. </p>
<p>In your specific case, even with <code>to_poly_solve=True</code>, we get (in Maxima):</p>
<pre><code>(%i14) to_poly_solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],[a,b,c,d,e,f,g,h,i,j]);
algsys: tried and failed to reduce system to a polynomial in one variable; give up.
</code></pre>
<p>I think you can set the recursion depth higher, but I don't think that will help. Maxima's solve capabilities are decent, but not overwhelming, so perhaps this example is just one it can't do. I do note that <code>e==e^2</code> usually just has two solutions, so maybe there are similar simplifications you can do? Sorry I can't be of more help.</p>
http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22429#post-id-22429Sorry, I was playing here with the autolinker to the trac tickets. It is now possible to type just "ticket #" and it should make a link to your bug tracker. Does not yet work in the comments though.Fri, 10 Dec 2010 15:29:00 -0600http://ask.sagemath.org/question/7796/limitation-of-solve/?comment=22429#post-id-22429