numerical root finding procedures
Ältere Kommentare anzeigen
trying to solve the part under else. eover and Re are known, but still leaves me with (f) on both side of the original colebrook equation. 1/sqrt(f) = -2*log10(eoverD/3.7 + 2.51/Re/sqrt(f)). Please help, a bit stuck.
Re = V*D1 / nu;
% Check for laminar flow.
if Re < 2300
F = 64 / Re;
else
F(f)=1/sqrt(f)+2*log10(eoverD/3.7 + 2.51/Re/sqrt(f));
end
3 Kommentare
the cyclist
am 19 Aug. 2013
You have written this a bit confusingly. I think it is a bit clearer to write your code as
Re = V*D1 / nu;
% Check for laminar flow.
if Re < 2300
f = 64 / Re;
else
% Here I need to calculate "f" such that it solves the equation
% 0 = 1/sqrt(f)+2*log10(eoverD/3.7 + 2.51/Re/sqrt(f));
end
Notice how I get rid of the confusing use of capital F.
See my suggestion for solving this in my answer below.
harley
am 19 Aug. 2013
harley
am 19 Aug. 2013
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 19 Aug. 2013
If you do some algebraic manipulation, you get
x = 0.3340248829e22 / (-0.5020000000e11 * lambertw(.4586822894 * Re * exp(.1239681863 * eoverD * Re)) + 6223202955 * eoverD * Re)^2
with no searching (provided that eoverD already has a value)
lambertw is in the Symbolic Toolbox. If you do not have that, then see http://www.mathworks.com/matlabcentral/newsreader/view_thread/32527
Kategorien
Mehr zu Surrogate Optimization finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!