Вы находитесь на странице: 1из 32

Chapter 2: Numerical Methods

Prepared by: Lim Ying Pei


FKK, UiTM Shah Alam
PART I:
ITERATIVE CONVERGENCE
METHODS
Introduction
Digital simulation is a powerful tool for solving the
equations describing chemical engineering systems.
One of the most common problems in digital simulation is
the solution of simultaneous nonlinear algebraic equations.
If these equations contain transcendental functions,
analytical solutions are impossible.
Therefore, an iterative trial-and error procedure of some
sort must be devised.
If there is only one unknown, a value for the solution is
guessed. It is plugged into the equation or equations to see
if it satisfies them. If not, a new guess is made and the
whole process is repeated until the iteration converges (we
hope) to the right value.
Introduction
The key problem is to find a method for making the new
guess that converges rapidly to the correct answer.
There are a host of techniques. Unfortunately there is no
best method for all equations. Some methods that converge
very rapidly for some equations will diverge for other
equations; i.e., the series of new guesses will oscillate
around the correct solution with ever-increasing
deviations.
This is one kind of numerical instability.
We will discuss only a few of the simplest and most useful
methods.
Method 1: Newton-Raphson
Newton-Raphson method is using the slope of the function
curve to extrapolate to the correct value.
Example:
In a small food industry, a spherical tank is used to store
liquid raw material. The capacity of the liquid in the tank
is described by the following equation:

V h 2 3R h
3
where V is the volume (m3), h is the depth of the water in
the tank (m), and R is the tank radius (m). Given that the
radius of the tank is 3 m. Using the NR method, determine
the depth of the tank when the volume is 30 m3. Take
initial depth to be 3 m (ho) and state the calculated values
correct to 4 decimal places and with tolerance error less
than 1x10-4
Method 2: False Position (Secant
Method)
B: False Position
Combination of Newton-Raphson and
interval halving.
Needs two guess values to start the
iteration.
Considered stable than Secant iterative
method.
Example:
Refer to handout
Question 5
Final Exam, April 2010
Tutorial (Q4, Final Exam, Oct 2010)
A well-stirred cylindrical tank with radius 2 m contains
100 kg of liquid Y. At the start of operation (t = 0), liquid
Y is pumped into the tank at 160 kg/hr and pure orange
juice is being added at 30 kg/hr. The resulting orange juice
solution (pure orange juice + Y liquid) is leaving the tank
at 120 kg/hr. Because of faulty design work, liquid Y is
evaporating from the tank at a velocity of 1m/hr.
Concentration of the outlet solution is the same as that
within the tank. Assume that the rates and of input and
output of the tank remain constant at the start of the
operation. Given that the density of liquid Y
vapor = 0.796 kg/m3.
a) Prove that the mathematical equation to model
the mass fraction of orange juice (w) in the
tank as a function of time (t) is given by

1 1
w 1
6 1 0.6t 3
15 marks

b) By using False Position method, determine the


time when the mass fraction of orange juice in
the tank is 0.1. Start the initial guess value as
0.5 hr and 1 hr for the time. State your
calculation values to four decimal places and
tolerance less than 10-4 16 marks
Method 3: Wegstein
You need two sets of guess values and the
other two values will be calculated from
given function.
Example
Refer to handout
Question 6
Final Exam, Oct 2007
PART II:
NUMERICAL INTEGRATION OF
ORDINARY DIFFERENTIAL
EQUATIONS
1: EULER ALGORITHM
Consider a batch reactor which has a combination of
consecutive and reversible chemical reactions as the follow :
K1 K3
A B C
K2 K4

Given that the kinetic rate constants and the initial


concentrations of the three components are as follows;
k1=1.0 min-1 and k2= 0 min-1, k3=2.0 min-1 and k4= 3 min-1
with initial concentration of CAO = 1 mol/l, CBO = 0 mol/l and
Cco = 0 mol/l

a) Derive the component equation (rate of formation) for


each component.
b) Simulate the concentration profile of this reaction system
with step size, t = 0.2 min starting at t = 0min to t =
0.6min by using explicit Euler method. (State your
calculation value to 4 decimal places)
ANSWER

t dCA/dt CA dCB/dt CB dCC/dt CC

0 -1.0000 1.0000 1.0000 0 0 0


0.2 -1.0000 0.8000 1.0000 0.2000 0 0
0.4 -0.8000 0.6400 0.4000 0.2800 0.4000 0.0800
0.6 -0.6400 0.5120 0.3200 0.3440 0.3200 0.1440
Tutorial (April 2010)
A mixing tank as shown in Figure 2 is used to mix component A
and B. The blending process outlet mixture from tank 1 flows to
tank 2 where it was mixed with component C. However at tank
2, component A reacts with component C irreversibly to
produce D as shown in equation 1. Component A and B were
recycled back to tank 1 and to retain component C and D in tank
2, a membrane was installed. All liquid in the system have the
same density and both tanks are perfectly mixed.

k1
A+C D (1)
(a) Develop the dynamic model for volume hold up inside the
tank 1 and tank 2. (4 marks)
F1 F2 F5
C Ao C Bo C Co

F6
C A2
F3 C A6
C A1 V2
C A3 CB 6
V1 CC 6
CB3
CD 6
F4
C A4 Membrane
Tank 1 CB 4 Tank 2

Figure 2 A series of mixing tank

(b) Develop the dynamic concentration models of component A in Tank 1 and Tank 2.
(11 marks)
(c) Due to valves failure occurred during the process, there is no flow at streams,
F3 and F4. By using Euler method, simulate the dynamic volume hold up and
concentration of component A in tank 1 from a period of t = 0 to 3 min with a step
change of 1 min. Table 1 shows the initial parameters before valves failure. Your
calculated values must be correct to four decimal places.

Table 1 Initial parameters for the mixing process

Parameter Value
F1 100 m3/min
F2 25 m3/min
F3 123 m3/min
F4 35 m3/min
CAo 5 mole/m3
CA1 3 mole/ m3
CA4 1.2 mole/ m3
V1 150 m3 13 marks
ANSWER
t (min) V1 (m3) dV1/dt CA1(mol/m3) dCA1/dt
(m3/min) (mol/min)

0 150 125 3 0.8333


1 275 125 3.8333 0.07577
2 400 125 3.9091 0.02841
3 525 125 3.9375 0.01488
Tutorial-Final Exam Oct 2007
Seawater with concentration of 8000 g/m3 is pumped into a well
stirred tank at a rate of 0.6 m3/hr and the resulting solution is
leaving the tank at the same flow rate. At the start of the
operation, the level of the tank is kept constant with a total
volume of 1 m3 of inlet solution. Because of faulty design work,
water is evaporating from the tank at a rate of 0.025 m3/hr.
Assume the rates of input and output of the tank remain constant
at the start of the operation and the contents of the tank are well
mixed all times.

a) Develop a total continuity equation for the well stirred tank


b) Determine the time required for the tank to run dry if outlet
pump is turned on.
c) Determine the salt concentration in the tank as a function of
time for every hour until it reaches 4 hours using Euler method.
ANSWER
t (hr) Cs (g/m3) dCs/dt
0 8000 200
1 8200 87.1795
2 8287.1795 36.7071
3 8323.8860 14.8813
4 8338.7679 5.7873
Runge Kutta 4th Order
Tutorial-Final Exam, Oct 2007
First order consecutive reaction take place in a batch reactor. The
reactions are as follow;
Given that the values of k1=1.5 min-1 and k2=3min-1 with initial
Concentration of Cxo = 3 mol/l, Cyo = 0 mol/l and Czo = 0 mol/l

X k1 Y
k2
Z
a) Derive the total continuity equation and component continuity
equations for X,Y and Z to describe the above system.
(6 marks)
b) Use Runge-Kutta 4th method to simulate the concentration
profile of component X,Y and Z in the reactor at t = 0 min to t
= 0.2min with step size, t = 0.1 (with 4 decimal places).
(19 marks)
ANSWER
t (min) CX (mol/L) CY (mol/L) CZ (mol/L)

0 3 0 0

0.1 1.9133 0.36223 0.72445

0.2 1.2202 0.59325 1.1865


ANSWER
Time Compon K1 K2 K3 K4
(min) ent

0.1 X -1.35 -1.04625 -1.1146 -0.84843


Y 0.45 0.34875 0.37153 0.28281
Z 0.9 0.6975 0.74306 0.56562
0.2 X -0.8610 -0.66726 -0.71085 -0.5411
Y 0.2870 0.2224 0.23695 0.18037
Z 0.57399 0.44484 0.47390 0.36074
Tutorial-Final Exam, April 2007
The following reaction is taking place in an isothermal
batch reactor
K1 K2
A B C
where B and C are the intermediate and final products,
respectively. The rate constants; k1 and k2 are given as
3s-1 and 1s-1, respectively and when t = 0s, CA = 1 mol.m-3,
CB = 0 and CC = 0.
a)Derive the component continuity equation(s) for the
reactor
b)Given the step size as 0.5s, solve the equations(s) using
Runge-Kutta 4th order from t = 0s to t = 1s
ANSWER
t (s) CA (mol/m3) CB(mol/m3) CC (mol/m3)

0 1 0 0

0.5 0.2734 0.5 0.2266

1.0 0.0748 0.4401 0.4851


ANSWER
Time (s) Component K1 K2 K3 K4

0.5 A -1.5 -0.375 -1.2188 0.3282


B 1.5 0 1.2188 -0.9376
C 0 0.375 0 0.6094
1.0 A -0.4101 -0.1025 -0.3332 0.0897
B 0.1601 -0.1875 0.1301 -0.40475
C 0.25 0.2900 0.2031 0.31505

Вам также может понравиться