Professional Documents
Culture Documents
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 but
a 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. A
special thanks is also extended by the authors to everyone who contributed through countless hours of
proof-reading and testing.
Contacting Hyprotech
Hyprotech can be conveniently accessed via the following:
Web site:
Information and Sales:
Documentation:
Training:
Technical Support:
www.hyprotech.com
info@hyprotech.com
HypCalgaryDocumentation@hyprotech.com
training@hyprotech.com
support@hyprotech.com
Detailed information on accessing Hyprotech Technical Support can be found in the Technical Support
section of the Get Started manual.
Table of Contents
1
2.2
Optimization Objects.............................................................2-5
2.3
2.4
2.5
2.6
2.7
4.2
5.2
The Solution..........................................................................5-3
5.3
The Benefits..........................................................................5-4
5.4
5.5
5.6
5.7
5.8
Optimization Objects...........................................................5-20
5.9
General Notes.....................................................................5-25
7.2
Optimizer ............................................................................7-12
A.2
Index.............................................................................I-1
ii
Introducing HYSYS.RTO
1-1
1 Introducing HYSYS.RTO
1.1 Welcome to HYSYS.RTO .................................................................3
1-1
1-2
1-2
Introducing HYSYS.RTO
1-3
1-3
1-4
Welcome to HYSYS.RTO
1-4
Using HYSYS.RTO
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
2-1
2-2
2-2
Using HYSYS.RTO
2-3
2-3
2-4
2.1.3 Overview
For 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 the
underlying flowsheet variable and provide the necessary
configuration information for use by Optim or Estim.
Collection Utilities Utilities used to identify the "pieces" of the
flowsheet which are to be exposed to Optim or Estim.
Optim and Estim parameters Tolerances and flags.
The mechanics for creating either a Data Reconciliation or Optimization
problem are essentially identical. The only differences are as follows:
2-4
Using HYSYS.RTO
2-5
2-5
2-6
Collection Utilities
2-6
Using HYSYS.RTO
2-7
2.
3.
Select the unit operations from the flowsheet that are associated
with the variables to be fit, or for which you have measured the data.
The streams that are attached to the unit operations are
automatically obtained at the same time.
4.
Install Fitting Parameters from the Utility and attach them to the
appropriate flowsheet variables to be fit.
5.
6.
Install DCS Tags and attach them to flowsheet variables for which
you have measured data.
7.
8.
9.
10. Set the appropriate Estim properties and tolerances and flags.
11. Invoke the HYSYS Optimizer F5 and turn on Data Reconciliation
mode.
12. Identify the utility containing the unit operations and streams being
reconciled.
13. Start the data reconciliation.
2-7
2-8
Optimization Problem
2.
3.
4.
Install Optimization Variables from the utility and attach them to the
appropriate flowsheet variables.
5.
6.
7.
8.
9.
2-8
Using HYSYS.RTO
2-9
2-9
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.
Figure 2.2
2-10
Tab
Description
Structural NonZeroes
Independent
Variables
Constraints/
Objective Function
Derivative Analysis
Using HYSYS.RTO
2-11
Configuration Group
At 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:
Field
Description
Add
2-11
2-12
Selection
Flowsheet
Wide
Specific Unit
Operation
Extension
Operation
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 Oper radio button is selected, the view
displays as shown in the figure below.
Figure 2.4
Select the target unit operations from the Object column 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.
2-12
Using HYSYS.RTO
2-13
Description
Optimization Variable
Tear Variables
Solution Variables
2-13
2-14
Description
Input
Output
Results
All
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, while
calculated variables are displayed in black.
Unit conversion is provided for each of the appropriate object property
combinations.
2-14
Type
Description
Optimization
Variable
Constraints
Objective Function
Variables
Using HYSYS.RTO
2-15
2-15
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
Figure 2.7
2-16
Using HYSYS.RTO
2-17
2-17
2-18
Derivative Analysis
The Derivative Analysis tab of the utility property view provides access
to 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 and
reduces the time of the overall problem solution.
Figure 2.8
Using HYSYS.RTO
2-19
If you have not supplied a value for the Range, the Span is used in
determining the size of the perturbation. The reason for providing the
span is that it allows for better control over the perturbation which is
being applied to the given variable, i.e., large enough to generate a
2-19
2-20
2-20
Optimizer
3-1
3 Optimizer
3.1 Optimizer Interface ..........................................................................3
3.1.1 Calculations............................................................................23
3.1.2 Results ...................................................................................23
3-1
3-2
3-2
Optimizer
3-3
The radio button selection provided along the bottom of the view
provides access to the available options:
3-3
3-4
Optimizer Interface
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 programming
algorithm with large-scale sparse matrix handling features.
NAG_SQP single-phase sequential quadratic programming
algorithm.
Suggested Default: MDC_SQP
3-4
Optimizer
3-5
LP Options
Used to select the options to be used with the SS_LP algorithm. Select
one of the following:
None No option.
Initialize A single run of the linear programming algorithm is
conducted, and the Objective Value property of the Optimizer is
reset to 0.0.
Intercepts The Optimizer Fix Variable Spans flag is switched on
prior to carrying out the SS_LP optimization.
Gradients The Optimizer constraint and objective function
gradients are re-evaluated prior to carrying out the SS_LP
optimization. Otherwise, the gradients used during the SS_LP
optimization are those found at the previous point.
The SS_LP algorithm is not included in the current version.
Gradient Calculations
This option specifies if one-sided or two-sided gradient calculations are
used:
1-sided Causes forward differences to be used when constructing
gradient approximations.
2-sided Causes central differences to be used. This option
requires twice as many function evaluations at a given solution, but
may provide a more accurate estimate of the constraint and
objective gradients, particularly for highly non-linear problems, or
problems 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
3-5
3-6
Optimizer Interface
Max. Iterations
This parameter fulfils the following two roles:
When Algorithm is set to MDC_SQP / MDC_SLP, this parameter
gives the maximum number of Optimizer iterations allowed to
improve an already feasible solution.
When Algorithm is set to NAG_SQP, this parameter gives the
maximum number of major iterations. A major iteration in this case
consists of a sequence of minor iterations which minimize a linearly
constrained subproblem.
Suggested Default: 50
3-6
Optimizer
3-7
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:
Value
Description
Checks both types of gradient. The checking takes place at the start of the
optimization.
Suggested Default: -1
3-7
3-8
Optimizer Interface
DV_Level
Used to specify which gradients should be estimated by the NAG_SQP
algorithm. Refer to the following table:
Value
Description
No action is taken.
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 this
phase.
Impossible This output signifies either a non-implemented
Optimizer algorithm is selected, or the algorithms could not find a
solution to the linearized problem. In this case, the problem
constraint/variable bounds and feasibility tolerance parameters
should be checked.
No variables The number of variables in the problem is zero.
Step convergence During the Optimizer OPT phase of
MDC_SQP, the stepping back procedure has resulted in a step
collapse to below the Step solution tolerance.
Cost convergence During the Optimizer OPT phase of
MDC_SQP, two successive objective function values have returned
a difference in cost less than the Cost solution tolerance. Note that
only feasible points are considered for this test.
Flat A special case of cost convergence in which the objective
function gradient is zero. Usually indicates an incorrectly defined (or
scaled) objective function.
3-8
Optimizer
3-9
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 algorithm
is used, this returns the number of major iterations used.
3-9
3-10
Optimizer Interface
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 diagnostics
file, and preparing to carry out the FPS search.
Results Reported when the Optimizer is writing the final solution
to the diagnostics file and completing any post-optimization
calculations.
Setup The Optimizer variables and constraints are being
inspected and set-up internally by the Optimizer using the usersupplied data.
FPS The beginning of the FPS phase of the Optimizer.
FPS Deriv The Optimizer is calculating the gradients of the
constraints and objective function during the FPS phase. This
occurs every time the Optimizer adjusts the current solution to
improve the feasibility of the current point.
FPS Visible The Optimizer has successfully solved the linearized
problem during the FPS phase.
FPS Invisible The linearized problem at the current solution in the
FPS phase cannot be solved.
FPS Shrink The Optimizer is stepping back during the FPS
phase. This occurs when the projected point in the FPS is less
feasible than the current point, and so the projected point is
adjusted.
Optim The Optimizer is preparing to enter the FPS phase.
OPT Deriv The Optimizer is calculating the constraint and
objective 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 the
objective function has increased.
3-10
Optimizer
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 the Numerical Gradients flag 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
the Numerical Gradients flag is checked.
Code Version
The current version of the Optimizer.
Start Objective
This gives the plant model cost function value at the starting point,
before carrying out any optimization.
3-11
3-12
Optimizer Interface
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
3-12
Optimizer
3-13
Optimality Tolerance
Gives the accuracy with which the linearized problem is solved by the
MDC_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 convergence when 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.
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
3-13
3-14
Optimizer Interface
Gradient
The tolerance which is the maximum value of the Lagrangian function
gradient for which the MDC_SQP algorithm is considered to have
converged on Lagrangian gradient. A value of 0.0 forces convergence of
either the Step or Cost kind.
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 is Zeta * Scale, for the given constraint. A value of 1.0 means
that the feasibility of the individual constraints is controlled uniquely
through the individual constraint Scale property.
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 be
binding (active) in the linearized problem.
In general, the solution of the linearized problem satisfies the constraint
Minimum and Maximum property bounds, whereas the solution of the
true non-linear problem satisfies the bounds (Minimum - Zeta * Scale,
3-14
Optimizer
3-15
Perturbation
The change in the scaled variables during gradient evaluation. An
individual variable in the Optimizer is scaled according to the variable
Minimum property, and the variable Span property (or the Range
property if the Optimizer Fix Variable Spans property is checked).
In general, the Optimizer scales the problem variables v to produce a set
of internal scaled variables x, according to the formula.
v j min
x j = ------------------S
(3.1)
3-15
3-16
Optimizer Interface
3-16
Optimizer
3-17
Jacobian Elimination
The value below which entries in the Jacobian matrix are deemed to be
pure model noise, and are set to zero (or when the Optimizer Sparse
Jacobian flag is checked, are excluded from the Jacobian sparsity pattern
and hence never re-evaluated in future).
Suggested Default: 10-12
3-17
3-18
Optimizer Interface
Penalty Parameter
This is used solely in the NAG_SQP algorithm. It is used for forcing
convergence 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 Parameter the 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
3-18
Optimizer
3-19
3-19
3-20
Optimizer Interface
Recentre
This is checked for testing purposes, in which case the Optimizer reflects
the effects created by an on-line Optimizer. The Optimizer variable soft
limits (the Minimum and Maximum properties) 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 the Max. Allowed Move parameter 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 Move parameter, and increases the lower bound by the
same amount.
Suggested Default: unchecked
Optimizer
3-21
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 numerical
calculation of the gradients by direct perturbation of variables using
the method specified in the Gradient Calculation flag.
If it is unchecked, the Optimizer obtains the gradient elements from
HYSYS.RTO using the same method. The main difference is that in
the latter case certain gradient elements may be computed
analytically, 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
3-21
3-22
Optimizer Interface
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 Jacobian property 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 the Jacobian Elimination tolerance parameter, which
may be difficult to set.
Is required once only (the efficient sparse storage of the Jacobian
eliminates 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 the
extra plant model evaluations, compared with the use of the
Jacobian Elimination tolerance 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 therefore
could be excluded from the sparsity pattern.
This flag should be checked along with the Sparse Jacobian flag, 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).
3-22
Optimizer
3-23
3.1.1 Calculations
The 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 Results
The results produced at the end of the optimization run are as follows:
3-23
3-24
3-24
Optimizer Interface
Derivative Utility
4-1
4 Derivative Utility
4.1 HYSYS.RTO Variables - Properties.................................................3
4.1.1
4.1.2
4.1.3
4.1.4
4-1
4-2
4-2
Derivative Utility
4-3
4-3
4-4
4-4
Derivative Utility
4-5
Current Value The current value for the property of the Object
Name in the plant model.
Optimize Flag Determines if the variable is to be used in the
optimization process. If this flag is not set, no attempt is made by the
Optimizer to include this variable into optimization process.
Minimum The lower bound property for the variable during the
optimization process. This value might be different from its global
minimum, if the change in the variable is restricted to its allowed
amount, set by the maximum rate of change, during the period in the
optimization process.
Maximum The upper bound property for the variable during the
optimization process. This value might be different from its global
maximum, if the change in the variable is restricted to its allowed
amount, set by the maximum rate of change, during the period in the
optimization process.
Range A user-specified alternative for the span. The purpose of
the range is to scale the gradients of the cost function and
constraints, to give similar gradient magnitudes for each variable.
The gradients of the objective function (and constraints) vary
inversely with the variable ranges.
4-5
4-6
4-6
Derivative Utility
4-7
4-7
4-8
4.1.4 Calculations
The following properties are set by the user before an optimization run:
Global Minimum
Global Maximum
Range
Start value
Sparse Column
4-8
Derivative Utility
4-9
4-9
4-10
4-10
Derivative Utility
4-11
Where Minimum and Maximum are the lower and upper bound
properties respectively, of the constraint, and Current is its current
value (equivalent to Hooked Property for constraints which have the
Use Flag checked).
Minimum Chi Square Determines whether or not a chi-square
test is done for the constraint.
4-11
4-12
by the Optimizer.
Inactive The constraint Current property lies between the
Minimum and Maximum properties, but is neither Active High nor
Active Low.
Violated Low The constraint Current property is less than
Minimum - Scale x Zeta, where Scale is the constraint Scale property
and Zeta is the Optimizer Zeta tolerance property.
Violated High The Current property is greater than Maximum +
Scale x Zeta.
Active Low The constraint Current property is less than Minimum
+ Scale x Zeta, but greater than Minimum - Scale x Zeta.
Active High The constraint Current property is greater than
Maximum - Scale x Zeta, but less than Maximum + Scale x Zeta.
4-12
Derivative Utility
4-13
4-14
4.2.4 Calculations
The 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:
4-14
Status
Normalization
Price
Sparse Row
Current
5-1
5-1
5-2
5-2
5-3
5-3
5-4
The Benefits
Applications
Current applications of the ESTIM DRU include:
5-4
5-5
5.4.3 Utilities
The ESTIM DRU invokes a number of statistical and optimization
routines to perform the following tasks:
Parameter Estimation Calculation of model parameters which
may change with time, such as reaction rate coefficients, heat
transfer coefficients, etc.
Data Reconciliation Model based reconciliation of overdetermined systems, such as steam system mass balancing, where
there are many flow-meters, or estimation of power output of a
turbine with both steam flow and driven load being measured.
Bad Data Elimination Results of data reconciliation calculations
can be examined statistically to determine whether bad data is
present, and if so eliminate the bad data.
5-5
5-6
(5.1)
5-6
5-7
5-7
5-8
Practical Considerations
When using parameter updating for a model it is important to have a
large enough history of results, which, over a short time period is
unlikely. There are two reasons for this requirement and they are as
follows:
Firstly, it is impossible to update a performance curve, such as the
efficiency/flow curve on a compressor, from a small knot of data.
Depending on the technique, the best that can happen is the curve
moves up or down, and the worst that can happen is the curve
becomes totally wrong towards the extremes.
Secondly, it is impossible to calculate a goodness-of-fit parameter.
This makes determination of faulty measurements difficult.
When these problems are anticipated, it is better to adopt a strategy
where an updated correction factor is applied to the model curve
instead of updating the performance curve.
This does not preclude updating performance curves in the longer term
by manual inspection and re-fitting.
HYSYS models are written in such a way that it is a simple task for ESTIM
DRU to update either a curve or a performance parameter.
5-8
5-9
2.
3.
4.
2.
3.
5-9
5-10
4.
5.
Calculate the data elimination goodness of fit. If the fit is good, the
task is completed. If the fit is bad, eliminate the offset fitting for the
data set with the largest relative offset, and allow the offset to "float"
(i.e. remove from the offset portion of the fitting function and allow
the routine to select an unrestricted fit value). Recalculate the fitting
problem with the eliminated data set.
5-10
5-11
5-11
5-12
5-13
5-13
5-14
The updating routine produces a set of results, that can be seen on the
Results tab of the Data Reconciliation Utility property view.
The Fit Error (Total) gives the total sum of the errors, for all the
datablocks of reach good historical data-set, between the measured
values and the model calculated values, the error being calculated using
the final value of the predicted parameters and measurement offsets.
The value of x2 gives the x2 calculation bases on the sum of the data
block errors scaled by the sigma, s, for each of the output data blocks.
This value is then checked against the maximum x2 value (Maximum
Chi2), which is calculated from the stated confidence and the calculated
number of degrees of freedom (Degrees of Freedom) for the problem. If
the calculated x2 values is less than the maximum value, the Fit flag is
deemed good, and the parameters and offsets are updated. A bad fit
leaves the parameters and offsets with their original values.
5-14
5-15
The Goodness of Fit returns whether a good or bad fit was returned by
the x2-test. Major Iterations indicates the number of parameter
variation steps undertaken by the optimization algorithm with
minimizing the total error.
The value for Function Calls indicates how many times the plant model
was executed by the updating algorithm in arriving at the fit answer.
The change in objective function can be seen by comparing the Starting
Objective to Final Objective. The objective quoted is the actual objective
seen by the optimization routine, and is based on the scaled offsets and
error functions.
A summary of the user-supplied parameters is also supplied in the
Number Of group.
Parameter/Offsets
These are the most important results obtained from the updating. They
define the parameters which most accurately describe the actual plant
for the data given in the model input and output blocks.
The parameter results can be viewed on the Parameter Fit tab.
The calculated offsets can be seen by examining the individual data
blocks on the DCS Tags tab as shown in the next section.
In most cases, successive updating over time should result in a
progressively more accurate solution.
5-15
5-16
Figure 5.3 shows the Stream Initialization tab. This indicates the
connections from the estimated entries in the plant model to the
measurement data list that contains the input and the output
measurement data blocks. The screen identifies whether a
measurement data block is a model input or calculated result.
This form displays information concerning flowsheet model inlet /
outlet streams, energy streams, and internal streams. An inlet stream is a
stream in the model that is an inlet to a reconciled unit operation
(targeted using the Target Objects button), but not an outlet. An outlet
stream is an outlet to a reconciled unit operation, but not an inlet.
Energy stream refers to the standard HYSYS energy streams. Internal
streams are both inlet and outlet streams (i.e., are both feeds and
products to unit operations), or are either feeds or products to a unit
operation which is not reconciled. The initialization prior to carrying
out a run of the estimation is done using DRU streams, streams created
by you specially for the purpose of storing simulated plant data in
5-16
5-17
The model parameters can be accessed from the Parameter Fit tab of
the Data Reconciliation Utility property view. These are the parameters
that are adjusted to give the best fit of the model to the data given in the
output blocks, e.g., the efficiency of a heat exchanger or the reaction
coefficients of a reactor model.
5-17
5-18
The Minimum and Maximum values define the range over which the
parameters are allowed to vary. These values should be considered
carefully so as not to constrain the model to a region in which the model
solution is greatly different from the actual plant.
The Start and Current values show the values of the parameters before
and after an update was carried out. After an update, and only if the fit is
good, the new values are placed directly into the model. The Result
Value stores the value of the parameter after the last run of the ESTIM
DRU. The Hooked Object/Variable refer to the object and property in
the flowsheet model which is estimated.
The DCS Tags tab is used for defining the transfer of measured data to
the flowsheet model during the ESTIM DRU calculations.
5-18
5-19
The Tag Filter group has options to display model Input data, Output
data, or All data (input and output), depending on the radio button
selected. Input data consists of property values of streams that are read
in the model, but are not reconciled. Output data, consisting of property
values, are then reconciled to these (read) values by the parameter
estimation algorithms in the ESTIM DRU.
When running ESTIM DRU offline, the Data Set Analysis view can be
used to see how well each variable behaves over up to 15 data sets, or
how up to 15 variables perform against observed plant data for any
particular data set. The absolute and percentage difference between the
observed and predicted data, and the arithmetic average and standard
deviation of these differences are displayed to show the statistical
accuracy of the model.
The Data Set Analysis view is accessed by clicking the Data Set Analysis
button on the Data Reconciliation Utility property view after running
the ESTIM DRU offline. The view includes both Good and Bad data.
Select the data sets to be included in the analysis and either input tags or
output tags. The analysis is run by clicking the Run button on the above
screen.
5-19
5-20
Optimization Objects
The Optimization Object property view for the selected object displays.
There are three tabs in this property view:
Connection
Properties
Transfer
These tabs are described in the following sections.
5-20
5-21
5-21
5-22
Optimization Objects
5-23
5-23
5-24
Optimization Objects
5-24
5-25
The Transfer tab lists the Transfer flags of an optimization object. These
flag properties are not used in the offline situation.
5-25
5-26
5-27
5-27
5-28
5-28
5-29
JTJ initial Hessian Controls the initial value of the upper triangular
matrix R (the estimate of the transformed and re-ordered Hessian of
the Lagrangian). J is the objective Jacobian matrix.
Reset frequency The number of major iterations after which the
Hessian is reset to JTJ.
In addition to the above parameters, the work arrays are checked for
suitable sizing, and a summary of the Jacobian element estimations is
given.
5-30
Description
5-30
5-31
5-31
5-32
5-32
6-1
6-1
6-2
6-2
6-3
6-3
6-4
Fitting Parameter
Name
Type
Data Type
Description
Minimum
Input
Double
Maximum
Input
Double
Fit
Input
Boolean
Start Value
Input
Double
Evaluate
Output
Double
Result Value
Output
Double
Name
Type
Data Type
Description
Scale
Input
Double
Offset
Input
Double
Total Error
Output
Double
Calculate Bias
Input
Boolean
Use Bias
Input
Double
Percent
Output
Double
Input
Input
Double
Eliminated
Output
Boolean
Evaluated
Value
Internal
Double
Current Error
Internal
Double
Next Value
RTO
Boolean
Count
RTO
Double
Total Count
RTO
Double
Over Data
RTO
Double
DCS Tag
6-4
Name
Type
Data Type
Description
Next Good
RTO
Double
Limit
RTO
Double
6-5
6-5
6-6
To install a DRU:
1.
2.
3.
6-6
6-7
Description
Configuration
Results
Stream Initialisation
Parameter Fit
DCS Tages
This view displays all of the unit operations currently attached to the
Utility. You can either Add or Remove unit operations from the utilities
collection.
6-7
6-8
The Object Filter group found at the bottom left of the view provides
options for filtering the display of available objects. In addition, the
Flowsheet Wide option is provided to allow the application of the Data
Reconciliation Utility to the entire flowsheet. For this example, this is the
correct choice.
When you have moved the desired items into the right column
(highlight them in the Available Objects list and then press the right
arrow button), click the Accept List button . The appropriate
optimization objects (DCSTags, DRUStreams and Fitting Parameters
which are attached to these operations and their associated streams are
collected from the simulation case.
Figure 6.4
The Stream Initialization tab lets you acccess (and create if desired) the
DRU Streams (Data Reconciliation Utility Streams) which are used to
hold multiple sets of Feed, Product or Internal Stream data for a Data
Reconciliation Utility.
There are a number of features associated with the DRUs (such as
converting data for a new Component Basis in an associated stream,
inserting and removing data sets , etc).
6-8
6-9
For this problem however, the composition of the Feeds and Products
remains fixed and Tags are used to modify any of the stream data for the
problem.
If a "Specific Stream" is selected, it allows an Internal stream (one that is
connected to two unit operations in the collection) to be created. This
can be used to store internal stream data from the results of the data
reconciliation (a copy of the stream data is saved for each data set).
By default, all of the DRUs have their Multiple flag set to True. This
needs to be turned "off" for Inlet DRUs.
The figure below illustrates the option of selecting a new stream basis
for the flowsheet stream, which results in any of the supplied data (if
desired) being converted to the new basis.
Figure 6.5
There are three options when a new basis is selected for the streams
compositional basis. You can set all supplied values to unknown,
convert the previously supplied value to the new basis, or retain the
values as supplied and have them interpreted in the new basis.
6-9
6-10
The Fit Parameters in the table on this tab are selected through the Add
button beside the Fit Parameter drop-down list. When you click the Add
button, the Select Optimization Variable view is displayed.
6-10
6-11
The first Fit Parameter that was selected for the DRU was the E-100
object, Spec Value variable and the UA variable specifics as shown in the
figure below.
Figure 6.7
6-11
6-12
Selection of Tags
Move to the DCS Tags tab in the Data Reconciliation Utiltiy property
view.
Figure 6.8
The Input DCS Tags in the Tag Filter group on this tab are selected
using the Add button beside the DCS Tags drop down menu. When you
click the Add button, the Select Optimization Variable view is displayed.
6-12
6-13
The first Input DCS Tag that was selected for the DRU was selected as
shown in the figure below.
Figure 6.9
The tag is automatically placed in the Tag Filter list as the variable
(Stream 2 Flow) is specified in the flowsheet.
The Output DCS Tags were added as shown below.
Figure 6.10
6-13
6-14
If you return to the Configuration tab of the Utility and specify the
minimum number of data sets to be four, the appropriate number of
data sets are created for each tag and DRU Stream.
Return to the DCS Tags tab and in the Tag Filter group, click the All radio
button and the Parameters radio button. The configuration data was
supplied for each of the Input and Output tabs as described in the
following table:
6-14
Tag
Offset
Limit
Scale
Sigma
Calc Bias
Use Bias
2 Flow
1000
False
False
3 Flow
1000
False
False
59 Flow
1000
False
False
30 Flow
1000
False
False
14 Flow
1000
False
False
1 Flow
1000
False
False
61 T
1000
False
False
4T
1000
False
False
5T
1000
False
False
7T
1000
False
False
8T
1000
False
False
6-15
Select the Measured Data radio button and view the data:
Tag
Data Set 1
Data Set 2
Data Set 3
Data Set 4
2 Flow (lbmole/hr)
900
1000
1100
1200
3 Flow (lbmol/hr)
1450
1550
1650
1750
59 Flow (lbmol/hr)
600
550
500
450
30 Flow (lbmol/hr)
1500
1600
1700
1800
14 Flow (lbmol/hr)
1350
1450
1550
1650
1 Flow (lbmol/hr)
2350
2550
2750
2950
61 T (F)
-33.25
-33.16
-33.06
-32.96
4 T (F)
-24.48
-23.01
-21.59
-20.24
5 T (F)
-59.96
-56.64
-53.63
-50.88
7 T (F)
-37.89
-37.12
-36.34
-35.57
8 T (F)
-44.85
-43.85
-42.80
-41.76
6-15
6-16
Figure 6.12
6-16
7-1
7-1
7-2
7-2
7-3
2.
Click Derivative Utility in the list box on the right and click on the
Add Utility button. In the case, R-13opt.dox.hsc, a Derivative Utility
is already installed, so you are viewing that utility.
7-3
7-4
3.
In the list box on the left, click on Utility-1 and then click on the
View Utility button. The Derivative Utility property view displays as
shown below:
Figure 7.2
7-4
7-5
There are three modes for the derivative utility and they are as follows:
Flowsheet Wide Use when minimal flowsheet tearing is to be
employed, and no special derivative and solution mechanisms (such
as extension operations) are to be used. In this mode, a single
derivative utility is used for the entire flowsheet.
Specific Unit Operation Typically, this is a sub-flowsheet that is
torn on both the feeds and products. The sub-flowsheet typically
contains several unit operations that are solved either using the
HYSYS standard solver, or one of the column solvers.
Extension Operation Used when the sub-flowsheet contains an
extension operation that is solved using the available OLE functions
to allow the solver to solve the model equations as part of the
optimization problem.
It is best to select the desired unit operation prior to installing any of the
remaining optimization objects. You should attach all existing
optimization objects to the Derivative Utility, and this is how the correct
mode is selected.
For this example, a Specific Unit Operation (T-100) is selected for the
derivative utility. Use this mode to optimize variables pertaining to the
T-100 unit operation.
Figure 7.4
7-5
7-6
7-6
7-7
When optimization objects are created for the model, they are displayed
in a WorkSheet format as shown below.
Figure 7.7
The Object Name column lets you modify the name of the created
variables. In addition, the Attached Object and Attached Property are
also displayed in the view, as well as the variables current value. The
start value is updated at the start of an optimization run. There are
several other properties also displayed in this view.
The Independent Properties radio buttons filter the overall list of
variables to those of the specific types described previously. In addition,
the Master and Runtime lists toggle the display between all objects and
those being considered for the current evaluation.
The properties can be filtered into the following:
7-7
7-8
Optimize Flag
Minimum
Maximum
Range (optional)
Global Minimum
Global Maximum
The latter are appropriate only for real time applications and can be set
at the same values as the minimum and maximum.
The Optimize flag works in conjunction with Run Time and Master lists.
When the optimization problem is being set up, this flag is evaluated for
each variable. If the flag is false, then the variable is not exposed to the
Optimizer and the value remains at its starting value for the length of the
solution. With this, you can switch problems easily by turning variables
and constraints on and off.
The value for the variable Range is used for the calculation of a
perturbation, range x perturbation factor. If none is provided, the span
(maximum - minimum) is used for the calculations.
All required input for the variables can be done through the Utility view,
which provides access to unit conversion capabilities.
7-8
7-9
7-9
7-10
Use Flag
Minimum
Maximum
Scale
7-10
7-11
At this point, all required input (for the various objects)is provided, and
the Optimizer can be invoked.
7-11
7-12
Optimizer
7.2 Optimizer
The Optimizer interface is used to collect all of the derivative utilities
within the current simulation case and provide them to the Optimizer.
The Optimizer is invoked by pressing F5 or, open the Simulation menu
and select Optimizer.
To access the configuration options for the Optimizer, first select the
Optimization radio button at the bottom of the view. This provides
access to the Optim Configuration tab, as shown below.
Figure 7.11
7-12
7-13
The Configuration group in the upper left corner of the view contains a
collection of radio buttons that control the information and input
options that are displayed:
SetUp Selection of the optimization scheme, print levels, as well
displaying the running results
Tolerances Specification of Optimizer settings and solution
tolerances
Flags Access to a number of flag settings that control the solution
mechanism
While the model is running, you can move through HYSYS, but dont
change any of the values.
7-13
7-14
Optimizer
7-14
7-15
Figure 7.14
7-15
7-16
7-16
Optimizer
HYSYS.RTO+ Example
A-1
A HYSYS.RTO+ Example
A-1
A-2
A-2
HYSYS.RTO+ Example
A-3
For the above process, you are going to reconcile measured data of mass
flows of inlet streams Fuel, Dils, BFW1 and BFW2, as well as measured
data of temperatures of outlet streams GT1 STM1, GT1 STM2 and Strm
A-3
A-4
5T, and mass flow of outlet stream GT1 Stackage. You are also going to
do parameter fitting of UA of heat exchanger E-100 and E-101.
For Data Reconciliation and Parameter Estimation, there are:
DCS Tags variables for which the user has a set of
measurements, and are used to calculate offsets in the
measurements, and update fitting parameters. These can be either
specified or calculated variables.
Fitting Parameters variables whose value is to be directly
adjusted 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 the user.
These values are taken as supplied, no offsetting is calculated for these
streams.
A-4
HYSYS.RTO+ Example
A-5
There are five pages and they are described in the following table:
Page
Description
Configuration
Results
Stream Initialization
Parameter Fit
DCS Tag
A-5
A-6
The first step is to select the unit operations to be considered (press the
Target Objects button, located in the top of the Configuration view). This
produces the view shown below.
This view displays all of the unit operations currently attached to the
Utility. You can either add or remove unit operations from the utilitys
collection.
When you press Accept List button, all of the appropriate optimization
objects (DCSTags and Fitting Parameters) which are attached to these
operations and their associated streams are collected from the
simulation case. DRU streams are automatically created for inlet, outlet,
and energy streams. Internal streams have to be added manually.
A-6
HYSYS.RTO+ Example
A-7
DCS Tags used for this example are listed in the following table.
Input Tag Name
Variable
Variable
Fuel
TSTM1
Temperature of
GT1 STM1
Dils
TSTM2
Temperature of
GT1 STM2
BFW1
MassStackgas
Mass Flow of
GT1Stackgas
BFW2
Strm 5T
Temperature of 5
A-7
A-8
view this data, the Inlet and Set Up radio buttons must be selected.
Figure A.5
A-8
HYSYS.RTO+ Example
A-9
Figure A.6
A-9
A-10
Figure A.7
A-10
HYSYS.RTO+ Example
2.
A-11
Each of the tags (flowsheet variables for which there is measured data)
is associated with a DCS Tag optimization object. When the
optimization object is created and attached, the Data Recon Utility
A-11
A-12
Information about the tags and how they are to be treated for the
problem, can be set by selecting the parameters radio button. The key
parameters are:
Calc Bias and Use Bias - whether a bias (offset) is to be calculated for the
tag during the solution, or whether the supplied offset is to be used
directly (Use Bias).
The Scale parameter is available so the user can apply scaling to the
calculated error. In general, all tags should have a similar scaled error,
however, there are situations, as described previously, where the user
may want to apply different scalings to the tags.
A-12
HYSYS.RTO+ Example
A-13
For a first evaluation of the model, using the unity scale is sufficient.
Figure A.10
Once the number of data sets to be used is set, the measured data radio
button can be selected. This provides access to the following view which
A-13
A-14
A-14
HYSYS.RTO+ Example
A-15
A-15
A-16
Figure A.13
A-16
HYSYS.RTO+ Example
A-17
A-17
A-18
A-18
HYSYS.RTO+ Example
A-19
Figure A.16
A-19
A-20
A-20
Index
B
Bnd
See also ESTIM DRU
iteration output
C
Central difference interval
See also ESTIM DRU
initial problem parameters
COLD start
See also ESTIM DRU
initial problem parameters
Collection Utilities 2-6
constraints/objective function 2-10
creating 2-9
data reconciliation 2-6
derivative 2-6
derivative analysis 2-10
independent variables 2-10
structural non-zeroes 2-10
Cond H
See also ESTIM DRU
iteration output
Cond Hz
See also ESTIM DRU
iteration output
Cond T
See also ESTIM DRU
iteration output
Conv
See also ESTIM DRU
iteration output
Crash tolerance
See also ESTIM DRU
initial problem parameters
D
Data Recon
heat exchanger 6-3
Data Recon Utility 6-1
DCS tag selection 6-12
DCS Tag terminology 6-4
DCS Tags 6-3
I-1
I-2
I-2
L
Lagr Mult
See also ESTIM DRU
final output
Lin
See also ESTIM DRU
iteration output
Linear constraints
See also ESTIM DRU
initial problem parameters
Linear feasibility
See also ESTIM DRU
initial problem parameters
Linesearch tolerance
See also ESTIM DRU
initial problem parameters
Lower Bound
See also ESTIM DRU
final output
M
Majits
See also ESTIM DRU
final output
Major iterations limit
See also ESTIM DRU
initial problem parameters
Major print level
See also ESTIM DRU
initial problem parameters
Minor iterations limit
See also ESTIM DRU
initial problem parameters
Minor print level
See also ESTIM DRU
initial problem parameters
Model updating 5-9
N
Ngrad
See also ESTIM DRU
final output
Nonlinear constraints
See also ESTIM DRU
initial problem parameters
Nonlinear feasibility
See also ESTIM DRU
initial problem parameters
Index
I-3
I-3
I-4
I-4