CBE 250: Computer Applications in Chemical Engineering: Sept 9, 2015 First Finish Bracketing Example
CBE 250: Computer Applications in Chemical Engineering: Sept 9, 2015 First Finish Bracketing Example
CBE 250: Computer Applications in Chemical Engineering: Sept 9, 2015 First Finish Bracketing Example
Applications in Chemical
Engineering
Lecture 4
Sept 9, 2015
*first finish bracketing
example
Open Methods
Chapter 6
Open methods
require only a
single starting
value of x or two
starting values
that do not
necessarily
bracket the root.
Newton-Raphson Method
Most widely used open method.
Based on first order Taylor series expansion:
x 2
f ( xi 1 ) f ( xi ) f ( xi )x f ( xi )
Ox 3
2!
The root is the value of x i 1 when f(x i 1 ) 0
Rearrangin g,
0 f(xi ) f (xi )( xi 1 xi )
f ( xi )
xi 1 xi
f ( xi )
A convenient method
for functions whose
derivatives can be
evaluated analytically.
Newton-Raphson
Visual Example
http://en.wikipedia.org/wiki/File:NewtonIteration_Ani.gif
Newton-Raphson Example
Class Examples
1. Solve the following nonlinear equation f(x)=e -x-x=0
using Newton method in Excel.
Graphical
examples of
functions for
which the
NewtonRaphson
technique (as
formulated)
doesnt work.
Numerical Differentiation
Definition of derivative
i 1,2,3,
Secant
Method
Secant example
f n ( x1 , x2 , x3 , , xn ) 0
More than one function with more than
one variable.
ui
u
( x1,i 1 x1,i ) i ( x2 ,i 1 x2,i )
x1
x2
vi
vi
vi 1 vi
( x1,i 1 x1,i )
( x2,i 1 x2 ,i )
x1
x2
ui
ui
ui
ui
xi 1
yi 1 ui xi
yi
x
y
x
y
vi
vi
vi
vi
xi 1
yi 1 vi xi
yi
x
y
x
y
vi
ui
ui
vi
y
y
xi 1 xi
ui vi ui vi
x y y x
vi
ui
ui
vi
x
x
yi 1 yi
ui vi ui vi
x y y x
Determinant
of the
Jacobian of
the system.
CLASS PROBLEM
Solve two simultaneous nonlinear equations:
x x x 10
2
x 3x x 57
2
The Wilson equations are used to correlate the activity coefficients of strongly non-ideal, but
miscible systems. These equations reads:
x2 (G12 2 G211 )
ln 1 ln(1 )
1 2
x1 (G12 2 G211 )
ln 2 ln( 2 )
1 2
where: 1=x1+x2G12 and 2=x2+x1G21,
x are expressed as mole fractions
At the azeotrope point both vapor and liquid compositions are identical and i = P/Pio
Determine constants G12 and G21 knowing that azeotrope point is at P=760 mm Hg located at T=58.7oC
and x1=33.21 mole% (1-is ethanol; 2 is n-hexane).
logP1o=8.04494 - 1554.3/(222.65 + T)
logP2o = 6.87776 1171.530/(224.366 + T)
where T is in oC and Pio in mm Hg. The molecular weights of ethanol and n-hexane are 46.07 and
86.18. respectively.