Documente Academic
Documente Profesional
Documente Cultură
McMaster University
1280 Main Street West
Hamilton, Ontario L8S 4L7
Canada
Francios Beaudreau
Athanasis Kassidas
Paul Nomikos
Laura Ronholm
San Yip
Thomas Marlin
Appendix
A User’s Manual For Distillation Simulation 11
B MATLAB Controller Subroutine 16
1
1. Introduction
Most engineers learn best by solving problems and by learning from prior experience; this is
often termed “experiential learning”. This workbook contains a set of experiential learning
exercises covering dynamics and control of distillation. You will be presented a set of problems
to solve, and you will use a combination of inquiry skills and simulation experiments in preparing
your answers. The problems begin with a new perspective on topics that you have seen in other
courses, and they conclude with you defining the final question and solving it.
The simulation has been programmed in MATLAB. (The programming was performed
by Mr. Francios Beaudreau, Dr. Athanasis Kassidas, Dr. Paul Nomikos, Ms. Laura Ronholm, and
Dr. San Yip while they were teaching assistants.) The simulation is designed to be menu-driven,
so that you can consider this close to an experimental system, without programming the process
simulation. Guidance on the use of the program is provided in Appendix A.
The distillation tower in this exercise is shown in Figure 1 and associated data is given in
Table 1. This is a two-product, binary distillation tower, and all compositions are reported as
fraction light key (L.K.). The model conforms to the following assumptions; these assumptions and
the resulting models follow the development in the textbook (Marlin, 2000; Section 5.6).
The simulation is designed to accurately model responses for small and medium input
changes. The simulation will not model extreme input changes, examples of which are given in the
following.
- start up and shutdown
- loss of adequate liquid inventory in overhead or bottoms accumulators
- excessive overhead vapor rate which could not be condensed with the available heat
exchanger
- internal liquid or vapor rates that exceed the hydraulic limits of the trays, leading to
weeping, entrainment, downcomer filling, or other poor performance.
Before beginning to consider the dynamic operation of any process, the engineer should
thoroughly understand the process and equipment principles. Some questions to help you review
and extend your knowledge are presented in the next section.
2
Table 1. Base base data for the binary distillation tower
Variable Value
Feed rate 8.00 kmole/min
Feed composition 0.45 mole fraction L.K.
Feed liquid 1.00 fraction
Feed tray 10 counted from bottom
Total trays 21 (+ reboiler)
Relative volatility 2.20
Distillate composition 0.975 mole fraction L.K.
Distillate product flow rate 3.625 kmole/min
Reflux flow rate 7.487 kmole/min
Bottoms product composition 0.015 mole fraction L.K.
Bottoms product flow rate 4.375 kmole/min
Vapor leaving the reboiler 11.11 kmole/min
Reflux drum holdup 7.2 min (Volume/flow)
Bottoms holdup after weir 5.3 min (Volume/flow)
* enter mole/min (not kmole/min) in the program
PC
LC
F R
Z
D
q A
XD
LC
A
XB
3
2. Exercise 1. Process and Equipment Principles
The questions in this section are designed to help you think about operating the process
equipment. Therefore, the design aspects that provide flexibility are emphasized. In addition, the
equipment that are essential for control - sensors and final elements (valves) - are covered. These
topics complement and reinforce the perspective more common in mass transfer courses, i.e., the
steady-state design and equipment sizing (e.g., heat exchanger area).
The questions are presented below. In determining answers, you are encouraged to use
the references available; textbooks, engineering handbooks, the WWW (Google), and the
process control WEB site PC-Education (www.pc-education.mcmaster.ca).
1. Sketch the design for two heat exchangers that can be used as condensers. For each
design, explain how the heat transfer can be changed and indicate a valve or other
element of the design that could be manipulated to change the heat transferred. What
fluid medium is normally used for heat exchange in the condenser and why?
2. Repeat question (1) for a reboiler.
3. Discuss the purpose of the overhead accumulator (drum). How much liquid should be
contained in the overhead accumulator?
4. Repeat (3) for the bottoms accumulator.
5. What design factors determine the amount of liquid holdup on each tray? Is level control
needed?
6. Define relative volatility and give an example of components for which constant relative
volatility is a good approximation.
7. For what conditions is constant molal overflow a valid approximation?
8. How would you define the best feed tray? How is the best feed tray determined?
9. a. What factors are considered when determining a “good” pressure determined for
a distillation tower during design?
b. What determines the maximum pressure for an operating distillation tower?
c. What determines the minimum pressure for an operating distillation tower?
d. What physical device should be provided to prevent excessive pressures?
10. a. What determines the maximum vapor boilup in an operating distillation tower?
b. What determines the minimum vapor boilup in an operating distillation tower?
11. Describe likely disturbances that would influence product compositions and would be
compensated by feedback control.
12. Determine the physical measurement principle for each of the following sensors used for
distillation control and briefly explain why this is an appropriate choice. Note that
several correct answers may be possible.
a. Overhead accumulator level
b. Reflux flow rate
c. Overhead pressure
13. What type of valve body to you recommend for the distillate product control valve?
4
For this question, you will enter your changes via interactive menus. You need to change
the variables that determine the size of the step changes, and you might need to change the length of
the simulation to capture the entire dynamic response. The level controllers are implemented and
tuned for you: do not change them. The composition sensors are functioning, but the composition
controllers are not implemented even though the menu for the controllers exists. In later exercises,
you will continue with the same distillation tower (and simulation) by programming the
composition controllers and tuning them.
In these exercises, you are to use process reaction curve Method II, as defined in the
textbook Section 6.3 (Marlin, 2000), to fit first order with dead time dynamic models. In each case
below, you are to determine two models, between the input change and the top and bottom
compositions (light key fraction). You are to use the sampled values of the product compositions,
which appear as staircase plots.
Your solution will report plots, show calculations, and report model structure with
parameters (e.g., gain, time constant and dead time) for exercises a-e.
a. Determine the dynamic response for a step change in reboiler duty (vapor boilup) of 880.
mol/min.
b. Determine the dynamic response for a step change in reboiler duty (vapor boilup) of 88.
mol/min.
c. Determine the dynamic response for a step change in reflux flow of +88 mol/min.
d. Determine the dynamic response for a step change of reflux flow of –88 mol/min.
e. Determine the dynamic response for concurrent positive step changes in the vapor boilup
and reflux flow. The magnitudes of the changes are equal at the magnitude of the change in
(c) above.
5
Before performing the following exercises, you must program the PID controllers for XD
and XB; recall that the pressure controller is functioning properly, and the level controllers are
defined and tuned already. Submenu 4 is provided for the composition controllers and will
function if you use the variables defined for the tuning constants, initialization, etc. Directions
and hints for programming are provided in this handout.
a. Based on the open-loop dynamic experiments performed previously, calculate the tuning
for the two single-loop composition controllers (XD by manipulating reflux and XB by
manipulating reboil). Recall that the controllers are executed with a period of 2 minutes.
Enter the tuning for both controllers via main submenu 4. (Remember to clear all step
changes in main menu item 2.)
b. Set the bottoms product composition controller in manual or "OFF", i.e., not in service so
that the reboiler vapor flow is constant, and the distillate composition controller "ON". In
two separate runs, determine the dynamic responses for
1) A set point change in XD of -0.01 mole fraction (from 0.975 to 0.965) and
2) A feed composition disturbance of -0.05 mole fraction (from 0.45 to 0.40 light key).
Use the tuning determined in (a) with any fine tuning you deem necessary.
c. With both composition controllers in automatic or "ON", determine the response of the
system to a set point change in the XD controller of -0.01 mole fraction. Begin with the
tuning determined in (b); you may further fine tune the controllers as needed.
d. With both composition controllers in automatic or "ON", determine the response of the
system to a feed composition change of -0.05 mole fraction. Begin with the tuning
determined in (c); you may further fine tune the controllers as needed.
e. Compare the control performances in XD achieved in response (b1) with (c) and in (b2)
with (d). Is the single-loop or multiloop always better for XD? For each case, explain
the differences in performance.
Hints for programming your controllers are given in the following, because you need to
prepare before programming!
• First, read the attached subroutine so that you understand the variables and options within the
program.
• Second, review the digital forms of the PID controller.
• Third, prepare a flowchart of the code that you plan to write.
• Fourth, prepare hand calculations of the controller that can be used to check the program.
• Fifth, plan your solution, specifically, which variables are (i) communicated in or from the
subroutine, (2) local and must be stored between subroutine executions, and (3) local and
need not be stored
6
• Sixth, include displays of intermediate results in your code so that you can confirm your
excellent results (or find and correct a bug). Values of variables can be displayed in digital
form in the MATLAB window using the display function. A sample of a statement is given
in “disp(MVXBt) ;”, which prints values of the variable MVXBt (or values if the variable
is a vector or matrix) in the MATLAB window. These can be removed when your results are
satisfactory.
Retain a copy of your subroutine: you will need it for the next exercise.
You should be sure that your code is calculating the correct values before you send values back to
the distillation process simulation. This rule is especially true when working with the real
process!
In this assignment, you will modify the process design and/or control system. You may select
one of the proposed exercises, or you may propose an exercise of your own design. The modified
control design must be described, programmed, tuned (based on new process reaction curves, as
needed), and the performance of the new design evaluated by dynamic simulation of the
nonlinear process.
Only one group can perform each exercise, and the instructor will make the allocation
based on your completed project selection forms.
The group members will present the group's results in a brief (10 minute) oral
presentation. The group may prepare up to 5 power point slides for use as visual aids. (Students
missing the class and not presenting an acceptable reason in writing will receive zero for the
assignment.)
The written report should be concise (not more than four pages of typed text, not
including the cover, subroutine listing, presentation hardcopy, and plots) and provide the
following, in addition to a statement of the study goals.
7
e. A summary of what you learned. How did the system perform, why, conclusions,
unsolved mysteries. What principles have you reinforced and what generalizations can
you support based on these results?
SOME HINTS
For all distillation control studies, the base process is the same as for the previous studies. Dual
composition control should be evaluated via simulation for three input changes:
Note that all simulations (1) to (3) should have the same controller tuning.
A. Level Loop Pairing - In the original design, the distillate drum level is controlled by
manipulating the distillate flow rate, and the distillate product composition is controlled
by adjusting the reflux. In the modified design, the manipulated variables are switched,
level is controlled by adjusting reflux flow rate and distillate composition is controlled by
adjusting distillate flow rate. (Note that the controller pairings can be changed through
main menu item 3.)
B. Decoupling compensation - One type of feedforward control uses the measures of the
manipulated variables to compensate for the process interaction. Decoupling achieves
this goal while retaining the PID feedback controllers. In this exercise, a two-way
decoupler is implemented and evaluated. See Section 21.5 on Explicit Decoupling in the
textbook (Marlin, 2000).
C. IMC predictive control - Two single-loop model predictive controllers are used in place
the two PID composition controllers. These can be either IMC or Smith Predictor
algorithms.
D. Equipment holdup changes - The liquid holdups on the trays and in the drums could be
changed by equipment redesign. The following situations will be evaluated.
8
3) The smallest practical holdup in the drums. (with base case tray holdups)
E. Feedforward control - Control performance can be improved when key disturbances are
measured and compensated before the controlled variable is upset. Assume that the feed
composition is measured and implement feedforward control. The simulation cases
below replace those given above.
F. Feedforward control - Control performance can be improved when key disturbances are
measured and compensated before the controlled variable is upset. Assume that the feed
flow rate is measured and implement feedforward control. The simulation cases below
replace those given above.
G. Dynamic matrix control - Implement a 2x2 Dynamic matrix controller for composition
feedback control. You can use results from the program TWOBYTWO in the design of
the controller, i.e., calculating the KDMC matrix. You will have to program the DMC
controller.
One case you should start with is XD=0.999, XB=0.002, alpha=1.9, z=0.40, NT=50, and
NF=20.
I. Alternative Analyzer Loop Pairing – You will change the analyzer controllers so that XD
is controlled by adjusting the reboiler vaporization and XB is controlled by the reflux
flow.
J. Exercise defined by group - Any group may propose an exercise, which must be accepted
by the instructor.
6. Distillation References
Distillation fundamentals
King, C., Separation Processes, 2nd Ed., McGraw-Hill, New York, 1980.
Chin, T., Guide to Distillation Pressure Control Methods, Hydrocarbon Proc., 145-153 (Oct. 1979).
9
Kister, H., Distillation Design, McGraw Hill, New York, 1992.
Kister, H., Distillation Process Operations and Applications, McGraw Hill, New York, 1990.
Lieberman, N. and E. Lieberman, A Working Guide to Process Equipment, McGraw Hill, New York, 1997.
Ludwig, E., Applied Process Design for Chemical and Petrochemical Plants (2nd Edition), Gulf Publishing,
Houston, 1979.
Barnicki, S. and J. Davis, Designing Sieve Trays – Part 1, Chemical Engineering, October 1989, 140
(1989).
Barnicki, S. and J. Davis, Designing Sieve Trays – Part 2, Chemical Engineering, November 1989, 202
(1989).
Lockett, M., Distillation Tray Fundamentals, Cambridge University Press, London, 1986.
Aspen, Aspen Dynamics™ and Aspen Custom Modeller™, Aspen Technology, 10 Canal Park, Cambridge,
MA, 1999.
Holland, C., Unsteady State Processes with Applications to Multicomponent Distillation, Prentice-Hall,
Englewood Cliffs, 1966.
Hyprotech, HYSYS.PLANT v2.0 Documentation, Dynamic Modelling Manual, Hyprotech Ltd., Calgary,
1998.
Marlin, T., The Software Laboratory, Version 3.0, McMaster University, Hamilton, 1999.
Tyreus, B., W. Luyben, and W. Schiesser, Stiffness in Distillation Models and the Use of an Implicit
Integration Method to Reduce Computation Times, Ind. Eng. Chem. PDD, 14, 427-433 (1975).
Distillation control
Luyben, W. (Ed.), Practical Distillation Control, Van Nostrand Reinhold, New York, 1992.
Shinskey, F., Distillation Control, McGraw Hill, New York, 1984.
Industrial Instrumentation
Andrew, W. and H. Williams, Applied Instrumentation in the Process Industries, Volume I, A Survey (2nd
Ed.), Gulf Publishing, Houston, 1979.
Andrew, W. and H. Williams, Applied Instrumentation in the Process Industries Volume II, Practical
Guidelines (2nd Ed.), Gulf Publishing, Houston, 1980.
Driskell, L., Control Valve Selection and Sizing, ISA Publishing, Research Triangle Park, 1983.
Marlin, T., et. al., PC_Education WEB site, www.PC-Education.mcmaster.ca , 2006
10
Appendix A. User’s Manual For Distillation Simulation
The distillation simulation requires MATLAB version 7.0 or higher and all of the files stored in the
McMaster JHE system under the course 3E04 in the "K:\" drive in subdirectory "Distil_2006". If
you want to perform the study on your home computer using a student version of MATLAB, copy
all files in "Distil_2006" to your home computer.
The distillation simulation has been developed to be menu-driven for most parameters you
will input during these exercises. (As you will see, later exercises will require some limited
programming.) After you have started MATLAB and defined the correct MATLAB folder for the
location of the m-files, you can start the program by typing distil and enter. The screen will
clear and the main menu will be displayed as shown below.
*************************************************************************
* SIMULATION OF A BINARY DISTILLATION COLUMN *
* Version 3.0 *
*************************************************************************
The first item allows you to modify the process design and solve for the initial steady-state
operating conditions. You should enter the data given in the following copy of submenu 1.
11
*************************************************************************
* Define Initial State *
*************************************************************************
The relative volatility is entered using submenu item 9. Do not change any of the other
data appearing in this menu.
Note that the program has two options for the column sizing, which determines the column
diameter and dimensions of the trays. A selection is presented to you when you select item 13,
Calculate new steady state: “Maintain hydraulic rating unchanged? (y/n)”.
1. No - Calculate the diameter and tray dimensions before calculating the steady-state tray
compositions. This would be appropriate for an initial equipment design.
2. Yes - Retain the original diameter and tray dimensions and calculate new initial steady-
state compositions. This is appropriate for simulating various scenarios for an existing
distillation tower.
In this exercise, you should select option 1, No, (calculating dimensions) for determining
the initial steady state. If you ever run the steady-state program at other input values, you select
execute option 2, Yes, because we are considering dynamics from one distillation tower with
unchanged physical design but changing operating conditions.
By the way, the user can request displays of the tray compositions and McCabe-Thiele
Diagram by using menu item 12. These will help you recall the basic principles of distillation
learned long ago during the Mass Transfer course.
12
After defining the proper steady-state operation, you can define the regulatory control
system that maintains levels and pressure at their desired values using submenu 3. The program
provides no options for pressure control but allows for different level control structures. For
Exercises 2 and 3, you make no changes to the level control shown in the process sketch and given
below.
*************************************************************************
* Define Loop Pairings *
*************************************************************************
You can define step changes to various variables using submenu 2. These changes will be
introduced during the dynamic simulation; these changes will define process reaction curves
(manipulated variables) or disturbances. For each variable, you define a step size and time for
introduction of the step. All steps are introduced, so a zero size should be given for those variables
that you want to be unchanged. A sample of the submenu with one step defined is given below; the
boilup vapor rate is changed by +88 mol/min at a time of 6 minutes.
*************************************************************************
* Define Time and Size of Step Changes *
*************************************************************************
13
The simulation can be executed by selecting the simulation submenu. The first two entries
are the time step used in solving the process simulation and the time between product composition
analyses, which is also the time step for the composition plots and controllers. For this exercise, do
not change the values of entries 1 and 2. The total time is initialized, but you can change this
value, if necessary.
*************************************************************************
* Dynamic Simulation Menu *
*************************************************************************
When you select submenu item 4, you are asked to provide a case name (without
extension), which is used as the file name for saving the results for later retrieval; the extension will
be “.MAT”. You should provide a unique name, because the program will overwrite (without a
warning) the contents of any existing file with the same name in the default folder that exists in the
active MATLAB path directory. Therefore, name each case that you want to save with a unique
name, such as “Marauder_Case_2a”.
When the simulation is being executed, numerical values are displayed on the screen to
give you an update on the case. This enables you to recognize and stop any case that is clearly
wrong due to incorrect data input. The variables displayed are summarized below.
At the completion of each simulation case, the results are plotted automatically and also
stored in the file named at the beginning of the case. A sample of the plots is given in Figure 2.
You can repeat the plot of any saved simulation by selecting main menu item 7 and entering the
name of the appropriate stored case. The plot provides the following three graphs:
When the plot is displayed, you can copy it and paste it in a MS WORD document where
you can add descriptions of the cases. The word processor document can be printed so that you can
perform the process reaction curve calculations. You can save the word processor and the data
MATLAB case files as described previously for each case. This will allow you to recover from
14
computer restarts, printing errors, check for errors (unlikely that you will make any!), and transport
the results to your home computer. Better safe than sorry.
8001 1.5
1
8000.5
Z (mol frac)
F (mol/min)
0.5
8000
0
7999.5
-0.5
7999 -1
0 20 40 60 80 100 0 20 40 60 80 100
Time (min) Time (min)
1.5
q (mol ratio)
0.5
0
0 20 40 60 80 100
Time (min)
0.975 0.015
XD (mol frac)
0.014
XB (mol frac)
0.97
0.013
0.965
0.012
0.96 0.011
0.955 0.01
0 20 40 60 80 100 0 20 40 60 80 100
Time (min) Time (min)
3740 4380
3720 4360
3700 4340
D (mol/min)
B (mol/min)
3680 4320
3660 4300
3640 4280
3620 4260
0 20 40 60 80 100 0 20 40 60 80 100
Time (min) Time (min)
0.975 0.015
XD (mol frac)
0.014
XB (mol frac)
0.97
0.013
0.965
0.012
0.96 0.011
0.955 0.01
0 20 40 60 80 100 0 20 40 60 80 100
Time (min) Time (min)
4
x 10
7488.5 1.122
7488 1.12
1.118
R (mol/min)
V (mol/min)
7487.5
1.116
7487
1.114
7486.5
1.112
7486 1.11
0 20 40 60 80 100 0 20 40 60 80 100
Time (min) Time (min)
15
Appendix B. MATLAB Controller Subroutine
This is the subroutine stored in file compcont.m. You should store the original
(compcont.bak) and modify the m-file. Only the file with the extension “.m” will be
executed.
16
%
% XDSP and XBSP are the current set points of the distillate and
% bottoms composition.
%
% COMPCONT_INIT is a flag that indicates if this function is being called
% for the first time in the simulation, in which case
% the controllers have to be initialized. The value
% reported to this function is given below, and you
% may use this information to decide when to initialize
% you controller calculations.
%
% COMPCONT_INIT = 1, if is this is the first call
% = 0, otherwise.
%
% I This is an array of dimension 2, i.e., I(2), in which
% you can store the results of initialization calculations,
% if necessary, and have them stored for all future calculations.
% NOTE: The convention is:
% I(1) for controller 1,
% I(2) for controller 2.
%
% NOTE: This is an output from the first execution and
% an input thereafter
%
% R, VB, D, B are the current values of the reflux rate, vapour boilup
% rate, distillate rate, and bottoms rate.
% F, Z, q are the current values of feed properties: feed rate, feed
% composition, liquid fraction
%
% *********************************************************************
% Output:
% These are the variables and parameters which can be changed
% through the controller calculations and will be transmitted
% to the plant.
%
% MVXDt and MVXBt are the calculated values of the manipulated variables
% used to control the distillate and bottoms compositions;
% these values will be implemented at the current time.
%
% **********************************************************************
% Calculations:
% Some suggestions and hints are given below.
%
%
% 1. The convention is that the integral mode of a controller is turned off
% by setting the integral time constant to zero in the menu for editing
% controllers. If at some point you will want to turn off the integral mode
% of a composition controller this way, make sure that your code
% treats the case TI=0 as a special case; if not, a division by zero will
% occur (recall: Integral Mode = (Error integral)/TI ).
% 2. The controller can be turned off two ways via the menu.
% i) select "off" in the menu.
% ii) give the controller gain a value of zero.
% 3. Any special calculations for initialization must be included.
% 4. When a controller is "OFF", this subroutine is executed but the
% values of MVt are ignored. When the controller is "ON", this
% subroutine is executed and the values of MVt are implemented.
%
% ***********************************************************************
%
% -------------------------------------
% Do not remove this 'global' statement.
% This ensures that the value of variables
% I, STORE1, ..., STORE10 are retained for
% subsequent controller executions
global I STORE1 STORE2 STORE3 STORE4 STORE5 STORE6 STORE7 STORE8 STORE9 STORE10
%
% ------------------------------------
17
% Comment ththe following line when programming
% the composition controllers
% ------------------------------------
% ******************************************************************
% *************** CONTROLLER CALCULATIONS GO HERE ****************
% INITIALIZATION ----------------------------
% -------------------------------------------
% UPDATE RECENT PAST VALUES AT EACH EXECUTION
return;
18