Presented in this short document is a description of what we call "Advanced" Production Accounting (APA) applied to a small Olefins Plant found in Sanchez and Romagnoli (1996). APA is the term given to the technique of vetting, screening or cleaning the past production data using statistical data reconciliation and regression (DRR) when continuous-processes are assumed to be at steady-state (Kelly and Hedengren, 2013) i.e., there is no significant material accumulation. For this case, the model and data define a simultaneous mass or volume linear DRR problem. Figure 1a shows the Olefins Plant using simple number indices for both the nodes and streams where Figure 1b depicts the same problem configured in our unit-operation-port-state superstructure (UOPSS) (Kelly, 2004, 2005; Zyngier and Kelly, 2012).
Sparse Observability using LP Presolve and LTDL Factorization in IMPL (IMPL-S...
Advanced Production Accounting of an Olefins Plant Industrial Modeling Framework (APA-OP-IMF)
1. Advanced Production Accounting of an Olefins Plant
Industrial Modeling Framework (APA-OP-IMF)
i n d u s t r IAL g o r i t h m s LLC. (IAL)
www.industrialgorithms.com
August 2014
Introduction to Advanced Production Accounting, UOPSS and QLQP
Presented in this short document is a description of what we call "Advanced" Production
Accounting (APA) applied to a small Olefins Plant found in Sanchez and Romagnoli (1996).
APA is the term given to the technique of vetting, screening or cleaning the past production data
using statistical data reconciliation and regression (DRR) when continuous-processes are
assumed to be at steady-state (Kelly and Hedengren, 2013) i.e., there is no significant material
accumulation. For this case, the model and data define a simultaneous mass or volume linear
DRR problem. Figure 1a shows the Olefins Plant using simple number indices for both the
nodes and streams where Figure 1b depicts the same problem configured in our unit-operation-
port-state superstructure (UOPSS) (Kelly, 2004, 2005; Zyngier and Kelly, 2012).
Figure 1a. Olefins Plant Flowsheet (Sanchez and Romagnoli, 1996).
2. Figure 1b. Olefins Plant UOPSS Flowsheet.
The diamond shapes or objects are the sources and sinks known as perimeters, the rectangle
shapes with the cross-hairs are continuous-process units and as mentioned these units should
have a steady-state detection algorithm (SSD) installed to determine if the units are steady or
stationary. The circle shapes with no cross-hairs are in-ports which can accept one or more
inlet flows and are considered to be simple or uncontrolled mixers. The cross-haired circles are
out-ports which can allow one or more outlet flows and are considered to be simple or
uncontrolled splitters. The lines, arcs or edges in between the various shapes are known as
internal and external streams and represent in this context the flows of materials from one
shape to another. This example and its data are taken directly from Sanchez and Romagnoli
(1996) as mentioned but is mapped to our UOPSS modeling framework which includes only one
time-period typically defined for one business or calendar day.
3. Unfortunately, more detailed information on the types of unit-operations and the overall process
is not available. However, as can be seen from the flowsheet, the complexity of the Olefins
Plant network in terms of its stream inter-connectivity is quite involved and includes several
recycle streams or loops which poses no issue for our modeling and solving techniques.
Industrial Modeling Framework (IMF), IMPL and SSIIMPLE
To implement the mathematical formulation of this and other systems, IAL offers a unique
approach and is incorporated into our Industrial Modeling Programming Language we call IMPL.
IMPL has its own modeling language called IML (short for Industrial Modeling Language) which
is a flat or text-file interface as well as a set of API's which can be called from any computer
programming language such as C, C++, Fortran, C#, VBA, Java (SWIG), Python (CTYPES)
and/or Julia (CCALL) called IPL (short for Industrial Programming Language) to both build the
model and to view the solution. Models can be a mix of linear, mixed-integer and nonlinear
variables and constraints and are solved using a combination of LP, QP, MILP and NLP solvers
such as COINMP, GLPK, LPSOLVE, SCIP, CPLEX, GUROBI, LINDO, XPRESS, CONOPT,
IPOPT, KNITRO and WORHP as well as our own implementation of SLP called SLPQPE
(Successive Linear & Quadratic Programming Engine) which is a very competitive alternative to
the other nonlinear solvers and embeds all available LP and QP solvers.
In addition and specific to DRR problems, we also have a special solver called SECQPE
standing for Sequential Equality-Constrained QP Engine which computes the least-squares
solution and a post-solver called SORVE standing for Supplemental Observability, Redundancy
and Variability Estimator to estimate the usual DRR statistics. SECQPE also includes a
Levenberg-Marquardt regularization method for nonlinear data regression problems and can be
presolved using SLPQPE i.e., SLPQPE warm-starts SECQPE. SORVE is run after the
SECQPE solver and also computes the well-known "maximum-power" gross-error statistics
(measurement and nodal/constraint tests) to help locate outliers, defects and/or faults i.e., mal-
functions in the measurement system and mis-specifications in the logging system.
The underlying system architecture of IMPL is called SSIIMPLE (we hope literally) which is short
for Server, Solvers, Interfacer (IML), Interacter (IPL), Modeler, Presolver Libraries and
Executable. The Server, Solvers, Presolver and Executable are primarily model or problem-
independent whereas the Interfacer, Interacter and Modeler are typically domain-specific i.e.,
model or problem-dependent. Fortunately, for most industrial planning, scheduling,
optimization, control and monitoring problems found in the process industries, IMPL's standard
Interfacer, Interacter and Modeler are well-suited and comprehensive to model the most difficult
of production and process complexities allowing for the formulations of straightforward
coefficient equations, ubiquitous conservation laws, rigorous constitutive relations, empirical
correlative expressions and other necessary side constraints.
User, custom, adhoc or external constraints can be augmented or appended to IMPL when
necessary in several ways. For MILP or logistics problems we offer user-defined constraints
configurable from the IML file or the IPL code where the variables and constraints are
referenced using unit-operation-port-state names and the quantity-logic variable types. It is also
possible to import a foreign *.ILP file (row-based MPS file) which can be generated by any
algebraic modeling language or matrix generator. This file is read just prior to generating the
matrix and before exporting to the LP, QP or MILP solver. For NLP or quality problems we offer
user-defined formula configuration in the IML file and single-value and multi-value function
blocks writable in C, C++ or Fortran. The nonlinear formulas may include intrinsic functions
such as EXP, LN, LOG, SIN, COS, TAN, MIN, MAX, IF, NOT, EQ, NE, LE, LT, GE, GT and CIP,
4. LIP, SIP and KIP (constant, linear and monotonic spline interpolations) as well as user-written
extrinsic functions (XFCN). It is also possible to import another type of foreign file called the
*.INL file where both linear and nonlinear constraints can be added easily using new or existing
IMPL variables.
Industrial modeling frameworks or IMF's are intended to provide a jump-start to an industrial
project implementation i.e., a pre-project if you will, whereby pre-configured IML files and/or IPL
code are available specific to your problem at hand. The IML files and/or IPL code can be
easily enhanced, extended, customized, modified, etc. to meet the diverse needs of your project
and as it evolves over time and use. IMF's also provide graphical user interface prototypes for
drawing the flowsheet as in Figure 1 and typical Gantt charts and trend plots to view the solution
of quantity, logic and quality time-profiles. Current developments use Python 2.3 and 2.7
integrated with open-source Dia and Matplotlib modules respectively but other prototypes
embedded within Microsoft Excel/VBA for example can be created in a straightforward manner.
However, the primary purpose of the IMF's is to provide a timely, cost-effective, manageable
and maintainable deployment of IMPL to formulate and optimize complex industrial
manufacturing systems in either off-line or on-line environments. Using IMPL alone would be
somewhat similar (but not as bad) to learning the syntax and semantics of an AML as well as
having to code all of the necessary mathematical representations of the problem including the
details of digitizing your data into time-points and periods, demarcating past, present and future
time-horizons, defining sets, index-sets, compound-sets to traverse the network or topology,
calculating independent and dependent parameters to be used as coefficients and bounds and
finally creating all of the necessary variables and constraints to model the complex details of
logistics and quality industrial optimization problems. Instead, IMF's and IMPL provide, in our
opinion, a more elegant and structured approach to industrial modeling and solving so that you
can capture the benefits of advanced decision-making faster, better and cheaper.
Olefins Plant "Advanced" Production Accounting Synopsis
At this point we explore further the purpose of "advanced" production accounting in terms of its
diagnostic capability of aiding in the detection, identification and elimination of "bad" production
data where "bad" really implies inconsistent data. The major advantage of DRR is its ability to
use redundant data which is sometimes referred to as over-determined or over-specified
problems. The redundancy primarily occurs because of the inclusion of a model i.e., equations
or equality constraints relating all of the flow variables together including the laws of
conservation of matter (i.e., a mass, volume or mole basis).
Some of these variables are measured or reconciled, some are unmeasured or regressed while
others can be fixed or rigid. Measured variables include a raw and known (finite) variance, as
shown in Table 1, unmeasured variables have a large and unknown (infinite) variance and fixed
variables have no or zero variance. The DRR objective function is to minimize the weighted
sum of squares of the raw measurements minus its reconciled estimate where the weights are
simply determined as the inverse of its raw variance (Kelly, 1998; Kelly and Zyngier, 2008). At a
converged DRR solution using SECQPE we have estimates of the reconciled and unmeasured
or regressed variables and after running SORVE we have new variance estimates for the
reconciled and unmeasured or regressed variables as well as redundancy and observability
estimates for each measured and unmeasured variable respectively. Furthermore, using these
variances we can compute individual gross-error detection statistics for the measured variables
and equality constraints as well as confidence intervals for each unmeasured variable using the
Student-t tables to determine statistical threshold or critical values. In addition, we can also
5. compute a global or overall Hotelling statistic on the objective function value to detect if at least
one gross-error exists.
Table 1. Olefins Plant’s Measurements (Sanchez and Romagnoli, 1996).
After solving this linear DRR problem in two (2) iterations using SECQPE, we arrive at the same
solution as found in Table 1 with an objective function of 26.12 which has a Hotelling statistic of
3.94 at 95% confidence and 31 – 23 = 8 degrees-of-freedom indicating at least one gross-error
is present. There are thirty-one (31) equations (i.e., 31 nodes), twenty-nine (29) measured
variables and thirty-four (34) unmeasured variables for a total of sixty-three (63) variables.
SECQPE identifies that eleven (11) of the unmeasured variables are dependent leaving twenty-
three (23) independent variables (Sanchez and Romagnoli,1996; Kelly, 1998). And, of the 23
independent unmeasured variables only five (5) are observable or determinable (i.e., streams
24, 34, 35, 36 and 49). Unobservable variables cannot be uniquely determined from the model
and data or information provided and hence their values are unusable. In order to increase the
observability of the system, extra measurements would need to be installed on the process
(Kelly and Zyngier, 2008). The lack of observability also reduces the amount or degree of
redundancy in the system. A redundant measured variable means that if the measurement is
not available for some reason then it can be uniquely determined from the model and other
data.
Table 2. Olefins Plant’s Measurement Statistics.
6. Stream Statistic
1 -1.36E-01
2 -1.36E-01
7 -7.96E-01
8 7.96E-01
9 2.35E-01
12 -6.80E-01
13 -1.21E-01
14 -1.26E-01
15 -3.22E+00
16 -9.27E-01
17 -9.27E-01
18 -9.20E-01
19 -1.43E-01
20 1.71E+00
21 3.26E+00
22 1.71E+00
23 1.71E+00
25 -9.27E-01
26 -9.26E-01
27 4.29E+00
28 1.49E+00
29 1.49E+00
30 -1.17E+00
31 2.32E+00
32 2.33E+00
33 2.32E+00
37 3.59E+00
46 3.59E+00
53 3.59E+00
Table 2 displays the Student-t measurement statistics (sometimes called the maximum-power
statistic) with a critical or threshold value of 3.44 at 95% confidence. The violated
measurements are shown in bold with stream 27’s as the worst violator. If we remove or delete
stream 27’s measurement, by setting its objective function weight to zero (0) or setting its
variance to infinity, and re-solve with SECQPE, the objective function is now 7.74. This is
consistent with the well-known observation that the change in the objective function if we delete
one measurement is equal to the square of the statistic i.e., 26.124 – 4.29^2 = 7.72. Table 3
displays the new Student-t measurement statistics.
Table 3. Olefins Plant’s Measurement Statistics with Stream 27 Removed/Deleted.
7. Stream Statistic
1 -4.01E-02
2 -4.00E-02
7 -7.85E-01
8 7.85E-01
9 3.97E-01
12 -7.16E-01
13 -3.57E-01
14 -3.72E-01
15 2.50E-02
16 -2.12E-01
17 -2.12E-01
18 -2.11E-01
19 -9.05E-01
20 8.37E-01
21 -2.12E-01
22 8.36E-01
23 8.37E-01
25 -2.12E-01
26 -2.12E-01
27 N/A
28 -1.70E+00
29 -1.70E+00
30 -2.18E+00
31 7.45E-01
32 7.46E-01
33 7.46E-01
37 1.70E+00
46 1.70E+00
53 1.71E+00
As can be seen from Table 3, there are no individual measurement Student-t statistic violations
even though the objective function of 7.74 is greater that its Hotelling statistic threshold value.
At this point it is not possible to further detect and identify more gross-errors or defects in the
model and/or data.
In summary, we have highlighted the advanced production accounting of a small Olefins Plant
where the mass or volume data has at least one gross-error identified. At this point if we were
at site or in the field we would ask for the flow measurement on stream 27 to be re-calibrated
i.e., zero and spanned and then we would re-run the production accounting balance tomorrow
for example to see if stream 27’s flow is no longer suspect. This forms the basis of APA as an
intelligent problem solving or systematic troubleshooting methodology to help reduce variability
or uncertainty in your production data before it is used in planning and scheduling decision-
making i.e., you do not want to run your business on noise or bad data!
References
8. Sanchez, M., Romagnoli, J., “use of orthogonal transformations in data classification-
reconciliation”, Computers & Chemical Engineering, 20, 483-493, (1996).
Kelly, J.D., "A regularization approach to the reconciliation of constrained data sets", Computers
& Chemical Engineering, 1771, (1998).
Kelly, J.D., "Production modeling for multimodal operations", Chemical Engineering Progress,
February, 44, (2004).
Kelly, J.D., "The unit-operation-stock superstructure (UOSS) and the quantity-logic-quality
paradigm (QLQP) for production scheduling in the process industries", In: MISTA 2005
Conference Proceedings, 327, (2005).
Kelly, J.D., Zyngier, D., "A new and improved MILP formulation to optimize observability,
redundancy and precision for sensor network problems", American Institute of Chemical
Engineering Journal, 54, 1282, (2008).
Zyngier, D., Kelly, J.D., "UOPSS: a new paradigm for modeling production planning and
scheduling systems", ESCAPE 22, June, (2012).
Kelly, J.D., Hedengren, J.D., "A steady-state detection (SDD) algorithm to detect non-stationary
drifts in processes", Journal of Process Control, 23, 326, (2013).
Appendix A – APA-OP-IMF.UPS (UOPSS) File
i M P l (c)
Copyright and Property of i n d u s t r I A L g o r i t h m s LLC.
checksum,537
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Unit-Operation-Port-State-Superstructure (UOPSS) *.UPS File.
! (This file is automatically generated from the Python program IALConstructer.py)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&sUnit,&sOperation,@sType,@sSubtype,@sUse
0,,perimeter,,
1,,processc,blackbox%,
10,,processc,blackbox%,
11,,processc,blackbox%,
12,,processc,blackbox%,
13,,processc,blackbox%,
14,,processc,blackbox%,
15,,processc,blackbox%,
16,,processc,blackbox%,
17,,processc,blackbox%,
18,,processc,blackbox%,
19,,processc,blackbox%,
2,,processc,blackbox%,
20,,processc,blackbox%,
21,,processc,blackbox%,
22,,processc,blackbox%,
23,,processc,blackbox%,
24,,processc,blackbox%,
25,,processc,blackbox%,
26,,processc,blackbox%,
27,,processc,blackbox%,
28,,processc,blackbox%,
29,,processc,blackbox%,
3,,processc,blackbox%,
30,,processc,blackbox%,
31,,processc,blackbox%,
32,,perimeter,,
4,,processc,blackbox%,
5,,processc,blackbox%,
6,,processc,blackbox%,
7,,processc,blackbox%,
8,,processc,blackbox%,
9,,processc,blackbox%,
&sUnit,&sOperation,@sType,@sSubtype,@sUse