MATLAB Answers

Solve: Unable to find explicit solution.

10 views (last 30 days)
Hello everyone,
thank you for entering this discussion. I'm trying to solve the following system of equations and inequalities. I read that one way to do it is by using Symbolic Toolbox and function solve.
b = 20;
c = 100;
syms a11 a12 a21 a22 a31 a32 b11 b12 b21 b22 b31 b32 a1 a2 a3 b1 b2 b3 c1 c2 c3 d1 d2 d3
ineq1 = a11 > 0;
ineq2 = a12 > 0;
ineq3 = a31 > 0;
ineq4 = a32 > 0;
ineq5 = b11 > 0;
ineq6 = b12 > 0;
ineq7 = b22 > 0;
ineq8 = b31 > 0;
ineq9 = b32 > 0;
eq1 = a1 - a11 - a12 == 0;
eq2 = a2 - a21 - a22 == 0;
eq3 = a3 - a31 - a32 == 0;
eq4 = b1 - b11 - b12 == 0;
eq5 = b2 - b21 - b22 == 0;
eq6 = b3 - b31 - b32 == 0;
eq7 = 2*sqrt(a11*a21) - c1 == 0;
eq8 = 2*sqrt(a22*a31) - c2 == 0;
eq9 = 2*sqrt(a32*a12) - c3 == 0;
eq10 = 2*sqrt(b11*b21) - d1 == 0;
eq11 = 2*sqrt(b22*b31) - d2 == 0;
eq12 = 2*sqrt(b32*b12) - d3 == 0;
eq13 = 2*a1 - 2*b1*c - d3*c == 0;
eq14 = 2*b1*c - c1 + c*d1 == 0;
eq15 = 2*a2 - 2*b2*c - d1*c == 0;
eq16 = 2*b2*c - c2 + c*d2 == 0;
eq17 = 2*a3 - 2*b3*c - d2*c == 0;
eq18 = 2*b3*c - c3 + c*d3 == 0;
eq19 = -c1 + c*d1 - c*d2 == 0;
eq20 = -c2 + c*d2 - c*d3 == 0;
eq21 = -c3 + c*d3 - c*d1 == 0;
eqns = [eq1 eq2 eq3 eq4 eq5 eq6 eq7 eq8 eq9 eq10 eq11 eq12 eq13 eq14 eq15 eq16 eq17 eq18 eq19 eq20 eq21];
ineqs = [ineq1 ineq2 ineq3 ineq4 ineq5 ineq6 ineq7 ineq8 ineq9];
S = solve([eqns ineqs],[a11 a12 a21 a22 a31 a32 b11 b12 b21 b22 b31 b32 a1 a2 a3 b1 b2 b3 c1 c2 c3 d1 d2 d3]);
At the end of the execution, I get the following warning message:
Warning: Unable to find explicit solution
Does it mean that there's no solution to the problem?
Thank you in advance

  0 Comments

Sign in to comment.

Accepted Answer

John D'Errico
John D'Errico on 29 Nov 2020
Edited: John D'Errico on 29 Nov 2020
I spent 20 minutes writing a detailed answer to your question, only to find you appeared to have deleted the question. Now it is back. Sigh.
The final answer: No. It means nothing of the sort. It does mean you don't understand that an inequality does not reduce the dimension of your space. It effectively splits a space into two halves. But it does not help you to solve anything.
You now have 21 equations. Still apparently 24 variables. The solution locus, if any exists, will be a 3-manifold of solutions embedded in a 24 dimensional space. Think of that as a surface of possible solutions. The sqrts and products of variables mean the surface will generally be a curved manifold.
The 9 inequalities do nothing but bound the locus, each inequality reduces infinitely many solutions into infinity/2 solutions. 9 inequalities do little more.
So is there no solution? No. It means there is no solution that can be provided. There are probably/possibly some solutions, but it is effectively impossible to describe the solution locus in any algebraic form, as a surely nasty looking 3-dimensional potatoe that lives in 24 dimensions.
You could pick 3 variables, fix them at some value. Then you can ask if a solution exists for the other 21 unknowns. The solution locus, IF it could be found and described in algebraic form, will often have multiple solutions. Or possibly for that set of 3 prameter values, perhaps no solution exists. This is impossible to know in advance. But you could try to define the locus of solutions in this way. Regardless, you need to remember the solution locus still is some complicated 3-manifold that lives in 24 dimensions.

  3 Comments

Cristina Magnetti Gisolo
Cristina Magnetti Gisolo on 29 Nov 2020
Hi,
I'm so sorry for the inconvenient, I noticed that the system was wrong, so I changed it.
I modified it and now I see that Matlab is busy, for now I'm not getting that warning, the exectuion is lasting a lot of time. I think I'll leave it during the night and hope it will find a numerical solution.
Actually I'm interested in 12 variables, the others are just used to simplify the writing of the expressions.
Thank you very much for your explanation and your help. May I ask what you mean here:
So is there no solution? No. It means there is no solution that can be provided
Because I would be interested in a numerical solution, not in a solution that is a function of the parameters.
Anyway, I will try to fix 3 variables and see what happens.
John D'Errico
John D'Errico on 29 Nov 2020
It won't find a solution. That would leave you trying to find a solution for 12 variables, in terms of the other 12 variables left over. You will now have 21 equalities. and 12 unknowns. Now your problem is over-determined, Unless some of those equalities are redundant, NO exact solution will exist, The result will still be no solution, but now for different reasons. And even if MATLAB could theoretically try to find a solution, it will probably fail. Those nonlinearities (square roots and products of variables) in your problem effectively create a high order polynomial system. And polynomials of degree higher than 4 have no solution that can be found in general in algebraic form.
So MATLAB will now spend all night searching for a way to solve the problem, not understanding that what you are asking it to do will fail.
Just because you want something good to happen, it is very easy to write a problem with no solution possible to find. In fact, you just did that.
Cristina Magnetti Gisolo
Cristina Magnetti Gisolo on 30 Nov 2020
Matlab ran out of memory, of course.
I tried to rewrite the problem starting only from the 12 variables I am interested in. Now I got 9 equations of the second order.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by