How well can MATLAB solve systems of nonlinear equations?

I realize this is a relative question since some systems of nonlinear equations are probably much more difficult to solve than others. I'm relatively new to using the symbolic toolkit, so I don't have a good feeling for what it can, and cannot do.
At the moment, I'm trying to solve 9 equations with 9 unknowns and it has taken at least 3 hours, but a very similar system of 6 equations with 6 unknowns only takes about 2 seconds.
This is the particular command I'm trying.
r = solve(...
'c1 + c2 + c3 = 2', ...
'c1*x1 + c2*x2 + c3*x3 + d1 + d2 + d3 = 0', ...
'c1*x1^2 + c2*x2^2 + c3*x3^2 + 2*d1*x1 + 2*d2*x2 + 2*d3*x3 = 2/3', ...
'c1*x1^3 + c2*x2^3 + c3*x3^3 + 3*d1*x1^2 + 3*d2*x2^2 + 3*d3*x3^2 = 0', ...
'c1*x1^4 + c2*x2^4 + c3*x3^4 + 4*d1*x1^3 + 4*d2*x2^3 + 4*d3*x3^3 = 2/5', ...
'c1*x1^5 + c2*x2^5 + c3*x3^5 + 5*d1*x1^4 + 5*d2*x2^4 + 5*d3*x3^4 = 0', ...
'c1*x1^6 + c2*x2^6 + c3*x3^6 + 6*d1*x1^5 + 6*d2*x2^5 + 6*d3*x3^5 = 2/7', ...
'c1*x1^7 + c2*x2^7 + c3*x3^7 + 7*d1*x1^6 + 7*d2*x2^6 + 7*d3*x3^6 = 0', ...
'c1*x1^8 + c2*x2^8 + c3*x3^8 + 8*d1*x1^7 + 8*d2*x2^7 + 8*d3*x3^7 = 2/9');
Does anyone have any suggestions on how this may be sped up? Or is this simply how things go with symbolic computation?
Thanks!

1 Comment

I am not sure of what you are trying to accomplish, perhaps more insight into your problem and how you formulated it would be helpful

Sign in to comment.

 Accepted Answer

What you are seeing is pretty typical with symbolic solutions, especially if you have not restricted the range of the variables to the ranges you are interested in (e.g., real numbers, positive reals, whatever.) You get an exponential explosion of cases that have to be expanded, such as trying the 3rd [imaginary] root of a quartic for one variable against the 7th root of an order 16 polynomial for another...

1 Comment

Thanks for the answer. I'm afraid you are probably correct, I'm going to need to think of a more clever way to approach my problem.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!