Professional Documents
Culture Documents
For any question on the Aspen Adsorption training please send us a message via
Telegram channel:
@aspenadsorptiontraining
or discussion group:
@aspenadsorptiontraining2
or:
yadollahtavan@gmail.com
“Introduction to estimation”
Example number # V
1
Mass Transfer Coefficient (MTC) estimation example
“Introduction to estimation”
Estimation of Nitrogen and Oxygen mass transfer coefficients using measured data from a
breakthrough run.
• Vertical adsorption
2
Ultimate Flow-sheet
Product
3
Introduction to Estimation
Estimation is used when you need to fit a model to a set of experimental or actual process
data. You can use estimation for both steady-state and dynamic simulations. The model is
fitted by finding the appropriate values for the estimated parameters. A special run class
is provided with the Aspen Modeler product to allow the estimation of adjustable
parameters. The elements of an estimation simulation are:
o Experimental data, which you define using the Estimation tool or scripting
o Regressed parameters (variables), which are selected using the Estimation tool or
scripting
4
About Parameter Estimation Methods
This situation is not common and it is usually not possible even to know if or when
the above criteria are satisfied. Hence, an appropriate choice of method must be made.
If you have some idea of the error in the measurements, then the Weighted Least
Squares method is appropriate, otherwise the Maximum Log Likelihood method is
preferred.
For more information on the two methods available for solving a parameter estimation
problem, see the Solver Options Reference.
5
Estimation (The Least Squares method)
The Least Squares method minimizes the weighted absolute squared error between the
observed and predicted values of the measurements. You should set the weights of the
measured variables to be the reciprocal of the standard error (if they are known) of the
observations.
Given the process model and the experimental measurements, using the least squares
method to solve your parameter estimation problem determines the values of the
parameters θ which solve the following minimization problem:
subject to θL ≤ θ ≤ θU, where zj(tijk) are calculated (or predicted) by solving the model
equations (1) and (2) with the inputs u and initial conditions corresponding to dynamic
experiment i.
The weights wijk and wij (the product of experiment and measurement weights) are user-
specified and reflect the importance of, or confidence in, the corresponding experimental
measurement.
The lower and upper bounds θL and θU serve to keep the parameters within physically
realistic and/or mathematically acceptable limits.
6
Estimation (Likelihood method)
The Maximum Log Likelihood method maximizes the log of the likelihood function of
the predicted and observed values. When the log of the likelihood function (and hence the
likelihood function itself since log is a monotonically increasing function) is maximized,
the probability of obtaining the given set of measurements from the estimated variables is
maximized. This corresponds to getting the best fit of your measurements.
The likelihood function used takes into account the standard error of the observations by
using a heteroscedasticity parameter for each unique measured variable. The
heteroscedasticity parameter has range 0 to 2:
0 corresponds to the error in the measurements being independent of the values of the
measurements (constant absolute error)
2 corresponds to the error in the measurements being proportional to the values of the
measurements (constant relative error).
You can fix the value of the heteroscedasticity parameters (if you know suitable values
for them) or ask the method to compute them automatically during maximization of the
log likelihood function. This method is particularly useful if you have no idea of the
errors in the measurements.
Given the process model and the experimental measurements, using the maximum log
likelihood method to solve your parameter estimation problem seeks to determine the
values of the parameters θ (and optionally the heteroscedasticity parameters γ of your
measurements) to solve the following maximization problem:
ni = The total number of measurements over all experiments for measured variable i.
7
About Experimental Data
A dynamic experiment is defined by specifying the time variation of the input variables u(t) and a
consistent initial condition for the given mathematical model. At various times t>0 during the
experiment, measurements (or observed values) are taken of a subset z of x and/or y. Note that the
variables being measured are not necessarily the same for different times t.
Let the total number of dynamic experiments be Ndyn; the dimension of z, that is, the number of
unique variables z(j), of x or y which have been measured over all the experiments be Nmeas; and the
number of measurements of z(j) in experiment i be Mij.
ẑijk denotes the kth measurement of variable z(j) in experiment i. It is a measurement of zj at time tijk.
A steady-state experiment is simply a special case of the a dynamic experiment, with inputs u=
constant, for all t≥0 and the initial conditions ẋ = 0. They involve a single measurement only of a
subset z of variables x and/or y. Let NSS be the total number of steady-state experiments.
8
Define Steady-State Estimation Experiments
To define a new steady-state estimation simulation:
1. In the Estimation dialog box, click the Steady-State Experiments tab and click New.
2. To display details of the experiment, click the Edit button or double-click the experiment
name.
3. You can now:
o Add or remove Measured or Fixed variables
o Change the weight, value and units for each experiment variable by selecting
them on a table. Measured variables which are fixed are shown as reconciled.
o Change the experiment weight and activity.
o Associate a snapshot or result with the experiment.
After a successful Estimation run, the Predicted Value, Absolute Residual, % Residual,
and Standard Residual for each steady-state Measured Variable is displayed on the table.
9
Estimation Data Entry
Changing variable values at existing time
This is done by selecting the cell to edit, typing in a new value, pressing the Enter key, using the arrow
keys to move to an adjacent cell or clicking elsewhere on the table.
Time values are entered in the units displayed beneath the time header. These can be changed on
the Run Options dialog in the display time units’ field.
If the new time value is the same as an existing one then the change will be rejected because you are
not allowed to have two time points at the same time for a variable.
The table is not automatically sorted when a time value is edited as you may still have incomplete rows
from a previous Insert. If you wish to force the table to re-sort you can click in the header cell for the
Time column. Note: Any rows that do not have a time and at least one variable value will be lost.
Any inserted rows that do not have a Time and at least one variable value will be lost if you re-sort the
table by a click on the Time header cell. If you attempt to exit from the dynamic experiment tables
using the Done button and you have incomplete rows you will be prompted to see if you wish to
continue.
Clearing Contents
You can clear values from the estimation table using either the context menu or the Delete key. Data is
not placed on the clipboard.
10
• If you have a single variable value selected the value is cleared.
• If you have a variable column selected all values for that variable are cleared.
• If you have a complete row selected all values at that time for all variables will be removed.
This results in the time point also being completely removed.
• If the whole table is selected then all values for all variables are removed.
• If a whole row has been selected you can also use the Remove button to remove the time
points and values.
Selection Options
The tables allow the following selection options. These allow a single command such as clear contents
to be applied to several cells. The context menu available when multiple cells are selected indicates
what commands are available.
To select do this
this
A single cell Click in a cell.
Multiple Click in the start cell and drag to the finish cell or click in the start cell, hold the Shift key
cells and click in the finish cell. All cells in the range are selected.
A single Click in any variable header cell and the whole column is selected.
column Note: Clicking in the Time header cell causes the table to be re-sorted. This is useful
when rows have been inserted.
A single row Click in the cell in the header column on the required row. All values in the row are
selected, including the time value.
The whole Click in the top left cell. All values in the table are selected.
table
Copy Copies the selected values from the estimation table to the clipboard.
11
This does this
command
Paste Adds value(s) from the clipboard to the estimation table. See Pasting Estimation Data
from Excel.
Insert Adds a blank row above the current selection so that new values can be added.
Remove Removes the variable or time point for the current selection from the estimation.
• If a complete column is selected all rows including the headers are copied to the clipboard.
• If a complete row is selected all items in that row are copied to the clipboard including the
blank value in the row header column.
• If the whole table is selected then all rows and columns are copied to the clipboard including
headers.
If you have measured data for a single variable that includes weights you can paste it from a
spreadsheet application such as MS Excel using this dialog. You can paste columns of values using
standard cut-and-paste or drag-and-drop methods, or alternatively you can use Paste Special if you
want to select or edit rows.
12
If you paste then
A single The values in the currently selected column will be overwritten, unless you paste to
column theTime column, in which case new time points are created after deleting the selected time
points.
Multiple New time points are created, assuming the first column is Time, the second from last
columns the Measure value, and the last Weight. Intervening columns are ignored.
Tip: If you are pasting from Excel, you can use the CTRL key to select multiple non-adjacent columns, but
ensure the Time column is on the left and the values and weights (optional) are on the right of the selection.
You can also select Paste Special from the context menu available over the dynamic data grid. This brings
up a dialog allowing you to select which rows of data are to be used and to adjust the experiment data
times.
13
Pasting Estimation Data from Excel
Experimental data from an Excel spreadsheet may be added to the estimation table by selecting the
required data in Excel and using the Paste command in either the measured or fixed tab. The behavior
of the paste depends on the current cell in the table. The paste command is available from the Edit
menu, the context menu for the table and using the ctrl V key combination.
If data is pasted into a variable value cell the data will be pasted from that location into the following
rows and columns. No rows or columns will be added.
If the data is pasted into a time cell, or any header, a mapping dialog is presented allowing you to
indicate which variable or time values should be mapped with which column in the pasted data. In this
case the current table cell is ignored.
All data added to the table using paste is added using the current units of measure shown at the top of
the column in the estimation table. If any time values in the pasted data coincide with existing time
values these will be overwritten with the pasted data.
Blank cells in the pasted data are considered to mean that this variable has no value at this time point. It
does not mean that this cell will be ignored. When pasting data into the table when it already contains
data it is possible to delete variable values by overwriting them with a blank value.
Paste Mapping
This dialog lets you decide on the destination of the pasted columns of data as well as selection criteria
on which rows are to be included.
14
By default, the pasted data columns are mapped in order with the columns in the estimation data grid.
You can change this by selecting an item in the clipboard variable column. A combo-box then drops
down that allows you to select from any column in the pasted data. A blank entry indicates that no data
will be pasted for that variable. When all columns are mapped correctly click OK. It is also possible to
select the same clipboard variable multiple times. This lets you paste the same data in for different
estimation variables.
The data supplied is placed in the estimation table according to the mapping specified.
You can use the other fields to modify and select the data pasted.
Shift time to start at subtract the smallest time value encountered from all time values.
zero
Skip every value skip rows of data according to the frequency given.
Include last row ensure that the last row is copied even if the skip or fir into values would
otherwise miss it out.
Replace all existing delete all values for the mapped estimation variables before pasting.
values
15
Solvers for Estimation
The following table details the solvers available for Optimization and Estimation.
Optimization solvers
Reduced space optimization is where only the additional constraint equations (inequalities and
equalities) in the flowsheet constraints section are handled by the optimization solver. The remaining
flowsheet equations are solved at each value of the optimization variables (decision, initial and control)
separately by steady state or dynamic simulations.
Full space optimization is where both the additional constraint equations and all flowsheet equations
are simultaneously handled by the optimization solver. It can only be used for steady state
optimization.
The Open NLP interface enables you to interface your own solver. To use an Open NLP solver, on
the Optimizer tab of Solver Options, select the Open NLP optimizer type, then enter the path and file
name of the solver DLL, excluding the DLL file extension, in the Open NLP solver dll box . For
example, D:\My Simulations\myestimator
16
Estimation solvers
SRQP, NL2SOL, FEASOPT, Nelder-Mead, and HYPSQP are built in solvers supplied with ACM.
The Open NLP interface enables you to interface your own solver. To use an Open NLP solver, on
the Estimator tab of Solver Options, select the Open NLP solver type, then enter the path and file
name of the solver DLL, excluding the DLL file extension, in the Open NLP solver dll box . For
example, D:\My Simulations\myestimator
17
Access Results of Estimation Simulations
To obtain results from Estimation simulations:
Steady-state Measured variables, predicted values and Measured Variables tab for each steady-
residuals state experiment
18
Values of Variables for Estimation Simulations
If the estimation simulation converges:
• All variables except those estimated are reset to their values at the start of the simulation
• Estimated variables take their final converged values that fit the measured data
If the simulation fails to converge or is interrupted, then the values of the variables depend on the
simulation status, as follows:
Interrupted All variables take their current unconverged values from the solvers at the point
of interrupt.
19
The required data are given in the following:
Number of nodes 20
20
Table 2. Feed properties
Property Value
Composition mol %
N2 0.79
O2 0.21
Property Value
21
Bulk density (kg/m3) 592.62
N2 Unknown
O2 Unknown
Initial guess
0.04 (1/s)
for N2 and O2
22
Table 5. Isotherm parameters (IP)
Component Value
23
1
Mole fraction
0.8
0.6
0.4 N2
0.2 O2
0
0 500 1000
Time
Figure i: Breakthrough curve for MTC estimation
0 1 0
60 0.9865 0.0135
24
Objective:
References to read:
I assume you have read the following books and familiar with adsorption principles
I-Yang, R.T., 1987. Gas separation by adsorption processes. World Scientific Publishing
Company, Boston.
II-Ruthven, D.M., 1984. Principles of Adsorption and Adsorption Processes. John Wiley
& Sons, NewYork.
25
Start of simulation
Run the simulation software, we here using Aspen Adsorption version 10, as indicated in Figure
1.
Overview of simulation:
Steps:
❑ Define estimation
❑ Execute
26
After starting the software, click on” Component list” in the Exploring-simulation section, then
click on” Configure Properties” to add components to the simulation, according to Figure 2.
A new page entitled “Physical Properties Configuration” will be observed as shown in Figure 3.
In order to add component list, we may “Use Aspen properties system” and then click on “Edit
using Aspen properties” icon. Then wait till when Aspen properties launches on your screen.
-If you have an already Aspen properties component file, you may use “Import Aspen properties
file.”
According to Figure 4, we add “N2, O2” in the “Component ID” as given in Figure 5. Then click
on “Next” icon on top of page.
27
Figure 3. Selecting “Aspen properties”
28
Figure 5. Defining components in “Aspen properties”
29
Figure 7. Defining the ideal gas property model in “Aspen properties”
Since, all properties of components are available (as given in Figure 7), you can click on “Next”
or “Run” icons. Here, we click on “Run”. Figure 8 shows that “Results available” and now we
can proceed.
30
Figure 8. Results available in “Aspen properties”
Now, click on Aspen Adsorption file, and press “OK” as shown in Figure 9. The program closes
“Aspen Properties” software and only “Aspen adsorption” file presents on screen.
If “Aspen Properties” software does not close, click on “Aspen Properties” software and press
“Yes” on the observing icon, as shown in Figure 10.
31
Figure 9. Pressing “OK” in “Aspen Adsorption”
32
Figure 11. Selecting components into “Aspen Adsorption”
33
Now, click on “Libraries” in “exploring simulation” page, then click on “Adsim” then click on
“Gas_Dynamic” as shown in Figure 13. In our flowsheet, we need to add “gas_feed”,
“gas_bed”, “gas_valve” and “gas_product” into “process flowsheet window”. For example,
click on “gas_feed” and drag it into the “process flowsheet window”. Figure 14 shows that all
equipments are added into the “process flowsheet window”. To connect the equipments, click on
“stream Types” and then “gas_Material_Connection”, drag it into the “process flowsheet
window” and connect it.
34
Figure 13. Selecting equipments in the “Aspen Adsorption” software
35
Figure 14. Adding equipments into the “process flowsheet window”
36
Figure 15. Adding gas connections into the “process flowsheet window”
37
Then click on “B1” and then click on “Specify” and add all properties of feed stream as given in
Figure 16. Please note that, all properties of feed stream are given, so, set “spec” for all
properties as “fixed” using radio bottom.
Figure 16. Adding properties of block “B1” as feed into the “process flowsheet window”
Then click on “B3” and then select “specify” and then add the properties as given in Figure 17.
Please note that we are aimed to have 0.79 N2 and 0.21 O2 (mole fraction) at output of software.
Moreover, we have set outlet pressure “spec” as “free” to be calculated via pressure model.
38
Figure 17. Adding properties of block “B3” as feed into the “process flowsheet window”
By clicking on “B4” and left unchanged the items in “gas_valve”, according to Figure 18, the
“Specify” option is pressed and “B4.Specift Table” will appear. Since the feed flow rate is fixed
at 1e-6 kmol/s, the valve “active_specification” of “3” is chosen and feed flow rate is provided.
Figure 18. Adding properties of block “B4” as inlet valve into the “process flowsheet
window”
39
By clicking on “B5” and left unchanged the items in “gas_valve”, according to Figure 19, the
“Specify” option is pressed and “B5.Specift Table” will appear. Since no information is provided
for this case, the valve “active_specification” is selected as “1” in order to fully open of this
valve towards product stream.
Figure 19. Adding properties of block “B5” as outlet valve into the “process flowsheet
window”
Then double click on “B2”. The gas bed has one layer, vertical and 1-D. Therefore, no changes
are required. As Figure 20 shows, we click on “Configure” to show up “Configure Block/stream
B2.layer(1)”.
Figure 20 shows that “UDS1” has been chosen as default for Discretization method with 20
nodes.
40
Figure 20. Adding properties of block “B2” as gas bed into the “process flowsheet window”
41
In “Material/Momentum Balance” page, “Convection only” is used for material balance
assumption and the Karman-Kozeny equation is used for momentum balance assumption, as
given in Figure 21. In the “Kinetic model” page, the “Solid” is selected for film model
assumption and “Lumped resistance” for “kinetic model assumption” with “linear” form of
lumped resistance model with “constant” form of mass transfer coefficient.
Figure 21. Adding properties of momentum balance and kinetic model into the “configure
block”
42
Figure 22 shows that the “Extended Langmuir I” with “Concentration” based for isotherm
dependency is selected. Moreover, “Isothermal” condition is used for energy balance
assumption. After that, we click on “specify” on right side of page to introduce gas bed
properties.
Figure 22. Adding properties of isotherm and energy balance into the “configure block”
43
Then, all properties of bed should be introduced to the software as given in Figure 23.
Figure 23. Adding properties of gas bed into the “specify table”
Due to nature of dynamic properties of Aspen adsorption software, we then need to introduce
initial conditions for gas bed according to Figure 24. The gas bed is assumed to be filled with
pure N2 and zero O2 (mole fraction). Then we click on “Initialize” bottom to evaluate the
entered data, as shown in Figure 25.
44
Figure 24. Adding initial conditions of gas bed into the “Initials_YVWC table”
After evaluation of data, we are observing that the green box will not appear as shown in bottom
of Figure 26. By double click on red icon the “Specification status” in Figure 27 shows that
45
one fixed variable is under specified. Accordingly, we should provide one more fixed variable.
Figure 28 shows that by clicking on “B3”, and then “Specify”, the “spec” of pressure in product
is changed to “fixed” variable and is set to “1.2” bar. Figure 29 shows appearing of the green box
on screen.
46
Figure 27. Simulation status shows that one fixed variable is underspecified
47
Figure 29. Appearance of green box on simulation status
Then, Figure 30 depicts that the run mode is changed to “Initialization” and by pressing an
Error appears. The error says that “Initialization failed at time 0”, implying that some data is
given in wrong-way. In order to resolve this error, we should re-check all input data to find the
wring data. As you may recall, the “model type” of valve in “B4” is set “reversible flow setter”
(see Figure 28), hence, Figure 30 shows that change in model type of “B4” to “Non-reversible”.
By re-running the simulation, Figure 31 shows that the simulation is ready for adsorption.
48
Figure 30. Appearance of error in simulation and relevant modification
49
Figure 31. Appearance of error in simulation and relevant modification
50
Save your file!
51
Before executing the software, click on “Run” and then “Run options” and select the software to
be “pause at” 8000 s, and press OK (according to Figure 32).
52
Now, change the run mode, into “Dynamic” and press run bottom till 8000s, then a box of “Run
complete” will appear on screen (as shown in Figure 33).
53
Estimation
Firstly, we should check the solver using in Estimation module via Figures 34 and 35.
54
Figure 35. Choosing the Least square method for estimation
In the top icons of the software, we select “estimation” through Figure 36. In the appearing
window, one the “estimated variables”, one should select MTC’s of N2 and O2 using “Find”
bottom, accoroding to Figure 36. In the place of “Find in”, we select “B2.layer(1)” and by
pressing “Find” bottom, “B2.layer(1), MTC(“N2”)” and “B2.layer(1), MTC(“O2”)” are dragged
and dropeed on the left page.
55
Figure 36. Selecting MTC’s on “Estimated variables”
56
Now, in the “dynamic experiments”, the “New” bottom is clicked according to Figure 37.
Here, we should select “B3.Y_Fwd(“N2”)” and “B3.Y_Fwd(“O2”)” and drag&drop them onto
the right page given in Figure 38.
57
Figure 38. Selecting measured variables for estimation
58
So, the data given in Table 6 are pasted into “Measured variables” and “Done” is pressed. After
completing this step, Figure 39 shows that “Close” is selected.
Figure 39. Pasting the breakthrough curve data into “measured variables” page
59
Now, the run option is changed to “Estimation” and the run bottom is pressed till “The run has
completed” page appearing on the screen as shown in Figure 40.
Figure 40. Changing run mode to estimation and executing the simulation
One can observe new estimated MTC’s on the B2 block, as given in Figure 41.
60
Now, “Re-start” the simulation and set the run mode as “Initialization” and save your file.
61