Aspen HYSYS SQP Optimization
Aspen HYSYS SQP Optimization
Aspen HYSYSTM SQP optimizer uses a steady state simulation of the process built using HYSYS software. There are a number of optimization algorithms in Aspen HYSYS. This document only focuses on the Hyprotech SQP method. This document provides information for the following: Those wishing to gain basic information about SQP optimization using Aspen HYSYS. Those requiring in depth knowledge in analysing the results from the optimization.
This guide covers the following main aspects of optimization: Configuring a derivative utility for a SQP optimizer, running the optimizer and viewing the results. Configuring a HYSYS spreadsheet to organize optimizer inputs and results. Performing derivative analysis and noise calculation to diagnose the optimizer setup. Analyzing the results to ensure that the optimizer recommendations are justifiable. Improving the optimizer predictions through analysis of derivative and reducing noise in the simulation. Using optimizer as a tool to perform What-If case studies exploring new strategies in design and process operation.
A simple Aspen HYSYS simulation is used to cover the topics listed above. It is assumed that the readers are familiar with the necessary steps required to build the optimizer in Aspen HYSYS. For further details please refer the following documents. 1. Aspen HYSYS Operations Guide - AspenHYSYSV7_0-Ops.pdf 2. Aspen HYSYS Real Time Optimization Reference Guide - AspenRTOV7_0-Ref.pdf These documents are supplied with the installation disks; alternatively the registered user can download these documents from AspenTech Support Centre at http://support.aspentech.com
1.0 Overview
1.1 Optimizer Configuration
The configuration of a SQP Optimizer is done via the Derivative Utility available within Aspen HYSYS. It is assumed that the readers are already familiar with the necessary steps require to build an optimizer using the derivative utility. Here it is intended to outline the main steps to refresh your understanding in this area. The mains steps are listed with relevant screenshots from the flowsheet. 1. Create a Derivative Utility and give an appropriate name for this utility (e.g., NGL Optimizer).
Figure 1.1: Derivative utility setup screen. 2. Define the scope of the optimizer. The scope can be selected as FlowSheet Wide if a generalized optimizer for the whole simulation is to be considered.
An optimizer has three main elements: Variable decision variables for the optimization that must be linked with inputs in the flowsheet. The variables can be included or excluded in an optimization by selecting the Optimize Flag. The values of the variables are manipulated in order to minimize or maximize the objective function. Each variable has maximum and minimum limits which are used to set the search range. The range can be user specified. If this is not given then optimizer calculate this as
(Minimum Scale)
Current Value
(Maximum + Scale)
The scale can be used as the accuracy of measurement, for example a scale of 1oC can be used for a process temperature of 100oC. Typical range is 1-5% of maximum limit. Sometimes a larger scale helps solving problems with non-linear relationships as the feasible region is expanded by the amount of the scale. However, one drawback is a non-feasible problem can give a false convergence. An optimization using a well constructed simulation should always give an optimum within the specified limits of the constraints. Objective function this is the function which is to be minimized or maximized. Individual objective function can be added separately and price of each specified. Alternatively, this can be built in a spreadsheet, with a single cell representing the results. By default the SQP optimizer works as a minimization algorithm. For a maximization problem the price term should be negative.
3. Add variables and specify their limits (minimum and maximum values). Give meaningful names for the variables.
4. Add constraints and specify their limits and scale. Give meaningful names for the constraints.
Figure 1.4: Optimizer constraint setup screen. 5. Add objective function terms and specify the prices.
Figure 1.5: Optimizer objective function setup screen. 6. Close the Derivative Utility page.
7. Open the optimizer page following the Menu bar, Simulation and Optimizer or simply using shortcut F5. The Hyprotech SQP and other optimization methods available in Aspen HYSYS are shown in the optimizer page (Figure 1.6).
Figure 1.6: Optimizer screen showing the options available in HYSYS. We will only consider the Hyprotech SQP method.
8. Select Hyprotech SQP. This will add a new tab named Hyprotech SQP. Select this tab and then click on Select Utilities to Run. The available Derivative Utilities will be listed here. Select the utility to run with this SQP optimizer.
9. Close the Select Utilities to Run window. Now the optimizer page with all the default parameters will be visible. The optimizer is now ready to start.
Figure 1.8: Overall results shown in the main optimizer screen. The optimizer results are displayed in Running Results section of the screen. A successful optimization displays one of the following messages in the Termination Reason field. OK This is based on the feasibility point search indicating that a feasible termination of this phase. Step convergence During the optimization search the stepping back procedure resulted in a step collapse to below the step tolerance.
Cost convergence Two successive iterations resulted in objective function value difference in less than the accuracy tolerance.
The benefits from the optimizer can be calculated from values shown in Starting Objective and Objective Value fields as Optimizer benefits = - (Objective Value Starting Objective) The results of the optimizer variables and constraints can be found in the Derivative Utility. This utility can also be accessed from the optimizer page by a mouse double-click on the optimizer item (in this case NGL Optimizer) located under Derivative Utility.
Figure 2.2: Spreadsheet containing power & utilities and their costs.
The variables and constraints can be imported from the optimizer objects to a spreadsheet. This provides a convenient method in performing benefits analysis using multiple what-if scenarios, for example The statuses of the variables can be switched ON or OFF The limits can be changed The current values for the variables can be specified The recommended values for variables and constraints are readily available Calculated benefits can be obtained
The screenshot given below (Figure 2.5) illustrates how an Aspen HYSYS spreadsheet can be put together with optimizer variables, constraints and objective function values.
Figure 2.6: Object navigation page for importing or exporting values in a spreadsheet. (4) Select the option Custom from the Object Filter (5) Select Optimization Object from the available list of Select Type
(6) There will be a list of all the optimization parameters. Now if, for example, you want the minimum limit value of a variable then select Optimizer Variable from the list, select the variable, Variable Property Value and min from Variable specific column.
The sign and size of the objective function gradient indicates the direction the variable should move during optimization. For maximization problem with a negative derivative value the optimizer variable favours a higher value and with a positive derivative value it favours a lower value.
The screenshot for derivative analysis inside the optimizer is shown in Figure 3.1.
There are two modes available for derivative calculation. 1-sided (forward):
dc c(v + v) c(v) = dv v
dc c(v + 0.5v ) c (v 0.5v) = dv v
2-sided (centered):
The noise can propagate throughout the flowsheet and convolute the gradient values. Inaccurate gradient produces erroneous optimizer results. In Aspen HYSYS simulation noise is attributed to the solver convergence tolerances in heat exchanger, recycle operation, column, adjust operation etc. The noise level can be reduced by tightening the convergence tolerance in these unit operations. This will be demonstrated in the following section.
Figure 4.1: Optimizer overall results with default tolerances for columns and LNG exchanger. The detailed results can be found in the spreadsheet shown in Figure 4.2. This screenshot shows the values of the optimizer variables, constraints and the calculated benefits by the optimizer. The calculated benefits is shown as 1.321e05 $/day.
Figure 4.2: Optimizer results with default error tolerances for columns and LNG exchanger. Now we see how the optimizer results can be explained in conjunction with the derivative values. A screenshot for the derivative values are shown below (Figure 4.3).
Figure 4.3: Derivative values with default error tolerances for columns and LNG exchanger.
How does the optimizer accomplish the benefit? The sign of the derivative values indicates the direction the variable should move to give a higher objective function value. For a maximization problem and with a negative derivative value, the variable favours a higher value subject to limits of the constraints imposed in the optimization problem. The opposite is expected for variables with positive derivative values. The move of variables can be compared with the sign of derivative values for the objective function (Daily Benefits). The expected and actual move in optimizer variables are presented in a table below. See Figures 4.2 and 4.3 for optimizer results and derivative values respectively.
Variable Chiller temperature Expander pressure DePropanizer feed pressure DeMethanizer C1 purity DeEthanizer C2 purity DeEthanizer reflux ratio DePropanizer C3 purity DePropanizer reflux ratio
Derivative Value (Figure 4.3) +ve -ve +ve +ve +ve +ve +ve -ve
Expected Value decrease increase decrease decrease decrease decrease decrease increase
Actual Value (Figure 4.2) decreased increased decreased increased decreased decreased decreased increased
This table shows that the variable, de-methanizer purity, did not move in the direction following the sign of the derivative value. The screenshot shown in Figure 4.4 shows the calculated noise associated with derivative calculations for this optimization. The noise level is possibly the contributing factor giving this inconsistent result.
Figure 4.4: Noise in derivative calculations using default tolerances for columns and LNG exchanger.
Tolerance terms LNG exchanger error HYSYS column default equilibrium error HYSYS column default Heat / Spec error
The optimiser was run with improved error tolerances and the overall results from the optimizer are shown in Figure 4.5. The optimizer setup parameters were unchanged.
Figure 4.5: Optimizer overall results with improved error tolerances for columns and LNG exchanger. The results for the variables, constraints and objective function values are in the spreadsheet in Figure 4.6. The calculated benefits is shown as 1.377e05 $/day.
Figure 4.6: Optimizer results with improved error tolerances for columns and LNG exchanger. The derivative values obtained with improved error tolerances are shown in Figure 4.7.
Figure 4.7: Derivative values with improved error tolerances for columns and LNG exchanger.
The move of optimizer variables are compared with the derivative values for the objective function (Daily Benefits). This is presented in a table below.
Variable Chiller temperature Expander pressure DePropanizer feed pressure DeMethanizer C1 purity DeEthanizer C2 purity DeEthanizer reflux ratio DePropanizer C3 purity DePropanizer reflux ratio
Derivative Value (Figure 4.7) +ve -ve +ve +ve +ve +ve -ve -ve
Expected Value decrease increase decrease decrease decrease decrease increase increase
Actual Value (Figure 4.6) decreased increased decreased decreased decreased decreased increased increased
This table shows that all the variables moved in the direction consistent with their derivative values. The absolute error in the derivative calculation is shown in Figure 4.8. Comparing this with Figure 4.4 (using defaults error tolerances) it can be seen that errors are significantly less when the tolerances are tightened.
Figure 4.8: Noise in derivative calculations using improved error tolerances for columns and LNG exchanger.
Figure 4.9: Optimizer case study results with higher duty limit for the de-methanizer reboiler. Now suppose the design engineer is interested to know the additional benefits by setting the o chiller temperature minimum limit of -75 C and maximum duty limit for the de-methanizer reboiler of 3600 kW. To calculate the additional benefits the optimizer was run from the base case (Figure 4.6). The results for this run are shown in Figure 4.10.
Figure 4.10: Optimizer case study results with higher duty limit for the de-methanizer reboiler and reduced lower limit for the chiller. With this new strategy the optimizer pushed the chiller temperature as low as -71.09 C and this is again constrained by de-methanizer reboiler duty. The additional benefit calculated by the optimizer with this new proposed operating scenario is $1.353e+04/day. These two examples illustrate how the optimizer can be used to perform What-If case studies. The design engineer can use this as a tool to study beyond current guidelines in place for process operation and undertake strategies for process improvement.
o