Ask Your Question

Limitation of solve?

asked 2010-12-07 23:21:47 +0200

Eric A Bunch gravatar image

updated 2010-12-13 13:05:40 +0200

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.

edit retag flag offensive close merge delete


If 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.

niles gravatar imageniles ( 2010-12-13 08:19:33 +0200 )edit

Ah, much better. Thanks for the tip

Eric A Bunch gravatar imageEric A Bunch ( 2010-12-13 13:06:16 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2010-12-08 07:58:45 +0200

kcrisman gravatar image

updated 2010-12-13 22:01:20 +0200

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

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.

edit flag offensive delete link more


What other information about my problem would be useful? And I do need algebraic solutions, not numeric approximates.

Eric A Bunch gravatar imageEric A Bunch ( 2010-12-09 13:42:06 +0200 )edit

you 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.

niles gravatar imageniles ( 2010-12-10 22:17:19 +0200 )edit

Sorry, 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.

Evgeny gravatar imageEvgeny ( 2010-12-10 22:29:00 +0200 )edit

that's amazing -- thanks!!

niles gravatar imageniles ( 2010-12-10 22:32:54 +0200 )edit

Alright, I have updated and added the equations. Sorry, the simplified version was too simple so I put up the full version.

Eric A Bunch gravatar imageEric A Bunch ( 2010-12-12 23:34:42 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2010-12-07 23:21:47 +0200

Seen: 1,060 times

Last updated: Dec 13 '10