how can solve for ' f ' in 1/sqrt(f) = -2*log(((e​/d)/3.7)+(​2.51/Re*sq​rt(f))) . Re = 1000, d=0.0254, e0.03

how can solve for ' f ' in 1/sqrt(f) = -2*log(((e/d)/3.7)+(2.51/Re*sqrt(f))) . Re = 1000, d=0.0254, e=0.03

Answers (2)

Re = 1000, d=0.0254, e=0.03
syms f
solve(1/sqrt(f) == -2*log(((e/d)/3.7)+(2.51/Re*sqrt(f))))
You can use fzero. I plotted it and found two real roots (necessary because fzero hs its limitations):
Re = 1000; d=0.0254; e=0.03;
Eqn = @(f) 1./sqrt(f) + 2*log(((e/d)/3.7)+(2.51/Re*sqrt(f)));
f1 = fzero(Eqn, 1)
f2 = fzero(Eqn, 1E5)
produces:
f1 =
192.8954e-003
f2 =
73.1662e+003

Categories

Find more on Get Started with MATLAB 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!