Advanced Production Accounting of a Flotation Plant
1. Advanced Production Accounting of a Flotation Plant
Industrial Modeling Framework (APA-FP-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 Tin-Iron Flotation Plant found in Woollacott and Stange
(1987) where their “smoothing” algorithm used can be partially found in Hodouin (2010). 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 quantity and quality
bilinear DRR problem (Kelly, 2004b).
Figure 1a shows the Flotation Plant using names for the nodes and simple number indices for
its streams where Figure 1b depicts the same problem configured in our unit-operation-port-
state superstructure (UOPSS) (Kelly, 2004a, 2005; Zyngier and Kelly, 2012).
Figure 1a. Flotation Plant Flowsheet (Woollacott and Stange, 1987).
2. Figure 1b. Flotation 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 or transfers of materials
from one shape to another. This example and its flow and assay data are taken directly from
Woollacott and Stange (1987) as mentioned but is mapped to our UOPSS modeling framework
which includes only one time-period typically defined for one business or calendar day.
For this problem the configuration is as follows. There are nine (9) mass flows, six (6)
components in mass percent (representing the size distributions of >44.3, >30.2, >22.3, >15.8,
>12.4 and <12.4 micro-meters) and two (2) properties (tin and iron) in mass percent. The
components and properties are called assays in metallurgical accounting applications. Each
continuous-process unit-operation is configured as a blackbox subtype with a “%” character
suffixed (or prefixed) indicating that an overall quantity balance is applied (see Appendix A) and
each quality also has a “%” character suffixed (or prefixed) indicating that an overall quality
balance is to applied (see Appendix B). More details and discussion on these types of bilinear
data reconciliation problems can be found in Kelly (2004b).
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
3. (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,
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 Gnome Dia and Matplotlib modules respectively but other
prototypes embedded within Microsoft Excel/VBA for example can be created in a
straightforward manner.
4. 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.
Flotation 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 quantity and quality variables together including the
laws of conservation of matter (i.e., a mass, volume or mole basis). It interesting to quote a
recent trade magazine article on “metal accounting risks” (Lothian, 2012) regarding assessing
the accuracy of metallurgical balances: “attempting to achieve this without a statistical data
reconciliation engine is impossible”.
From our Table 1, taken directly from Woollacott and Stange (1987)’s Table I, all 9 stream
assays are measured where we use their Error Model 1 which applies a 10% standard error
uncertainty to all components and properties (i.e., the standard-deviation equals 0.10 times its
actual, raw or measured value). In addition, shown in their Table II are the measured flowrates
with estimates of their uncertainty.
Table 1. Flotation Plant’s Measurements (Woollacott and Stange, 1987).
5. After modeling and solving this bilinear DRR problem in twenty-five (25) iterations using IMPL’s
SECQPE, we arrive at a solution with an objective function of 8.92 which has a Hotelling
statistic of 21.66 at 95% confidence and 36 – 2 = 34 degrees-of-freedom indicating that no
gross-errors are present. There are thirty-six (36) equations (i.e., 4 nodes times (1 quantity + 8
qualities)), seventy-nine (79) measured variables of which all are declared to be redundant and
the two (2) unmeasured quantity or flow variables are declared to be observable for a total of
eighty-one (81) variables.
Unfortunately Woollacott and Stange (1987) do not report the objective function value of their
“smoothed” algorithm, which is somewhat similar to other well-known data reconciliation
algorithms except that it uses a hierarchical solution strategy briefly described in Hodouin
(2010). However, they present the solutions for several Error Models (except Error Model 1
which is the one we use) in their Table VII and our Table 2. Fortunately, our reconciled results
found in our Table 3 using Error Model 1 are relatively close to their smoothed results using
Error Models 2, 3, 4 and 5 which confirms that our model and data are consistent.
6. Table 2. Flotation Plant’s “Smoothed” Flow Results from Woollacott and Stange (1987).
Table 3. Flotation Plant’s Reconciled Flow Results from IMPL-SECQPE.
1. Feed 6.47
2. PyriteConcentrate 0.61
3. PyriteTailings 5.86
4. RougherFeed 11.48
5. ScavengerConcentrate 1.70
6. RougherConcentrate 4.03
7. FinalTailings 5.74
8. CleanerTailings 3.91
9. FinalConcentrate 0.12
In summary, we have highlighted the advanced production accounting of a small Flotation Plant
with both mass quantity and quality data and no statistically detectable gross-errors are present.
References
Woollacott, L.C., Stange, W., “Guidelines for the derivation of reliable material balances from
plant data”, Journal of South Africa Institute of Mining and Metallurgy, 87, 207-217, (1987).
Kelly, J.D., "Production modeling for multimodal operations", Chemical Engineering Progress,
February, 44, (2004a).
Kelly, J.D., "Formulating large-scale quantity-quality bilinear data reconciliation problems",
Computers & Chemical Engineering, 357-362, (2004b).
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).
7. Hodouin, “Process observers and data reconciliation using mass and energy balance
equations”, Chapter 2 in Advanced Control and Supervision of Mineral Processing Plants,
editors Sbarbaro, D., del Villar, R., Springer, (2010).
Zyngier, D., Kelly, J.D., "UOPSS: a new paradigm for modeling production planning and
scheduling systems", ESCAPE 22, June, (2012).
Lothian, K., “Is your business safe from metal accounting risks”, Global Mining,
www.energydigital.com, November, (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-FP-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,80
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Unit-Operation-Port-State-Superstructure (UOPSS) *.UPS File.
! (This file is automatically generated from the Python program IALConstructer.py)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&sUnit,&sOperation,@sType,@sSubtype,@sUse
Cleaners,Recleaners,processc,blackbox%,
Conditioner,,processc,blackbox%,
Feed,,perimeter,,
FinalConc,,perimeter,,
FinalTails,,perimeter,,
PyriteCircuit,,processc,blackbox%,
PyriteConc,,perimeter,,
Roughers,Scavengers,processc,blackbox%,
&sUnit,&sOperation,@sType,@sSubtype,@sUse
! Number of UO shapes = 8
&sAlias,&sUnit,&sOperation
ALLPARTS,Cleaners,Recleaners
ALLPARTS,Conditioner,
ALLPARTS,Feed,
ALLPARTS,FinalConc,
ALLPARTS,FinalTails,
ALLPARTS,PyriteCircuit,
ALLPARTS,PyriteConc,
ALLPARTS,Roughers,Scavengers
&sAlias,&sUnit,&sOperation
&sUnit,&sOperation,&sPort,&sState,@sType,@sSubtype
Cleaners,Recleaners,6,,in,
Cleaners,Recleaners,8,CleanerTails,out,
Cleaners,Recleaners,9,,out,
Conditioner,,3,,in,
Conditioner,,4,RougherFeed,out,
Conditioner,,5,,in,
Conditioner,,8,,in,
Feed,,1,,out,
FinalConc,,9,,in,
FinalTails,,7,,in,
PyriteCircuit,,1,,in,
PyriteCircuit,,2,,out,
PyriteCircuit,,3,PyriteTails,out,
PyriteConc,,2,,in,
Roughers,Scavengers,4,,in,
Roughers,Scavengers,5,ScavengerConc,out,
Roughers,Scavengers,6,RougherConc,out,
Roughers,Scavengers,7,,out,
&sUnit,&sOperation,&sPort,&sState,@sType,@sSubtype
! Number of UOPS shapes = 18
&sAlias,&sUnit,&sOperation,&sPort,&sState
ALLINPORTS,Cleaners,Recleaners,6,
ALLINPORTS,Conditioner,,3,
ALLINPORTS,Conditioner,,5,
ALLINPORTS,Conditioner,,8,
ALLINPORTS,FinalConc,,9,
ALLINPORTS,FinalTails,,7,
ALLINPORTS,PyriteCircuit,,1,
ALLINPORTS,PyriteConc,,2,
ALLINPORTS,Roughers,Scavengers,4,