Solve equation without symbolic toolbox

17 vues (au cours des 30 derniers jours)
S M Inzamul Islam
S M Inzamul Islam le 7 Nov 2022
Hi. I am trying to solve "0.0178508*x^2 - 1/(0.694548*(1/x)^0.9 + 0.000136807)^5.44=0" this equation which is a simplified equation derived from Reynold's number equation for head loss.
syms x
solve(0.0178508*x^2 - 1/(0.694548*(1/x)^0.9 + 0.000136807)^5.44==0,x);
I tried this code. It's not giving me any solution for symbolically. Can anyone help me to solve this equation for x. Thanks.
FYI.
This is the actual equation.
hL=19.5, L=18, g=9.8, D=0.0889, Ɛ=0.000045, v=1.37, V̇=?

Réponse acceptée

Walter Roberson
Walter Roberson le 8 Nov 2022
digits(50)
syms x
F = 0.0178508*x^2 - 1/(0.694548*(1/x)^0.9 + 0.000136807)^5.44;
sol = vpasolve(F, x, [1e10 1e15])
sol = 
242078482462.87555530675540801383196081859252378323
subs(F, x, sol)
ans = 
0.0000000000000000000000000000000000037615819226313200254999569191111861690197297816707
That is non-zero. Is there actually a root there?
subs(F, x, sol-1e-25)
ans = 
We see that there is a sign change in the function close to the location found, which lends weight to the possibility of a root. But is it an actual root or is there a singularity involved?
If you examine the 0.0178508*x^2 term, you can see that there is no discontinuity in that, at least over the reals
If you examine the (1/x) term, then you can see that would have a discontinuity at 0 but not at any other real value. So in itself 0.694548*(1/x)^0.9 would not have a discontinuity. But the overall term is 1/(0.694548*(1/x)^0.9 + 0.000136807)^5.44 : could it have a discontinuity? Well, if we think about positive real x, 0.694548*(1/x)^0.9 is positive real, and add a positive real constant to that gives you a positive real, so (0.694548*(1/x)^0.9 + 0.000136807) is a positive real. Could the ^5.44 part make it zero? It could if the base expression were less than eps(realmin)^(1/5.44) but with 0.694548*(1/x)^0.9 being non-negative for finite real x and with 0.000136807 being added, the 0.694548*(1/x)^0.9 + 0.000136807 expression cannot be as small as 1e-60 . So (0.694548*(1/x)^0.9 + 0.000136807)^5.44 cannot be 0 for positive real x, so that term cannot form a singularity either.
By continuity, we can therefore see that there must indeed be an actual zero for the function near the location indicated.
  6 commentaires
S M Inzamul Islam
S M Inzamul Islam le 8 Nov 2022
Modifié(e) : S M Inzamul Islam le 8 Nov 2022
Hi Walter. Thank you so much. This answer is correct. 1.97-2.4 is the final answer. Sorry i forgot to mention that.
John D'Errico
John D'Errico le 8 Nov 2022
A problem in all of this analysis is that the coefficients/exponents are given only to as few as 3 significant digits.

Connectez-vous pour commenter.

Plus de réponses (1)

John D'Errico
John D'Errico le 7 Nov 2022
Do you understand this is not a simple quadtatic polynomial? In fact, it is equivalent to a rather high order polynomial. And is is known (Abel-Ruffini, dating back to 1799) that a polynomial equation of degree higher than 4 has no algebraic solution (except for some trivial cases.) And your simply written problem is equivalent to a polynomial of degree over 100.
Anyway, I'm not sure what you were expecting to see as a result. You gave MATLAB no place to return anything into a variable, but then tyou eneded the line with a semi-colon, so nothing would be displayed on the command line.
syms x
F = 0.0178508*x^2 - 1/(0.694548*(1/x)^0.9 + 0.000136807)^5.44;
xsol = vpasolve(F==0,x)
xsol = 
Note that vpasolve will return ONE solution, but as I said, there may be literally hundreds of solutions. Why do I say that? You are raising things to the power 5.44. One can theoretically turn that into a polynomial, with only integer exponents. But now the exponents will be at least 100, and here, surely more. Most of those solutions will be complex valued of course.
Does a real solution exist at all? Perhaps not. It does not appear to cross zero, at least for positive x.
fplot(F,[0,1])
  4 commentaires
John D'Errico
John D'Errico le 8 Nov 2022
I showed you code that returns a "value" It is a complex value. But I also point out it is entirely possible no real solution exists.
S M Inzamul Islam
S M Inzamul Islam le 8 Nov 2022

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by