Upload
others
View
11
Download
0
Embed Size (px)
Citation preview
INCOOP WorkshopDüsseldorf, January 23 – 24, 2003
Dynamic Real-time Optimization
Jitendra Kadam, Wolfgang Marquardt, Martin SchlegelLehrstuhl für Prozesstechnik
RWTH Aachen
1Dynamic real-time optimization
Operational strategies – the status
• plant in isolation• steady-state operation• limited flexibility• disturbance handling• largely autonomous
Production planning system
operation support system
supplier
purchasing&
procurement
customer
marketing&
sales
units,group of units,plant,group of plants,...
units,group of units,plant,group of plants,... ... and its
operation supportsystem
environment
marketsupply chain
corporateobjectives
2Dynamic real-time optimization
Manufacturing in the future
operational strategiesreengineering the plant
flexible productionsmooth dynamicslean inventorieshigh capital productivitiessustainable production...
synchronous or asynchronousrolling window prediction adaptation
performance
indicators
delivery on demandvarying quality specsfluctuating pricestime-varying environmentcorporate strategyadvancing technologiessaturating global marketstightening legal regulations...
the disturbances the requirements
feedback
the plant as part ofthe supply chain
3Dynamic real-time optimization
General operational objectives
optimal operation of chemical processes
economy
model uncertaintiesdisturbances
constraints• equipment, safety, environment• capacity, quality, reproducability
optimal profiles
manipulated variables
statevariables
Why should they be constant over time?
d
F
process model
)()(
),,,,(0
00
xgyxtx
dpuxxf
==
= &
h
4Dynamic real-time optimization
Optimization-based control
optimal feedback control system
measurements manipulatedvariables
dynamic data reconciliation optimal control
2 coupled problems:
hF ,
cury~
],[),(0
))((U
)()(
),,,(0
0,
cr
rrr
cr
rrr
rr
rrrr
tttdxh
uu
xtxxgy
duxxf
∈≥
⋅=
=== &
),,,,,(min 0,,0,fcrrrrdx
ttdxyrr
ηΦ
s.t.
],[),(0
))((D)()()(
),,,(0
fc
ccc
rc
crcc
cc
cccc
tttuxh
ddtxtxxgy
duxxf
∈≥
⋅===
= &
),,,(min fccccuttux
c
Φ
s.t.
5Dynamic real-time optimization
Direct solution approach
• solution of optimal controlreconciliation problems atcontroller sampling frequency
• computationally demanding
• model complexity limited(INCOOP benchmarks ⇒ large models!)
• lack of transparency,redundancy and reliability
( Terwiesch et al., 1994;Helbig et al., 1998;Wisnewski & Doyle, 1996;Biegler & Sentoni, 2000 )
dynamicdata recon-
ciliation
decisionmaker
optimalcontrol
processincluding
base control
cδ
)(tuc
)(td
)(tdr
)( cr tx
cδ
)(tη
h,Φoptimizing feedbackcontrol system
6Dynamic real-time optimization
Horizontal decomposition
• decentralization typically oriented at functional constituents of the plant
• coordination strategies enable approximation of”true” optimum
• not adequately covered inoptimization-based controland operations yet
( Mesarovic et al., 1970;Findeisen et al., 1980;Morari et al., 1980;Lu, 2000 )
decisionmaker
subprocess2
h,Φ
)(2 tdsubprocess
1
coordinator
optimizingfeedback
controller 2
optimizingfeedback
controller 2
)(1 td
2,cδ
)(2 tη
)(2, tuc
1,cδ
)(1 tη
)(1, tuc
optimizingfeedbackcontrolsystem
coδcoδ
7Dynamic real-time optimization
decisionmaker
trackingcontroller
processincluding
base control
h,Φ
cδ)()()( tututu cc ∆+=
)(td
)(0 td
)(0 ctx
cδ
optimaltrajectory
design
long time scaledynamic datareconciliation
short time scaledynamic datareconciliation
time scaleseparator
)(td∆)(0 ctx
)(),(),( tutytx ccc
)(0 tη
)(tη∆
0δ0δ Ψ
Vertical decomposition
• generalizes steady-state real-time optimization and constrained predictive control
• requires (multiple) time-scale separation, e.g.
d(t) = d0(t) + ∆d(t)withtrend d0(t)zero mean fluctuation ∆d(t)
optimizing feedbackcontrol system
8Dynamic real-time optimization
D-RTOtrigger
Vertical decomposition – INCOOP approach
DynamicReal Time
Optimisation
ModelPredictive
Control
Estimation
process (including base control)
optimal referencetrajectories
state and disturbance estimates (slow)
measurements control setpoints
market andenvironmental conditions
state and disturbance estimates (fast)
INCOOP reference architecturedecision
maker
dynamic optimizationproblems
9Dynamic real-time optimization
Goal: determine optimal transition trajectories using an economic objective function
Focus: D-RTO block
modelDynamic
Real TimeOptimisation
optimal referencetrajectories
market and environmentalconditions
state and disturbance estimates
Challenges: • Develop numerical solution methods which solve the problem
robustly and sufficiently fast• Develop techniques for triggering a re-optimization based on external
conditions• Implement software framework for enabling interaction with MPC and
estimator
10Dynamic real-time optimization
A closer look on dynamic optimization
Mathematical problem formulation
))((min,),( ftptu
txf
Φ
s.t.
))((0
,],[),,,,(0
,)(0
,],[),,,,(
0
00
0
f
f
f
txE
ttttpuxP
xtx
ttttpuxFxM
≥
∈≥
−=
∈=& } DAE system (process model)
path constraints (e.g. temp. bound)
endpoint constraints (e.g. prod. spec.)
objective function (e.g. cost)
Degrees of freedom: u(t) time-variant control variables
p time-invariant parameters
tf final time
11Dynamic real-time optimization
Example: Bayer Benchmark Process (I)
Separation
Cooling Water
LoopTC
LC
Recycle
Q PolymerQ
FC
CV 2: Viscosity CV 1: Conversion [%]
MV 1: Recycle Monomers [kg/h]
LC
Buffer
Tank
Monomer
Catalyst
MV 2: Reaktor Temperature [°C]
MV 3: Feeds[kg/h]
Downstream
Processing
(From: Dünnebier & Klatt: Industrial challenges and requirements for optimization of polymerisationprocesses)
12Dynamic real-time optimization
Example: Bayer Benchmark Process (II)
Polymerization process• minimize time for load change• three degrees of freedom• path constraints on specifications
Holdup
Zeit
Hold up
Time
endpointconstraint
Molekulargewicht
Zeit
Viscosity
Time
Specification
pathconstraint
(From: Dünnebier & Klatt: Industrial challenges and requirements for optimization of polymerisationprocesses)
Separation
Cooling Water
Loop
Recycle
Polymer
MV 1: Recycle Monomers [kg/h]
Buffer
Tank
Monomer
Catalyst
MV 2: Reaktor Temperature [°C]
MV 3:Feeds[kg/h]
Downstream
Processing
13Dynamic real-time optimization
Solution approaches
Indirect solution methodsNecessary optimality conditionslead to multipoint boundary valueproblems:
• Highly accurate solutions with shooting techniques.
• Solution requires detailed a-priori knowledge of the optimal solution structure and appropriate estimates
for adjoint variables.
Direct solution methodsConversion of dynamic optimizationproblem into nonlinear programmingproblem (NLP) by discretization…
• …of state and control variables. (simultaneous methods, i.e. collocation, multiple shooting)
• …of control variables only.(sequential method, i.e.single shooting)
Direct solution methodsConversion of dynamic optimizationproblem into nonlinear programmingproblem (NLP) by discretization…
• …of state and control variables. (simultaneous methods, i.e. collocation, multiple shooting)
• …of control variables only.(sequential method, i.e.single shooting)
• Succesfully applied with large-scaleprocess models
used inINCOOP
14Dynamic real-time optimization
Solution algorithm
Discretization
initial values: u0, p0, tf0
specify Φ, P, E
z0={c0, p0, tf0}
IntegrationQP solver
dk
Line search
zk
Integration
Hessian update
Convergence?
no
yes
SQP solver
optimal solution:c*, p*, tf*, Φ*, P*, E*
optimal trajectories:u(t), x(t)
x0(z0)⇒ Φ0, P0, E0
xk(zk)⇒ Φk, Pk, Ek +
Φk, Pk, Ek + ⋅∇
⋅∇
00000 ,,)( EPzs ∇∇Φ∇⇒
expensive!> 90 % ofCPU time
Potential improvements:• most efficient integration• as few NLP steps as possible
15Dynamic real-time optimization
Sequential approach → single shooting
Control vector parameterization
∑Λ∈
≈ik
kikii tctu )()( ,, φ
)(, tkiφ parameterizationfunctions
kic , parameterst
ui(t)
φi,k(t)
ci,k
⇒ Reformulation as nonlinear programming problem(NLP) )),,((min
,, ftpctpcx
f
Φ
))((0
,),,,,(0
f
ii
txE
ttpcxP
≥Τ∈∀≥s.t
.
DAE system solved by underlying numerical integration
• DAE system solved by underlying numerical integration• Gradients for NLP solver typically obtained by integration of sensitivity systems
⇒ Numerical integration computationally most expensive (> 90 % of CPU time)⇒ Computational effort strongly depends on size and complexity of process model
16Dynamic real-time optimization
Algorithmic improvements – sequential approach
Sensitivity integrationis expensive
Reduce numberof sensitivity parameters
Improve efficiency of sensitivity integration
Reduce model complexity
State integration is expensive
Control gridadaptation strategy
),(f
1
11 zX
hM
AA
hM
AA
hM
A
XX k
jn
j
j
kk
z
−
+
−
−
−
−=OM
New solver forsensitivity integration
Methods formodel reduction
2x
1x
2z 1
z
*x
17Dynamic real-time optimization
Efficient sensitivity integration solver
z∂∂
zi
i nizf
sxf
sM ,...,1=∂∂
+
∂∂
=&
Dynamic optimization problem:
))((0),,(0
)(0),,(s.t.
00
ftxEtzxP
xtxzxtfxM
≥≥
−==&
),,(min tzxz
Φ
Typical solution approaches based on BDF-type integrators• Caracotsios & Stewart (1985), Maly & Petzold (1996), Feehery et al. (1997)
New idea: Use one-step extrapolation method• Based on LIMEX algorithm (Deuflhard et al. (1983,87))• Extension for sensitivity computation: Schlegel et al. (2002)
},,{ ftpcz =
18Dynamic real-time optimization
Reuse LUdecomposition
Combined state and sensitivity system
zi
i nizF
sxF
sM
tzxFxM
,...,1
),,(
=∂∂
+
∂∂
=
=
&
&
Efficient solution of the combined system• M is identical in both systems.• A is already required for state integration.
A:=T
nzssxX ],,[ 1 K=
),,(f tzXXM =&
with
neglect off-diagonalelements
Linear-implicitEuler discretization
),(f
1
11 zX
hM
AA
hM
AA
hM
A
XX k
jn
j
j
kk
z
−
+
−
−
−
−=OM
19Dynamic real-time optimization
zki
kikkiki
kkk
niypf
syALUss
pyfLUyy
,...,1,)()()(
),()(
,1
,1,
11
=
∂∂
+−=
−=
−+
−+
Solution algorithm
Extrapolation algorithm for simultaneous state and sensitivity integration
Compute
for j=1,...,jmax while convergence criterion not satisfied
for k=0,...,j-1
if j>1 compute Tj,j and check convergence
)),(( 00 pyfy
A∂∂
=
j
j
hB
ALU
jHh
−=
=
0
/
jj YT =1,
jjnew XX ,=
(here simplified for M = const.)
Reuse LUdecomposition
20Dynamic real-time optimization
Results
Small example problem, solved for two different tolerances
tol = 1.e-5 tol = 1.e-7
⇒ One-step extrapolation faster than multistep BDF with increasing level ofdiscretization
⇒ Used as standard for optimization of INCOOP benchmark problems
21Dynamic real-time optimization
Algorithmic improvements – sequential approach
Sensitivity integrationis expensive
Reduce numberof sensitivity parameters
Improve efficiency of sensitivity integration
Reduce model complexity
State integration is expensive
Control gridadaptation strategy
),(f
1
11 zX
hM
AA
hM
AA
hM
A
XX k
jn
j
j
kk
z
−
+
−
−
−
−=OM
New solver forsensitivity integration
Methods formodel reduction
2x
1x
2z 1
z
*x
22Dynamic real-time optimization
Multiscale representation
∑+=Λ∈ ψ
ψϕ),(
)(,,)(0,00,0kj
tkjkjdtcu
Different representations of thesame function …
(t)c ,, 0000 ϕ (t)d ,, 0000 ψ0=j
1=j
2=j
3=j
0=j
1=j
2=j… for problem discretization:
… for grid point elimination analysis:
(t)c ,, 0101 ϕ
(t)c ,, 1111 ϕ
∑=Λ∈ ϕ
ϕ),(
)(,,kj
tkjkjcu
single scale function
wavelet
23Dynamic real-time optimization
Adaptive refinement algorithm
• Concepts from signal analysis
• Grid point elimination
• Grid point insertion
untilstoppingcriterionmet.
Repetitive procedure
• Re-optimize problem on refined mesh
• Profile from previous solution as initial guess
• Decouple optimization and adaptation
eliminate refine
refine
Mesh analysis
coarse initial mesh
wavelet
analysis
re-solve optimization
re-solve optimization
…
24Dynamic real-time optimization
Elimination of parameterization functions
Problemspecification
Discretization NLP
Warm start
A-posteriori analysisTerminationcriterion• Elimination
• Insertion
Analysis of wavelet coefficientsof control variables
ε≤−
||*||
||*~*||
u
uu
Minimize number of parameterizationfunctions in such that:
Approximation: Norm equivalence Discarding small causes only small changes in approximate representationdu
lL 22
~kjd ,
timeco
ntro
l
*u
25Dynamic real-time optimization
Insertion of parameterization functions
Problemspecification
Discretization NLP
Warm start
A-posteriori analysis Terminationcriterion• Elimination
• Insertion
Analysis of wavelet coefficientsof control variables
Introduction of new parameterization functions where η≥d kj,
cont
rol
time
26Dynamic real-time optimization
Example: Batch reactive distillation
D, xDR
V
Q
Objective:Minimize energy demand with given:• Fixed batch time• Amount of distillate D 6.0 kmol• Product purity xD 0.46
Controls:• Reflux ratio R(t)• Vapor rate V(t)
Dynamic model:• 10 theoretical trays• gPROMS model contains 418 DAEs (63 differential equations)
≥
≥
27Dynamic real-time optimization
Results: Batch reactive distillation
28Dynamic real-time optimization
Application in direct approach setting
fixed discretizationadaptive successive
refinement
Adaptive approach (Binder et al., 2000):• numerical lower for the adaptive refinement approach• intermediate solutions are available
- back-up values in real-time environment- direct employment on the process at early time
29Dynamic real-time optimization
Software development – sequential approach
DyOS yes
no
SetVariables
optimal trajectory
gridrefinement
DAEintegrator
stopping criterion
ES
O
model server(e.g. gPROMS)
processmodel
ESO
u(t)
u(t)
u(t)
u(t)
NLPsolver
CAPE-OPENcompliantsoftware interface
CORBA Object Bus
GetResiduals
initial trajectoryO
PC
connection toOPC server
Dynamic optimization software DyOS (LPT)
30Dynamic real-time optimization
algebraic and control variablesdiscontinuous
××××
∑=
=k
q
qn
q ytgty1
)()( ∑=
=k
q
qn
q utgtu1
)()(
× ×q = 2
q = 1
differential variablescontinuous
∑=
−− −+=k
q
q
n
qnn dt
dztgttztz
111 )()()(
× ××
×element n
×
×
collocation points
to tf
× × × ×
• ••• •
••
••
••
•
true solution
polynomials
× ×× ×
•
finite element ntn
αn
× × ××
mesh points
Collocation on finite elements
Simultaneous approach → collocation (I)
31Dynamic real-time optimization
( )fi,qi,qi ,p,t,u,yzψ min
,,, ,,,
1,
=
p,uyz
dtdz
,zFdtdz
jijiiji
i-ji
= p,uyz
dtdz
,zG jijiiji
i- ,,,0 ,,,
1
ul
ujiji
lji
uji
lji
uii
li
ppp
uuu
yyy
zzz
≤≤
≤≤
≤≤
≤≤
,,,
,ji,,
s.t.
ii
jii z
dtdz
fz
= −
−1
,,
1
(0)0 zz o =
Simultaneous approach → collocation (II)
Conversion into NLP problem yields
large-scale NLP problem
uL
Rx
xxx
xc
xfn
≤≤
=∈
0)(s.t
)(min
Requires specially tailored solution techniques:• advanced interior-point solver• filter-line search techniques(implemented as IPOPT, Biegler et al., 2001)
32Dynamic real-time optimization
0 0)(s.t
ln)()( min1
=−=
−= ∑=∈
xsxc
sxfxn
ii
Rx nµϕµ
0 0)(s.t
)(min
≥=
∈
xxc
xfnRx
original formulation
barrier approach
can be generalized for
bxa ≤≤
⇒ as µ → 0, x*(µ) → x*
Barrier function formulation
33Dynamic real-time optimization
⇒Newton Directions (KKT System)
0 0 )(0 0 )()(
=−==−=−+∇
xsxceSVevxAxf
µλ
⇒solve primal-dual version
−
−+∇
−=
−
−−−
0
00000
000
11
ceSvvAf
dddd
IIA
IVSIAH
v
s
x
T
µλ
λ
Solution of the barrier problem (I)
34Dynamic real-time optimization
⇒ Range Space Step
cCdR1−−=⇒
0=+ cdA xT
( )( ) ( ) QTT
T
RTT
dQdHQddRdHQQ
Q
Σ++Σ++∇ 21 min µϕ
⇒ Null Space Step (reduced QP)
reduced Hessian cross term
( )[ ] ( )( )RTTT
Q RdHQQQHQd Σ++∇Σ+−=−
µϕ1
Solution of the barrier problem (II)
35Dynamic real-time optimization
Opt
imal
ity (
RG
)
Feasibility
Member of filter set Area of optimal solutionk),( ϕθ
Illustration of filter concept
36Dynamic real-time optimization
Software development – simultaneous approach
Dynamic optimization software DYNOPC/IPOPT (CMU)
DYNOPC
optimal trajectory
NLP solverIPOPT
model server(e.g. gPROMS)
processmodel
ESO
u(t)
u(t)
initialintegration
CAPE-OPENcompliantsoftware interface
CORBA Object Bus
SetVariables
ES
O
GetResiduals
initial trajectory
37Dynamic real-time optimization
Comparison of approaches
initial guess requiredfor...
DAE model fulfilled ineach step?
size of NLP
states andcontrols
controls
noyes
largesmall
Simultaneousapproach
Sequentialapproach
Experience from solving INCOOP benchmark problems
• sequential approach more robust and capable of handling biggerproblems
• simultaneous approach can be faster with good initial guess, butmore sensitive to initial guess
• accuracy problems with simultaneous approach for stiff problems
(error controlled integration vs. fixed-grid collocation)
38Dynamic real-time optimization
Results for Bayer Benchmark Problem
39Dynamic real-time optimization
Interplay between D-RTO and MPC
• Soft constraints can be movedfrom MPC to D-RTO
• Longer time horizon for D-RTO toensure feasibility
• D-RTO trigger for a possible re-optimization
• Delta-mode MPC computes updates to the control profiles for trackingthe process in the strict operation envelope: rejects fast frequencyprocess disturbances
t∆
t~∆.......
refref uy ,updated
D-RTO trigger
D-RTO
MPC
refref uy ,updated
40Dynamic real-time optimization
D-RTO trigger (I)
)ˆ,()ˆ,( jref
iT
ijref
ij duhduL µ+Φ=
• One sensitivity integration of process model at eachsampling time using previous D-RTO results (andactive constraint set) at is required
• Compute change in sensitivities ( ) andLagrange function ( ) can be thencalculated
it0
jt0~
ijj SSS −=∆
;ˆ0
~jt
jjj dddLS =compute
Lagrange function sensitivities w.r.t. all estimated disturbances
ijj LLL −=∆
41Dynamic real-time optimization
D-RTO trigger (II)
• Solution to QP problem:
- using second order information (Hessian of Lagrange function)⇒ optimal sensitivities
- using first order information⇒ feasible only sensitivities
• updates as )ˆ( ijT
irefi
refj ddUuu −+=
and changed active constraint set
jtjj
refjj ddduU
0~
ˆ=compute
• If and are larger than a threshold value Sth and changed activeconstraint set is predicted, a re-optimization should be done
• Else linear updates based on optimal solution sensitivities are sufficient
jS∆ jL∆
jU
Optimal solution sensitivities w.r.t. all estimated disturbances
42Dynamic real-time optimization
results with re-optimization and feasible updates
43Dynamic real-time optimization
re-optimization results (2)
• Reaction parameters randomlyperturbed between their bounds
• Re-optimization done only whennecessary
⇒ steer to desired grade
• Feasible updates only possible up to+4% change in parameter 1
• D-RTO problem needs to be solved only necessary
• the hybrid integrated D-RTO and control with embedded sensitivityanalysis is well suited for large-scale industrial process operation
44Dynamic real-time optimization
Summarizing comments
Off-line dynamic optimization:Today already many numerical and software techniques availablefor efficient and convenient solution of such problems
but...
dynamic optimization still not state-of-the-art (especially not in industry):• Though pure solution time for solving one mathematical problem only in the
order of hours,• overall engineering time to solve the real application problem in the order of
weeks or months.• Problems: Modeling issues, problem formulation, convergence problems, ...
It is still not “pushing the button”.
45Dynamic real-time optimization
Future perspectives
Experience from INCOOP: for large-scale process models application ofdynamic optimization in real-time still time-critical
Dynamic real-time optimization• further enhance sequential approach dynamic optimization• more elaborate adaptation strategies• interaction NLP solver / integrator• adapt integration accuracy• incorporate second order information
Integration of control and optimization• further exploit re-optimization features• apply adaptation strategies in real-time context• gain speed by feasible-first optimizations• interlink MPC and D-RTO by shifting the prediction to the D-RTO level