You are on page 1of 23

Application of the Newton-Raphson method for the solution of the Colebrook-W

Colebrook equation
(valid for Re>4000 )
1 2 . 51
√f [
=0 . 869⋅Ln 0. 27⋅Rrel+
Re⋅√ f ]
The friction factor can be expressed as
1 Rrel 2 . 51
√f
=0 . 869⋅Ln
[ +
3. 71 Re⋅√ f ]
( -2)
Rrel 2. 51
{
f = 0 . 869⋅Ln
[ +
3 . 71 Re⋅√ f ]}
For clarity change f by x
( -2)
Rrel 2. 51
{
x= 0 . 869⋅Ln
[ +
3 .71 Re⋅√ x ]}
Microsoft Equation
3.0

Naming
F (x )= Fx
and
f' (x )= Fxx
Naming
F (x )= Fx
and
f' (x )= Fxx

( -2 )
Rrel 2 .51
{
Fx =x− 0. 869⋅Ln
[ +
3 . 71 Re⋅√ x ]}
(-3 )
Rrel 2 . 51 (−0. 5) 0 . 869
{
Fxx= 1 +2⋅ 0 . 869⋅Ln +
3. 71 Re
⋅x [ ]} ⋅
{
Rrel 2 . 5
+
3 .71 Re

Fx = xOld - (0.869 * Log( Rrel/3.71 + 2.51/(Re*fxOld^0.5 ) ) )^(-2 )

Fxx = 1 +2 * ( 0.869 * Ln( Rrel/3.71 + 2.51/(Re * xOld^0.5 ) ) )^(-3 ) * ( 0.869 * 1/

According to Newton-Raphson method,


a new solution is found as

xNew =xOld - Fx( xOld ) / Fxx( xOld )

Repeat the procedure, evaluating the


functions Fx and Fxx using the obtained
xNew =xOld - Fx( xOld ) / Fxx( xOld )

Repeat the procedure, evaluating the


functions Fx and Fxx using the obtained
xNew value
The iteration ends when the difference
between the New and the Old values is
small enough
Microsoft Equation
3.0

Tabulated solution

Data
Relative rugosity Rrel = 0.000333
Reynolds number Re = 125000

Equations to solve the Colebrook-White equation

Fx = xOld - (0.869 * Ln( Rrel/3.71 + 2.51/(Re*xOld^0.5 ) ) )^(-2 )

Fxx = 1 +2 * ( 0.869 * Ln( Rrel/3.71 + 2.51/(Re * xOld^0.5 ) ) )^(-3 ) * ( 0.869 * 1/

xNew = xOld - Fx(xOld) / Fxx(xOld)

Tabulated solution of
Colebrook-White equation using
the Newton-Raphson method

Initial solution Xold = 0.1


xold Fx(xold) Fxx(xold) xnew
Eq. (1) Eq. (2) Eq. (3)
1 0.1 0.082833057 1.0081 0.0178
2 0.0178 -0.001233907 1.0803 0.0190
3 0.0190 -3.64183E-06 1.0741 0.01898
4 0.0190 -2.92104E-11 1.0741 0.018978

DxStop = 3.6E-06
ution of the Colebrook-White friction factor

Defining a function F that will have


a value of zero when evaluated with
the value of the solution

(-2)
Rrel 2 . 51
{
F (x )=x− 0 . 869⋅Ln +
[
3. 71 Re⋅√ x ]}
Obtain the derivative of the function F
( -3 )
Rrel 2. 51 (−0 .5 ) 0 . 869
{
F ' ( x )= 1 +2⋅ 0 . 869⋅Ln
[ +
3 .71 Re
⋅x
]} ⋅
{
Rrel 2. 51
+
3 . 71 Re

Assume an initial va
Use a value as near
expected solution . N

Evaluate the functio


Assume an initial va
Use a value as near
expected solution . N

Evaluate the functio


for x = xOld

(-3 )
{
Fx =xOld− 0 . 869⋅

0 . 869 -1 .255 (−1 . 5)


5)
]} ⋅
{ ⋅
Rrel 2 . 51 (−0. 5 ) Re
+ ⋅x
⋅x [ ]} {
Fxx= 1 +2⋅ 0 . 869⋅
3 .71 Re
0 . 869
Microsoft Equation
3.0
¿
{
Rrel 2 .51
+
3 . 71 Re
⋅xOld

(Eq. 1)

3 ) * ( 0.869 * 1/( Rrel/3.71 + 2.51/( Re *xOld^0.5) ) * ( (-1.255/Re ) *xOld^(-1.5 ) ) ) (Eq. 2)

xNew = xOld - Fx(xOld) / Fxx(xOld) (Eq. 3)


(Eq. 1)

3 ) * ( 0.869 * 1/( Rrel/3.71 + 2.51/( Re *xOld^0.5) ) * ( (-1.255/Re ) *xOld^(-1.5 ) ) ) (Eq. 2)

(Eq. 3)

Solutions using VBA functions


(only for Re > 4000)
f= Colebrook(Rrel, Re) f= Pipe_Friction_Factor_Rrel_Re
Rrel = 0.000333 Rrel = 0.000333
Re = 125000 Re = 125000
f= #VALUE! f= #VALUE!

Iterations: 4
DxStop = 1.0E-06
rev.cjc.30.10.2018
1

0 . 869 -1. 255 (−1. 5)



{ ⋅
[
Rrel 2. 51 (−0 .5 ) Re
+
3 . 71 Re
⋅x
⋅x
]}
Microsoft Equation
3.0

me an initial value as the solution


value as near as possible to the
ed solution . Name this value, xOld

ate the function and its derivative


me an initial value as the solution
value as near as possible to the
ed solution . Name this value, xOld

ate the function and its derivative


= xOld
( -2)
Rrel 2. 51
{
Old− 0 . 869⋅Ln
[ +
3 .71 Re⋅√ xOld ]}
(-3 )
Rrel 2 . 51
{
1 +2⋅ 0 . 869⋅Ln [ +
3. 71 Re
⋅xOld
(−0 . 5)
]} ⋅

69 -1. 255
+
2 .51
⋅xOld(−0 . 5 )
[

Re
⋅xOld
(−1 . 5)
]}
1 Re
Microsoft Equation
3.0

3
4

DarcyFriction_Rrel_Re
Rrel = 0.000333
Re = 125000
f= #MACRO?
Newton-Raphson method

Solution of a single equation Solve


x= 1.5 - exp(-l * x) f(x) = x - 1.5 + exp(-l*x)
l= 4

Newton-Raphson method

Evaluating the function at x = x old


f(xold) = xold -1.5 + exp(-l*xold)

and evaluating the first derivative


at x=xold
f '(xold) = 1 -l*exp(-

The new x-value is


xnew = xold - f(xold) / f '(xold)

Initial asumption
xinitial = 2
'
f ( x )=1−λe− λx
f ( x old )
x new =x old − '
f ( x old )

f= ( - 2 * log( Rrel/3.7 + 2.51 / (Re

F= ( - 2 * log( Rrel/3.7 + 2.51


Fx = ( -2 * ( - 2 * log( Rrel/3.7 + 2.51

z= ( - 2 * log( Rrel/3.7 + 2.51 / (Re

-z/2 = ( - 2 * log( Rrel/3.7 + 2.51 / (Re


z/4 = log( Rrel/3.7 + 2.51 / (Re * f^
1.- Tabulated solution using
the Newton-Raphson method
x - 1.5 + exp(-l*x) for xold f(xold) f '(xold) xnew
Eq. (1) Eq. (2) Eq. (3)

2 0.5003 0.9987 1.4990


aphson method 1.4990 0.0015 0.9900 1.4975
1.4975 0.0000 0.9900 1.4975
the function at x = x old 1.4975 0.0000 0.9900 1.4975
xold -1.5 + exp(-l*xold) Eq. (1)

2.- Goal-seek solution


ating the first derivative
f(x) = x - 1.5 + exp(-l*x)
1 -l*exp(-l*xold) Eq. (2) l= 4
x= 1.497496 (By changing)

f(x) = 0.000 (Set Cell)

xold - f(xold) / f '(xold) Eq. (3)

3. Solution using the VB function


Newton_Raphson_example_4
f(x) = x - 1.5 + exp(-l*x)
l = 4
x= Newtonn_example_4
x= #VALUE!

−λx
f (x )=x−1 . 5+e =0
( - 2 * log( Rrel/3.7 + 2.51 / (Re * f^0.5 ) ) )^(-2)

( - 2 * log( Rrel/3.7 + 2.51 / (Re * f^0.5 ) ) )^(-2) - f


( -2 * ( - 2 * log( Rrel/3.7 + 2.51 / (Re * f^0.5 ) ) )^-3 * dz/df -1

( - 2 * log( Rrel/3.7 + 2.51 / (Re * f^0.5 ) ) )

( - 2 * log( Rrel/3.7 + 2.51 / (Re * f^0.5 ) )


log( Rrel/3.7 + 2.51 / (Re * f^0.5 )
−λx
5+e =0
[1] https://www.youtube.com/watch?v=-Ws7cEH7w_U

[2] http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_genstat

[3] http://stackoverflow.com/questions/23443361/matrix-math-with-vba-system-of-linear-equations
Microsoft Equation
3.0
Microsoft Equation
viewer.htm#imlug_genstatexpls_sect004.htm 3.0

m-of-linear-equations
Microsoft Equation
3.0

You might also like