Chee 222: Chemical Process Dynamics and Numerical Methods
Chee 222: Chemical Process Dynamics and Numerical Methods
2
Introduction
• In Module 1 we developed models consisting of ordinary
differential equations
3
Solving Steady State Parameters
• To solve for steady state parameters the time derivative term is set to 0:
• Or in vector notation:
4
Introduction
• For now we will deal with methods of solving
single variable non linear algebraic equations
– Graphical
– Direct Substitution/Fixed Point Iteration This
– Interval Halving (Bisection) Lecture
– False Position (Reguli Falsi)
– Newton’s Method
5
Graphical Method
Graphical Method
• Can find the values of roots by examining the
graph of a function:
-3
-5
7
Graphical Method
• Advantages
– Can visually see the relationship between x and f(x)
– Can see all the roots in the plotted domain (other methods may only find one root, or another, depending on initial guess)
• Disadvantages
– Manual method, can be slow
– Can be imprecise (only an approximation, useful for initial guess)
8
Direct Substitution/Fixed Point
Iteration
Direct Substitution/Fixed Point Iteration
• Relatively simple method for solving single algebraic equation
with single unknown:
10
Direct Substitution/Fixed Point Iteration
• Example:
11
Direct Substitution/Fixed Point Iteration
• Example:
12
Direct Substitution/Fixed Point Iteration
• If we start with an initial guess of 4:
13
Direct Substitution/Fixed Point Iteration
• If we rearranged to get:
14
Direct Substitution/Fixed Point Iteration
• If we rearranged to get:
15
Direct Substitution/Fixed Point Iteration
• If we rearranged to get:
• Diverging
16
Direct Substitution/Fixed Point Iteration
• Convergence depends on the initial guess used for a
particular rearrangement
• Additional information on direct substitution/fixed
point iteration convergence can be found in:
– Gerald, C.F., Wheatley, P.O. (1999). Applied Numerical
Analysis. New York: Addison-Wesley
– Chapra, S.C., Canale, R.P. (2006). Numerical Methods
for Engineers. New York: McGraw-Hill.
17
Interval Halving (Bisection)
Interval Halving (Bisection)
• Conceptually simple method of finding roots
• Requires that the sign of the function is known
• Starts with two x values, a and b, that bracket a
root
– If f(a)f(b)<0 (opposite sign), and the function is
continuous, than the interval between a and b will
contain at least one root
19
Interval Halving (Bisection)
• Conceptually simple method of finding roots
• Requires that the sign of the function is known
20
Interval Halving (Bisection)
• For example:
– Find x1, where f(x1) is negative and x2 where f(x2) is
positive
– Determine the midpoint (x3). If f(x3) is negative:
throw out x1 and make x3 lower bracket
– Determine midpoint between x3 and x2 (x4). If f(x4)
is positive: throw out x2 and make x4 the upper
bracket
– Find midpoint between x3 and x4 (x5). If the f(x5) is
negative: throw out x3 and make x5 the lower
bracket
21
Interval Halving (Bisection)
• Graphically: Initial
Upper
Limit
Initial
Lower
Limit 22
Interval Halving (Bisection)
• Advantages:
– Simple to understand
– Guaranteed to work if f(x) is continuous in [a,b] and
the values of a and b bracket a root (f(a)f(b)<0)
• Disadvantages:
– Slow to converge
– May be difficult to find an interval that brackets
roots when there is more than one root
– Only finds one root at a time
23
False Position (Reguli Falsi)
False Position (Reguli Falsi)
• Referred to as False Position or Reguli Falsi
• Uses two previous iterations to determine next
iteration value
• Steps:
– Select xk and xk+1 to bracket solution
– Draw line between f(xk) and f(xk+1), the x-intercept
of this line is xk+2
– Evaluate f(xk+2).
– Replace bracket limit that has the same sign for its
function as f(xk+2)
– Continue until tolerance is met
25
False Position (Reguli Falsi)
• Advantages:
Initial
Lower
Limit
Initial
Upper
Limit
26
False Position (Reguli Falsi)
• In the above plot x3 can be found using the
following equation:
27
False Position (Reguli Falsi)
• Advantages:
– Can be used when the derivative of the function is
unknown
– Generally converges more quickly than the
bisection method
• Disadvantages
– Potentially slower than other methods
– May be difficult to find an interval that brackets
roots when there is more than one root
– Only finds one root at a time
28