Solve equation without symbolic toolbox
18 views (last 30 days)
Show older comments
S M Inzamul Islam
on 7 Nov 2022
Edited: S M Inzamul Islam
on 8 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̇=?
0 Comments
Accepted Answer
Walter Roberson
on 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])
subs(F, x, sol)
That is non-zero. Is there actually a root there?
subs(F, x, sol-1e-25)
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 Comments
John D'Errico
on 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.
More Answers (1)
John D'Errico
on 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)
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 Comments
John D'Errico
on 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.
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
