Unable to find explicit solution
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mirroyal Ismayilov
le 2 Nov 2023
Réponse apportée : John D'Errico
le 2 Nov 2023
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);
0 commentaires
Réponse acceptée
John D'Errico
le 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
h2 = rand
k = rand
r_1 = rand
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)
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."
0 commentaires
Plus de réponses (1)
Torsten
le 2 Nov 2023
Déplacé(e) : Torsten
le 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 commentaire
Dyuman Joshi
le 2 Nov 2023
solve() can be used to obtain a (symbolic) numerical value for b as well.
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

