distillation dynamics and control workbook 2006

Upload: b95504048

Post on 30-May-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    1/18

    1

    Department of Chemical Engineering

    McMaster University

    1280 Main Street West

    Hamilton, Ontario L8S 4L7

    Canada

    DISTILLATION DYNAMICS AND CONTROL

    WORKBOOK

    By

    Francios Beaudreau

    Athanasis Kassidas

    Paul Nomikos

    Laura Ronholm

    San Yip

    Thomas Marlin

    Section Topic Page

    1. Introduction 2

    2. Exercise 1. Process and Equipment Principles 4

    3. Exercise 2. Open-loop Process Dynamics 4

    4. Exercise 3. Closed-loop PID Control 5

    5. Exercise 4. Student-defined Project 7

    6. References 9

    Appendix

    A Users Manual ForDistillation Simulation 11

    B MATLAB Controller Subroutine 16

    Copyright 2006 by T. Marlin

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    2/18

    2

    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 preparingyour 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 andthe resulting models follow the development in the textbook (Marlin, 2000; Section 5.6).

    1) equal molal overflow

    2) equilibrium trays with constant relative volatility3) liquid inventory is determined by a weir equation (liquid always above the weir)

    4) accumulation in the vapor phase is negligible

    5) the analyzers can have dead time

    6) an updated analyzer measurement is available periodically (initialized at 2 minutes) and the

    analyzer controllers are executed when updated measurement is available

    7) the level in the distillate drum can be controlled by adjusting the reflux or distillate flow

    8) the level in the bottoms can be controlled by adjusting the bottoms flow or reboiled vapor

    (Level controllers in 7 and 8 above are initially configured as shown in Figure 1, areessentially continuous, and are initially provided with reasonable tuning.)

    9) Sufficient liquid is always available in the overhead and bottoms accumulators to provide

    liquid to the pumps

    10) The pressure is maintained constant by the controller shown in Figure 1.

    The simulation is designed to accurately model responses for small and medium input

    changes. The simulation will notmodel extreme input changes, examples of which are given in thefollowing.

    - 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.

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    3/18

    3

    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

    Figure 1. Binary distillation tower.

    F

    Z

    q

    R

    D

    B

    LC

    LC

    PC

    A

    XD

    AXB

    V

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    4/18

    4

    2. Exercise 1. Process and Equipment Principles

    The questions in this section are designed to help you think about operating the processequipment. 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 referencesavailable; 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 otherelement 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 pressure13. What type of valve body to you recommend for the distillate product control valve?

    3. Exercise 2. Open-loop dynamics

    This question is to be answered using programs provided in MATLAB to simulate a two-product

    distillation column. Directions for the use of the programs are provided in Appendix A. In this

    problem, you will evaluate the dynamic responses for the cases defined below and analyze theresults based on your chemical engineering training. Later, you will use the results of your open-

    loop tests in designing and tuning feedback digital PID controllers for this system.

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    5/18

    5

    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 implementedeven though the menu for the controllers exists. In later exercises,

    you will continue with the same distillation tower (and simulation) by programming thecomposition 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.

    Answer the following questions about your results.

    f. Compare your results in a and b and explain.g. Compare your results in c and d and explain.

    h. For exercise b, how long is it between the time that the vapor boilup is changed and the

    measured distillate composition changes? Explain your answer.

    i. For exercise e, (i) Can you determine transfer functions for XD(s)/V(s) and XD(z)/R(z)from this data set?, and (ii) Explain the qualitative behavior (the shapes) of the dynamic

    responses of XD and XB.

    4. Exercise 3: Closed-loop PID control

    This question is to be answered using programs provided in MATLAB to simulate a two-product

    distillation column; refer to Appendix A for directions on using the program. This assignmentfollows Distillation Exercise 2. Be sure that the parameters in submenu 1 are the same as used in

    the Distillation Exercise 2, and before running dynamic cases, calculate the steady-state

    conditions using submenu 1, item 13! You will investigate the multiloop feedback control of the

    two-product distillation column in this problem.

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    6/18

    6

    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.

    Perform the following exercises and prepare a solution documenting programming,

    intermediate calculations, and discussion of results. Provide a copy of your subroutine with yourassignment.

    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 sothat 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 anyfine tuningyou 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 furtherfine 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 furtherfine 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 theprogram.

    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

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    7/18

    7

    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 digitalform 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 variableis 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!

    i) Appropriate initialization for the PID algorithm should be included; a variable

    (COMPCONT_INIT) is provided to designate the first time the calculations are executed.

    ii) Anti-reset-windup protection must be provided.

    iii) The control calculations should function when TI=0, even though TI appears in the

    denominator; prepare your program so that setting TI=0 turns off the integral mode.

    iv) Remember that values of intermediate local variables, i.e., those not appearing in thefunction call or GLOBAL statements are not retainedfor subsequent executions. Thus,

    variables like the previous error or previous CV must be stored by you. Some extra

    GLOBAL variables STORE? are provided for this purpose. They can be used as scalars

    or vectors.

    5. Exercise 4. Control Case Study

    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 thenonlinear 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 theassignment.)

    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 thefollowing, in addition to a statement of the study goals.

    a. An explanation of the algorithms used for control.

    b. Discussion of additional modelling required, e.g., process reaction curve experiments and

    calculations.

    c. A discussion of the control performance obtained. Compare with the previous results, as

    appropriate.

    d. A hard copy of the presentation visual aids.

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    8/18

    8

    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

    1) Start early! (Have you heard this before?)2) You can arrange to see the instructor with a plan before beginning the detailed work.

    - The plan will not be graded.- Use outline or bullet format, hand-written in preparation for discussion with instructor.

    - Prepare a plan for changes in menu-entered data.

    - Prepare a plan documenting the new control equations and where they will be

    programmed, empirical modelling cases, and tuning procedures.

    - Explain what you will look for in your simulations, i.e., what are the expected results.- Refer to the programming hints in Section 4.

    3) Do NOT copy long sections of the text into your written report. Be concise!

    CANDIDATE DISTILLATION STUDIES

    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:

    a) - 0.05 mole fraction step in feed light key (.45 to .40),

    b) +10% step change in feed rate (100 to 110),

    c) -1% step change in the bottoms composition controller set point (2% to 1%)

    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 controlledby 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 placethe 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.

    1) All holdups on trays and drums are increased by factors of 2, and 5.

    2) Only the two drum holdups are increased by 5. (with base case tray holdups)

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    9/18

    9

    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 thefeedcomposition is measured and implement feedforward control. The simulation cases

    below replace those given above.

    1) Feedback control of XD only, disturbance of -.05 in feed composition.

    2) Feedback and feedforward control of XD only, disturbance of -.05 in feedcomposition.

    3) Feedback and feedforward control of XB and XD, disturbance of -.05 in feed

    composition.

    F. Feedforward control - Control performance can be improved when key disturbances aremeasured and compensated before the controlled variable is upset. Assume that the feedflow rate is measured and implement feedforward control. The simulation cases belowreplace those given above.

    1) Feedback control of XD only, disturbance of +10% in feed rate.2) Feedback and feedforward control of XD only, disturbance of +10% in feed rate.

    3) Feedback and feedforward control of XB and XD, disturbance of +10% in feed

    rate.

    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.

    H. Effects of operating conditions - You are to determine the effects of operationing

    conditions on distillation dynamics, controller tuning, and controller performance.

    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.

    Distillation equipment design and operation

    Chin, T., Guide to Distillation Pressure Control Methods,Hydrocarbon Proc., 145-153 (Oct. 1979).

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    10/18

    10

    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.

    Distillation tray hydraulics

    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.

    Distillation dynamic simulation

    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, PracticalGuidelines (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

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    11/18

    11

    Appendix A.Users Manual ForDistillation 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 youwill 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 willclear and the main menu will be displayed as shown below.

    The first item allows you to modify the process design and solve for the initial steady-stateoperating conditions. You should enter the data given in the following copy of submenu 1.

    ************************************************************************** SIMULATION OF A BINARY DISTILLATION COLUMN ** Version 3.0 **************************************************************************

    1) Define Initial State2) Define Step Changes3) Define Loop Pairings4) Composition Controllers5) Level Controllers6) Start Simulation7) Plot a Previous Simulation8) Load a Base Case9) Save a Base Case10) QUIT TO MATLABPLEASE ENTER A SELECTION :

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    12/18

    12

    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.

    REMEMBER TO SOLVE FOR THE STEADY-STATE

    OPERATION USING SUBMENU ITEM 13 BEFORE

    LEAVING THIS SUBMENU!

    ************************************************************************** Define Initial State **************************************************************************

    DEPENDENT VARIABLES FOR CURRENT INITIAL STEADY-STATE:Initial Reflux Rate, R0 (mol/min) : 7487.16

    Initial Boilup Rate, VB0 (mol/min) : 11112.2Initial Distillate Rate, D0 (mol/min): 3625Initial Bottoms Rate, B0 (mol/min) : 4375WHICH OF THE FOLLOWING INDEPENDENT VARIABLES WOULD YOU LIKE TO CHANGE?Feed properties Present Values1) Initial Feed Rate, F0 (mol/min) 80002) Initial Feed Composition, Z0 (mol frac) 0.453) Initial Liquid Fraction, q0 1Required separation4) Initial Distillate Composition, XD0 (mol frac) 0.9755) Initial Bottoms Composition, XB0 (mol frac) 0.015Column properties6) Number of Trays, NT 217) Feed Tray Location, NF 108) Tray Hydraulics Rating

    9) Component Properties and Operating ConditionsInventories10) Initial Distillate Drum Holdup, MD0 (mol) 8000611) Initial Column Base Holdup, MB0 (mol) 2318812) Display Initial Tray Compositions and McCabe-Thiele13) Calculate New Steady-State14) Quit to main menuPLEASE ENTER A SELECTION :

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    13/18

    13

    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.

    You can define step changes to various variables using submenu 2. These changes will beintroduced 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 Loop Pairings **************************************************************************

    WHICH OF THE FOLLOWING WOULD YOU LIKE TO CHANGE?Present Values

    1) MV for overhead level: Distillate Rate (3)2) MV for reboiler level: Bottoms Rate (4)3) MV for distillate composition: Reflux Rate (1)

    MV for bottoms composition: Boilup Rate (2)4) Quit to main menu

    PLEASE ENTER A SELECTION :

    ************************************************************************** Define Time and Size of Step Changes **************************************************************************

    CURRENT INITIAL STEADY-STATE:Feed Rate, F0 (mol/min) : 8000

    Feed Composition, Z0 (mol/min) : 0.45Feed Liquid Fraction, q0 (mol frac) : 1Reflux Rate, R0 (mol/min) : 7487.16Boilup Rate, VB0 (mol/min) : 11112.2Distillate Rate, D0 (mol/min) : 3625Bottoms Rate, B0 (mol/min) : 4375

    WHICH OF THE FOLLOWING PARAMETERS WOULD YOU LIKE TO CHANGE?Size of step change in Present Values1) Feed Rate, OF1 (mol/min) 02) Feed Composition, OZ1 (mol frac) 03) Feed Liquid Fraction, Oq1 (mol frac) 04) Reflux Rate, OR1 (mol/min) 05) Boilup Rate, OV1 (mol/min) 886) Distillate Rate, OD1 (mol/min) 0

    7) Bottoms Rate, OB1 (mol/min) 0Time of step change in8) Feed Rate, FSTEP1 (min) 69) Feed Composition, ZSTEP1 (min) 610) Feed Liquid Fraction, qSTEP1 (min) 611) Reflux Rate, RSTEP1 (min) 612) Vapour Boilup Rate, VSTEP1 (min) 613) Distillate Rate, DSTEP1 (min) 614) Bottoms Rate, BSTEP1 (min) 615) Quit to main menuPLEASE ENTER A SELECTION :

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    14/18

    14

    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.

    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:

    - the feed variables (flow, composition, and vaporization)

    - the product compositions (XD and XB) and the product flows (D and B)

    - the product compositions (XD and XB) and the recycle flows (V and R)

    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

    ************************************************************************** Dynamic Simulation Menu **************************************************************************

    WHICH OF THE FOLLOWING PARAMETERS WOULD YOU LIKE TO CHANGE?Present Values

    1) Simulation time step, DELTA (min) 0.012) Analyser sampling time, WRSTEP (min) 23) Total simulation time, TSTOP (min) 604) Start simulation5) Quit to main menu

    PLEASE ENTER A SELECTION :

    TIME XDM XBM V R D B

    with XDM = fraction light key in distillate as measured by sensorXBM = fraction light key in bottoms as measured by sensorR = reflux flow rateD = distillate flow rateV = vapor flow rate from reboilerB = bottoms liquid product flow rate

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    15/18

    15

    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.

    0 20 40 60 80 1007999

    7999.5

    8000

    8000.5

    8001

    Time (min)

    F(mol/min)

    0 20 40 60 80 100-1

    -0.5

    0

    0.5

    1

    1.5

    Time (min)

    Z(molfrac)

    0 20 40 60 80 1000

    0.5

    1

    1.5

    2

    Time (min)

    q(molratio)

    0 20 40 60 80 1003620

    3640

    3660

    3680

    3700

    3720

    3740

    Time (min)

    D

    (mol/min)

    0 20 40 60 80 1004260

    4280

    4300

    4320

    4340

    4360

    4380

    Time (min)

    B

    (mol/min)

    0 20 40 60 80 1000.955

    0.96

    0.965

    0.97

    0.975

    0.98IAE = 0.92963 I SE = 0.011913

    Time (min)

    XD

    (molfrac)

    0 20 40 60 80 1000.01

    0.011

    0.012

    0.013

    0.014

    0.015

    0.016IAE = 0.37213 I SE = 0.0015946

    Time (min)

    XB(molfrac)

    0 20 40 60 80 1000.955

    0.96

    0.965

    0.97

    0.975

    0.98IAE = 0.92963 I SE = 0.011913

    Time (min)

    XD

    (molfrac)

    0 20 40 60 80 1000.01

    0.011

    0.012

    0.013

    0.014

    0.015

    0.016IAE = 0.37213 I SE = 0.0015946

    Time (min)

    XB(molfrac)

    0 20 40 60 80 1007486

    7486.5

    7487

    7487.5

    7488

    7488.5

    Time (min)

    R

    (mol/min)

    0 20 40 60 80 1001.11

    1.112

    1.114

    1.116

    1.118

    1.12

    1.122x 10

    4

    Time (min)

    V(mol/min)

    Figure 2. Sample plots of results for a 88 mol/min step in reboiled vapor.

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    16/18

    16

    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.

    function [MVXDt,MVXBt] = compcont(Kc,TI,TD,dT,MVXD,MVXDmin,MVXDmax,MVXB, ...MVXBmin,MVXBmax,XD,XB,XDSP,XBSP,COMPCONT_INIT,R,VB,D,B,F,Z,q);

    %%% ********************************************************************% File: COMPCONT.M% COPYRIGHT C BOUDREAU & MARLIN, 1997% VERSION: 2.0% DATE: NOVEMBER 1997%% ********************************************************************% Usage:% This function m-file is a subroutine which can be called% using the following statement.%

    % function [MVXDt,MVXBt] = compcont(Kc,TI,TD,dT,MVXD,MVXDmin,MVXDmax,MVXB, ...% MVXBmin,MVXBmax,XD,XB,XDSP,XBSP,COMPCONT_INIT,R,VB,D,B);%% Decription:% This function returns the values of the manipulated% variables used to control the distillate and bottoms% compositions.%%% ********************************************************************% Inputs:% These variables and parameters are available for use% in the controller calculation. The values are provided% from the menu entries and the plant measurements. These% values should NOT be changed as part of the controller% calculations.%

    % Kc(i),% TI(i),% TD(i) are the PID parameters for CVi (i=1,2).%% i=1 for XD and i=2 for XB%% dT is the execution period of the composition controllers.%% MVXD is the current value of the manipulated variable used to% control the distillate composition, i.e. the value implemented% at time t-dT (where "t" stands for present time)%% MVXB is the current value of the manipulated variable used to% control the bottoms composition, i.e. the value implemented% at time t-dT (where "t" stands for present time).%% MVXDmin and MVXDmax are the lower and upper bounds for the manipulated

    % variable used to control the distillate composition.%% MVXBmin and MVXBmax are the lower and upper bounds for the manipulated% variable used to control the bottoms composition.%% NOTE: These values are applied to the controller% outputs. The plant variables to which they% apply depends on the loop pairing decisions% entered via the menu.%% XD and XB are the current values of the distillate and% bottoms composition.

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    17/18

    17

    %% 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

    %% ------------------------------------

  • 8/9/2019 Distillation Dynamics and Control Workbook 2006

    18/18

    18

    % Comment ththe following line when programming% the composition controllers

    MVXDt = MVXD; MVXBt=MVXB;

    % ------------------------------------% ******************************************************************% *************** CONTROLLER CALCULATIONS GO HERE ****************

    % INITIALIZATION ----------------------------

    % END INITIALIZATION ------------------------

    % -------------------------------------------% UPDATE RECENT PAST VALUES AT EACH EXECUTION

    % END UPDATE OF PAST VALUES -----------------

    % CONTROLLER CALCULATIONS -------------------

    % END OF CONTROLLER CALCULATIONS% -------------------------------------

    % ********************** CONTROLLER CALCULATIONS END *******************% ************************************************************************

    return;