hysys rto refguide

Upload: mohanad-magdy-said

Post on 02-Jun-2018

250 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Hysys Rto Refguide

    1/154

  • 8/10/2019 Hysys Rto Refguide

    2/154

    Copyright Notice

    2002 Hyprotech Ltd. All rights reserved.

    Hyprotech Ltd is the owner of, and have vested in them, the copyright and all other intellectual propertyrights of a similar nature relating to their software, which includes, but is not limited to, their computerprograms, user manuals and all associated documentation, whether in printed or electronic form (theSoftware), which is supplied by us or our subsidiaries to our respective customers. No copying or

    reproduction of the Software shall be permitted without prior written consent of Hyprotech Ltd., Suite 800,707 - 8thAvenue SW, Calgary AB, T2P 1H5, Canada, save to the extent permitted by law.

    Hyprotech reserves the right to make changes to this document or its associated computer programwithout obligation to notify any person or organization. Companies, names, and data used in examplesherein are fictitious unless otherwise stated.

    Hyprotech does not make any representations regarding the use, or the results of use, of the Software, interms of correctness or otherwise. The entire risk as to the results and performance of the Software isassumed by the user.

    HYSYS, HYSYS.RTO, HYSYS Dynamics, HYSYS.Plant, HYSYS.Process, HYSYS.Refinery, HYSYS.Concept,HYSYS OTS Environment, HYSYS.RTO, Economix, HTFS TASC and MUSE, DISTIL, HX-NET, HYPROP III,and HYSIM are registered trademarks of Hyprotech Ltd.

    Microsoft Windows, Windows 95/98, Windows NT, Windows 2000, Visual Basic, and Excel are registeredtrademarks of the Microsoft Corporation.

    Documentation Credits

    Authors of the current release, listed in order of historical start on project (2002-1998):

    Colleen Kachmarski, BAC; Nana Nguyen, BSc; Conrad Gierer, BASc; Lisa Hugo, BSc, BA; Ian McKay, BSc.

    Since software is always a work in progress, any version, while representing a milestone, is nevertheless buta point in a continuum. Those individuals whose contributions created the foundation upon which this

    work is built have not been forgotten. The current authors would like to thank the previous contributors. Aspecial thanks is also extended by the authors to everyone who contributed through countless hours ofproof-reading and testing.

    Contacting Hyprotech

    Hyprotech can be conveniently accessed via the following:

    Web site: www.hyprotech.com

    Information and Sales: [email protected]

    Documentation: [email protected]

    Training: [email protected]

    Technical Support: [email protected]

    Detailed information on accessing Hyprotech Technical Support can be found in the Technical Supportsection of the Get Startedmanual.

    http://www.hyprotech.com/mailto:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]://www.hyprotech.com/
  • 8/10/2019 Hysys Rto Refguide

    3/154

    i

    Table of Contents

    1 Introducing HYSYS.RTO..............................................1-1

    1.1 Welcome to HYSYS.RTO.....................................................1-3

    2 Using HYSYS.RTO.......................................................2-1

    2.1 Role of the Sub-Flowsheet ...................................................2-3

    2.2 Optimization Objects.............................................................2-5

    2.3 Collection Utilities .................................................................2-6

    2.4 Optimizer Interface ...............................................................2-62.5 Data Reconciliation/Parameter Estimation Problem.............2-7

    2.6 Optimization Problem ...........................................................2-8

    2.7 Creating a Collection Utility...................................................2-9

    3 Optimizer .....................................................................3-1

    3.1 Optimizer Interface ...............................................................3-3

    4 Derivative Utility .........................................................4-1

    4.1 HYSYS.RTO Variables - Properties......................................4-3

    4.2 HYSYS.RTO Constraints - Properties ..................................4-9

    5 ESTIM DRU Overview..................................................5-1

    5.1 The Problem .........................................................................5-3

    5.2 The Solution..........................................................................5-3

    5.3 The Benefits..........................................................................5-4

    5.4 ESTIM DRU Facilities...........................................................5-5

    5.5 Using ESTIM DRU................................................................5-6

    5.6 Configuring a Fitting Problem .............................................5-10

    5.7 Estim Data Set Analysis .....................................................5-19

    5.8 Optimization Objects...........................................................5-20

    5.9 General Notes.....................................................................5-25

    5.10 ESTIM DRU Diagnostic File Output....................................5-26

  • 8/10/2019 Hysys Rto Refguide

    4/154

    ii

    6 Data Reconciliation Utility..........................................6-1

    6.1 Heat Exchanger Network Data Reconciliation......................6-3

    7 Derivative Utility & Optimizer.....................................7-1

    7.1 The Derivative Utility.............................................................7-3

    7.2 Optimizer ............................................................................7-12

    A HYSYS.RTO+ Example ................................................A-1

    A.1 Data Reconciliation Example............................................... A-3

    A.2 Install Data Reconciliation Utility.......................................... A-5

    Index.............................................................................I-1

  • 8/10/2019 Hysys Rto Refguide

    5/154

    Introducing HYSYS.RTO 1-1

    1-1

    1 Introducing HYSYS.RTO

    1.1 Welcome to HYSYS.RTO .................................................................3

  • 8/10/2019 Hysys Rto Refguide

    6/154

    1-2

    1-2

  • 8/10/2019 Hysys Rto Refguide

    7/154

    Introducing HYSYS.RTO 1-3

    1-3

    1.1 Welcome to HYSYS.RTOHYSYS.RTO is a real-time on-line optimization software package that

    combines the following two proven technologies:

    Rigorous first principal models and thermodynamic methods (fromHYSYS).

    Optimization and data reconciliation routines (from RTO).

    Optimization within HYSYS is based on a simultaneous modular

    approach. A flowsheet model is developed as a collection of Sub-

    flowsheets (SFS or the modular blocks) are connected through streams.

    Within each SFS are a collection of unit operations and streams that are

    appropriate to be solved together. During the course of the optimizationrun, each Sub-flowsheet is solved using one of the standard HYSYS

    solvers (non-sequential modular or one of the available column

    solvers).

    When the model is being posed to the optimizer, each product stream

    from one SFS that serves as a feed stream to another SFS is "torn". The

    act of tearing the stream creates a collection of connection equations

    which the optimizer solves as part of its calculations. In the case of

    nested Sub-flowsheets, the tearing occurs at the terminal locations (i.e.,

    between the stream which is calculated as the product of one unit

    operation, and the stream which feeds the next unit operation). There

    are no intermediate tears constructed.

    Recycle locations in the flowsheet should be defined at the transition

    across a Sub-flowsheet boundary. This additional transfer basis allows

    the flowsheet to be initialized correctly, and then have the recycle

    replaced by connection equations when the model is posed to the

    optimizer.

    Within each of the Sub-flowsheets are a number of decision variables,

    true process constraints and objective function variables. These are

    individually selected and configured by the user and are automatically

    associated with the corresponding block when the problem is posed tothe optimizer.

  • 8/10/2019 Hysys Rto Refguide

    8/154

    1-4 Welcome to HYSYS.RTO

    1-4

    Upon configuration of the flowsheet, Derivative Utilities can be attached

    to the various Sub-flowsheet operations. These utilities allow the tearing

    of the appropriate streams to be invoked, and the various optimization

    objects (decision variables, constraints, objective function variables)

    collected into lists which are then provided to the optimizer.

    When the optimizer is invoked, it accesses these lists from each of the

    utilities to construct its solution matrix. During the course of its

    solution, the optimizer configures the necessary information from each

    of the objects to determine aspects such as step size, derivative

    evaluations etc.

    In the simultaneous modular approach, the blocks are treated as a

    matrix of variables (decision and tear) and constraints (true process

    constraints and connection equations). The derivatives that theoptimizer then sees from any block are of the entire constraints vector

    with respect to each individual variable within the block. If the block

    contains variables which are part of the objective function, the gradient

    is also determined for each of the variables.

    During the optimization, values are returned to the flowsheet through

    the utilities to be evaluated by the models, with the calculated results

    (tear equation residuals, process constraint values, objective function,

    etc.) returned to the optimizer. The interaction between the optimizer

    and the flowsheet continues until the defined solution criteria is met.

  • 8/10/2019 Hysys Rto Refguide

    9/154

    Using HYSYS.RTO 2-1

    2-1

    2 Using HYSYS.RTO

    2.1 Role of the Sub-Flowsheet..............................................................3

    2.1.1 Simultaneous Modular Optimization.........................................4

    2.1.2 Implementation in HYSYS.RTO ...............................................4

    2.1.3 Overview ..................................................................................4

    2.2 Optimization Objects .......................................................................5

    2.3 Collection Utilities............................................................................6

    2.4 Optimizer Interface ..........................................................................6

    2.5 Data Reconciliation/Parameter Estimation Problem ....................7

    2.5.1 General Procedure...................................................................7

    2.6 Optimization Problem......................................................................8

    2.6.1 General Procedure...................................................................8

    2.6.2 Flowsheet Tearing ....................................................................8

    2.7 Creating a Collection Utility............................................................9

    2.7.1 Derivative Utility......................................................................11

    2.7.2 Optimization Objects ..............................................................14

    2.7.3 Optimization Object Installation..............................................15

  • 8/10/2019 Hysys Rto Refguide

    10/154

    2-2

    2-2

  • 8/10/2019 Hysys Rto Refguide

    11/154

    Using HYSYS.RTO 2-3

    2-3

    2.1 Role of the Sub-FlowsheetIn the standard HYSYS modeling environment, the sub-flowsheet lets

    you provide a logical grouping of operations to facilitate understanding

    of the process behaviour. In addition, it provides the mechanism to

    encapsulate a solver (i.e., the Column sub-flowsheet) or to use different

    fluid packages (thermodynamics, component slates, etc.) within a

    simulation.

    For optimization, the sub-flowsheet provides the same benefits plus a

    number of additional capabilities for the simultaneous modular

    approach. Foremost, it provides a location where the standard

    propagation of information can be broken. Once a model is torn foroptimization, information does not propagate from one sub-flowsheet

    to another. This limits calculations to only those needed at a point in

    time.

    Similarly, by selecting the structure of the Sub-flowsheets appropriately,

    unnecessary equations are never posed to the optimizer. In addition, if

    derivatives are being generated numerically, the potential for noise in

    the generated derivatives is minimized by constructing suitably sized

    Sub-flowsheets.

    For operations that deliver analytical derivatives, these must be

    encapsulated within a single sub-flowsheet. For example, HYSYS

    columns being solved by the Newton solver are able to deliver the

    Jacobian matrix to the optimizer directly. Extension unit operations that

    deliver analytical derivatives are handled in the same manner.

  • 8/10/2019 Hysys Rto Refguide

    12/154

    2-4 Role of the Sub-Flowsheet

    2-4

    2.1.1 Simultaneous Modular OptimizationSimultaneous Modular Optimization (SMO) is a hybrid between

    Sequential Modular and Open Equation forms of optimization. It uses

    modular solvers to solve the unit operations themselves, and the

    Optimizer solver to solve both the Optimization and connection

    equation problems.

    2.1.2 Implementation in HYSYS.RTO

    In HYSYS.RTO, the SMO is facilitated by the development ofOptimization Objects (which provide a generic interface to flowsheet

    variables), configuration utilities (Data Reconciliation and Derivative)

    and flowsheet tearing. The act of tearing the flowsheet blocks the

    propagation of information across the torn location, creating a set of

    connections equations which are exposed to the Optimizer for solution

    as part of the optimization problem.

    2.1.3 OverviewFor the HYSYS user, the key pieces to configuring an optimization or

    data reconciliation problem are:

    Optimization Objects A generic set of objects used to identify theunderlying flowsheet variable and provide the necessaryconfiguration information for use by Optim or Estim.

    Collection Utilities Utilities used to identify the "pieces" of theflowsheet which are to be exposed to Optim or Estim.

    Optimand Estimparameters Tolerances and flags.

    The mechanics for creating either a Data Reconciliation or Optimization

    problem are essentially identical. The only differences are as follows:

    Optimization object types being used

    Optim or Estim properties

    Tolerances and flags being configured

    Specific procedures to the type of problem being solved

  • 8/10/2019 Hysys Rto Refguide

    13/154

    Using HYSYS.RTO 2-5

    2-5

    2.2 Optimization ObjectsOptimization objects are the mechanism of identifying the flowsheet

    variables which are to be considered as part of the problem. The

    optimization and data reconciliation routines have the ability to set and

    retrieve flowsheet values as well as the necessary configuration

    parameters through the optimization object. While there are a number

    of different optimization object types, they all serve the same basic

    function.

    The primary differences between the optimization objects are the

    properties they contain, and how Optimor Estimtreats them. For

    flowsheet optimization, there are: Optimization Variable Decision variables for the optimization that

    must be specified (blue) variables.

    Constraints True process constraints, bounded variables that areinstantiated by the user. These must be calculated (black) variables.

    Objective Function Variables A variable that is part of the overallobjective function. Each variable has its own defining equation, theresults of which are combined into a single flowsheet objectivefunction. These must be calculated (black) variables.

    For Data Reconciliation and Parameter Estimation, there are:

    DCS Tags Variables for which you have a set of measurements,which are used to calculate offsets in the measurements and updatefitting parameters. These can be either specified or calculatedvariables.

    Fitting Parameters Variables whose value is to be directlyadjusted to match the supplied data. These must be specified (blue)variables.

    There is a third type of Optimization Object used for Data Reconciliation

    called a DRU Stream (Data Reconciliation Utility Stream). This is

    essentially a data holder, i.e., it allows for multiple sets of stream data,

    each corresponding to a different data set, to be supplied by you. These

    values are taken as supplied, no offsetting is calculated for these

    streams.

  • 8/10/2019 Hysys Rto Refguide

    14/154

    2-6 Collection Utilities

    2-6

    2.3 Collection Utilities

    Derivative and Data Reconciliation UtilityThere are two utilities used by HYSYS.RTO to provide the primary

    interface between the flowsheet model and the solver:

    Data Reconciliation Utility

    Derivative Utility.

    Their primary purpose is to collect appropriate optimization objects

    which are then exposed to the solvers.

    These utilities are first "attached" with unit operation(s) within the

    flowsheet model. Then, based on the types of optimization objects that

    utility type is interested in, it collects those objects of the correct types

    which are attached to variables that are related to the targeted unit

    operations and their corresponding streams.

    It is the corresponding lists of "variables" and "constraints" that are

    exposed to Optim.

    2.4 Optimizer InterfaceThe Optimizerinterface in HYSYS provides the collection points for the

    utilities within the flowsheet. Depending on the mode, the Optimizer

    invokes either Estim(Data Reconciliation and Parameter Fitting) or

    Optim(Optimization) and provides the necessary interfaces back into

    the process model.

  • 8/10/2019 Hysys Rto Refguide

    15/154

    Using HYSYS.RTO 2-7

    2-7

    2.5 Data Reconciliation/ParameterEstimation Problem

    2.5.1 General Procedure1. Build the flowsheet.

    2. Install aData Reconciliationutility.

    3. Select the unit operations from the flowsheet that are associatedwith the variables to be fit, or for which you have measured the data.The streams that are attached to the unit operations areautomatically obtained at the same time.

    4. Install Fitting Parametersfrom the Utilityand attach them to theappropriate flowsheet variables to be fit.

    5. Supply appropriate values for the Fitting Parameters.

    6. Install DCS Tags and attach them to flowsheet variables for whichyou have measured data.

    7. Supply required values for the Tags.

    8. Supply the measured data.

    9. If necessary, turn on the multiple data set option for attachedstreams, and supply corresponding data.

    10. Set the appropriate Estimproperties and tolerances and flags.

    11. Invoke the HYSYS Optimizer F5and turn on DataReconciliationmode.

    12. Identify the utility containing the unit operations and streams beingreconciled.

    13. Start the data reconciliation.

  • 8/10/2019 Hysys Rto Refguide

    16/154

    2-8 Optimization Problem

    2-8

    2.6 Optimization Problem

    2.6.1 General Procedure1. Build the flowsheet.

    2. Install a Derivativeutility.

    3. SelectFlowsheet Wide for the Unit Operation.

    4. InstallOptimizationVariablesfrom the utility and attach them to theappropriate flowsheet variables.

    5. Supply appropriate values for the Optimization Variables.6. Install Constraintsand attach them to appropriate flowsheet

    variables.

    7. Supply required values for the Constraints.

    8. Install the objective function object(s) and attach them toappropriate flowsheet variables.

    9. Configure the appropriate prices for the objective function objects.

    10. Invoke the Optimizer F5and select Optimization.

    11. Change appropriate Optimproperties and tolerances and flags.

    12. Start the Optimization.

    2.6.2 Flowsheet TearingThere is an additional feature available for optimization which involves

    Flowsheet Tearing. With this approach, specific streams in the flowsheet

    are "torn" and appropriate connection equations written. These

    additional variables and constraints are passed to the Optimizerto be

    solved as part of the optimization problem. Typically, this approach

    requires multiple derivative utilities to be constructed.

  • 8/10/2019 Hysys Rto Refguide

    17/154

    Using HYSYS.RTO 2-9

    2-9

    2.7 Creating a Collection UtilityUtilities are created from the FlowSheet Tools Menu Bar, or by using the

    CTRLUhot key combination. This produces a view containing the

    available and installed utilities in the flowsheet. Select Derivative Utility

    (as shown in Figure 2.1) orData Recon Utility, and click theAdd Utility

    button. This displays the corresponding Utility property view.

    Utility Property ViewBoth the Data Reconciliation and Derivative Utilityproperty viewscontain a number of tabs, that are organized around the optimization

    object types (variables, constraints, fitting parameters, DCS Tags, etc.).

    Both utilities contain a similar section at the top of the view that

    provides access, on every tab, to the features for unit operation

    attachment and optimization object creation for the problem. While

    optimization objects can be created from the flowsheet prior to

    installing a utility, it is recommended that this be done from this

    location. Once unit operations are selected, optimization objects that

    are created, are tested as to whether they are associated with the

    attached operations and streams.

    Figure 2.1

  • 8/10/2019 Hysys Rto Refguide

    18/154

    2-10 Creating a Collection Utility

    2-10

    Immediate feedback is provided when the objects are created and added

    directly to the lists contained within the utility, and are displayed

    directly on the property view. Information can either be supplied as

    objects are added, or at any time prior to running the solver.

    The tabs of the Derivative Utility are defined as follows:

    Figure 2.2

    Tab Description

    Structural Non-Zeroes

    Assign variable/constraint associations such that a Jacobianelement is always assigned to the pair regardless of theJacobian Tolerance.

    IndependentVariables

    Access the collection of variables (optimization Variables,Connection Equation Variables, and Solution Variables)associated with the utility

    Constraints/Objective Function

    Access the collection of dependent variables (Constraints,Technical Constraints, Solution Constraints and ObjectiveFunction variables) associated with the utility.

    Derivative Analysis Access the numerical perturbation mechanism to allowexamination of the sparsity pattern and Jacobian values,gradient and model noise which will be generated by thegradient calculations of the solution.

  • 8/10/2019 Hysys Rto Refguide

    19/154

    Using HYSYS.RTO 2-11

    2-11

    2.7.1 Derivative Utility

    Configuration GroupAt the top of the Derivative Utility property view is the Derivative Utility

    Configuration group, which is displayed on every tab. This provides

    access to the following options:

    Figure 2.3

    Field Description

    Unit Operation Selection Select the unit operation(s) for the given utility.

    Add Add variables, constraints and objective function objects.

    Master/Run Time Toggle Switch between Master and Run Time lists for displaypurposes. The Master List is all variables or constraintsthat are attached to utility. During the set up phase of anoptimization problem, each variable and constraint isevaluated for its current parameter settings. Those whichdo not qualify for the current problem (i.e., the OptimizeFlag is false) are not included in the list of variables andconstraints exposed to the Optimizer, which is the Run

    Time list. This button lets you switch between lists (evenwhen the problem is running).

  • 8/10/2019 Hysys Rto Refguide

    20/154

    2-12 Creating a Collection Utility

    2-12

    Unit Operation Selection

    There are three modes for the derivative utility and they are as follows:

    It is best to select the desired unit operation prior to installing any of the

    remaining optimization objects. Part of the procedure for attaching the

    unit operation to the utility is to obtain all existing optimization objects

    (of the appropriate type) from the simulation case.

    For example, if the Specific Unit Operradio button is selected, the view

    displays as shown in the figure below.

    Select the target unit operations from the Objectcolumn of the view.Note that Sub-flowsheets (i.e., Columns), are to be selected as an Object,

    not as a Flowsheet. When a Unit Operation is selected, the utility

    displays all optimization objects currently installed in the simulation

    case which are associated (attached to) the unit operation(s) and their

    associated streams.

    Mode Selection

    FlowsheetWide

    Use when minimal flowsheet tearing is being employed, and nospecial derivative and solution mechanisms (such as extensionoperations) are being used. In this mode, a single derivative utility isused for the entire flowsheet.

    Specific UnitOperation

    Typically this is a sub-flowsheet, which is torn on both the feeds andproducts. The sub-flowsheet typically contains several unitoperations which are solved either using the HYSYS standardsolver, or one of the column solvers.

    ExtensionOperation

    Used when the sub-flowsheet contains an extension operationwhich is solved using the available OLE functions to allow the solverto solve the model equations as part of the optimization problem

    Figure 2.4

  • 8/10/2019 Hysys Rto Refguide

    21/154

    Using HYSYS.RTO 2-13

    2-13

    Object and Property Filters

    In Optim, there are only variables and constraints. However, to assistwith the interpretation of the optimization problem, these lists are

    divided according to the source of the attached variable. On the

    corresponding tabs of the utility, there are radio buttons which filter the

    objects into these types.

    For theVariablestab, the Independent Propertiescan be selected by

    using the following radio buttons:

    Figure 2.5

    Variable Description

    Optimization Variable True decision variables

    Tear Variables Variables created by the tearing of a flowsheet stream

    Solution Variables Variables created to support an extension operation whichis to be solved as par t of the optimization problem

  • 8/10/2019 Hysys Rto Refguide

    22/154

    2-14 Creating a Collection Utility

    2-14

    Further filtering is provided to indicate which of the given object

    properties are as follows:

    All of the appropriate optimization object types are displayed on the tab

    in a worksheet format. In addition to the properties, the view displays

    the flowsheet object and variable that each optimization object is

    associated with. Values that can be specified are indicated in blue, whilecalculated variables are displayed in black.

    Unit conversion is provided for each of the appropriate object property

    combinations.

    2.7.2 Optimization ObjectsThe Optimizationobject types which are used for optimization

    problems are as follows:

    Radio Button Description

    Input Required user input.

    Output Values output from Optim.

    Results Values resulting from the optimization problem.

    All Access to all properties. There are a number of internal properties(i.e., Sparse Column), contained inside of the optimization object,but are used as internal values for the solution.

    Type Description

    OptimizationVariable

    Decision variables for the optimization that must be specified(blue) variables.

    Constraints True process constraints, bounded variables and areinstantiated by the user. These must be calculated (black)variables.

    Objective FunctionVariables

    A variable which is part of the overall objective function. Eachvariable has its own defining equation, the results of which arecombined into a single flowsheet objective function. Thesemust be calculated (black) variables.

  • 8/10/2019 Hysys Rto Refguide

    23/154

    Using HYSYS.RTO 2-15

    2-15

    2.7.3 Optimization Object InstallationOptimization objects appropriate for the utility (in the case of the

    Derivativeutility - Optimization Variables, Constraintsand Objective

    Functionvariables) can be added directly from the view. Use the drop-

    down list in the upper right corner of the Derivative Utility

    Configurationgroup, to select one of the three options. By selecting the

    appropriate option and clicking theAddbutton, the corresponding

    selection view is displayed:

    By making the selection as shown (Flowsheet, Object, Variable and

    Variable Specifics), the Optimization Variable is created and added to

    the utilities collection.

    Figure 2.6

  • 8/10/2019 Hysys Rto Refguide

    24/154

    2-16 Creating a Collection Utility

    2-16

    By default, the new object is given the next available name. However,

    you can edit the name of the object directly from the utility view by

    highlighting the name in the Object Name column and typing a new

    string, as shown below

    Constraints and Objective Function Objects are added in a similar

    manner. When an object of a given type is added, the utility

    automatically switches to the appropriate tab and filter type.

    Specified Versus Calculated ValuesWhen you install a variable or constraint, you must examine the status

    of the Current Value property. Variables must display a status of Blue

    (specifiable), while Constraints must display a status of Black(calculated).

    Figure 2.7

  • 8/10/2019 Hysys Rto Refguide

    25/154

    Using HYSYS.RTO 2-17

    2-17

    Units and Delta Properties

    All communication with Optim for property values is conducted inHYSYS internal units. However, you can input your values in any

    necessary unit set, the conversion is handled internally. There are

    certain properties (typically span or range type properties) which are

    handled differently based on the variable type they are attached to (i.e.,

    pressure and temperature). When you input a value for these types of

    property/variable combinations, the input is converted automatically to

    Delta; i.e., a Range for a temperature variable of 1 C displays as 1.8 F if

    the unit set is changed.

    The only location where the chosen Units set influences the problem is

    with respect to the Objective Function object. The default formula for anObjective Function object is variable value X price. The calculations

    performed for determining the individual contribution of that object to

    the overall objective function are done in display units. For example, if

    the objective function object is attached to a LiquidVolumeFlow

    variable, and the current display units are in Barrels/Day, then the actual

    display value (1000 bbl/day) is used in determining the contribution to

    the objective function. You can create a new unit set (Tools/Preferences)

    for this purpose.

    If you store a case and then reload it from disk, you should ensure

    that the correct units set is being used prior to running theoptimization problem.

  • 8/10/2019 Hysys Rto Refguide

    26/154

    2-18 Creating a Collection Utility

    2-18

    Derivative Analysis

    The Derivative Analysistab of the utility property view provides accessto the Jacobian and Gradient calculation mechanism used during the

    solution. Examine different perturbation sizes and single and two sided

    gradient calculations to see their impact on the calculated Jacobian and

    gradient for the variables.

    Filtering is provided to allow examination of subsets of the overall

    variable and constraint lists. In addition, examine the model noise to

    determine if tighter solution tolerances on the individual unit

    operations (i.e., Columns) are necessary. Typically, a tighter solution

    tolerance requires more individual calculations at any phase, but

    improves the quality of the Jacobian being returned to Optim andreduces the time of the overall problem solution.

    When the calculations are complete, examine both the individual

    Jacobian elements, or the Gradient, as well as the noise of the model.

    While the default solution tolerances for unit operations is valid for

    modelling purposes, experience shows that a tighter tolerance is more

    appropriate for Jacobian evaluations (where small changes are being

    Figure 2.8

  • 8/10/2019 Hysys Rto Refguide

    27/154

  • 8/10/2019 Hysys Rto Refguide

    28/154

    2-20 Creating a Collection Utility

    2-20

    sensical response, without impacting the conditioning of the

    optimization problem (i.e., a desired very small range to work with on

    the variable itself).

  • 8/10/2019 Hysys Rto Refguide

    29/154

    Optimizer 3-1

    3-1

    3 Optimizer

    3.1 Optimizer Interface ..........................................................................3

    3.1.1 Calculations............................................................................23

    3.1.2 Results ...................................................................................23

  • 8/10/2019 Hysys Rto Refguide

    30/154

    3-2

    3-2

  • 8/10/2019 Hysys Rto Refguide

    31/154

    Optimizer 3-3

    3-3

    3.1 Optimizer InterfaceWhile the derivative utilities are used for collecting and configuring the

    individual optimization objects for the problem, the Optimizer collects

    all of the utilities and exposes the combined list of variables and

    constraints to Optim. In addition, this is where you set the tolerances,

    flags and settings for the Optimization problem in its entirety. The

    Optimizer is accessed by pressing the F5key.

    The radio button selection provided along the bottom of the view

    provides access to the available options:

    Default the existing HYSYS Optimizer

    Optimization access to Optimization (Optim)

    Data Recon access to Data Reconciliation (Estim)

    Model used specifically for Real Time applications

    Figure 3.1

  • 8/10/2019 Hysys Rto Refguide

    32/154

    3-4 Optimizer Interface

    3-4

    Depending on the radio button selected, additional tabs are displayed

    on the view. A number of tabs (Testing, Properties, Transferand Object

    Transfer) relate solely to the Real Time interfaces and should not be

    used. All of the necessary configuration for the Optimization Problem

    can be accessed through the Optim Configurationtab.

    There are three pieces of the Configuration:

    SetUp Identifying the optimization algorithm to be used, type ofperturbations, level of diagnostics, etc.

    Tolerances Access to the various solution tolerances and Optimparameters.

    Flags Access to the various Optim configuration options which areBooleans.

    Optim Configuration Set Up Inputs (Set Up Radio Button)These inputs consist of the following Optimizer properties:

    Algorithm

    The algorithm used by the Optimizer, is one of the following:

    SS_LP single-shot linear programming algorithm.

    MDC_SLP sequential linear programming algorithm.

    MDC_SQP two-phase sequential quadratic programmingalgorithm with large-scale sparse matrix handling features.

    NAG_SQP single-phase sequential quadratic programmingalgorithm.

    Suggested Default: MDC_SQP

  • 8/10/2019 Hysys Rto Refguide

    33/154

    Optimizer 3-5

    3-5

    LP Options

    Used to select the options to be used with the SS_LP algorithm. Selectone of the following:

    None No option.

    Initialize A single run of the linear programming algorithm isconducted, and the Objective Valueproperty of the Optimizer isreset to 0.0.

    Intercepts The Optimizer Fix Variable Spansflag is switched onprior to carrying out the SS_LP optimization.

    Gradients The Optimizer constraint and objective functiongradients are re-evaluated prior to carrying out the SS_LPoptimization. Otherwise, the gradients used during the SS_LPoptimization are those found at the previous point.

    Gradient Calculations

    This option specifies if one-sided or two-sided gradient calculations are

    used:

    1-sided Causes forward differences to be used when constructinggradient approximations.

    2-sided Causes central differences to be used. This optionrequires twice as many function evaluations at a given solution, butmay provide a more accurate estimate of the constraint andobjective gradients, particularly for highly non-linear problems, orproblems featuring large amounts of noise.

    In both cases, the perturbation size used for the Optimizer internal

    variables is given by the Optimizer Perturbation property.

    Suggested Default:1-sided

    The SS_LP algorithm is not included in the current version.

  • 8/10/2019 Hysys Rto Refguide

    34/154

    3-6 Optimizer Interface

    3-6

    Diagnostic Print Level

    Select one of the following options: None No Optimizer diagnostic file is produced.

    Partial_1, Partial_2, or Partial_3 Increasing levels of Optimizeroutput in the diagnostic file.

    Full The maximum amount of useful information in the Optimizerdiagnostic file.

    Excessive Only used for debugging the Optimizer.

    Suggested Default:Partial_2

    Max. Iterations

    This parameter fulfils the following two roles:

    When Algorithmis set to MDC_SQP / MDC_SLP, this parametergives the maximum number of Optimizer iterations allowed toimprove an already feasible solution.

    When Algorithmis set to NAG_SQP, this parameter gives themaximum number of major iterations. A major iteration in this caseconsists of a sequence of minor iterations which minimize a linearlyconstrained subproblem.

    Suggested Default:50

    Max. Feasible Point

    This parameter also fulfils two roles:

    When Algorithmis set to MDC_SQP / MDC_SLP, this parametergives the maximum number of Optimizer iterations allowed to findthe first feasible solution.

    When Algorithmis set to NAG_SQP, this parameter gives themaximum number of minor iterations. A minor iteration in this caserepresents a sequence of local improvements to the linearizedproblem within a major iteration.

    Suggested Default:20

  • 8/10/2019 Hysys Rto Refguide

    35/154

    Optimizer 3-7

    3-7

    Max. Constraint Relaxations

    This parameter relates to the Relax Violated Constraintsflag. This flag isused to drive the Optimizer constraint bounds to their extreme values

    allowed by the Optimizer tolerances. This is done to help the feasible

    point search part of the MDC_SQP algorithm find the first feasible

    solution. TheMax. Constraint Relaxationsparameter gives a limit for the

    number of times this can occur.

    Suggested Default: 0

    Max. Hessian Resets

    The MDC_SQP algorithm operates using an approximation to the

    matrix of second derivatives of the objective function. On some

    problems, it is necessary to reset this approximation to the diagonal

    matrix arising from the FPS Hessian Diagonal parameter (during the

    FPS search) or to the diagonal matrix arising from the OPT Hessian

    Diagonal parameter (during the OPT search). The Max. Hessian Resets

    parameter gives a limit on the number of times this can be done.

    This is useful if the algorithm suffers from step convergence meaning it

    is not used when the algorithm converges according to other criteria.

    Suggested Default:0

    Verify

    In the NAG_SQP algorithm, you can carry out numerical checking on

    gradient elements. Setting Verify to -1 switches off this checking. The

    extent of the numerical checking conducted by the NAG_SQP algorithm

    depends on the setting for Verify. Refer to the following table:

    Suggested Default:-1

    Value Description

    0 Results in a check on the gradients at the first feasible point.

    1 Results in a check of the Optimizer objective gradients

    2 Results in a check on the Optimizer constraint gradients

    3 Checks both types of gradient. The checking takes place at the start of theoptimization.

  • 8/10/2019 Hysys Rto Refguide

    36/154

    3-8 Optimizer Interface

    3-8

    DV_Level

    Used to specify which gradients should be estimated by the NAG_SQPalgorithm. Refer to the following table:

    This parameter is only to be used for debugging the Optimizer.

    Suggested Default:3

    Objective Value

    This displays the current plant model objective function value as

    calculated by the Optimizer.

    Termination Reason

    An output from the optimization run, which is one of the following:

    OK Used by the FPS to indicate a feasible termination of thisphase.

    Impossible This output signifies either a non-implementedOptimizer algorithm is selected, or the algorithms could not find asolution to the linearized problem. In this case, the problemconstraint/variable bounds and feasibility tolerance parametersshould be checked.

    No variables The number of variables in the problem is zero.

    Step convergence During the Optimizer OPT phase ofMDC_SQP, the stepping back procedure has resulted in a stepcollapse to below the Stepsolution tolerance.

    Cost convergence During the Optimizer OPT phase ofMDC_SQP, two successive objective function values have returneda difference in cost less than the Costsolution tolerance. Note thatonly feasible points are considered for this test.

    Flat A special case of cost convergence in which the objectivefunction gradient is zero. Usually indicates an incorrectly defined (orscaled) objective function.

    Value Description

    0 Both missing constraint gradients and missing objective gradients areestimated.

    1 Missing constraint gradients are estimated

    2 Missing objective gradients are estimated.

    3 No action is taken.

  • 8/10/2019 Hysys Rto Refguide

    37/154

    Optimizer 3-9

    3-9

    Gradient convergence Occurs when the gradient of theLagrangian function for the given optimization problem is less thanthe Gradientsolution tolerance.

    Globally infeasible This occurs when the feasible region cannotbe seen from the FPS starting point (i.e., even the linearization ofthe problem does not yield a feasible solution).

    The MDC_SQP Optimizer expands the variable local bounds (theMinimumand Maximumproperties of the variables) out to the globalbounds (the Global Minimumand Global Maximumproperties of thevariables) to attempt to solve the linearized problem with thesebounds. If this still yields no solution, the FPS phase conducts asequence of steps aimed at minimizing the constraint violations.

    An objective function is constructed which contains the sum of theconstraint violations, and this function is minimized, producing afeasible solution to the problem (if one exists).

    Infeasible In the FPS phase of the optimization, if a step collapse

    takes place while looking for a feasible point, then the problem isconsidered to be infeasible due to this. This is not the same asGlobally infeasible.

    Unbounded This occurs when the objective function isunbounded below (or is badly scaled), i.e., can be reduced withoutlimit. This usually indicates incorrectly set constraint and/or variablebounds.

    Time out (feasible) This report is generated by the OPT phase ofthe MDC_SQP Optimizer, when the number of Optimizer iterationsduring the OPT phase exceeds the Optimizer Max. Iterationsparameter.

    Time out (infeasible) This report is similar to the Time out(feasible) report, except occurs during the FPS phase, when thenumber of iterations exceeds the Max. Feasible Pointparameter.

    Not converged A report solely from the NAG_SQP algorithm.

    Not run Set during the Optimizer initialisation phase. This isreported in the Optimizer screen while the Optimizer is initializing.

    Stopped Occurs when the you stop the Optimizer using thecontrol box on the Optimizer screen (beside the spreadsheetbutton).

    Actual Optimizer

    This is output from the Optimizer. It gives the number of iterations the

    Optimizer has conducted after finding the first feasible solution, when

    the MDC_SQP/SLP algorithms are used. When the NAG_SQP algorithmis used, this returns the number of major iterations used.

  • 8/10/2019 Hysys Rto Refguide

    38/154

    3-10 Optimizer Interface

    3-10

    Feasible Point Iterations

    This is output from the Optimizer. It gives the number of iterations theOptimizer has conducted in order to find the first feasible solution,

    again when the MDC_SQP/SLP algorithms are used. When NAG_SQP is

    used, this returns the number of minor iterations from the last major

    iteration (in this case the usefulness of this parameter is limited).

    Solution Phase

    This is output from the Optimizer. It describes the current phase of the

    Optimizer search, which is one of:

    Initialize A report that the Optimizer is initializing the diagnosticsfile, and preparing to carry out the FPS search.

    Results Reported when the Optimizer is writing the final solutionto the diagnostics file and completing any post-optimizationcalculations.

    Setup The Optimizer variables and constraints are beinginspected and set-up internally by the Optimizer using the user-supplied data.

    FPS The beginning of the FPS phase of the Optimizer.

    FPS Deriv The Optimizer is calculating the gradients of theconstraints and objective function during the FPS phase. Thisoccurs every time the Optimizer adjusts the current solution toimprove the feasibility of the current point.

    FPS Visible The Optimizer has successfully solved the linearizedproblem during the FPS phase.

    FPS Invisible The linearized problem at the current solution in theFPS phase cannot be solved.

    FPS Shrink The Optimizer is stepping back during the FPSphase. This occurs when the projected point in the FPS is lessfeasible than the current point, and so the projected point isadjusted.

    Optim The Optimizer is preparing to enter the FPS phase.

    OPT Deriv The Optimizer is calculating the constraint andobjective function gradients during the OPT phase.

    OPT Search The Optimizer has successfully found a new,improved solution which remains feasible, and has moved the

    current solution to this point. OPT Shrink The Optimizer is stepping back in the OPT phase.

    This occurs if either the projected solution is infeasible, or theobjective function has increased.

  • 8/10/2019 Hysys Rto Refguide

    39/154

    Optimizer 3-11

    3-11

    Gradient Evaluations

    This reports the number of gradient (constraint and objective function)evaluations during the course of the optimization. At present, this gives

    the correct number only when theNumerical Gradientsflag is checked.

    Model Evaluations

    This reports the number of plant model evaluations during the course of

    the optimization. At present, this gives the correct number only when

    theNumerical Gradientsflag is checked.

    Code Version

    The current version of the Optimizer.

    Total CPU Time

    This reports the total time taken during both phases of the

    Optimization, in minutes and seconds.

    Start ObjectiveThis gives the plant model cost function value at the starting point,

    before carrying out any optimization.

  • 8/10/2019 Hysys Rto Refguide

    40/154

    3-12 Optimizer Interface

    3-12

    Optim Configuration Tolerance Inputs (Tolerance Radio

    Button)This section contains the tolerances to be used for generating

    approximations to the objective and constraint functions, controlling

    the path taken to Optimizer feasible/optimal solutions, and for

    determining whether an optimum point has been reached:

    Sigma

    This tolerance is not currently used.

    Linesearch Tolerance

    This is used by the NAG_SQP algorithm to control the accuracy of the

    linesearch phase.

    Suggested Default:0.8

    Function Precision

    Gives the precision to which functions are to be evaluated by the

    NAG_SQP algorithm. Used when constructing default Optimizer control

    parameters.

    Suggested Default:10-8

  • 8/10/2019 Hysys Rto Refguide

    41/154

    Optimizer 3-13

    3-13

    Optimality Tolerance

    Gives the accuracy with which the linearized problem is solved by theMDC_SQP algorithm. This parameter is a tolerance below which any

    changes to the cost function of the linearized problem are considered to

    have caused cost convergencewhen solving the linearized problem.

    Suggested Default:1.e-8

    Row Tolerance

    A tolerance used with the NAG_SQP algorithm which gives the feasibility

    tolerance within which linear constraints are to be satisfied. If a linear

    constraint violates a bound by a value not greater than the Row

    Tolerance(in absolute terms) the constraint is considered to be feasible

    by NAG_SQP.

    In the current version of the Optimizer all constraints are considered to

    be non-linear, and so this property is not used.

    Nonlinear Row Tolerance.

    As for Row Tolerance, except this applies to constraints defined as non-

    linear.

    Suggested Default:10-8

    Step

    The step convergence limit used in the MDC_SQP algorithm. If the

    algorithm at any point makes a step which is less than the Step

    tolerance, the algorithm is considered to have converged on step.

    Suggested Default:10-2

  • 8/10/2019 Hysys Rto Refguide

    42/154

    3-14 Optimizer Interface

    3-14

    Gradient

    The tolerance which is the maximum value of the Lagrangian functiongradient for which the MDC_SQP algorithm is considered to have

    converged on Lagrangian gradient. A value of 0.0 forces convergence of

    either the Stepor Costkind.

    Suggested Default:0.0

    Cost

    This is the maximum magnitude of change in scaled objective function

    between Optimizer steps for which the Optimizer is considered to have

    converged on cost.

    Suggested Default:10-4

    Zeta

    The tolerance which is used in conjunction with the constraint Scale

    properties to define the feasibility tolerance for constraints in the

    MDC_SQP algorithm. The feasibility tolerance for an individual

    constraint isZeta * Scale, for the given constraint. A value of 1.0 means

    that the feasibility of the individual constraints is controlled uniquelythrough the individual constraint Scaleproperty.

    Suggested Default: 1.0

    Bind

    A tolerance used with the NAG_SQP algorithm and in the solution of the

    linearized problem in the MDC_SQP algorithm. This tolerance gives a

    value which is the maximum absolute difference between a constraint

    and one of its bounds below which the constraint is considered to bebinding (active) in the linearized problem.

    In general, the solution of the linearized problem satisfies the constraint

    MinimumandMaximumproperty bounds, whereas the solution of the

    true non-linear problem satisfies the bounds (Minimum - Zeta * Scale,

  • 8/10/2019 Hysys Rto Refguide

    43/154

    Optimizer 3-15

    3-15

    Maximum + Zeta * Scale) for the given constraint. In this way, by

    enforcing tighter bounds in the linearization, there is a greater

    likelihood of the problem remaining feasible when the non-linearities

    are re-introduced.

    Suggested Default:10-8

    Perturbation

    The change in the scaled variables during gradient evaluation. An

    individual variable in the Optimizer is scaled according to the variable

    Minimumproperty, and the variable Spanproperty (or the Range

    property if the Optimizer Fix Variable Spansproperty is checked).

    In general, the Optimizer scales the problem variables vto produce a set

    of internal scaled variablesx, according to the formula.

    Where minis the variableMinimumproperty, and Sis the variable

    Rangeproperty if the Optimizer Fix Variable Spansflag property is

    checked (the variable Spanproperty otherwise). This allows equalmagnitude gradients to be produced for all internal variablesx,

    regardless of the magnitude of the external (model) variables v, by

    suitable choice of the variable Rangeproperties.

    The perturbation which is applied to the external variables vis therefore

    , where is the Optimizer Perturbationproperty.

    Suggested Default:10-3

    Max. Iteration StepCalculated by the Optimizer, this gives the current maximum step under

    consideration for projecting the current point to the new point. The size

    of this parameter is based on the current history of the optimization run.

    (3.1)xjvj mi n

    S-------------------=

    S

  • 8/10/2019 Hysys Rto Refguide

    44/154

    3-16 Optimizer Interface

    3-16

    Base Search Step

    The upper limit for Max. Iteration Step. When the Optimizer finds asequence of good linear approximations to the constraints and

    simultaneously improves the objective function, the Max. Iteration Step

    can be reset to the Base Search Step.

    Suggested Default:2.0

    Max. Allowed Move

    This parameter gives the maximum allowable change in a scaled

    (internal Optimizer) variable over the entire course of an optimization

    run. A value of 1.0 indicates a 100% change in the variable.

    Suggested Default:2.0

    FPS Hessian Diagonal

    These give the starting values of the diagonal elements of the

    approximated Hessian matrices before the FPS phase of the Optimizer,

    of the MDC SQP algorithm.

    Suggested Default:1.0

    OPT Hessian Diagonal

    These give the starting values of the diagonal elements of the

    approximated Hessian matrices before the FPS and OPT phases of the

    Optimizer respectively, of the MDC SQP algorithm.

    Suggested Default:0.1

  • 8/10/2019 Hysys Rto Refguide

    45/154

    Optimizer 3-17

    3-17

    Jacobian Elimination

    The value below which entries in the Jacobian matrix are deemed to bepure model noise, and are set to zero (or when the Optimizer Sparse

    Jacobianflag is checked, are excluded from the Jacobian sparsity pattern

    and hence never re-evaluated in future).

    Suggested Default:10-12

    Max. CPU Usage

    This parameter is not currently used.

    Objective Scale Factor

    This is used for scaling the objective function (and its gradient). The

    given function is divided by the Objective Scale Factor.

    Suggested Default:1.0

    Major Damping Parameter

    Used in the NAG_SQP algorithm to restrict the effects of major iterationvariable moves of the scaled variables and the Lagrange multipliers. A

    value of 2.0 restricts the variable move to 200%.

    Suggested Default:2.0

    Minor Damping Parameter

    Used in NAG_SQP to restrict the effects of minor iteration variable

    moves. As Major Damping Parameter.

    Suggested Default:2.0

  • 8/10/2019 Hysys Rto Refguide

    46/154

    3-18 Optimizer Interface

    3-18

    Penalty Parameter

    This is used solely in the NAG_SQP algorithm. It is used for forcingconvergence of the linearized constraints solved in each NAG_SQP

    minor iteration to their non-linear versions which are actually evaluated

    in the major iterations. The larger the Penalty Parameterthe slower the

    algorithm converges upon a feasible solution, however, this may be

    necessary for highly non-linear constraints.

    Suggested Default:1.0

    Scaling Type

    The scaling algorithm to be used by the NAG_SQP algorithm. When set

    to 0, no scaling is done. Otherwise the NAG_SQP algorithm attempts to

    scale the Jacobian matrix in order to make the matrix coefficients as

    close to 1 as possible. To scale the rows only, the parameter should be set

    to 1. To scale the rows and columns, the parameter should be set to 2.

    Suggested Default:0.0

    Flow Field / Gradient Evaluation

    Not used.

  • 8/10/2019 Hysys Rto Refguide

    47/154

    Optimizer 3-19

    3-19

    Optim Configuration Flag Inputs (Flag Radio Button)

    This section contains the Optimizer properties used for controlling thenature of the Optimizer search, for specify methods for handling the

    constraints, for initializing and terminating the Optimizer, and for

    specifying the nature of the gradient calculations.

    Omit Tech. Constraints

    Indicates whether the technical constraints (specifications) are to be

    omitted entirely from the constraint residuals when searching for a

    feasible point. Technical constraints are used to obtain a valid model

    solution, e.g. pressure drop or mass balance residuals. Processconstraints relate to the actual process being modelled, e.g. vessel

    pressure or unit throughput limits.

    Suggested Default:unchecked

    Relax Violated Constraints

    If the MDC_SQP algorithm cannot find a feasible point, one method of

    proceeding is to relax the constraints. This property is therefore a flag

    indicating whether all of the constraints (unchecked) or only those

    which are currently violated (checked) are to be relaxed, duringconstraint relaxation. The maximum number of relaxation steps is given

    by theMax. Constraint Relaxationsparameter.

    Relaxing the violated constraints within the context of the MDC_SQP

    algorithm means the constraint bounds in the linearized problem

    (usually set to the constraintMinimumandMaximumproperties) are

    expanded out to the bounds (Minimum - Zeta * Scale, Maximum + Zeta

    * Scale) for the given constraint.

    Thus, under normal circumstances the linearized problem is solved to a

    much higher tolerance level than the true non-linear problem (whichimproves the chances of the current solution remaining feasible upon

    introducing the non-linearities back into the problem). However, when

    the Optimizer relaxes the violated constraints, both problems are solved

    to the same tolerance (the capacity of the solution of the linearized

    problem to satisfy the non-linearities is therefore much reduced).

    Suggested Default:unchecked

  • 8/10/2019 Hysys Rto Refguide

    48/154

    3-20 Optimizer Interface

    3-20

    Recentre

    This is checked for testing purposes, in which case the Optimizer reflectsthe effects created by an on-line Optimizer. The Optimizer variable soft

    limits (theMinimumandMaximumproperties) are re-calculated so

    that at the start of optimization, the current value of the variable lies

    mid-way between the soft limits, while ensuring that the soft limits do

    not fall out of range of the global limits.

    Suggested Default:unchecked

    Restricted Step

    Used to indicate to MDC_SQP that theMax. Allowed Moveparameter is

    to be used to limit the overall change in the Optimizer variables brought

    about during optimization. When this flag is checked, the optimization

    algorithm reduces the upper bound of each optimization variable by the

    Max. Allowed Moveparameter, and increases the lower bound by the

    same amount.

    Suggested Default:unchecked

    Include Fixed Constraints

    If this is checked then Optimizer variables that have their Optimize Flag

    property checked are nevertheless included in the optimization. This

    acts on every variable, and its Optimizeflag property is checked.

    Otherwise, such variables remain with fixed values during the

    optimization.

    Suggested Default:unchecked

    NAG Calculated Gradients

    If this flag is checked when the NAG_SQP algorithm is being used, then

    the NAG_SQP algorithm itself carries out numerical calculation of any

    gradient elements needed.

    Suggested Default:unchecked

  • 8/10/2019 Hysys Rto Refguide

    49/154

    Optimizer 3-21

    3-21

    Fix Variable Spans

    This flag indicates whether the Span(i.e.Maximum - Minimum) of theOptimizer variables is to be calculated and stored, or taken directly from

    the stream Rangeproperty (which is user-specified for each variable).

    Suggested Default:unchecked

    Sparse Jacobian

    Checked when the user wants the Optimizer to calculate the Jacobian

    matrix of constraint gradients in sparse form (by storing only the

    nonzero elements, which usually indicates constraint-variable

    functional dependence). This is done once, at the start of the

    optimization, and establishes which Jacobian elements are stored for

    the rest of the optimization (the sparsity pattern).

    Suggested Default:unchecked

    Numerical Gradients

    Used to indicate to the Optimizer the origin of the gradient elements for

    the constraints and objective function.

    If the flag is checked, the Optimizer carries out numericalcalculation of the gradients by direct perturbation of variables usingthe method specified in the Gradient Calculationflag.

    If it is unchecked, the Optimizer obtains the gradient elements fromHYSYS.RTO using the same method. The main difference is that inthe latter case certain gradient elements may be computedanalytically, and are therefore potentially more accurate.

    Suggested Default:unchecked

    Include Scales

    Whether the constraint Scale properties are to be included when

    normalizing the Jacobian matrix of constraint gradients and calculating

    the bounds for the linearized subproblems in the MDC_SQP algorithm.

    Suggested Default:unchecked

  • 8/10/2019 Hysys Rto Refguide

    50/154

    3-22 Optimizer Interface

    3-22

    Adjust Scaling

    Not used.

    Pert_Reset

    Used at the start of optimization to indicate that the gradient calculation

    process removes noise elements (checked) or not (unchecked).

    When calculating the gradient functions by perturbing Optimizer

    variables, model noise is introduced into the gradient elements, which

    can mislead the Optimizer. When perturbing variable vj, if it does not

    affect constraint ci, the corresponding noise can be removed from the

    gradients by recalculating the constraint functions after removing the

    perturbation from the variable.

    This recalculation is done once for each variable, (i.e., for the first

    gradient calculation) and is used for establishing the sparsity pattern of

    the Jacobian matrix. The sparsity pattern is stored for use during the rest

    of the optimization, if the Sparse Jacobianproperty flag of the Optimizer

    is checked.

    The advantages of this method are as follows:

    Removes noise terms which can mislead the Optimizer.

    Does not need theJacobian Eliminationtolerance parameter, whichmay be difficult to set.

    Is required once only (the efficient sparse storage of the Jacobianeliminates this kind of noise from all future Optimizer steps).

    The disadvantages are as follows:

    For certain models it may take much more CPU time to carry out theextra plant model evaluations, compared with the use of theJacobian Eliminationtolerance method.

    The presence of structural zeros in the Jacobian matrix are ignored.A structural zero is a forced presence of a Jacobian element, which,during first pass evaluation of the Jacobian, is zero and thereforecould be excluded from the sparsity pattern.

    This flag should be checked along with the Sparse Jacobianflag, since it

    takes advantage of the removal of model noise in terms of future

    computation of gradients and their storage. However, it is still possible

    to use this method with a dense Jacobian matrix (where all zero

    elements are retained during optimization).

  • 8/10/2019 Hysys Rto Refguide

    51/154

    Optimizer 3-23

    3-23

    Suggested Default:unchecked

    If empty or invalid values are entered, the Optimizer uses a set of in-

    built default values.

    3.1.1 CalculationsThe Optimizer controls the running of the continuous optimization

    algorithms. A description of the techniques used is given in the

    Continuous Optimizer Overview.

    3.1.2 ResultsThe results produced at the end of the optimization run are as follows:

    A price for the current model data

    Values of the Optimizer constraints and variables

    Shadow prices for the constraints and variables, if they exist

    A termination reason

    A feasibility flag for the model data at termination of the Optimizer

    Iterations taken

    CPU time taken

  • 8/10/2019 Hysys Rto Refguide

    52/154

    3-24 Optimizer Interface

    3-24

  • 8/10/2019 Hysys Rto Refguide

    53/154

    Derivative Utility 4-1

    4-1

    4 Derivative Utility

    4.1 HYSYS.RTO Variables - Properties.................................................3

    4.1.1 Inputs: Object Object Name - Range .......................................4

    4.1.2 Inputs: Global Minimum - Price ................................................6

    4.1.3 Inputs: Sparse Column - Jac Num ...........................................7

    4.1.4 Calculations..............................................................................8

    4.2 HYSYS.RTO Constraints - Properties ............................................9

    4.2.1 Inputs: Object Name - Maximum............................................10

    4.2.2 Inputs: Scale - Sparse Row....................................................11

    4.2.3 Inputs: Current Bias1...........................................................13

    4.2.4 Calculations............................................................................14

  • 8/10/2019 Hysys Rto Refguide

    54/154

    4-2

    4-2

  • 8/10/2019 Hysys Rto Refguide

    55/154

    Derivative Utility 4-3

    4-3

    4.1 HYSYS.RTO Variables -Properties

    The Variables in a HYSYS.RTO optimization problem are held in a

    Derivative Utility. This is used for holding all of the data used for

    defining the HYSYS.RTO Optimizer constraints and variables.

    For detailed information on the Optimizer properties, see the Optimizer

    Properties document[3].

    The Optimizer contains a number of properties used for specifyingand controlling an optimization problem for a given HYSYS.RTOcase.

    The Optimizer is also associated with a Derivative Utilitywhichcontains, a list of Independent Propertiesand DependentProperties. The Independent Propertiesare the variables in theplant model that are changed to satisfy the Dependent Properties(the constraints on the plant model) simultaneously minimizing theplant model cost function.

    Figure 4.1

  • 8/10/2019 Hysys Rto Refguide

    56/154

    4-4 HYSYS.RTO Variables - Properties

    4-4

    This document has the following styles:

    All properties of the Optimizer/Variables/Constraints are shown initalic.

    Important notes are shown in bold.

    4.1.1 Inputs: Object Object Name - RangeThe Independent Propertieshave a number of inputs and they are

    described following the figure below:

    The Independent Propertiesinputs are as follows:

    Object Name The name of the HYSYS.RTO object which is usedas optimizer variable.

    Attached Object The object (e.g., Stream or Unit Op, etc.) that isattached or associated with the listed variable.

    Attached Property The property relating to the Attached Objectand variable.

    Start Value The starting value for the property of the Object Namein the plant model.

    Figure 4.2

  • 8/10/2019 Hysys Rto Refguide

    57/154

    Derivative Utility 4-5

    4-5

    Status The current status of the variable, which is calculated bythe Optimizer. Unlike constraints, variables are not allowed to moveout of their bounds. The Statusproperty is set to one of:

    Not Evaluated The status of the variable is not evaluated bythe Optimizer.

    InactiveThe variable Output property lies between the Minimumand Maximumproperties, but not on one of the bounds.

    EqualityThe maximum and minimum properties of the variable,Minimumand Maximum, are equal, and the Outputproperty has thesame value as well.

    Active LowThe variable Outputproperty value is equalto that ofthe Minimum.

    Active HighThe variable Outputproperty value is equalto that ofthe Maximum.

    Current Value The current value for the property of the ObjectName in the plant model.

    Optimize Flag Determines if the variable is to be used in theoptimization process. If this flag is not set, no attempt is made by theOptimizer to include this variable into optimization process.

    Minimum The lowerbound property for the variable during theoptimization process. This value might be different from its globalminimum, if the change in the variable is restricted to its allowedamount, set by the maximum rate of change, during the period in theoptimization process.

    Maximum The upperbound property for the variable during theoptimization process. This value might be different from its globalmaximum, if the change in the variable is restricted to its allowedamount, set by the maximum rate of change, during the period in theoptimization process.

    Range A user-specified alternative for the span. The purpose ofthe range is to scale the gradients of the cost function andconstraints, to give similar gradient magnitudes for each variable.The gradients of the objective function (and constraints) varyinversely with the variable ranges.

  • 8/10/2019 Hysys Rto Refguide

    58/154

    4-6 HYSYS.RTO Variables - Properties

    4-6

    4.1.2 Inputs: Global Minimum - Price

    Global Minimum Represents the absolute minimum value for

    which the variable is operated. This value is user-specified. Global Maximum Represents the absolute maximum value for

    which the variable is operated. This value is also user-specified.

    Span The difference between the Global Minimumand GlobalMaximumvalues for the variable and is calculated by the variableset-up. The role of the span is to convert every variable into therange (0, 1), to use uniform numerical perturbations andconvergence tests.

    Output It is the current value of the variable in the plant model.The output value is determined by the optimizer during theoptimization process.

    Price The shadow price (Lagrange multiplier) for the givenvariable, calculated by the Optimizer. The shadow price is used to

    estimate the effect which small changes to variable bounds have onthe plant cost function.

    Figure 4.3

  • 8/10/2019 Hysys Rto Refguide

    59/154

    Derivative Utility 4-7

    4-7

    4.1.3 Inputs: Sparse Column - Jac Num

    Sparse Column The column occupied by the given variable in the

    Jacobian matrix. Unused variables are given a sparse column of 0. Old Var Value This is the cached value of variable prior to

    perturbation, during gradient calculation.

    Delta Var The change in variable after perturbation, duringgradient evaluation.

    Gradient

    Tear Variable

    Jac Offset The Jacobian Offset.

    Jac Num The Jacobian Number.

    Figure 4.4

  • 8/10/2019 Hysys Rto Refguide

    60/154

    4-8 HYSYS.RTO Variables - Properties

    4-8

    4.1.4 CalculationsThe following properties are set by the user before an optimization run:

    Global Minimum

    Global Maximum

    Range

    Start value

    Sparse Column

    The following properties are Initialized by the HYSYS.RTO model before

    an optimization run:

    Minimum

    Maximum

    Span

    The following properties are updated by the HYSYS.RTO model during

    an optimization run:

    Old Var Val

    Delta Var

    The following properties are updated by the Optimizer during and after

    an optimization run:

    Status

    Price

    Output

  • 8/10/2019 Hysys Rto Refguide

    61/154

    Derivative Utility 4-9

    4-9

    4.2 HYSYS.RTO Constraints -Properties

    The constraints in a HYSYS.RTO optimization problem are held in a

    Derivative Utilityand are used for holding all data used for defining the

    HYSYS.RTO Optimizer constraints and variables. For details about the

    Optimizer properties, see the Optimizer Properties document[3].

    The Optimizer contains a number of properties used for specifying and

    controlling an optimization problem for a given HYSYS.RTO case. It is

    associated with a Derivative Utilitythat contains a list of Independent

    Propertiesand Dependent Properties. The Independent Propertiesare the

    variables in the plant model that are changedto satisfy the Dependent

    Properties(the constraints on the plant model) simultaneously

    minimizing the plant model cost function.

    Properties of the Optimizer/Variables/Constraints are shown in italic

    and important notes are bold.

    Figure 4.5

  • 8/10/2019 Hysys Rto Refguide

    62/154

    4-10 HYSYS.RTO Constraints - Properties

    4-10

    4.2.1 Inputs: Object Name - Maximum

    The Dependent Propertieshave a number of inputs and they are as

    follows:

    Object Name The name of the HYSYS.RTO object to beconstrained.

    Attached Object The object (e.g. Stream or Unit Op, etc.) that isattached or associated with the listed variable.

    Property The property related to the Attached Object andvariable.

    Current Value The current value for the property of the objectName.

    Use Flag Determines whether the constraint is to be used in theoptimization. If this flag is not set, no attempt is made by theOptimizer to satisfy this constraint.

    Minimum The lowerbound for the constraint, which is user-specified.

    Maximum The upperbound for the constraint, which is also user-specified.

    Figure 4.6

  • 8/10/2019 Hysys Rto Refguide

    63/154

    Derivative Utility 4-11

    4-11

    4.2.2 Inputs: Scale - Sparse Row

    Scale A user-supplied number that gives the scale on which the

    feasibility of the constraint is measured. This property is used inconjunction with the Optimizer Zeta property, which is a relativefeasibility tolerance. In general, a constraint is said to be feasible if:

    Where Minimum and Maximum are the lower and upper boundproperties respectively, of the constraint, and Current is its currentvalue (equivalent to Hooked Property for constraints which have theUse Flag checked).

    Minimum Chi Square Determines whether or not a chi-squaretest is done for the constraint.

    Figure 4.7

    Mi ni mu m Sc al e Ze ta C ur re nt M ax im um S ca le Z et a+

  • 8/10/2019 Hysys Rto Refguide

    64/154

    4-12 HYSYS.RTO Constraints - Properties

    4-12

    Status The current status of the constraint, which is calculated bythe Optimizer. The Status property is set to one of:

    Not EvaluatedThe status of the constraint has not been evaluated

    by the Optimizer. InactiveThe constraint Currentproperty lies between the

    Minimumand Maximumproperties, but is neither Active High norActive Low.

    Violated LowThe constraint Currentproperty is less thanMinimum - Scale x Zeta, where Scaleis the constraint Scalepropertyand Zetais the Optimizer Zetatolerance property.

    Violated HighThe Currentproperty is greater than Maximum +Scale x Zeta.

    Active LowThe constraint Currentproperty is less than Minimum+ Scale x Zeta, but greater than Minimum - Scale x Zeta.

    Active HighThe constraint Currentproperty is greater thanMaximum - Scale x Zeta, but less than Maximum + Scale x Zeta.

    Normalization When the Jacobian matrix is first calculated (firstpass evaluation) the Normalizationproperty for the constraint is setto be the largest Jacobian entry in the row ( Sparse Row) of theJacobian matrix corresponding to this constraint. This number isused to normalize the rest of the given Jacobian row, for allremaining Optimizer search steps (i.e., is not recalculated).

    Base Value When calculating the gradient of a given constraintwith respect to each variable, the internal scaled variable isperturbed away from the current point by adding the numberspecified in the Optimizer Perturbationproperty. The new value ofthe constraint is found corresponding to the new variable value, andthe change in constraint, divided by the change in the variable, is thecorresponding Jacobian element.

    The constraint Baseproperty stores the pre-perturbation value ofthe constraint. Under certain circumstances, however, the Baseproperty itself can change duringthe Jacobian calculation. This isdue to the fact that removing a perturbation from a perturbedvariable, and re-running the plant model, will not reproduce theprevious Baseproperty within the constraint Currentproperty; this isdue to noise in the model arising from non-zero convergencetolerances (i.e., the de-perturbed constraint Currentdiffers slightlyfrom the pre-perturbed Current).

    Therefore, under certain circumstances (when the Pert_Reset flagproperty of the Optimizer is checked) the Optimizer will remove theperturbation from the variable, re-run the plant model, and then re-set the Baseproperty of the constraint to match the re-calculatedCurrentproperty. This eliminates associated noise from the

    Jacobian matrix. This method is discussed in more detail in theOptimizer Properties document[3], in the Pert_Resetsection.

  • 8/10/2019 Hysys Rto Refguide

    65/154

    Derivative Utility 4-13

    4-13

    Price The shadow price (Lagrange multiplier) for the givenconstraint, calculated by the Optimizer. If a feasible solution is foundby the Optimizer, then a simple interpretation of the Lagrange

    multiplier is that it gives the gradient of the cost function along thecorresponding constraint normal. Thus, the shadow price indicatesthe approximate change to the objective function when increasing(i.e., relaxing) the given active bound by a unit amount.

    Hard Constraint A user-specified flag that indicates whether theconstraint is a technical one, i.e., is a process specification such asa mass balance or a temperature, as opposed to purely aneconomic constraint.

    Off Flag A user-specified flag that indicates whether the constraintis in the 'off' state, or not. This is often used when related items ofequipment are being constrained, which themselves have an on-offbehaviour.

    Sparse Row The number of the row in the Jacobian matrix whichis occupied by the given constraint.

    4.2.3 Inputs: Current Bias1

    Current The current value the constraint possesses in the plantmodel.

    Figure 4.8

  • 8/10/2019 Hysys Rto Refguide

    66/154

    4-14 HYSYS.RTO Constraints - Properties

    4-14

    Old Cons Value The value of the constraint prior to perturbationof a variable, during gradient calculation.

    Bias1

    Delta Cons The change in constraint after perturbing a variable,during gradient evaluation.

    4.2.4 CalculationsThe following properties are updated by the HYSYS.RTO model during

    an optimization run:

    Base Value

    Old Cons Val

    The following properties are updated by the Optimizer during and after

    an optimization run:

    Status

    Normalization

    Price

    Sparse Row

    Current

  • 8/10/2019 Hysys Rto Refguide

    67/154

    ESTIM DRU Overview 5-1

    5-1

    5 ESTIM DRU Overview

    5.1 The Problem .....................................................................................3

    5.2 The Solution .....................................................................................3

    5.3 The Benefits .....................................................................................4

    5.4 ESTIM DRU Facilities .......................................................................5

    5.4.1 Error Detection/Correction........................................................5

    5.4.2 Model Updating ........................................................................5

    5.4.3 Utilities......................................................................................5

    5.5 Using ESTIM DRU ............................................................................6

    5.5.1 Measurement Problem.............................................................6

    5.5.2 Basic Methods..........................................................................7

    5.6 Configuring a Fitting Problem ......................................................10

    5.6.1 Configuration Tab ...................................................................11

    5.6.2 Results Tab.............................................................................14

    5.6.3 Stream Initialization Tab .........................................................16

    5.6.4 Parameter Fit Tab ...................................................................17

    5.6.5 DCS Tags Tab ........................................................................18

    5.7 Estim Data Set Analysis ................................................................19

    5.8 Optimization Objects .....................................................................20

    5.8.1 Connection Tab ......................................................................21

    5.8.2 Properties Tab ........................................................................225.8.3 Transfer Tab............................................................................25

    5.9 General Notes.................................................................................25

  • 8/10/2019 Hysys Rto Refguide

    68/154

    5-2

    5-2

    5.10 ESTIM DRU Diagnostic File Output............................................26

    5.10.1 Initial Problem Parameters...................................................275.10.2 Iteration Output ....................................................................29

    5.10.3 Final Output .........................................................................31

  • 8/10/2019 Hysys Rto Refguide

    69/154

    ESTIM DRU Overview 5-3

    5-3

    5.1 The ProblemModern instrumentation and distributed control and management

    information systems produce a wealth of plant data. The plant

    operator/manager has a problem making sense of all this data where:

    It may be inconsistent or inaccurate.

    It may not give a complete or understandable indication of plantperformance.

    In addition, plant models can only be configured to a specific

    operational instance, whereas the performance of actual equipment

    varies as conditions change and equipment degrades. Thus, the model

    behaviour may start to diverge from actual plant behaviour.

    5.2 The SolutionThe ESTIM DRU addresses these issues and produces concise

    information to aid decision making and aid model tuning and off-line

    investigation.

    Firstly, it can perform data reconciliation. Measurements are subject to

    error and, therefore, provide inconsistent information. ESTIM DRU can

    detect and correct measurement errors, thereby providing a consistent

    and accurate data set.

    Secondly, a model representing a specific item of plant can be updated

    whereby ESTIM DRU is able to reconcile model and actual plant values,

    to ensure that the model continues to represent actual plant

    performance.

  • 8/10/2019 Hysys Rto Refguide

    70/154

    5-4 The Benefits

    5-4

    5.3 The BenefitsThe ESTIM DRU brings real benefits by ensuring good representation of

    plant equipment, and providing indications of poor plant data as an aid

    to decision making in the following areas:

    Identification of process unit performance, in particular conditionmonitoring.

    Identification and quantification of instrument errors.

    This leads to improvements due to:

    Better process operation in general.

    More effective and efficient equipment maintenance and/or

    replacement. More effective and efficient instrument maintenance.

    Improved plant model representation.

    ApplicationsCurrent applications of the ESTIM DRU include:

    Compressor model updating/condition monitoring

    Catalyst performance monitoring/updating

    Thermal cracker model updating

    Steam system data reconciliation

    Gas turbine model parameter updating

    Heat exchanger fouling effect updating

    Reactor model parameter updating

    Boiler model updating and condition monitoring

    General network reconciliation (e.g., oil & gas fields, steam systems,etc.)

    In fact, anywhere where plant measurements are available around

    process equipment, the ESTIM DRU can be applied.

  • 8/10/2019 Hysys Rto Refguide

    71/154

    ESTIM DRU Overview 5-5

    5-5

    5.4 ESTIM DRU Facilities

    5.4.1 Error Detection/CorrectionNo measurement is perfect, so by using a number of sets of data and

    statistical routines, the ESTIM DRU sorts the good from the bad and

    only uses good data. This is a pre-requisite for model updating and the

    essence of data reconciliation.

    5.4.2 Model UpdatingThe ESTIM DRU can update the parameters of even the most complex

    model.

    5.4.3 UtilitiesThe ESTIM DRU invokes a number of statistical and optimizationroutines to perform the following tasks:

    Parameter Estimation Calculation of model parameters whichmay change with time, such as reaction rate coefficients, heattransfer coefficients, etc.

    Data Reconciliation Model based reconciliation of over-determined systems, such as steam system mass balancing, wherethere are many flow-meters, or estimation of power output of aturbine with both steam flow and driven load being measured.

    Bad Data Elimination Results of data reconciliation calculationscan be examined statistically to determine whether bad data ispresent, and if so eliminate the bad data.

  • 8/10/2019 Hysys Rto Refguide

    72/154

    5-6 Using ESTIM DRU

    5-6

    5.5 Using ESTIM DRUThe ESTIM DRU comes in the form of a tool kit, comprised of the

    following:

    A set of related screens in HYSYS for attaching an ESTIM DRU to aHYSYS plant model simulation case.

    Demonstration examples describing how to use the DRU[1]. This letsyou configure plant model updating and data reconciliation routineswithin the HYSYS environment without recourse to programming orexpert assistance.

    5.5.1 Measurement ProblemMeasurement devices are often assumed to have zero bias and random

    error