Advanced Modeling of Industrial Optimization Problems
Advanced Modeling of Industrial Optimization Problems:Beyond Algebraic & Algorithmic Modeling Languages J.D. Kelly & A. Vazacopoulos Industrial Algorithms firstname.lastname@example.org & email@example.com September 10, 2012
UOPSS: Modeling the Objects● UOPSS = Unit-Operation-Port-State Superstructure.● Unit-operations are the structural objects combining "physical" units with "procedural" operations (eg. Equipment x Activities or Machine x Job).● Port-states are the structural points where resources, etc. are consumed & produced.● UOPS superstructure models the hyper-network of UOPS to PSUO connectivity.● UOPSS objects define the "keys" of the problem or model.
UOPSS: Modeling the Objects● UOPSS is designed for batch, continuous and dimensional process industries and has the following types & sub-types: ● ProcessB, ProcessC, ProcessD, Perimeter, Pool, Pipeline, Pileline, Parcel & Port (In/Out). ● Blender, Splicer, Splitter, Separator, Reactor, Fractionator & Blackbox for Processes. ● Stock, Utility, Utensil, Time & Task for Ports.
QLQP: Modeling the Attributes● QLQP = Quantity-Logic-Quality Phenomena. ● Phenomenological is different from/orthogonal to hierarchical, structural, spatial & temporal dimensions.● Quanties = rates, flows, holdups, yields, durations,● Logic = setups, startups, switchovers, shutdowns, sequences, slots,● Qualities = densities, components, properties, conditions, coefficients,● Logistics is the combination of Quanity & Logic (MILP) and Quality is the combination of Quantity & Quality (NLP).
QLQP: Modeling the AttributesU O U O U O O U Attributes Attributes Phenomenological Attributes of Quantity, Logic and QualityP S P S Attributes P S S P
Advanced ModelingAllegoric-Form(Figurative Language)Algebraic-FormAlgorithmic-Form Baker, T.E., Ladson, L.S., “Successive Linear Programming at Exxon”, Management Science, 31, 1985.
Advanced Modeling● Philosophy = "Configure v. Code".● Allows the modeler or user the ability to focus on the important aspects of the industrial optimization problem (IOP) instead of its algebra & algorithms.● Most of the variables and constraints found in an IOP can be generalized or formalized using UOPSS objects and QLQP attributes. ● We currently have over 125 different variable-types & over 185 different constraint-types including over 100 sets/lists & 150 parameters (and counting ...).
Advanced Modeling System: IMPRESS● IMPRESS = Industrial Modeling & Presolving System.● Problems are configured either interfacing with a flat-file language (IML = Industrial Modeling Language) or interactively using a programming language such as Python, Java, C#, C++, C or Fortran (IMI = Industrial Modeling Interchange).● We currently have bindings to several linear and nonlinear programming solvers such as COINMP, GLPK, LPSOLVE, SCIP, XPRESS, XPRESS-SLP, CONOPT, IPOPT, KNITRO, NOVA & SLPQP.
Advanced Modeling System: IMPRESS● IMPRESS uses the following resources or entities to formulate or model the IOP: – SETS & LISTS = integer- & string-keyed to store integers. – CATALOGS = integer-keyed to store strings. – PARAMETERS = integer-keyed to store reals. – VARIABLES = integer-keyed to store complexes (Re/Im). – CONSTRAINTS = integer-keyed to store complexes. – DERIVATIVES = 2 integer & 1 real parallel vectors. – EXPRESSIONS = 1 integer & 1 real parallel vectors. – FORMULAS = integer-keyed to store 1 integer & 1 complex parallel vectors.
Key Differences with AMLs● AMLs use sorted database table technology to store and manipulate sparse data. ● IMPRESS also stores the sparse data in a database table format (i.e., coordinate, triplets, ordered-pairs, non- zeros, etc.) but manipulates the data using a proprietary referencing technique for spot or random-access.● AMLs manage the time-period dimension like any other key, index or cursor in the sparse data table. ● IMPRESS inherently manages the time-period dimension as a separate appendable-array or vector which is manipulated using whole-array or vectorized processing (much faster as the number of time-periods increases).
Key Differences with AMLs● AMLs always export each nonlinear constraint instance as a prefix/postfix (RPN) tokenized expression in byte-code. ● IMPRESS also does this for nonlinear solvers such as XPRESS-SLP & LINDO-SLP but can also be embedded directly into function callbacks required by CONOPT, IPOPT, KNITRO, NOVA & SLPQP in machine-code (requires substantially less memory).● Some AMLs perform their own mostly linear presolving calculations (AMPL & AIMMS). ● IMPRESS performs LP primal presolving as well as nonlinear presolving such as detecting if nonlinearly declared constraints are linear after presolve.
Important Features● Digitization Engine: ● All time-varying data such as orders, transactions or events are entered in continuous-time where they are either discretized (uniform) or distributed (non- uniform) into time-periods over the time-horizon. – This also includes a compression & continuosization on the solution data to remove temporal redundancy.● Differentiation Engine: ● All 1st-order partial derivatives are either supplied analytically or computed numerically of analytical quality using complex-step differencing & graph- colouring. * The modeler or user is not responsible for providing derivatives.
Important Features● Documentation Engine: ● All constraints are externalized into a "human- readable" form as well as all other entities such as sets, lists, parameters, variables & formulas have annotations available.● Diagnostic Engine (Work-in-Progress ...): ● Experience says that over 95% of IOPs have infeasibilities that occur in the linear part of the model where these can be quickly identified in LP primal presolve. The rest require artificial or what we call excursion variables in both the integer and nonlinear parts of the model and are generated automatically.
Important Features● Demarcation Engine (Openings, Wet-Plant Problem): ● Optimizing into the future is the goal but respecting the past & present is vital to properly achieving this i.e., the "demarcation" between the past & future time-lines. Addressing the previous activities currently occurring in the problem must be respected as we look-ahead into the future. For example, if a unit-operation has a minimum run-length of 10-hours & if it started 2-hours in the past then there is a minimum of 8-hours left i.e., it can be shutdown after 8- hours into the future. – It also includes respesting future operations when at a certain future time a known event is to occur (predictive- or preventative- maintenance).
System Architecture: SIIMPL● SIIMPL = Server, Interfacer, Interacter, Modeler, Presolver Libraries.● There are five DLL components in IMPRESS: ● Server = data modeling & presolving routines. ● Interfacer = parsing for the language. ● Interacter = inserting, updating & viewing routines for the interchange. ● Modeler = formulating of the variables, constraints, derivatives & expressions including "dependent" sets, lists & parameters. ● Presolver = bindings for 3rd-party solving-systems.
Types of Optimization & Estimation● IMPRESS is designed both for industrial decision- making & data-mining problems deployed off-line, in-line & on-line such as: ● Planning & Scheduling Optimization (active). ● Data Reconciliation & Regression Estimation (passive). ● Real-Time Control & Optimization (active). ● Monitoring, Tracking & Tracing (passive). – The terms active & passive imply the "degree of causality". Active models must be "causal" (cause & effect amongst variables) & passive models may or may not be causal (no cause & effect required) also known as "observational".
Types of Optimization & Estimation● IMPRESS directly manages the integration of planning & scheduling decision-making by exploiting its hierarchical nature: ● Planning decisions are implemented as either lower & upper hard bounds (min 1-norm excursions) or as target soft bounds (min 2-norm deviations) in the scheduling.● IMPRESS can also model "hybrid" planning & scheduling problems i.e., a mix of planning & scheduling constraints in the same model/horizon: ● Both "big" & "small" time-buckets or periods are included in the problem by allowing one or more operations on the same unit for the same time-period (single or multi-use).
Types of Optimization & Estimation● IMPRESS inherently manages the integration of the logistics & quality QLQ phenomena in either planning or scheduling problems: ● Logistics has quality proxyd and Quality has logic fixed but quanties are free/finite. This is a "truncated" Benders Decomposition heuristic to avoid MINLP but is very effective in practice and is a natural mechanism to manage complexity.● IMPRESS includes estimatibility diagnostics: ● Observability, redundancy and variability estimates are calculated as a postsolve for all measured (reconciled) and unmeasured (regressed) variables using novel sparse matrix techniques (no GJ, QR or SVD required).
Complexity Management● IMPRESS is intended to assist with the ubiquitous issue of "complexity management" in IOPs.● Managing uncertainty & hierarchy are somewhat addressed but managing complexity is difficult: – how to balance accuracy, tractability & operability when modeling & implementing the solution.● What looks like uncertainty & hierarchy management issues may be the inability to model the IOPs complexity ... – Perceived supply & demand uncertainty maybe the inability of the upstream producer & downstream consumer to manage their production or manufacturing as well as intermediate transportation or distribution.
Poor Mans Parallelism● MPP = Multi-Problem Parallelism.● MPP does not require IMPRESS to be multi- threaded unless the solver is multi-threaded (parallel Barrier or B&B) but allows multiple processes to be run concurrently managed by the operating-system.● IMPRESS has a low memory footprint allowing many problems to be run simultaneously on multi- core, shared-memory computers with different starting-values, settings and/or solvers. ● Due to the nonlinear and nonconvex nature of these problems local solutions can and will occur so extra runs can be beneficial to potentially find better solutions.
MILP Example - SeqDepSwo● SeqDepSwo = Sequence-dependent switchovers w/ "repetitive-maintenance" (setup). – This instance can be considered as the "Prize-Collecting Traveling-Salesman Problem" (PCTSP). – This formulation is from Kelly & Zyngier, "An Improved MILP Modeling of Sequence-Dependent Switchovers for Discrete- Time Scheduling Problems",I&ECR, 46, 4964-4973, (2007). ● Horizon duration = 30-days, period duration = 1-day. ● Production-line rate (semi-continuous) = 18-tons/day. ● Ten-materials (3..5-day run-lengths), 3-families (3-3-4), 1-cleanout task (1-day run-length, rate = 2-tons/day). ● Demands of 0..72-tons w/ release,due-dates = 0,30-days w/ prices of $+1/ton & cleanout costs of $-1/ton.
MILP Example - SeqDepSwo● Maximum profit = $540 = $1/ton * 18-tons/day * 30-days● Provably optimal profit = $502 = 1 * 18 * 28 + -1 * 2 * 1 – Schedules 3rd family and either the 1st or 2nd family in any sequence (3rd then 1st or 2nd OR 1st or 2nd then 3rd) with one cleanout instance & one idle day. Idle Python 2.7 w/ Matplotlib 1.1.0 Cleanout
MILP Example - SeqDepSwoPython 2.3 w/ Dia 0.97.2 Creates a *.UPS file which can be used in both IML & IMI UOPSS Stencil Sheet Cleanout
MILP Example - SeqDepSwo● Python 2.7 w/ ctypes w/ IMPRESS-IMI:from ctypes import *# Number of materials (including maintenance) and families.nmaterials = 10+1nfamilies = 3# Include IMPRESS constants and callbacks.execfile("IMPRSimi.py")# Set the problem path and name.problem = c_char_p(b"C:/IndustrialAlgorithms/Problems/seqdepswo")# Root the problem (initializes).rtnstat = imis.IMPRSroot(problem)# Reserve the problem memory.rtnstat = imis.IMPRSreserve(problem,IMPRSall) Past & Future# Receive the chronological data. Time Horizon Duration & Time-Period Durationdthp = c_double(-1.)dthf = c_double(30.)dtp = c_double(1.0)rtnstat = imii.IMPRSreceiveT(byref(dthp),byref(dthf),byref(dtp))
MILP Example - SeqDepSwo● Python 2.7 w/ ctypes w/ IMPRESS-IMI:# Receive the construction data.for i in range(nmaterials): if i < nmaterials-1: j = i+1 else: j = -1... add Sj UO and UOPS “PL” is a uname = c_char_p(b"PL") Continuous-Process oname = c_char_p(str(j)) utype = c_char_p(b"processc") usubtype = c_char_p(b"") uuse = c_char_p(b"") rtnstat = imii.IMPRSreceiveUO(uname,oname,utype,usubtype,uuse,IMPRSkeep) pname = c_char_p(b"IN") One inlet & sname = c_char_p(str(j)) one outlet port ptype = c_char_p(b"in") psubtype = c_char_p(b"") puse = c_char_p(b"") rtnstat = imii.IMPRSreceiveUOPS(uname,oname,pname,sname,ptype,psubtype,puse,IMPRSkeep) “Keep” or “Erase” pname = c_char_p(b"OUT") sname = c_char_p(str(j)) ptype = c_char_p(b"out") rtnstat = imii.IMPRSreceiveUOPS(uname,oname,pname,sname,ptype,psubtype,puse,IMPRSkeep)... add Dj UO and UOPS
Coding New Variables & Constraints● Although IMPRESS is not an AML, coding or creating your own variables, constraints, derivatives & expressions as well as sets, lists, parameters & formulas is possible.● Coding/creating a variable: Type = Continuous, Binary, etc. – vregister(number,name,dimension,type) – vreceive(index,value) Objective Function Weights – vrestrain(index,lower,upper,weight)● Coding/creating a constraint (f(x)+...+A*x+b ~ 0): – cregister(number,name,dimension,type) Defines Sparsity-Pattern – creceive(index,value) – dratio(cindex,vindices,derivatives optional) Defines Expression – erelate(cindex,ntokens,instructions,values)
Challenges● Understanding how to configure IOPs to improve business performance (economics, efficiency, etc.).● Understanding how to configure IOPs for tracatability (good solutions in reasonable-time).● Troubleshooting IOPs for inconsistent & incorrect results (not infeasible but not expected either).● Incrementing & iterating the IOP from solution to solution (manually or automatically) to improve its solution accuracy & reality.● Improving the formulation of the IOPs model to help in the above (tighter, smaller, faster, smarter, ...)