Unable to find explicit solution
조회 수: 7 (최근 30일)
이전 댓글 표시
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
채택된 답변
John D'Errico
2023년 11월 2일
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
추가 답변 (1개)
Torsten
2023년 11월 2일
이동: Torsten
2023년 11월 2일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

