function entranceLength
% entranceLength  Plot entrance length (L/D) versus Re

Rel = linspace(0,1000);          LDl = 0.06*Rel;
Relt = linspace(1000,2000,20);   LDlt = 0.06*Relt;
Rett = logspace(3,log10(2e3),5); LDtt = 4.4*Rett.^(1/6);
Ret = logspace(log10(2e3),5);    LDt = 4.4*Ret.^(1/6);

loglog(Rel,LDl,'-',Relt,LDlt,'--',Rett,LDtt,'--',Ret,LDt,'-');
xlabel('Re');   ylabel('L/D');
text(20,20,'L_e/d = 0.06 Re_d','FontName','Times','FontSize',14);
text(5000,40,'L_e/d = 4.4 Re_d^{1/6}','FontName','Times','FontSize',14);


% --- try with flow of water in a pipe as function of Q
V = logspace(-4,2);
nu = 1.12e-6;         %  kinematic viscosity of water
d = 5e-2;             %  pipe diameter (m)
Re = V*d/nu;
figure

loglog(V,Re,'o')

ilam = find(Re<2000);
iturb = find(Re>=2000);
Le = zeros(size(Re));
Le(ilam) = 0.06*Re(ilam);
Le(iturb) = 4.4*Re(iturb).^(1/6);

figure
loglog(Re,Le,'--');

end