Unformatted text preview: % Newtons method is x = x0 - F0/(dF/dx)_0 % Here, F(x) = 0; with F(x) = 1/x+2*log10(eps/3.7/D + 2.51/Re/x) % This is just the Colbrook equation rearranged to equal zero for i=1:5 x = x + (1./x + 2*log10(eps./D/3.7 + 2.51./Re./x)) ./ . .. (1./x./x + 2*2.51./Re./x./x./log10(eps./D/3.7+2.51./Re./x)); end % Recover f f = x.^2; %---------- Compute head loss hL = f*L./D .*v.^2/2/g; %---------- Plot the results semilogy(D,hL); xlabel('D (m)'); ylabel('hL (m)'); %---------- interpolate D for desired head loss Dwant = interp1(hL,D,hLwant)...
View Full Document
This note was uploaded on 03/11/2012 for the course CHE 374 taught by Professor Davidlignell during the Fall '12 term at Brigham Young University, Hawaii.
- Fall '12