Advanced Optimization Strategies for Integrated Dynamic ...focapo-cpc.org/pdf/Biegler.pdf•...
Transcript of Advanced Optimization Strategies for Integrated Dynamic ...focapo-cpc.org/pdf/Biegler.pdf•...
Advanced Optimization Strategies for Integrated Dynamic Process Operations
L. T. BieglerCarnegie Mellon University
withY.Nie, C. M. Villa, J. M. Wassick
T-Y. Jung, H. Jang, J. H. Lee
Overview • Introduction to Dynamic Optimization
– Roadmap of Methods
• Off-line Reactor Optimization– Optimal design of runaway reactors– Polymerization Recipe Optimization
• Integrated Dynamic Optimization– Embedded recipe optimization – Combined optimization and scheduling
• Optimization Under Uncertainty– Back-off vs. Multi-stage stochastic programming– Polymer Case Study
• Conclusions
zi,I0 zi,II
0 zi,III0 zi,IV
0
zi,IVf
zi,If zi,II
f zi,IIIf
Bi
A + B → CC + B → P + EP + C → G
Impact and Challenges of Dynamic Optimization in Chemical Engineering?
• Design – Reactors– Separations– Batch process recipes
• Control– Optimal reference trajectories– Real-time optimization
• Operations– Transitions– Upsets– Integration with logistics
3
tf, final timeu(t), control variablesp, time independent parameters
t, timez(t), differential variablesy(t), algebraic variables
Dynamic Optimization Problem
s.t.
Dynamic Optimization Approaches
DAE Optimization Problem
Multiple Shooting
Embeds DAE Solvers/SensitivityHandles instabilities
Single Shooting
Hasdorff (1977), Sullivan (1977), Vassiliadis (1994)…Discretize controls
Simultaneous Collocation(Direct Transcription)
Large/Sparse NLP - Betts; B…
Apply a NLP solver
Efficient for constrained problems
Simultaneous Approach
Larger NLP
Discretize state, control variables
Variational Approach
Pontryagin et al.(1956)
Bock and coworkers
Take Full Advantage of Open Structure• Many Degrees of Freedom• Periodic Boundary Conditions• Multi-stage Formulations…
Nonlinear DynamicOptimization Problem
Collocation onfinite Elements
(Piecewise)Continuous profiles
Nonlinear ProgrammingProblem (NLP)
Discretized variables
Nonlinear Programming Formulation
• Fully Equation-based formulations• Exact gradients and Hessians • BVP (not IVP) stability properties • Sparse, large-scale structures fully exploited
7
Design Optimization of Runaway Reactors(Hagan et al., 1988; Koning, et al., 2006; Nie et al., 2013)
8
Design Optimization of Runaway Reactors
9
Dynamic Optimization Solution Strategy
10
Catalyst Distribution Profiles
Zones Max. Product1 79.333 105.5110 106.63∞ 106.64
11
Recipe OptimizationSemi-Batch Polymer Process (Nie et al., 2013)
12
Semi-batch polyether polyol process (Nie et al., 2014)
• Comprehensive population balance models for MWD properties• Moment models implemented and compared• Operating strategies validated in plant
13
Polyol Dynamic Process Validation
14
Process Recipe Optimization
15
Recipe Optimization Results
16
Optimal Constraint Profiles
17
Satisfaction of Product Specifications
18
Goal: Bridge between planning, logistics (linear, discrete problems) and detailed process models (nonlinear, spatial, dynamic)
Planning
Scheduling
Site-wide Optimization
Real-time Optimization
Model Predictive Control
Regulatory Control
Feas
ibili
ty
Per
form
ance
Corporate Decision Pyramid for Process Operations
19
• Coordinate batch and continuous unit operations• Minimize wait times• NLP models for dynamic optimization• MILP models for process/product scheduling• Manage shared resources and inventories
Planning
Scheduling
Site-wide Optimization
Real-time Optimization
Model Predictive Control
Regulatory Control
Feas
ibili
ty
Per
form
ance
Synchronizing Dynamic Optimization and Scheduling
Integration with Process Scheduling
Integration with Process Scheduling(State-Space RTN Formulation)
22
Integrated RTN/Optimization Framework
Reactor Opt.
RTNSchedule
23
Integration of Dynamic Optimization and RTN Scheduling
23
12% higher profit
24
Presented at Annual AIChE Meeting, Salt Lake City, Nov. 2015
25
Dynamic Real-Time Optimization of a Mixed Mode Process (Nie, Lin, Hayot, Wassick et al., 2015)
Reactor Model extensively validated against internal models and operating data
26
Integrated NMPC and On-Line Optimization: An Initial Study
D-RTO through NMPC• Retain dynamic model • Shrinking batch horizon• Variable batch time• Economic NMPC (tf)• Key Issues
– Uncertainty-tolerant optimization formulations
– Time critical optimization(efficient large-scale NLP)
– Accelerate with advanced step (sensitivity-based) strategies
Incorporation of Uncertainty• From states, parameters,
measurement noise • State estimation with expanding
batch horizon, …• Back-off constraints for noise, …• Stochastic, Multi-stage Programs
within MPC for model errors and disturbances with delayed realization (Lucia, Finkler, & Engell, 2013)
T.-Y. Jung, Y. Nie, J. H. Lee, L. T. B., IFAC-PapersOnLine, 48 (8), 164-169 (2015)H. Jang, J. H. Lee, L. T. B., pp. 37-42, IFAC Papers Online, (2016)
• Minimize operating time of polymerization under uncertainty• Consider the operating time as a manipulated variable• Shrinking Horizon NMPC combined with Expanding Horizon LSE
• Based on the rigorous DAE model used in recipe optimization• Over operation window → Minimization of approximated error
Recipe Optimization
Estimator (LSE)
Controller (NMPC)
Plant/Simulator
Framework for On-line Dynamic Optimization
• Minimize operating time of polymerization under uncertainty• Consider the operating time as a manipulated variable• Shrinking Horizon NMPC combined with Expanding Horizon LSE
• Based on the rigorous DAE model used in recipe optimization• Over operation window → Minimization of approximated error
Recipe Optimization
Estimator (LSE)
Controller (NMPC)
Plant/Simulator
Framework for On-line Dynamic Optimization
• Minimize operating time of polymerization under uncertainty• Consider the operating time as a manipulated variable• Shrinking Horizon NMPC combined with Expanding Horizon LSE
• Based on the rigorous DAE model used in recipe optimization• Over operation window → Minimization of approximated error
Recipe Optimization
Estimator (LSE)
Controller (NMPC)
Plant/Simulator
Framework for On-line Dynamic Optimization
Batch LSE formulation(Analogous to MHE)
min𝑥𝑥1,𝑤𝑤𝑘𝑘𝑘𝑘=1,…,𝐾𝐾−1
�𝑥𝑥1𝑒𝑒 𝑇𝑇 �𝑃𝑃1−1 �𝑥𝑥1𝑒𝑒 + ∑𝑘𝑘=1𝐾𝐾 𝑣𝑣𝑘𝑘𝑇𝑇𝑅𝑅−1𝑣𝑣𝑘𝑘 + ∑𝑘𝑘=1𝐾𝐾−1𝑤𝑤𝑘𝑘𝑇𝑇𝑄𝑄−1𝑤𝑤𝑘𝑘
�𝑥𝑥𝑘𝑘 = 𝑥𝑥𝑘𝑘𝑇𝑇 𝑑𝑑𝑘𝑘𝑇𝑇 𝑇𝑇
𝑥𝑥1𝑒𝑒 = �𝑥𝑥1 − �̅�𝑥1𝑣𝑣𝑘𝑘 = 𝑦𝑦𝑘𝑘 − ℎ 𝑥𝑥𝑘𝑘 ,𝑢𝑢𝑘𝑘
𝑤𝑤𝑘𝑘 = 𝑥𝑥𝑘𝑘+1 − 𝑓𝑓 𝑥𝑥𝑘𝑘 ,𝑢𝑢𝑘𝑘 , 𝑑𝑑𝑘𝑘𝑑𝑑𝑘𝑘+1 − 𝑑𝑑𝑘𝑘
�𝑥𝑥𝑘𝑘 ∈ 𝕏𝕏𝕏, 𝑢𝑢𝑘𝑘 ∈ 𝕌𝕌, 𝑦𝑦𝑘𝑘 ∈ 𝕐𝕐
Augmented state vector
Measurement error vector
Augmented state error vector
Feasible domain
Initial error
: the time index
• Using full state information contained in measurements
Adding back-off constraints(see Srinivasan, Bonvin et al., 2003)
,
Uncertainties Original constraint
Back-off constraint
Optimization w/o Uncertainty
Monte Carlo Simulation
Data ProcessingApproximate backoff 𝛽𝛽0
Optimization w/ Backoff Constraints
Monte Carlo SimulationApproximate backoff 𝛽𝛽𝑘𝑘
Optimal control profiles 𝑢𝑢∗
State and output profiles
Backoff𝛽𝛽0
Optimal control profiles 𝑢𝑢𝑘𝑘∗
No
Converged
Tighten path constraints and product specifications with back-off terms, β
Multi-stage MPC – Stochastic Programming Formulation
Lucia, Engell et al., J. Process Control, 2013
Scenario branching: effect of uncertainty while optimizing control input
Non-anticipativity: control inputs from same node set equal until uncertainty is realized
xk
xk+1
xk+2
xk+3
(dk, uk)
(dk+1, uk+1)(dk+2, uk+2)
Simplified Multi-stage MPC
Robust horizon = 1
Lucia, Engell et al., J. Process Control, 2013
Non-anticipativity: control inputs from same node set equal until uncertainty is realized
Multi-stage, economic MPC formulation
min𝑥𝑥𝑘𝑘+1𝑗𝑗 ,𝑢𝑢𝑘𝑘
𝑗𝑗 ,𝑘𝑘=𝐾𝐾,…,𝑁𝑁𝑇𝑇−1,𝑗𝑗=1,…,𝑁𝑁𝑆𝑆 𝑘𝑘∑𝑘𝑘=𝐾𝐾𝑁𝑁𝑇𝑇−1 ∑𝑗𝑗=1
𝑁𝑁𝑆𝑆(𝑘𝑘) ℒ 𝑥𝑥𝑘𝑘+1𝑗𝑗 ,𝑢𝑢𝑘𝑘
𝑗𝑗
𝑁𝑁𝑆𝑆(𝑘𝑘)
ℒ 𝑥𝑥𝑘𝑘+1𝑗𝑗 ,𝑢𝑢𝑘𝑘
𝑗𝑗 = Δ𝑡𝑡𝑏𝑏 (+𝜇𝜇𝑃𝑃)
𝑥𝑥𝑘𝑘+1𝑗𝑗 = 𝑓𝑓 𝑥𝑥𝑘𝑘
𝑝𝑝 𝑗𝑗 ,𝑢𝑢𝑘𝑘𝑗𝑗 ,𝑑𝑑𝑘𝑘
𝑗𝑗
𝑔𝑔 𝑥𝑥𝑘𝑘𝑗𝑗 ,𝑢𝑢𝑘𝑘
𝑗𝑗 = 0
𝑐𝑐𝑝𝑝 𝑥𝑥𝑘𝑘𝑗𝑗 ,𝑢𝑢𝑘𝑘
𝑗𝑗 + 𝜆𝜆 β ≤ 0
𝑐𝑐𝑒𝑒 𝑥𝑥𝑁𝑁𝑇𝑇𝑗𝑗 ,𝑢𝑢𝑁𝑁𝑇𝑇−1
𝑗𝑗 + 𝜆𝜆 β ≤ 𝑃𝑃,𝑃𝑃 ≥ 0
𝑥𝑥𝑘𝑘𝑗𝑗 ∈ 𝕏𝕏, 𝑢𝑢𝑘𝑘
𝑗𝑗 ∈ 𝕌𝕌
𝑢𝑢𝑘𝑘𝑗𝑗 = 𝑢𝑢𝑘𝑘𝑙𝑙 if 𝑥𝑥𝑘𝑘
𝑝𝑝 𝑗𝑗 = 𝑥𝑥𝑘𝑘𝑝𝑝 𝑙𝑙
Economic cost function (processing time)
Nonlinear dynamic model
Algebraic constraints
Back-off path constraint
Back-off end-point constraint (relaxed)
Feasible domain
Non-anticipativity constraints
k : time indexj : scenario index
• Tools: GAMS implementation using IPOPT• Numerical strategy: Simultaneous collocation approach
• 24 finite elements (sampling time > 10 min) and three Gauss-Radaucollocation points reactor model instance: 3000 variables, 150 dofs
• Hypothetical Uncertainties for Demonstration• Three branches for parameter error (Kp): min (-10%), nominal, max
(+10%) • ±2% errors in measurements and initial states
eNMPC: ± 2% initial state error and measurement noise
eNMPC+ batch LSE Performance (410 min)
Inpu
tsPa
th co
nstr
aint
s
• Stabilized control inputs• Adiabatic temperature bounded
• Oscillatory control inputs• Adiabatic temperature violated
eNMPC Performance(nominal time = 380 min)
Multi-stage eNMPC PerformanceModel Parameter Error (10%) (530 min)
• Stabilized control inputs• Adiabatic temperature bounded
Inpu
tsPa
th co
nstr
aint
sMulti-Stage eNMPC
Performance ComparisonMulti-stage eNMPC + LSE
Model , State, Measurement Errors (535 min)
• Violation of adiabatic end temperature constraint
Multi-stage MPC and Back-off eNMPC + batch LSE + back-off (all errors)
(589 min)
• Avg. computation time= 8.77 CPU seconds (max. 33.48 CPU sec)
• > 10*(nominal and back-off cases, ~0.7 CPUs) • << sampling time (10 ~ 20 min)
Inpu
tsPa
th co
nstr
aint
s
Multi-stage eNMPC + batch LSE + back-off (539 min)
Dynamic Optimization widely applicable in: • Process design• Process control• Integrated Process Operations
Simultaneous Collocation Approach• Efficient, accurate and robust optimization approach• Deals with unstable processes, state constraints
Significant Impact Observed with Simultaneous Optimization• Optimization of Runaway Reactors• Recipe Optimization• Integrated optimization for process operation and scheduling• Optimization under Uncertainty
Broad Scope to Handle On-line Optimization• Improved Formulations to Handle Uncertainty• Parallel Decomposition for Dynamic Optimization• Fast NMPC Formulations for Time Critical Solutions
Conclusions
to tf
× × × ×
Collocation points
• ••• •
••
••
••
•
Polynomials
× ×× ×
•
Finite element, i
ti
Mesh pointshi
× × × ×
∑=
=K
qiqq(t) zz(t)
0
× ××
×element i
q = 1q = 2
××××Continuous Differential variables
Discontinuous Algebraic and Control variables
×
×
× ×
Collocation on Finite Elements
∑=
=K
qiqq(t) yy(t)
1 ∑
=
=K
qiqq(t) uu(t)
1
τddz
hdtdz
i
1=
),( uzfhddz
i=τ
]1,0[,1
1'' ∈+= ∑
−
=
ττ ji
i
iiij hht
41
Integrated Approach (Dynamics/Scheduling Optimized Simultaneously)
• MINLP Solution via GBD• 3 major iterations• 393 CPUs (MILP: 20 CPUs, NLP: 373 CPUs)• 12% higher profit
Integrated Optimization: Scheduling and Dynamics
• Both approaches have optimized reactor recipes• Integrated recipes are re-optimized over time• Re-optimized recipe squeezes an extra batch with lower utility• 11.7% higher profit in integrated case (validated in industry)
End-point constraints
Method NAMW [g/mol] Unsat. value [mmol/g polyol]
Unreacted PO [ppm]
Limit 3027.74 (lower) 0.02 (upper) 2000 (upper)Standard 3017.22 0.0202 2508.40
Back-off only 3051.09 0.0198 1493.78Multi-stage +
Back-off 3029.66 0.0199 1893.36