function Cf = schoenherr(Re)
%
% PURPOSE: Numerical solution for Schoenherr's line.
% AUTHOR:  Rob McEwen
% DATE:    02/03/19
% REFERENCE: See Hoerner p. 2-5.
%
% First Try: Solve the transcendental equation:
% x0 = -1e-12*Re + .01
% options = optimset('Display','off');
% Cf = fminsearch( inline( '(log10(Re*x) - .242/sqrt(x))^2' ), x0, options, Re);
% Cf = fminsearch( 'minfun', x0, options, Re );
%
% Second Try: The approximation on p. 2-5.
% Cf = .44/Re^(1/6);
%
% Third Try: The other approximation on 2-5.  Good to 2%.
  Cf = 1./(3.46*log10(Re) -5.6).^2;
  
function y = minfun(x,Re)
%
% Schoenherr function to be minimized
%
y = (log(Re*x) - .242/sqrt(x))^2;

return
