Post Reply 
Civil Engineers with Experience Using the Colebrook Equation?
02-08-2021, 05:56 PM
Post: #16
RE: Civil Engineers with Experience Using the Colebrook Equation?
Here is another way, by shifting iterations to W(exp(x)).
Argument inside W might be huge, we combine W(exp(x)) ≡ Wexp(x)

w*e^w = e^x       → w + ln(w) = x

If x → +∞, (x-ln(x)) + ln(x-ln(x)) ≈ x-ln(x)+ln(x) = x
If x → −∞, (e^x) + ln(e^x) ≈ 0 + x = x

We use these 2 asymptotic solutions for guess of W(e^z).
Code:
function Wexp(x)
    local w = x<0.3442 and exp(x) or x-log(x)
    repeat
        local f = w + log(w) - x
        local fp = 1 + 1/w
        local h = -f/(fp + f/(2*fp*w*w))
        w = w + h       -- Halley's correction
    until w + h*h == w
    return w            -- W(e^x)
end

Colebrook Equation:

x = log10(b-c*x) = ln(b-c*x)/ln(10),       where b = eps/(3.7*D), c = 5.02/Re, x = -0.5/√f

Let X = x*ln(10), C = c/ln(10), B = b/C, we have:

X = ln(C*(B-X))
B-X = B - (ln(C) + ln(B-X)) = W(e^(B-ln(C)))

Redo previous example:

lua> eps, D, Re = 0.2, 105, 178500
lua> C = 5.02/(log(10)*Re)   --> C = 1.2213771984057835e-005
lua> B = eps/(3.7*D*C)       --> B = 42.14918335404198
lua> X = B - Wexp(B-log(C))  --> X = -7.4097831878678875
lua> f = (0.5*log(10)/X)^2   --> f = 0.024141285096278223
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Civil Engineers with Experience Using the Colebrook Equation? - Albert Chan - 02-08-2021 05:56 PM



User(s) browsing this thread: 3 Guest(s)