industrial flowsheet optimization and estimation (ifoe) using impl
DESCRIPTION
Symposium on Modeling & Optimization (https://www.informs.org/Attend-a-Conference/Conference-Calendar/APM-Webinar-Series-on-Optimization-Applications-and-Theory) February 18, 2014 (9:00am MST) Abstract Presented in this talk is an overview of how to model and solve industrial types of optimization and estimation problems which invariably require a flowsheet, network or superstructure to accurately represent their complexity. These types of problems involve maximizing both profit and performance in an integrated fashion and are difficult for several reasons i.e., they are large-scale, dynamic, mixed-integer, non-linear and non-convex. To manage the complexity of these problems we use our Industrial Modeling and Programming Language (IMPL) which is flowsheet-aware given our Unit-Operation-Port-State Superstructure (UOPSS) to model the structural or spatial objects (e.g., batch and continuous processes, pools, pipelines, pilelines, etc.) and our Quantity-Logic-Quality Phenomena (QLQP) to model the phenomenological and temporal details (e.g., densities, components, properties, conditions and coefficients). IMPL can be called from any computer programming language such as C, C++, C#, Java, Python, VBA, etc. where it has bindings to all commercial and community-based solvers such as CPLEX, GUROBI, XPRESS, GLPK, LPSOLVE, COINMP, SCIP, CONOPT, IPOPT, KNITRO, etc. Several examples are provided taken from the fields of advanced planning and scheduling (APS) as well as data reconciliation and parameter estimation (DRPE) to highlight the concepts.TRANSCRIPT
Industrial Flowsheet
Optimization and Estimation
(IFOE) using IMPL
Jeffrey D. Kelly
Industrial Algorithms LLC. “Better Data + Better Decisions = Better Business”
2/4/2014 Copyright, Industrial Algorithms LLC.
Agenda
• IAL Introduction
• What is IMPL?
• What is IFOE?
• Advanced Planning & Scheduling (APS)
• Advanced Performance Management (APM)
2
Our Mission
• To provide advanced modeling and solving
tools for developing and deploying industrial
applications in important decision-making
and data-mining areas.
• Our market is:
– Operating companies in the process industries.
– Consulting service providers.
– Application software providers.
3
Our Focus
• IAL develops and markets IMPL, the world’s
leading software for flowsheet optimization and
estimation in both off and on-line environments.
• IAL provides Industrial Modeling Frameworks
(IMF’s) for many problem types in various
process industries which provides a pre-project
or pre-solution advantage (head-start).
• IMPL is an “enabling technology” intended to
drive and accelerate your time-to-benefits.
4
Our Differentiator • Advanced Project Development/Deployment
(APD).
“To install and implement small projects with
significant payback v. installing and implementing
large projects/products with little or limited
payback.”
• This requires knowledge of your “bottlenecks”
and “backoff’s” and to target or converge on
these problem areas for Advanced Industrial
Applications (AIA).
5
Backoff’s = reducing actual capability for complexity, uncertainty, operational, organizational, etc. reasons.
Our Industrial Modeling and
Solving Platform (IMPL)
• IMPL stands for “Industrial Modeling &
Programming Language” and is our proprietary
platform.
– You can “interface”, “interact”, “model” and
“solve” any process-chain, supply-chain, demand-
chain and/or value-chain optimization problem.
• IMPL is suitable for:
– Advanced Planning & Scheduling (APS),
– Advanced Production Optimization (APO) and
– Advanced Performance Management (APM). 6
• Problems are configured/coded using “sheets”
for each “shape” either by:
– Interfacing with our flat-file Industrial Modeling
Language (IML), or
– Interactively with our Industrial Programming
Language (IPL) embedded in any computer
programming language such as C, C++, Fortran,
C#, Java, Python, Excel/VBA, etc.
– Data are keyed by our UOPSS shapes where the
attributes are specified using our Quantity, Logic &
Quality Phenomena (QLQP) including Time.
How do we configure/code
problems in IMPL?
7
How do we configure/code
problems in IMPL? (cont’d)
8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Constriction Data (Practices/Policies)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&sUnit,&sOperation,@rUpTiming_Lower,@rUpTiming_Upper
Blender,Crudeoil,3.0,
&sUnit,&sOperation,@rUpTiming_Lower,@rUpTiming_Upper
&sUnit,&sOperation,&sPort,&sState,&sUnit,&sOperation,&sPort,&sState,@rUpTiming_Lower,@rUpTiming_Upper
TK3,Crudeoil,o,,Pipestill,Fuels,i,,19.0,
TK4,Crudeoil,o,,Pipestill,Fuels,i,,19.0,
&sUnit,&sOperation,&sPort,&sState,&sUnit,&sOperation,&sPort,&sState,@rUpTiming_Lower,@rUpTiming_Upper
&sUnit,&sOperation,@rFillDrawDelaying_Lower,@rFillDrawDelaying_Upper
TK1,Light,9.0,
TK2,Heavy,9.0,
TK3,Crudeoil,3.0,
TK4,Crudeoil,3.0,
&sUnit,&sOperation,@rFillDrawDelaying_Lower,@rFillDrawDelaying_Upper
&sUnit,&sOperation,&sPort,&sState,@iMultiUse_Lower,@iMultiUse_Upper
Blender,Crudeoil,o,,1,1
Pipestill,Fuels,i,,1,1
&sUnit,&sOperation,&sPort,&sState,@iMultiUse_Lower,@iMultiUse_Upper
&sUnit,@sZeroDownTiming
Pipestill,on
&sUnit,@sZeroDownTiming
IML Frames (Sheets) in CSV Format
How do we configure/code
problems in IMPL? (cont’d)
9
IPL Functions (Subroutines) in Python (CTYPES) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Construction Data (Pointers)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
rtnstat = interacter.IMPLreceiveUO(uname,oname,utype,usubtype,uuse,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPS(uname,oname,pname,sname,ptype,psubtype,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPSUOPS(uname,oname,pname,sname,uname2,oname2,pname2,sname2,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOOG(uname,oname,ogname,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOGOGO(uname,ogname,ogname2,oname,IMPLkeep)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Capacity Data (Parameters)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
rtnstat = interacter.IMPLreceiveUOrate(uname,oname,lower,upper,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPSteerate(uname,oname,pname,sname,lower,upper,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPStotalrate(uname,oname,pname,sname,lower,upper,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPSyield(uname,oname,pname,sname,c_double(1.0),c_double(1.0),c_double(0.0),IMPLkeep)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Command Data (Provisos)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
rtnstat = interacter.IMPLreceiveUOsetupopen(uname,oname,c_double(1.),c_double(-2.),IMPLkeep)
rtnstat = interacter.IMPLreceiveUOsetuporder(uname,oname,lower,upper,begin,end,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPSUOPSsetuporder(uname,oname,pname,sname,uname2,oname2,pname2,sname2,lower,upper,begin,end,IMPLkeep)
rtnstat = interacter.IMPLreceiveUOPSholduporder(uname,oname,pname,sname,lower,upper,target,begin,end,IMPLkeep)
• IMPL has six (6) system architecture parts we
call SIIMPLE:
– Server, Interfacer (IML), Interacter (IPL), Modeler,
Presolver DLL’s and an Executable (the
executable can be coded in any computer
programming language that can call DLL’s/SO’s).
– Interfacer, Interacter and Modeler are domain-
specific whereas the Server, Presolver and
Executable are not i.e., they are domain-inspecific
or generic for any type of optimization and
estimation problem.
What is the system architecture
of IMPL?
10
• “Primal Heuristic” used intuitively and naturally
in industry for decades to find “globally feasible”
solutions to MINLP problems.
• “Conjunction Values” are time-varying
parameters which “guide” each sub-problem
solution where “cuts” (extra constraints) can
also be added to avoid known infeasible and/or
inferior areas of the search-space.
How do we converge/convert to
solutions in IMPL?
Quality (NLP) Logistics (MILP)
Lower, Upper & Target Bounds on Yields
Lower & Upper Bounds on Setups & Startups
Conjunction Values
11
12
How do we converge/convert to
solutions in IMPL? (cont’d)
• For NLP (quality) we have bindings to:
– CONOPT, IPOPT, KNITRO, XPRESS-SLP as well
as our “home-grown” SLPQPE.
– SLPQPE out-sources the matrix to 3rd-party LP/QP
solvers. If the objective function has quadratic
terms then a QP is called at each major iteration
(appropriate for data reconciliation & parameter
estimation, nonlinear control, etc.).
• For MILP (logistics) we have bindings to:
– COINMP, GLPK, LPSOLVE, SCIP, CPLEX,
GUROBI, LINDO and XPRESS.
Industrial Flowsheet Optimization
and Estimation (IFOE) • IFOE requires the following five (5) features:
(1) Unambiguous Representation of the Flowsheet,
Network or Superstructure (UOPSS).
(2) Semantic-Variables and Meta-Constraints (QLQP).
(3) Time Model with Automatic Digitization (Discretized
& Distributed-Time).
(4) Optimization and Estimation (Simulation)
Interoperability (Under/Over/Exactly-Determined).
(5) Data Quality Checking: Range, Rate-of-Change,
Stationarity, Clustering, Scoring, Balancing, etc.
13
How do we represent the
flowsheet? Perimeters – Supply/Demand Points or Sources/Sinks
Pools – Inventory or Holdup
Batch-Processes – Variable-Size & Fixed-Time (VSFT) or Fixed-Size & Variable-Time (FSVT)
Continuous-Processes – Blenders, Splitters, Separators, Reactors , Fractionators & Black-Boxes
Parcels – Moveable/Transportable Inventory or Holdup with Round-Trip Travel-Time
Pipelines – Moveable/Transportable Inventory as FIFO (First-In-First-Out)
Port-In – Flows into a Unit (similar to a nozzle).
Port-Out – Flows out of a Unit
Dimensional-Processes – Geometry Transforms (Reels, Rolls, Sheets, Ingots, Logs, etc.)
Pilelines – Stackable Inventory as LIFO (Last-In-First-Out)
14
• IMPL models the “logistics” (quantity & logic)
and “quality” (quantity & quality) sub-problems
independently but integrated.
– Quantity details:
– Flows, holdups, yields, etc.
– Logic details:
– Setups, startups, switchovers, shutdowns and sequence-
dependent switchovers, etc.
– Quality details:
– Densities, components, properties, conditions and
coefficients i.e., catalyst activity, enthalpy, etc.
How do we formulate the
variables and constraints?
15
* Similar to: Cires, Hooker & Yunes (July 2013)’s
Meta-Constraints & Semantic Typing *
• IMPL expects all data to be dynamic (time-
varying) and entered in continuous-time
(begin/end-times) as “orders”/“transactions”:
– Discrete-time:
– Common time-grid with equally-spaced time-points.
– Suitable for logistics optimization (MILP).
– Distributed-time:
– Common time-grid with unequally-spaced time-points.
– Suitable for quality optimization (NLP).
How do we digitize the problem
data?
16
• Same Model with Different Data:
– Optimization using Future Data.
– Estimation using Past/Present Data.
– Adapt, Tune, Fit, Update, Calibrate, etc. Parameters
similar to Moving Horizon Estimation (MHE).
• Quality of Data prior to Optimization/Estimation:
– Similar to pre-solving, “pre-screen” data for gross
inconsistencies such as limit violations, unsteady-
state behavior, unexpected operating regions,
imbalances in simple conservation laws, etc.
How do we manage
interoperability and data quality?
17 Kelly, J.D., Hedengren, J.D., “A Steady-State Detection (SSD) Algorithm to Detect Non-Stationary Drifts in
Processes”, Journal of Process Control, 23, 2013.
Advanced Planning and
Scheduling (APS) • IMPL supports both planning and scheduling
optimization problems handling both logistics
and quality details in a coordinated manner.
• IMPL uses “discrete-time” with “big” (planning)
and “small” (scheduling) time-buckets or time-
periods for logistics optimization.
• IMPL uses “discrete-time” and “distributed-time”
i.e., continuous-time/event-based using a global
or common time-grid for quality optimization.
18
Kelly, J.D., "Formulating Production Planning Models", Chemical Engineering Progress, January, 43, 2004.
Zyngier, D., Kelly, J.D., "Multi-Product Inventory Logistics Modeling in the Process Industries", In: W. Chaovalitwonse,
K.C. Furman and P.M. Pardalos, Eds., Optimization and Logistics Challenges in the Enterprise", Springer, 61-95, 2009.
Crude-oil Blend Scheduling
Optimization (CBSO-IMF)
19
Kelly, J.D., Mann, J.L., “Crude-Oil Blend Scheduling Optimization: An Application with Multi-Million Dollar Benefits”,
Hydrocarbon Processing, June/July, 2003.
Menezes, B.C., Kelly, J.D., Grossmann, I.E., “Improved Swing-Cut Modeling for Planning and Scheduling of Oil-Refinery
Distillation Units”, Ind. & Eng. Chem. Res., 52, 2013.
Fractionation of Crude-Oil Mix
into Several Cuts or Streams
Crude-Oil
Segregation
• Key logistics details …
– 3-h uptime (run-length) for blend header.
– 19-h uptime for tank-to-pipestill flows.
– 9-h fill-draw-delay (mixing-time) for storage tanks.
– 3-h fill-draw-delay for charge tanks.
– 1 flow-out at-a-time for the blend header.
– 1 flow-in at-a-time for the pipestill.
– 0-h downtime (continuous) for the pipestill.
20
Crude-oil Blend Scheduling
Optimization (CBSO-IMF)
Crude-oil Blend Scheduling
Optimization (CBSO-IMF)
21
Product Blend Scheduling
Optimization (PBSO-IMF)
22 Kelly, J.D., “Logistics: The Missing Link in Blend Scheduling Optimization”, Hydrocarbon Processing, June, 2006.
Castillo, P.A.C., Kelly, J.D., Mahalec, V., “Inventory Pinch Algorithm for Gasoline Blend Planning”, AIChE J., 59, 2013.
One Blend Header with
Two Modes or Grades
• Key logistics details …
– 1-norm (abs) flow-smoothing on blend header flow.
– 6 to 8-h uptime for blend header.
– 6 to 8-h uptime for blender-to-tank flows.
– 4-h fill-draw-delay (mixing-time) for product tanks.
– 1 flow-out at-a-time for the blend header.
– 0 holdup on switching-when-empty for multi-product
tanks.
23
Product Blend Scheduling
Optimization (PBSO-IMF)
Product Blend Scheduling
Optimization (PBSO-IMF)
24
25
Key Quality Details …
Conditions-&sMacro,@sValue
E200,SIP(200.0:200.0;0.0;NT01;NY01;OT10;NY10;OT30;NY30;OT50;NY50;OT70;NY70;OT90;NY90;NT99;NY99;775.0;1.0)
…
E750,SIP(750.0:200.0;0.0;NT01;NY01;OT10;NY10;OT30;NY30;OT50;NY50;OT70;NY70;OT90;NY90;NT99;NY99;775.0;1.0)
Conditions-&sMacro,@sValue
&sCoefficient,@sType,@sPath_Name,@sLibrary_Name,@sFunction_Name,@iNumber_Conditions,@rPerturb_Size,@sCondition_Names
HOTH,dynamic,c:\IMPL\PhysProp\,steam67_H,steam67_H,1,1e-6,HOTT
COLDH,dynamic,c:\IMPL\PhysProp\,steam67_H,steam67_H,1,1e-6,COLDT
WARMH,dynamic,c:\IMPL\PhysProp\,steam67_H,steam67_H,1,1e-6,WARMT
&sCoefficient,@sType,@sPath_Name,@sLibrary_Name,@sFunction_Name,@iNumber_Conditions,@rPerturb_Size,@sCondition_Names
Compute Steam/Water Enthalpies using a Foreign STEAM67.DLL
Compute Evaporations from Distillation Curve using Monotonic Interpolation
Properties-&sMacro,@sValue
DT1001,7.40120*(D10-D01)^0.60244
DT3010,4.90040*(D30-D10)^0.71644
DT5030,3.03050*(D50-D30)^0.80076
DT7050,2.52820*(D70-D50)^0.82002
DT9070,3.04190*(D90-D70)^0.75497
DT9990,0.11798*(D99-D90)^1.66060
T01,T50 - DT5030 - DT3010 - DT1001
T10,T50 - DT5030 - DT3010
T30,T50 - DT5030
T50,0.87180*D50^1.02580
T70,T50 + DT7050
T90,T50 + DT7050 + DT9070
T99,T50 + DT7050 + DT9070 + DT9990
Properties-&sMacro,@sValue
Convert from ASTM D86 to True Boiling Point (TBP) Temperatures
XFCN-@sPath_Name,@sLibrary_Name,@sFunction_Name
C:\IMPL\Procedures\,xfunc.dll,xfunc
XFCN-@sPath_Name,@sLibrary_Name,@sFunction_Name
Compute Z using a Foreign XFUNC.DLL
Properties-&sMacro,@sValue
Z,3.0 * XFCN(LOG(X),Y/10.0)) ̂ 2.0
Properties-&sMacro,@sValue
26
Advanced Performance
Management (APM) • Employs Nonlinear and Dynamic Data
Reconciliation and Regression (NDDRR)
technology also known as “Error-in-Variables
Method” (EVM) & “Moving Horizon Estimation”
(MHE) with sensitivity diagnostic information.
• APM includes:
– Advanced Production Accounting (APA),
– Advanced Property Tracking/Tracing (APT) and
– Advanced Process Monitoring (APM). Kelly, J.D., "A Regularization Approach to the Reconciliation of Constrained Data Sets", Computers & Chemical
Engineering, 1771, 1998.
Kelly, J.D., "Techniques for Solving Industrial Nonlinear Data Reconciliation Problems", Computers & Chemical
Engineering, 2837, 2004.
27
Advanced Performance
Management (APM) (cont’d) • Solution data accessed via a flowsheet pointer
i.e., pointer = (UOPSS,QLQP,time-period).
• Statistical diagnostics such as:
– Redundancy and observability for measured and
unmeasured variables respectively.
– Hotelling T2 statistic for overall objective function.
– Maximum-power (Student-t) statistics for the
individual measurements and constraints.
– 95% confidence intervals for unmeasured variables
i.e., parameters or coefficients. Kelly, J.D., Zyngier, D., "A New and Improved MILP Formulation to Optimize Observability, Redundancy and
Precision for Sensor Network Problems", AIChE Journal, 54, 2008.
28
Advanced Performance
Management (APM) (cont’d) • Supports both Unconstrained (Y12M, MA28,
PARDISO, etc.) and Constrained (IPOPT,
CONOPT, KNITRO, etc.) NDDRR solutions.
• Solves for Observability, Redundancy and
Variances using a unique Sparse Matrix
Algorithm (CHOL, LU and LDL) compared to
Dense Matrix Algebra i.e., Reduced Row
Echelon Form (RREF), Gauss-Jordan (GJ), QR
Factorization and SVD.
Kelly, J.D., “On Finding the Matrix Projection in the Data Reconciliation Solution", Computers & Chemical
Engineering, 1553, 1998.
Kelly, J.D., “Reconciliation of Process Data using other Projection Matrices", Computers & Chemical
Engineering, 785, 1999.
Advanced Production Accounting
(APA-IMF)
29 Kelly, J.D., Mann, J.L., "Improve Yield Accounting by Including Density Measurements Explicitly", Hydrocarbon
Processing, January, 2005.
Single Defect in Tank Density
Inflates Objective Function
Over Hotelling T2
Advanced Property Tracking
(APT-IMF)
30
Kelly, J.D., Mann, J.L., Schulz, F.G., "Improve Accuracy of Tracing Production Qualities using Successive
Reconciliation", Hydrocarbon Processing, April, 2005.
Recycle
Track or Trace Qualities in Tanks Over
Time with Recycles – Useful for
Operating Downstream Processes
Advanced Process Monitoring
(APM-IMF)
31
Henson, M.A., Seborg, D.E., Nonlinear Process Control, Prentice Hall, New Jersey, 1997.
Conditions-&sMacro,@sValue
eqCa,V * Ca - (V * Ca[-1] + q * dt * (Caf - Ca) -`
k0 * dt * V * Ca * EXP(-EoverR / T))
eqT,rho * Cp * V * T - (rho * Cp * V * T[-1] +`
q * dt * rho * Cp * (Tf - T) +`
k0 * dt * V * mdelH * Ca * EXP(-EoverR / T) +`
UA * dt * (Tc - T))
Conditions-&sMacro,@sValue
Dynamic Model w/ Lagged or
Time-Shifted Variables [] in Bold
Material Flow Analysis (STAN2,
http://www.stan2web.net/)
32 Cencic, O.; Rechberger, H.,”Material Flow Analysis with Software STAN”, Journal of Environmental Engineering and
Management, 18, 2008.
* IMPL is Embedded in STAN2 *
33
• More accurate and timely diagnosis of “bad”
instrument readings i.e., less Type I and II
errors (false negatives and positives).
• More precise estimates of parameters or
unmeasured variables i.e., better vetting of
“unobservable” variables with loose confidence-
intervals spanning zero (0).
• Easier modeling, data integration and system
implementation allowing for more parts of the
plant to be monitored more frequently.
Benefits of APM
Kelly, J.D., ”The Necessity of Data Reconciliation: Some Practical Issues”, NPRA Computer Conference,
November, 2000.
34
• Without continuous improvement i.e.,
“parameter-feedback” (adapting Ymodel), “Plan
v. Actual” offsets are significant and persistent.
Benefits of APS with APM
Kelly, J.D., Zyngier, D., "Continuously Improve Planning and Scheduling Models with Parameter Feedback",
FOCAPO, July, 2008.
Supply Reactor Tank Demand
True Plant
Tank Holdup
(Variable)
Supply
(Solution)
Reactor Yield
(Parameter)
Demand
(Parameter)
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8 9
Supply (true) Inventory (true)
Supply (fixed y) Inventory (fixed y)
Supply (updated y) Inventory (updated y)
St = (Itarget – It + Dt) / Ymodel* It = It-1 + St * Yplant - Dt*
Planned/Target
Actual Offset
Thank You!
35