Presented in this short document is a description of what is called Advanced Process Monitoring (APM) as described by Hedengren (2013). APM is the term given to the technique of estimating unmeasured but observable variables or "states" using statistical data reconciliation and regression (DRR) in an off-line or real-time environment and is also referred to as Moving Horizon Estimation (MHE) (Robertson et. al., 1996). Essentially, the model and data define a simultaneous nonlinear and dynamic DRR problem where the model is either engineering-based (first-principles, fundamental, mechanistic, causal, rigorous) or empirical-based (correlation, statistical data-based, observational, regressed) or some combination of both (hybrid).
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Â
Advanced Process Monitoring IMF
1. Advanced Process Monitoring
Industrial Modeling Framework (APM-IMF)
i n d u s t r IAL g o r i t h m s LLC. (IAL)
www.industrialgorithms.com
July 2013
Introduction to Advanced Process Monitoring, UOPSS and QLQP
Presented in this short document is a description of what is called Advanced Process Monitoring
(APM) as described by Hedengren (2013). APM is the term given to the technique of estimating
unmeasured but observable variables or "states" using statistical data reconciliation and
regression (DRR) in an off-line or real-time environment and is also referred to as Moving
Horizon Estimation (MHE) (Robertson et. al., 1996). Essentially, the model and data define a
simultaneous nonlinear and dynamic DRR problem where the model is either engineering-
based (first-principles, fundamental, mechanistic, causal, rigorous) or empirical-based
(correlation, statistical data-based, observational, regressed) or some combination of both
(hybrid). Figure 1 depicts a very simple flowsheet problem with a continuously-stirred tank
reactor (CSTR) configured as a black-box in our unit-operation-port-state superstructure
(UOPSS) (Kelly, 2004a, 2005, and Zyngier and Kelly, 2012) taken from Henson and Seborg
(1997).
Figure 1. Simple CSTR Problem with One Reaction of Component A to B.
2. The single rectangular box with the cross-hairs is a "continuous-process" type of unit-operation
which can be of the "black-box" subtype and for this simple model has no in or out-ports given
that there is no explicit exchange of substances or resources. Black-boxes allow adhoc, custom
or user formula to be configured for the unit-operation where the variables referenced inside the
expressions are what we call "conditions". Each formula can be any nonlinear function of
conditions and "coefficients". Conditions represent operating or processing conditions such as
severity, temperature, pressure, etc. where coefficients refer to reaction frequency factors,
catalyst activities, activation energies, heat capacities, gas constants, etc. or other physical,
thermodynamic, hydraulic or kinetic properties and can be either fixed or variable. If variable,
then these may estimated or fitted from the data similar to parameter estimation or weighted
least-squares regression although we extend this to also use data reconciliation which is
identical to Error-in-Variables (EiV) regression (Kelly, 1998).
For this small CSTR example, there is one chemical reaction of component A to B where the
nomenclature is found in Figure 1. This model is both dynamic and nonlinear where the
concentration of A is found in equation (1) in difference form and the reactor temperature is
found in difference equation (2) below.
V * Ca[0] = V * Ca[-1] + q * dt * (Caf - Ca[0]) - V * k0 * dt * Ca[0] * EXP(-EoverR / T) (1)
rho * Cp * V * T[0] = rho * Cp * V * T[-1] + q * dt * rho * Cp * (Tf - T[0]) + k0 * dt * V * mdelH * Ca
* EXP(-EoverR / T[0]) + UA * dt * (Tc - T[0]) (2)
where "dt" is the time-period duration or sampling interval and [0] and [-1] are the time lags or
delays in the present and past. We use simple Euler's method to convert the ordinary
differential equations into simple algebraic equations that can be solved using optimization
techniques. Euler's method is very practical and effective where others may use orthogonal or
spline collocation. Although collocation on finite elements is more parsimonious, Euler's method
is easy to understand and implement and when used with sparse matrix solvers can be
numerically competitive as well. These types of engineering equations are also known as
"lumped" models where "distributed" models include spatial, axial, radial, longitudinal, etc.
independent dimensions other than time which can be similarly converted to algebraic form
using collocation on finite elements.
Industrial Modeling Framework (IMF), IMPRESS and SIIMPLE
To implement the mathematical formulation of this and other systems, IAL offers a unique
approach and is incorporated into our Industrial Modeling and Pre-Solving System we call
IMPRESS. IMPRESS 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, Java (SWIG), C# or Python
(CTYPES) 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 and
KNITRO 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
3. solution and a post-solver called SORVE standing for Supplemental Observability, Redundancy
and Variability Estimator to estimate the usual DRR statistics found in Kelly (1998 and 2004a)
and Kelly and Zyngier (2008). 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 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 IMPRESS is called SIIMPLE (we hope literally) which is
short for Server, Interacter (IPL), Interfacer (IML), Modeler, Presolver Libraries and Executable.
The Server, Presolver and Executable are primarily model or problem-independent whereas the
Interacter, Interfacer 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, IMPRESS's standard Interacter, Interfacer
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 IMPRESS 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 LP 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 KIP,
LIP, SIP (constant, linear and monotonic spline interpolation) as well as user-written extrinsic
functions.
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 IMPRESS to formulate and optimize complex industrial
manufacturing systems in either off-line or on-line environments. Using IMPRESS 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
4. 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 IMPRESS 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.
Advanced Process Monitoring Synopsis
At this point we explore further the purpose of advanced process monitoring in terms of its
estimation and diagnostic capability. For this small CSTR example we focus our attention on
estimating the value and variance of the heat transfer coefficient times the reactor cooling
jacket's surface area (UA) for a snap-shot of time within its dynamic operation. The rationale for
this is to institute a monitoring program to periodically and accurately check the UA coefficient
and to determine if it is deteriorating to a point where the cooling jacket needs to cleaned and/or
back-flushed.
We have chosen to highlight a single snap-shot of simulated processing data with a 30-second
time-horizon and a sampling duration of 0.1-seconds resulting in 300 equally-spaced time-
periods. The temporal data was generated in IMPRESS by using the nominal UA value of
50,000 J/K/s and arbitrarily perturbing the jacket cooling temperature (Tc), feed flow (q), feed
temperature (Tf) and feed concentration (Caf) variables as shown in Figure 2 whilst recording
the reactor concentration (Ca) and its temperature (T) over time with no measurement or
process noise superimposed. For all other coefficients, default values are taken from Henson
and Seborg (1997).
Figure 2. Condition Time Profiles for a 30-second Horizon with 0.1-second Intervals.
To estimate the UA coefficient, both the independent and dependent variable profiles are
inputted into IMPRESS where the independent variable values are fixed and the dependent
variable values are minimized according to a weighted sum of squares objective function found
in any DRR problem. The raw standard deviations used as weights (i.e., weight = 1 / variance)
for the reactor concentration and temperature are 0.01 mol/m3 and 1.0 K respectively. Given
that no random nor systemic error was added to the data set, the DRR objective function is
5. 2.1x10^(-5) and the value and variance for the single UA parameter is 50,000.1 and 25,164.1
respectively. This translates into a standard error of SQRT(25,164.1) = 158.6 and using an
estimate of 2.0 for the Student-t statistic at 95% confidence yields an interval of 49,682.9 to
50,317.3 indicating that the UA parameter is estimated significantly. The SECQPE solver
required approximately 9 iterations which is typical of most DRR problems without appreciable
gross-errors and solved in less than 1-second.
In summary and albeit a hypothetical example, this demonstrates that time-varying data can be
used along with a nonlinear and dynamic model to fit observable parameters such as the heat
transfer coefficient times area (UA). Performing APM either separately on selected equipment
or simultaneously on several units is also possible and serves as a best practice approach to
monitoring your production or process on a regular basis.
References
Robertson, D.G., Lee, J.H., Rawlings, J.B., "A moving horizon-based approach for least-squares
estimation", American Institute of Chemical Engineering Journal, 42, 2209, (1996)
Henson, M.A., Seborg, D.E., "Nonlinear process control", Prentice Hall, New Jersey, (1997).
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, (2004a).
Kelly, J.D., "Techniques for solving industrial nonlinear data reconciliation problems",
Computers & Chemical Engineering, 2837, (2004b).
Kelly, J.D., Mann, J.L., Schulz, F.G., "Improve accuracy of tracing production qualities using
successive reconciliation", Hydrocarbon Processing, April, (2005).
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).
Hedengren, J.D., "Advanced Process Monitoring", http://apm.byu.edu/pubs/springer.pdf
(2013).
Appendix A - APM-IMF.IML File