Unable to find explicit solution

9 views (last 30 days)
How can I get around this problem, it looks like Matlab is unable to solve the analytical expression. I need to express b in terms of other symbolic variables.
%% Symbolic variables
syms h1 h2 b k r_1
V3=((-2*b*h2^2+4*b*h1*h2-2*b*h1^2)*r_1^2+sqrt(-h2^2+(2*h1-2*b)*h2-h1^2+2*b*h1)*((6*b^2*asin((h2-h1+b)/b)-3*pi*b^2)*k*r_1+(3*pi*b^2-6*b^2*asin((h2-h1+b)/b))*k^2)+(-2*b*h2^2+(4*b*h1-12*b^2)*h2-2*b*h1^2+12*b^2*h1)*k*r_1+(4*b*h2^2+(12*b^2-8*b*h1)*h2+4*b*h1^2-12*b^2*h1)*k^2)/(6*h2^2+(12*b-12*h1)*h2+6*h1^2-12*b*h1);
solx = solve(V3, b);
Warning: Unable to find explicit solution. For options, see help.

Accepted Answer

John D'Errico
John D'Errico on 2 Nov 2023
It is not just that MATLAB could not solve it. In fact, it is trivially easy to write down equations where there is no algebraic solution possible, and it can be proved that no such solution can ever be written down.
This problem easily moves into that domain, where I can be quite confident that no solution could be found. Only if you have numerical values for ALL of the other parameters will you be able to find a solution, and even then, it is highly likely that no analytical solution will exist. As well, it is also likely that multiple solutions exist, IF you had numerical values for all of the other parameters.
For example, I'll pick some random values for all of the parameters.
syms b
h1 = rand
h1 = 0.2901
h2 = rand
h2 = 0.3605
k = rand
k = 0.0402
r_1 = rand
r_1 = 0.7953
V3=((-2*b*h2^2+4*b*h1*h2-2*b*h1^2)*r_1^2+sqrt(-h2^2+(2*h1-2*b)*h2-h1^2+2*b*h1)*((6*b^2*asin((h2-h1+b)/b)-3*pi*b^2)*k*r_1+(3*pi*b^2-6*b^2*asin((h2-h1+b)/b))*k^2)+(-2*b*h2^2+(4*b*h1-12*b^2)*h2-2*b*h1^2+12*b^2*h1)*k*r_1+(4*b*h2^2+(12*b^2-8*b*h1)*h2+4*b*h1^2-12*b^2*h1)*k^2)/(6*h2^2+(12*b-12*h1)*h2+6*h1^2-12*b*h1);
vpa(V3,4)
ans = 
It is still an ungodly mess. See that b appears inside and outside of square roots, It apears both inside and outside of asin. Not ever going to have a solution.
fplot(V3)
So it appears, for this set of random parameters, that a solution exists for b a little less that zero. But that changes when I randomly allow the parameters to change.
Just wanting something to exist does not make it happen, no matter how badly you want that. I recall an old saying: "If wishes were horses, beggars would ride."

More Answers (1)

Torsten
Torsten on 2 Nov 2023
Moved: Torsten on 2 Nov 2023
An analytical expression for b as a function of the other variables is impossible to find. If you give numerical values to the other parameters, "fzero" or "fsolve" might be able to find a numerical solution for b as a solution of the equation
V3 - right-hand side = 0.
  1 Comment
Dyuman Joshi
Dyuman Joshi on 2 Nov 2023
solve() can be used to obtain a (symbolic) numerical value for b as well.

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!