advanced strategies for real-time process...

42
11-6-25 1 Advanced Strategies for Real-Time Process Optimization Dr Zhijiang Shao Department of Control Science and Engineering Zhejiang University, Hangzhou, China EMAIL[email protected] NTUA, Greece, June 2, 2011 City of Hangzhou Hangzhou is one of the most beautiful city in China 180km away from Shanghai, 45 mins by train. Settled as early as 4,700 years ago, used to be capitals of six dynasties in china history. "the most splendid and luxurious city in the world" by Marco Polo, the Italian traveler in the 13th century. Total population of 6+ million Specials: West lake/Historic Sites/Green Tea/Sweet Osmanthus/Silk/

Upload: vanlien

Post on 29-Jul-2019

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

1  

Advanced Strategies for

Real-Time Process

Optimization

Dr Zhijiang Shao Department of Control Science and Engineering

Zhejiang University, Hangzhou, China EMAIL: [email protected]

NTUA, Greece, June 2, 2011

City of Hangzhou

•  Hangzhou is one of the most beautiful city in China

•  180km away from Shanghai, 45 mins by train.

•  Settled as early as 4,700 years ago, used to be capitals of six dynasties in china history.

•  "the most splendid and luxurious city in the world" by Marco Polo, the Italian traveler in the 13th century.

•  Total population of 6+ million

•  Specials: West lake/Historic Sites/Green Tea/Sweet Osmanthus/Silk/…

Page 2: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

2  

Zhejiang Univ. (1897~)

•  Founded a century ago: Qiushi Academy (with the literal meaning of "seeking truth" in Chinese)

•  3,000 full-time teachers, 1,200 professors, 80,000 students

•  40k+ full-time students, including 23k+ undergraduates, 9,500+ graduate students working for master degree, 6k+ doctoral candidates, 2k foreign students.

•  24 colleges, six campuses in Hangzhou, total area of 500+ hectares and a floor space of 2M+ square meters

Department of Control Science and Engineering

•  celebrated its 52 years anniversary •  originally part of Dept ChE Eng •  measurement and instrumentation and, control strategy

and theory, control systems development, systems engineering, …

Professors 5 Associate Professor 3 Assistant Professor 1

PhD students 8 Master students 21

Process Modeling & Optimization Process Control & Monitoring

PSE Lab in ZJU

http://pse.zju.edu.cn/

Page 3: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

3  

PSE Lab in Zhejiang University

Method & Algorithm Development Ø  Convergence depth control for optimization Ø  Random sampling based parameter tuning Ø  Robust extensions for reduced-space interior point methods Ø  Accuracy control of dynamic optimization based on Bi-level

method Ø  Homotopy-based backtracking method for simulation &

optimization of load change operation Ø  Objected-oriented disjunctive programming Ø  Dual-rate system identification Ø  Industrial MPC and LPV-based NMPC algorithm Ø  Model free optimization for batch process

PSE Lab in Zhejiang University

Industrial Applications Ø  Load change operation of cryogenic air separation process

Ø  Load change operation of high-temperature gas-cooled

nuclear reactor

Ø  Monitoring and optimization of PTA process

Ø  Quality control & optimization of injection molding process

Ø  Simulation & optimization of molecular weight distribution of

polymerization

Page 4: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

4  

PSE Lab in Zhejiang University

Software Development Ø  FrontAPC Suite

Ø  Taiji MPC (with Dr Zhu Yucai)

Ø  ALC for ASU (with Hangyang Group)

Ø  ProcessX(with ViaControl Inc)

Ø  RSQP for Matlab (with LT Biegler)

Ø  Extension of IPOPT(AOS, A2A)

Ø  Matlab-AspenPlus Interfacing toolbox

Aspen Plus

CNumericNLPSystemFactory

CNumericNLPSystem

SocketPlugScaling Module

CCapeNLP

NLP Problem

CCapeNLPSolverManager

CCapeNLPSystemCSolverParameter

IPOPT

AOSNumericNLPSystemFactory

AOSNumeicNLPSystem

AOSNumericNLPESO

IScalingModelInfo

ICapeMINLP

ICapeMINLPSystem

ICapeMINLPSolverManager

CallSocketCallPlug

PseudoSolver

MAP Interfacing

Toolbox

8

•  Algorithms and Techniques to Improve Convergence •  Mnemonic Enhancement Optimization •  Convergence Depth Control •  Robust Extensions for Reduced-Space Barrier Methods •  NLP Solver Parameter Auto-Tuning

•  Software Framework Based on CAPE-OPEN •  ASPEN Open Solvers Compliant IPOPT •  ASPEN PLUS Compatibility Extension for CAPE-OPEN Based Solvers •  ASPEN PLUS to AMPL Link

•  Industrial Applications •  Large-Scale PTA System Simulation and Optimization •  Simulation and Dynamitic Optimization of High-Temperature Gas-

Cooled Reactor (HTR)

Outline

Page 5: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

5  

9

Real-Time Optimization (RTO) Background

What is RTO? •  RTO is the approach that

keeps the process operating at the optimal set point by re-optimization under frequently changing conditions

Importance •  increase profit •  reduce costs

parameter estimation model update

optimization

controller

process

RTO cycle

uncertainties

data reconciliation

10

safety stability sustainability maximum-capacity optimality

planned economy à market economy à high productivity and hi-end products

Background: change of operation mode

Five Keys for process operation

à Variability à adaptation

Page 6: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

6  

11

Challenges and Opportunities

RTO Challenges •  real-time requirement •  robust convergence

Opportunities •  Take advantage of the similarity among RTO problem

sequence to accelerate solution process •  Design flexible convergence criteria to find the trade-off

between computational accuracy and efficiency •  Exploit the feature of large-scale process optimization with a

few degrees of freedom to develop reduced-space methods •  Design parameter auto-tuning to find appropriate option

settings for NLP solvers to improve practical performance •  Develop integrated modeling and optimization platform to

improve software accessibility and cooperation

12

Mnemonic Enhancement Optimization (MEO)

disturbances

departure from optimal set point

re-optimization

back to optimal set point

real-time performance

⎪⎩

⎪⎨

∈=∈=

+∈

IjycEiycts

yf

j

i

Ry dn

,0)(,0)(..

)(min

Optimization Algorithms: • RSQP • IPM • Augmented Lagrangian method etc.

Starting strategies: • hot start • warm start • traditional method in industrial practice

Observations of RTO Problem Sequence •  same objective function •  same constraints • different values of model parameters

RTO Observations

Page 7: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

7  

13

Parameterization minx!Rn

f (x,! )

s.t. ci (x,! ) = 0, i!Ecj (x,! ) " 0, j !I

#

$%%

&%%

TTTxy ][ α=

optimal set mapping

)(* αϕ=x

proved continuous under reasonable

assumptions dR∈α measured

variations of RTO system

Traditional Method in RTO

Parameterization & MEO Idea

MEO idea

⎭⎬⎫

+1

*),(

k

ii xαα appropriate

approximation schemes

01+kxstarting point

optimization *1+kx

critical for large-scale nonlinear optimization

historical database

MEO Method

a  good  start  is  half  the  success

14

Numerical Experience on a Debutanizer and Depropanizer Distillation Sequence Comparison of approximation error between

traditional method in RTO and MEO with zero-order approximation. Blue dots from MEO, and red dots from traditional method

Nearest-neighborhood Approximation

starting point approximation

nearest node selection

4190 variables 32 parameters 800 fluctuations

average solution time (s)

average # iterations

traditional method 116.2 5.6 MEO with Nearest-

neighborhood approximation

102.2 4.7

*1

01

* )( ++ →→= kkii xxx αϕ

jkkjij

αααα

−= += 1,,1minarg

Theoretical Result limk!"

P xk+10 # xk+1

* < !( ) =1

MEO with Nearest-neighborhood Approximation

X.Fang, Z.Shao, Z.Wang, W.Chen, K.Wang, Z.Zhang, Z.Zhou, X.Chen, J.Qian. Mnemonic Enhancement Optimization (MEO) for Real-time Optimization of Industrial Processes. Industrial and Engineering Chemistry Research, 2009, 48: 499–509

xk+10 ! xk+1

*

Page 8: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

8  

Approximation methods in MEO

interpolation method description advantages

Nearest-neighborhood Choose the past optimal solution as the initial point on the basis of the nearest node selection rule

easy method and good for use

Hermite

Choose the past optimal solution and corresponding derivative information to construct the initial point on the basis of the nearest node selection rule

derivative information is used

full space multivariate Lagrange

Construct initial point based on the Delaunay triangulation, nested node selection and a high-performance full space multivariate Lagrange interpolation

arbitrary degree of interpolation polynomials; approximation error can be very small

Barycentric A special case of full space multivariate Lagrange interpolation (degree=1)

suited for the case that there are not many experiences available

Radial Basis Function Perform RBF interpolation on an adequately accumulated empirical database with fixed size

a global interpolation method, suited for multivariate approximation based on scattered data

Z.Wang, Z.Shao, X.Fang, W.Chen, J.Wan. A Modified Mnemonic Enhancement Optimization Method for Solving Parametric Nonlinear Programming Problems. 49th IEEE Conference on Decision and Control, 2010

16

jkkjij

αααα

−= += 1,,1minarg

01+kx

MEO database

maxITERiter ≤

optimization

incremental Delaunay triangulation

( )*,, kk xiter α

iter

Y abandon

N ( )*, kk xα

old DT data

new DT data

node selection

•  nearest node selection •  nested node selection

approximation algorithm

1, +kN α

( ) ( )** ,~,11 NN iiii xx αα

threshold to control the size of MEO database

X.Fang, Z.Shao, Z.Wang Z. Mnemonic Enhancement Real-Time Optimization with Modified Barycentric Interpolation for Process Systems. International Symposium on Advanced Control of Industry Processes, 2011

MEO Empirical Database

( ) ( )dataDT

xx kk

~ **

11 ,, αα

X. Fang, Mnemonic Enhancement Optimization for Process Systems, PhD Thesis, 2009

Page 9: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

9  

•  Observations 1.  Algorithm has arrived very close to the optimum, but it spends

considerably more iterations to get further minor improvement 2.  The problem is not going to converge, and the algorithm spends

much time to keep trying until fails at last 3.  Algorithm fails due to exceeding the maximum number of

iterations, but feasibility is satisfied from the very early iterations to the end

•  Possible Reasons 1.  Rank deficient or inconsistent constraints 2.  Poor scaling of optimization problem 3.  Discontinuities of problem functions

•  Motivation •  Intelligent mechanism to be aware of the improvement the

algorithm has achieved and will achieve later •  Stop both successful and unsuccessful problems earlier

Cost-Effective Convergence Depth Control (CDC)

18

• Observation Indices •  Feasibility: •  Predictive Objective Improvement: •  Feasibility Change:

•  Objective Change:

}),(max{ kkfeask xxc −=δ

1−−= kkobjChgk ffδ

00)(..

)(min

≥=

xxcts

xfx

feask

feask

feasChgk 1−−= δδδ

kTk

objk df∇=δ

• Estimate Quality of Iterates •  Transformed Sigmoid Function: •  Convergence Depth:

•  Algorithm Progress:

( )varPr },,max{ εδδδ objChg

kfeasChgk

ogk S=

ζεδζεδ

tanh)log/logtanh(),( var

vark

kS ⋅=

( )var},,max{ εδδδ objk

feask

Cnvgk S=

CDC Framework

• NLP Problem

transformed sigmoid function (ξ=1.5) according to different εvar

Page 10: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

10  

19

Convergence Criteria Based on CDC Method

Theoretical results •  Under appropriate assumptions, the optimization process will either

terminate successfully at the acceptable approximate solution; or terminate because of no margin for improvement

•  Convergence depth indicates the degree of iterates converging to a Kuhn-Tucker point

CDC

Y Y

start CDC?

Y

optimization process

calculate

calculate

?

N

ogk

Cnvgk

Pr,δδ

objChgk

feasChgk

objk

feask δδδδ ,,,

δδ ≥Cnvgk

acceptable approximate solution

? 1Pr ≥ogkδ

under-converged result

N N

20

•  4190 variables, 2 degrees of freedom •  Change the feed 17 times, increasingly derivate from its optimal value •  Compared to traditional criteria, CDC reduced the total number of

iterations by 81.2%, CPU time by 85.9%. The most difference between their objective is 4.491e-10, between feasibility is 9.102e-7

Optimization of Distillation Columns

Data Reconciliation for ASU

-70 -40 -30 -20 -10 10 20 30 40 50 60 70 80 90 100 110 1400

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1x 10-6

load change amount

cons

train

t vio

latio

n

CDCTrad

-70 -40 -30 -20 -10 10 20 30 40 50 60 70 80 90 100 110 1400

20

40

60

80

100

120

load change amount

num

ber o

f ite

ratio

ns

CDCTrad

-70 -40 -30 -20 -10 10 20 30 40 50 60 70 80 90 100 110 1400

500

1000

1500

2000

2500

3000

3500

load change amount

CPU

(s)

CDCTrad

-70 -40 -30 -20 -10 10 20 30 40 50 60 70 80 90 100 110 14018

19

20

21

22

23

24

25

load change amount

obje

ctiv

e va

lue

CDCTrad

number of iterations CPU time objective feasibility

CDC Tradition Criteria

# iteration 41 191

CPU (s) 16.47 92.83 objective 4.0051e-2 4.0051e-2

feasibility 2.5313e-8 1.3039e-8

converged √ √

With the same objective and satisfied feasibility, the CPU time is decreased 82.26%

CDC for RSQP (I&ECR 2007) & IPOPT (AIChE J 2010)

K.Wang, Z.Shao, Z.Zhang, Z.Chen, X.Fang, Z.Zhou, X.Chen, J.Qian. Convergence Depth Control for Process System Optimization., I&ECR, 2007, 46(23): 7729-7738 W.Chen, Z.Shao, K.Wang, X.Chen, L.T.Biegler. Convergence Depth Control for Interior Point Method. AIChE Journal, 2010, 56(12): 3146-3161

Page 11: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

11  

21

•  Ideally, the optimal control problems (OCPs) can be solved instantaneously, thus there is no computational delay at all

•  Practically, the computation time for solving OCPs can’t be neglected •  Tradeoff between computational delay and control performance is needed

tolerancesmall

tradeoff point

large

Control performance

small

solution accuracycomputational delay

com

puta

tiona

l del

ay

solu

tion

accu

racy

high

low

relationship among computational delay, solution accuracy, and control performance (feasible sqp)

CDC for Nonlinear MPC

22

3 6 9 12 200 255 310 365 427

time[min]

T c [K]

profiles of T c (Input)

3 6 9 12 0 0.25

0.5 0.75

1

time[min]

C A [m

ol/L

]

profiles of C A

3 6 9 12 280 340 400 460 520

time[min]

T[K]

profiles of T (Output)

•  NMPC of CSTR

(Henson 1997; Tenny 2004; Findeisen & Allgöwer 2003)

!CA =qV(CAf !CA) ! k0 exp ( !

ERT)CA ,

!T = qV(Tf !T ) +

!"H!CP

k0 exp ( !ERT)CA +

UACPV!

(TC !T ),

OP1

Time step (11-40;71-100)

Weight Matrix

Q R S

2 0

OP2

Time step (41-70) Weight Matrix

Q R S

2 0.02

target

target

target

A,

C ,

T 375KC 0.159mol / LT 302.84K

=

=

=⎥⎦

⎤⎢⎣

⎡4004

target

target

target

A,

C ,

T 350KC 0.5mol / LT 300K

=

=

=⎥⎦

⎤⎢⎣

⎡4000

Parameters for Numerical Test Real-time simulation with NMPC Ideal Simulation with NMPC

3 6 9 12 200 255 310 365

427

time[min]

T c

profiles of T c (Input)

3 6 9 12 0 0.25 0.5

0.75 1

time[min]

C A

Profiles of C A

3 6 9 12 280 340 400 460 520

time[min]

T[K]

Profiles of T (Output)

[K]

[mol

/L]

CDC for Nonlinear MPC

Page 12: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

12  

23

criteria computation time (s)

IAE of output average longest shortest median

traditional criteria 10.62 40.53 1.94 7.98 4626.1

CDC 1.95 9.25 0.64 5.52 496.98

Statistics of Results

J.Wan, Z.Shao, K.Wang, J.Qian. Reduced Precision Solution Criteria for Solving Optimal Control Problems in NMPC. 49th IEEE CDC 2010

3 6 9 12 200 255 310 365 427

time[min]

T c [K]

profiles of T c (Input)

3 6 9 12 0 0.25 0.5

0.75 1

time[min]

C A [m

ol/L

]

profiles of C A

3 6 9 12 280 340 400 460 520

time[min]

T[K]

profiles of T (Output)

reference tracking under CDC Computational delay in NMPC under traditional criteria

CDC for Nonlinear MPC

•  Motivation for Reduced-Space Interior-Point (rIP) Methods •  Barrier methods are more efficient in dealing with inequalities (which can be simple

bounds for process systems to specify physical limits, product specifications or operating ranges) than active set methods

•  rIP method is efficient for large-scale process optimization with only a few degrees of freedom, for which quasi-Newton approximations can be used. This is important because there are few commercial modeling packages that provide second order derivatives and none of these related to process engineering applications

•  Problems for Robust Convergence •  Degenerate constraints lead to rank deficient Jacobians, for which reduced-space

methods fail immediately because reduced-space decomposition seems impossible

•  Ill-conditioning, singularity, infeasibility, etc. impose difficulties for global convergence

•  All these problems can come from formulation, such as improper models, discretization of high-index dynamic problems, or Newton’s method, which deals with nonlinear functions by local linearization

•  Ideas •  Dimension change method allows reduced-space decomposition for rank deficient

Jacobians •  Projected dogleg feasibility restoration phase working together with filter methods

helps to realize global convergence or identify (local) infeasibility of NLP problems

Robust Extensions for Reduced-Space Barrier Methods

Page 13: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

13  

⎥⎦

⎤⎢⎣

⎡−=⎥⎦

⎤⎢⎣

⎡=

∈∈∈∈⎥⎦

⎤⎢⎣

⎡=<=

−×−×−−××

rn

r

rnrmrrmrnrrrT

INCZ

IY

RNRCRNrankfullisRCNCNCAmrArank

~~,

0

ˆ,ˆ,~,~,ˆˆ

~~,)(

1

)()()()(

Dimension Change

Projected Dogleg Restoration Phase

Dimension Change Method & Restoration Phase

space decomposition according to the rank of TA

•  feasibility restoration problem

UL

RRRx

xxxts

xxDxcxn

≤≤

−+=∈

..

||)(||2

||)(||21)(min 2

222

ζφ

•  Define the above restoration problem to share decomposition in restoration phase with the rIP algorithm, thus to avoid extra decomposition overhead

•  Use projection method to deal with boundary constraints efficiently •  Exploit line-search strategy and determine the direction by combining Cauchy and

Newton steps, therefore the restoration algorithm has robust convergence property like trust-region method but is less inexpensive to be implemented

•  When the restoration algorithm converges to an infeasible stationary point, it indicates that the problem is at least locally infeasible

projected dogleg step

projected Newton step

projected Cauchy step Cp

Np

Dp

Feasibility restoration phase tries to help NLP problem to get progress by delivering a new iterate which is sufficiently less infeasible

0))(()(,...,1,0)(..

)(min

2)1()1(

)(

=−==xcxc

mixctsxfi

prob   fea   infea   prob   fea   infea   prob   fea   infea   prob   fea   infea  

avion2   opt   st   hs060   opt   st   methanol   opt     st   smmpsf   opt   st  

catmix   st   st   hs062   opt   st   minc44   opt   st   spanhyd   opt   st  

dallasl     opt     st     hs063   opt     st   minperm   opt   -­‐   ssebnln   opt   -­‐  

dallasm     opt     st   hs067   opt   st   optcdeg2   opt   st   ssnlbeam   opt   st  

dallass     opt     st   hs080   opt     st   optcdeg3   opt   st   steenbrb   opt     st  

di>ert     opt     st   hs081     opt     st   optcntrl   opt   st   steenbrd   opt   st  

gasoil   opt   st   hs099     opt     st   optctrl3   opt   -­‐   steenbre   opt   st  

himmelbj   opt   st   hs112   opt   st   optctrl6   opt   -­‐   steenbrg   opt     st  

hong   opt     st   hs99exp   opt   -­‐   prodpl0   opt     st   swopf   opt   st  

hs032   opt   st   loadbal   opt   -­‐   prodpl1   opt   st   try-­‐b   opt   st  

hs042   opt   st   lsnnodoc   opt   st   rk23   opt   st   zigzag   opt   st  

hs054   opt   st   marine   opt     st   smbank   opt     st  

Numerical Tests on Modified CUTE/COPS Examples with rIPOPT

modified example (feasible) modified example (infeasible)

fea:feasible case; infea:infeasible case; opt:optimal point; st:stationary point; -:failed case

1))(()(,...,1,0)(..

)(min

2)1()1(

)(

=−==xcxc

mixctsxfi

K.Wang, Z.Shao, L.T.Biegler, Y.Lang, J.Qian. Robust Extensions for Reduced-Space Barrier NLP Algorithms. Computers and Chemical Engineering, in press

Page 14: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

14  

27

•  Motivation •  Parameters/Options have significant impact on performance of NLP solvers •  Parameters are usually set by developers based on the rule of thumb. Not

easy to adjust them appropriately in practical applications.

•  Application Scenarios •  Hard Problems: When solvers under default parameter settings cannot

solve problems successfully, try PAT to find a way out •  Performance Improvement Demand: Such as in RTO or NMPC

applications, use PAT to improve online performance of solvers at the cost of some offline efforts

Parameter Automatic Tuning (PAT) for NLP Solvers

!

Relationship between performance of

optimization solver and parameter configurations

28

Random Sampling Algorithm1. θ ← default parameter setting θo; // N(θ, radius) is the neighborhood, radius is used to restrict // the lower and upper bound of integer and continuous parameter2. W  ← N(θ, radius); // TerminationCondition is designed based on computational // resource, such as number of function evaluations or total run time3. while not TerminationCondition() do4. θ ← random θr Î  W;5. call flag ← EvaluatePerformanceFunction(A, θ, Ins);6. if flag == true then θopt ← θ; break;7. return θopt;

PAT for Hard Problems

Page 15: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

15  

29

Enhanced Random Sampling Algorithm 1. θ ← default parameter setting θ0; // The fixed parameters only have one value for constructing new // neighborhood 2. W  ← N(θ, radius); 3. while not TerminationCondition() do 4. θ ← random(W); 5. call flag ← EvaluatePerformanceFunction(A, θ, I); // if θ is better than θopt, Better returns true 6. if flag == true && Better(θ, θopt) then 7. θopt ← θ; 8. FollowHeuristicRules(); // if the current neighborhood is sufficiently searched, the // neighborhood is updated 9. if UpdateNeighborhoodCondition() then // if θopt is updated in the current neighborhood, // θopt is used as the central point to create the // new neighborhood; otherwise, a random parameter // setting from current neighborhood is utilized10. if Isthetaoptimaupdated() then θ ← θopt; 11. else θ ← random(W);

               //  same as step 2, fixed parameters only have one value12. W  ← N(θ, radius);13. return θopt

PAT for Performance Improvement

An automatic parameter tuning tool for NLP solver

Using default parameters of NLP solver to solve some comprehensive problem

Fail to solve the hard problem

Too slow to satisfy real-time requirement

Default parameters of solver are not perfect.

Existing problem

Platform AMPL

Application OCP, RTO, NMPC…

PAT tool for NLP solver is needed

This software is a tool of tuning the parameters for NLP solver (IPOPT, SNOPT,MINOS,KNITRO). It was developed with Python and provided a GUI for users.

Algorithm Enhanced Random Sampling(ERS)

Page 16: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

16  

Software interface

Main Window of this software: It contains “Solving process information” on the left and “Optimized parameters configuration” on the right.

Mode Selection Window

Model Mode Ø Tuning parameters for each

model respectively. Ø Tuning general parameters

for all selected models.

Solving Mode Ø Tuning all selected

parameters. Ø Tuning each parameter one

by one. Ø Tuning any two of all selected

parameters

This window provides some different modes for parameter tuning.

Software interface

Page 17: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

17  

Solver Tree Window Ø Solver selection (IPOPT,

SNOPT,MINOS,KNITRO) Ø Parameters selection Ø Parameters' options

setting Ø Terminal condition setting

Coming soon… Ø Priority of different

parameters will be added. Ø Multithreaded technology

will be added to solve different problems at the same time.

Ø GUI will be improved.

Software interface

34

# iter CPU (s) objective feasibility status

Default 515 38.67 -5.000e-4 1.077e+1 restoration failed

Tuned 669 23.09 -4.372e-3 2.062e-11 optimal solution found

total CPU time decreased from 1655.0s to 184.6s

0 20 40 60 80 100

102

103

104

Simulation Horizon

Num

ber o

f Ite

ratio

ns

0 20 40 60 80 100

100

101

102

Simulation Horizon

CPU

Tim

e (s

)

DefaultTuned

DefaultTuned

Optimization of Crystallization Problem (Lang, Cervantes & Biegler, 1999)

NMPC of CSTR system (Hahn, Edgar, 2002)

PAT Case Studies

W.Chen, Z.Shao, K.Wang, X.Chen, L.T.Biegler. Random Sampling-Based Automatic Parameter Tuning for Nonlinear Programming Solvers, I&ECR, 2011, 50(7): 3907-3918

Page 18: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

18  

35

Provider Solver Type Interface Purpose

ESO NLA AOSNumericAlgebraicESO Problem description

NLP AOSNumericNLPESO Problem description

Solver

LA AOSNumericLASystem Solver access

AOSNumericLASystemFactory Solver factory

NLA AOSNumericNLASystem Solver access

AOSNumericNLASystemFactory Solver factory

NLP AOSNumericNLPSystem Solver access

AOSNumericNLPSystemFactory Solver factory

Common AOSNumericSolverComponent Parameters handling

Services Common AOSServices Memory allocation

AOSMessagesHandler Write to Sim window

ASPEN Open Solvers (AOS) Compliant IPOPT ASPEN Open Solvers Interface

36

Aspen Plus

CNumericNLPSystemFactory

CNumericNLPSystem

IPOPT

Scaling Module

CNLPStruct

NLP Problem

AOSNumericNLPSystemFactory

AOSNumeicNLPSystem

AOSNumericNLPESO

IScalingModelInfo

NLPStruct

AOS_IPOPT

PseudoSolver

Embedding IPOPT into ASPEN PLUS

Page 19: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

19  

37

AOS CAPE-OPEN

ICapeMINLP

ICapeMINLPSystem

ICapeMINLPSolverManager

Provide all the information required by a typical solver

Represent the conjunction of a selected solver with a particular MINLP problem

Given an MINLP object, exposing an ICapeMINLP interface, the solver manager creates an MINLPSystem which can be solved

AOSNumericNLPESO

AOSNumericNLPSystem

AOSNumericNLPSystemFactory

Describe, evaluate and update an NLP system

Allow a solver component derived from AOSNumericNLPSystem to be created

Provide the method that is called to solve the AOSNumericNLPESO passed to the solver when it is created

Compatibility Extension of ASPEN PLUS for CAPE-OPEN (C-O) Solvers Comparison between AOS and C-O

38

Aspen Plus

CNumericNLPSystemFactory

CNumericNLPSystem

SocketPlugScaling Module

CCapeNLP

NLP Problem

CCapeNLPSolverManager

CCapeNLPSystemCSolverParameter

IPOPT

AOSNumericNLPSystemFactory

AOSNumeicNLPSystem

AOSNumericNLPESO

IScalingModelInfo

ICapeMINLP

ICapeMINLPSystem

ICapeMINLPSolverManager

CallSocketCallPlug

PseudoSolver

Interface CO-IPOPT to ASPEN PLUS

W.Chen, Z.Shao, J.Qian. Interfacing IPOPT with Aspen Open Solvers and CAPE-OPEN. Computer Aided Chemical Engineering, 2009, 27: 201-206

Page 20: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

20  

39

•  Motivation u Using existing process simulator such as Aspen Plus may not be

enough for problem formulation u Extended definition of

•  new variables (interacting with existing EO variables) •  complex objective function •  complex constraints (either equalities or inequalities)

•  Problem Description

min ( )

. . ( ) 0

x

l u

f x

s t c xx x x

=≤ ≤

min ( ) ( , )

. . ( ) 0 ( , ) 0 , y

x

l u l u

f x Q x y

s t c xh x y

x x x y y

+

==

≤ ≤ ≤ ≤

ASPEN PLUS under EO Mode to AMPL (A2A) Link

40

x, y

Aspen Plus

Q (x, y)h (x, y)

first derivative, etc

x, y

x

f (x), c (x)first derivative,

etc

IPOPT

objectiveconstraints

⋯⋯

Integrated Model

Outside Model

AMPL

NL File AUX Files

get variable names

set x, y

Q (x, y) h (x, y)first derivative, etc

get objective name

Implementation of A2A Link

Page 21: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

21  

41

3 6

5

min :. .

0.91 0.02

Fs t mesh equations of the distillation columnsconnection eqautions of the distillation columnsPercentage of C HPercentage of C

≥≤

3 6

3 6

5

min : 0.0*. .

0.92 0.91 0.02

F ys t mesh equations of the distillation columnsconnection eqautions of the distillation columnsPercentage of C H yPercentage of C HPercentage of C

− +

− =≥

≤ 0 0.08y≤ ≤

objective # iteration feasibility CPU (s) 1.967e+1 16 6.26e-10 9.89

objective # iteration feasibility CPU (s) 1.964e+1 16 5.09e-10 18.86

Numerical Experiment – Optimization of Distillation Columns

42

Aspen Plus EO Modeling Environment

Aspen Open Solver (AOS) Interface

CAPE OPEN Unit Operation and Thermo Interface

C-O PX Oxidation Reactor

CAPE OPEN Optimization Interface

IPOPT

Convergence Depth

Control

AMPL

A2A Link

Parameter Auto Tuning

Overall Picture of Software Integration (PTA process)

Page 22: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

22  

43

4 Main Reactions

Reaction Kinetics

6 Side Reactions: generate CO generate CO2

PX

TA

PTA

oxidation

purification

P-Xylene Oxidation Reactor Model

Sequential Parameter Estimation Method

•  Ki (i=1…M) are kinetic constants which need to be estimated

•  Direct solving does not converge

PTA Modeling and Optimization

Multiple steady states in real process plant

-load fluctuates significantly -feed conditions changes -different products needed -operation conditions switched …

Reasons for multiple steady states

01-Jun-2008 00:00:00 01-Jul-2008 00:00:00-0.5

0

0.5

1

1.5

2

2.5

3

t /hhour

meas

ured d

ata /S

cmh

FIC 101 /100000

FIQC 102 /20000

FIQC 103 /40000

FIC 4 /10000

Air separation process

PTA process

Motivation: -  Process model is required to

cover a wide range of operation conditions for RTO use

-  Difficulty: an increase in computation effort

Page 23: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

23  

Formulation and Characteristics

Problem formulation with simultaneous approach:

, ,min ( ,

. . ( , , ) 01,2,...,1, 2,...,

1, 2,...,

X U pX Y)

G X U plx x uxlu u uui i i

j j j

kp kp kp p

J

s ti nj m

lp p up kp n

=≤ ≤ =≤ ≤ =

≤ ≤ =

( ,J X Y) - an objective function

[ ]1 2, ,..., nY = y y y - measurement data

[ ]1 2, ,..., nX= x x x - reconciled data [ ]1 2, ,..., mU = u u u - unmeasured variables

1 2, ,...,pn

p p p⎡ ⎤⎣ ⎦p = - model parameters

1 2[ , ,..., ]Ti i i iMy y y=y

1 2[ , ,..., ]Ti i i iMx x x=x

1 2[ , ,..., ]Tj j j jMu u u=u

M - number of data sets

( )2 2

1 1( , /

M n

ij ij ij i

J x y σ= =

−∑∑X Y) =

Formulation and Characteristics

Characteristics:

l  Large scale and nonlinear problem

l  Number of variables increases directly with the number of data sets

l  Solved simultaneously with infeasible path approach (SQP, IPOPT,…)

l  Difficult to solve with bad initial values

Using the characteristics of problem structure

Sequential Sub-Problem Programming Strategies - Construct a series of sub-problems which is easier to be solved - Use the solutions of each sub-problem as initial values of the next sub-problem - Get the optimum of the original optimization problem by solving this series of sub-problems

Page 24: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

24  

Sequential Sub-Problem Programming Strategies

Series of sub-problems:

Sub-problems based on increasing number of measurements 1 :P

( )1 2 2

1, , 1 1min ( , /

. . ( , , ) 01,2,...,1,2,...,

1,2,...,

X U pX Y

G X U plx x uxlu u uu

) =M

ij ij ij i

i i i

j j j

kp kp kp p

J x y

s ti nj m

lp p up kp n

σ= =

=≤ ≤ =≤ ≤ =

≤ ≤ =

∑∑

2 :P( )

2 2 22, , 1 1

min ( , /

. . ( , , ) 01,2,...,1,2,...,

1,2,...,

X U pX Y

G X U plx x uxlu u uu

) =M

ij ij ij i

i i i

j j j

kp kp kp p

J x y

s ti nj m

lp p up kp n

σ= =

=≤ ≤ =≤ ≤ =

≤ ≤ =

∑∑

:nP( )2 2

, , 1 1min ( , /

. . ( , , ) 01,2,...,1,2,...,

1,2,...,

X U pX Y

G X U plx x uxlu u uu

) =M n

n ij ij ij i

i i i

j j j

kp kp kp p

J x y

s ti nj m

lp p up kp n

σ= =

=≤ ≤ =≤ ≤ =

≤ ≤ =

∑∑

l  Use the characteristics of the objective

l  First sub-problem: use the multiple data sets of only the most important measured variable

l  Second sub-problem: add the multiple data sets of another measured variable

l  ….

l  The last sub-problem: use the multiple data sets of all the measurements

Sequential Sub-Problem Programming Strategies

Sub-problems based on increasing number of model parameter

,1 :kP

( )1

2 2, , 1 1

1

min ( , /

. . ( , , ) 01,2,...,1,2,...,

1

X UX Y

G X Ulx x uxlu u uu

) =M k

k ij ij ip j i

i i i

j j j

kp kp kp

J x y

s t pi nj m

lp p up kp

σ= =

=≤ ≤ =≤ ≤ =

≤ ≤ =

∑∑

,2 :kP( )

1 2

2 2, , , 1 1

1 2

min ( , /

. . ( , , , ) 01,2,...,1,2,...,

1,2

X UX Y

G X Ulx x uxlu u uu

) =M k

k ij ij ip p j i

i i i

j j j

kp kp kp

J x y

s t p pi nj m

lp p up kp

σ= =

=≤ ≤ =≤ ≤ =

≤ ≤ =

∑∑

, :pk nP

( )2 2, , 1 1min ( , /

. . ( , , ) 01,2,...,1,2,...,

1,2,...,

X U pX Y

G X U plx x uxlu u uu

) =M k

n ij ij ij i

i i i

j j j

kp kp kp p

J x y

s ti nj m

lp p up kp n

σ= =

=≤ ≤ =≤ ≤ =

≤ ≤ =

∑∑

l  Use the characteristics of the model parameters

l  First sub-problem: tunes only the most important parameter, whereas the other parameters are fixed

l  Second sub-problem: adds the number of tuning parameters

l  ….

l  The last sub-problem: tunes all of model parameters in the original DPRE problem

Series of sub-problems:

Page 25: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

25  

49

Objective Sequential Model

Parameter Sequential Model

adaptive-bounding for constraints

Objective Functions

Parameter estim

ation

change dimension of variables

change DOF of objective function

change constraints of parameter estimation

V 1

V 2

V 3

V 4

V N

PM 1

PM 2

PM 3

PM 4

PM P

Sequential Parameter Estimation Method

Construct the sub-problems and solve them sequentially based on plant data.

Parameter Estimation

Process Modeling CO Compliant Model

Simplification Model

Reduction

Z.Zhang, Z.Shao, P.Jiang, X.Chen, Y.Zhao, J.Qian. Sequential Sub-Problem Programming Strategies for Data Reconciliation and Parameter Estimation with Multiple Data Sets. 49th IEEE Conference on Decision and Control, Atlanta, 2010

Sequential Sub-Problem Programming Strategies

Series of sub-problems formulation in 2D map

Large scale nonlinear problem with more degrees of freedom

Series of sub-problems with increasing number of measurements and increasing degrees of freedom

sub-problems formulation

1,1P 2,1P ,1kP ,1nP

,2nP

,n jP

, pn nP, pk nP

,k jP

,2kP2,2P

2, jP

2, pnP1, pnP

1, jP

1,2P

0,0P

Series of sub-problems

Original problem

Initial Problem

using a search algorithm to find an accessible path from to 0,0P , pn nP sub-problems based on

measurements

sub-

prob

lem

s bas

ed o

n m

odel

par

amet

ers

Page 26: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

26  

Sequential Sub-Problem Programming Strategies

Sequential sub-problem programming strategies:

• Easy to find good initial values

Advantages

• Easy to solve each sub-problem

Original DRPE problem

Measurements- and parameters- sequential

sub-problem

Large-scale NLP solver

Accessible path search algorithm

Solutions for a series of sub-problems

including the original DRPE problem

1,1P 2,1P ,1kP ,1nP

,2nP

,n jP

, pn nP, pk nP

,k jP

,2kP2,2P

2, jP

2, pnP1, pnP

1, jP

1,2P

2

12

20A

23

18

17

C1-OUT

19

C2-OUT

22

29

C3-OUT

24

C4-OUT

25

26

27

28

3

35

36

430V

430L

431L TA+4CBA

HAC

OTHER

PX

REACT

C1

C2

C3

C4

C1-F

C2-F

C3-F

C4-F

MIXER

MIX

3D401

3E430 3E431

SEP1

p Number of data sets:5 p Number of measurements in each data set:7 p Number of parameters:10 p Number of equations:18488 p Number of variables:18498 10.....3,2,1

],......,[ 2

=

≤≤

==

−×∑∑= =

pubklbkkkk

0k)y,f(x,s.t

)y(yφmin

ppp

p1

5

1i

2measji,

7

1j

predji,ji,

DRPE Problem for PTA Process

Page 27: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

27  

PTA Oxidation Process System:

Some comparisons between initial values and measured values No. of data

sets

flow rate of product TA/ kg·h-1 mass fraction of product 4-CBA/ PPM

Measured data Initial value offset Measured data Initial value offset

1 69815.2 66734.9 3080.3 2464 3072.21 -608.21 2 75772.2 72581.9 3190.3 2498 3435.68 -937.68 3 80431.6 77014.5 3417.1 2643 4947.43 -2304.43 4 83770.4 79580.6 4189.8 2541 4019.51 -1478.51 5 90751.0 85315.4 5435.6 2600 5319.37 -2719.37

No. of data sets

flow rate of consumption acetic acid/ kg·h-1 mass fraction of oxygen in stream 29/ %

Measured data Initial value offset Measured data Initial value offset

1 2094.31 1821.31 273.00 6.01 11.39 -5.38 2 2273.14 2030.50 242.64 5.70 12.59 -6.89 3 2412.93 2056.52 356.41 5.69 12.06 -6.37 4 2512.93 2113.17 399.76 5.90 11.28 -5.38 5 2722.86 2251.02 471.84 6.00 10.50 -4.50

p The data sets are the steady-state measurements from the plant p Gross errors in the data sets have been identified and eliminated p Variables of the initial model were used to initiate the Aspen Plus

simulation, then we get the initial values for DRPE

DRPE Problem for PTA Process

PTA Oxidation Process System:

Solve the DRPE problem directly: failed

p All the following tests are based on Aspen Plus with EO mode

p Large-scale NLP method: SQP

Convergence information in

Aspen Plus

DRPE Problem for PTA Process

Page 28: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

28  

0,0 1,1 1,2 1,10 2,1 2,2 2,10 3,10... ...P P P P P P P P→ → → → → → → → →

4,10 5,1 5,2 5,10 6,10 7,10...P P P P P P→ → → → → → →

-Find an accessible path from to 0,0P 7,10P

sequential sub-problem programming strategies

DRPE Problem for PTA Process

No. of data sets

flow rate of product TA/ kg·h-1 mass fraction of product 4-CBA/ PPM Measured data Reconciled

data offset Measured data Reconciled data offset

1 69815.2 69642.7 172.5 2464 2522 58 2 75772.2 75623.5 148.7 2498 2484 14 3 80431.6 80160.3 271.3 2643 2580 63 4 83770.4 83490.1 280.3 2541 2615 74 5 90751.0 90457.1 293.9 2600 2589 11

No. of data sets

flow rate of consumption acetic acid/ kg·h-1 mass fraction of oxygen in stream 29/ % Measured data Reconciled

data offset Measured data Reconciled data offset

1 2094.31 2081.31 13 6.01 6.10 0.09 2 2273.14 2294.14 21 5.70 5.60 0.1 3 2412.93 2418.93 6 5.69 5.75 0.06 4 2512.93 2501.93 11 5.90 5.97 0.07 5 2722.86 2711.86 11 6.00 5.89 0.11

Solutions of measured variables using sequential sub-problem programming strategies

Small offsets

DRPE Problem for PTA Process

Page 29: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

29  

57

Process Simulation

Simulation Environment Aspen Plus

Property Package

Aspen Plus DIPPR

Unit Operation CO Model

Numerical Solver IPOPT

COSE (Aspen Plus)

IUnknown

Reactor

KineticsMESH

PropertiesICapeUnit

IPOPT

Cape_Ipopt

ICapeMINLP

CCapeTNLP

MaterialObject

ICapeThermoMaterialObject

ICapeThermoCalculationRoutine

ICapeThermoEquilibriumServer

ICapeThermoPropertySystemDMO Solver

ICapeUnitPort

IDispatchEO Mode SM Mode

ICapeUnstructuredMatrix

ICapeNumericMatrix

ICapeNumericESO

ICapeUnitPortVars

•  materials conservation •  phase equilibrium •  reaction dynamics (use estimated

parameters)

Reaction Model

•  ICapeUnit •  ICapeMINLP •  ICapeNumericESO •  ICapeUnstructuredMatrix •  ICapeNumericMatrix •  ICapeUnitPortVars

C-O Interface Function

CAPE-OPEN(C-O) aims at dividing the process simulation into different plug-in’s, which share information and work collaboratively.

Problem: Physical property package is associated with simulation environment

C-O Compliant PX Oxidation Reactor Model

58

DOF Analysis Variables: 236 + 80 fixed Equations: 236 DOF: 0 NZ in Jacobian: 990

*( ) * ( )

( ),( )

( ),

( ),( )

1/ ,

1/ ,( )

( ),

1,0,

,

oTFlow PPhFrac PTFlowoCFlow i oTFlow oCFrac i

PLFrac i i LoCFrac i

PVFrac i i VoCFrac i i L

oLFrac iNC i VNC i L

oVFrac ioCFrac i i Vi L

oPhFraci V

PLVolume i LoVolume

PVVol

==

=⎧= ⎨ =⎩

=⎧= ⎨ =⎩

=⎧= ⎨ =⎩

=⎧= ⎨ =⎩

==

,

,,

ume i VPLEnthalpy i L

oEnthalpyPVEnthalpy i V

oP PoT T

⎧⎨ =⎩

=⎧= ⎨ =⎩

==

( )

( )

1 1

1 2o

T PLFrac(i) PLFrac(i)T

( )PLFrac(j)

o ji

j

n ER T T ba

m

i

k e K K

kRate iK ν

⎡ ⎤⎛ ⎞− −⎢ ⎥⎜ ⎟⎢ ⎥⎝ ⎠⎣ ⎦

⎛ ⎞⎛ ⎞⎜ ⎟ −⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠=

∑ ∑

∑ ∏

1 1

1

( ) ( ) /( )* ( )( )

( )* ( ), ( )

( ) ( ) * ( )

( ) ( ) /

NC NC

i i

Nrij

i ik

kMole i PLFrac i PLVolumekMole i MW ikMFrac i

MWL

MWL PLFrac i MW i PTFlow PFlow i

vPFlow i CFlow i condV kRate i

vPFrac i PFlow i PTFlow

= =

=

=

=

= =

= +

=

∑ ∑

M! "!

R!"

CiL! "!

CiV

SH

! "!

!

"

#########

$

%

&&&&&&&&&

' f!"(Cin,i

ov ,Cout ,iov ,T ,P,Vreac ) = 0

*Nout

Q HFlow oEnthalpy oTFlow= −∑

( )( ) ( , , )

( )( ) , ,( ) , ,( )

PLFrac iPVFrac i CalcEquilibrium PFrac T PPPhFrac

PLVolume iPVVolume i PLFrac T P

CalcPropPLEnthalpy i PVFrac T PPVEnthalpy i

⎫⎪ =⎬⎪⎭

⎫⎪ ⎛ ⎞⎪ =⎬ ⎜ ⎟

⎝ ⎠⎪⎪⎭

Reaction Kinetics

Stream Output Material Balance Energy Balance

Physical Property

C-O Compliant PX Oxidation Reactor Model (continue) •  First-principle Model

Page 30: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

30  

59

C-O Compliant PX Oxidation Reactor Model (continue)

•  Modeling Framework

Main Reactor Modeling

(ESO)

Numeric Solver

OOMF

PME (Aspen Plus)

Property Package

Script config.

Interface Interface

Interface

Model Verification Tool

Initialization: Variable Mapping Variable Scaling

Cape_Ipopt(ICapeMINLP*)

ICapeUnit

ICapeThermoMaterialObject

User-Defined Thermo Environment Within ASPEN+ ICapeEquilibriumServer ICapeThermoCalculationRoutine

Reaction Kinetic MESH Equations

Interface Implemented

ICapeNumericESO ICapeUnstructuredMatrix

60

Transitional Page

Your Subtitle Goes Here

CO  Compliant  Model  

C-O Compliant PX Oxidation Reactor Model (continue)

•  Embedding PX Oxidation Reactor Model into ASPEN PLUS

Page 31: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

31  

61

•  General Interfaces (Generated by CAPE-OPEN Unit Operation Wizard) •  Collection Interface; Parameter Interface, etc.

•  Equation Oriented Mode (Parameter Estimation, large scale OPT) •  ICapeNumericESO •  ICapeUnstructuredMatrix •  ICapeNumericMatrix •  ICapeUnitPortVars

•  Sequential Modular Mode •  ICapeUnit •  ICapeMINLP •  CAPE-OPEN Compliant IPOPT (CMU)

•  Thermodynamic Calculation

•  ICapeThermoMaterialObject

•  Derivative Calculation: GetAlljacobianValues() •  Analytical Part: Matlab Symbolic Toolkit & CapeMO.CalcProp(Derivatives..) •  Otherwise: Fixed step Differentiation(ComputeDerivativesColumn)

COSE (Aspen Plus)

IUnknown

Reactor

KineticsMESH

PropertiesICapeUnit

IPOPT

Cape_Ipopt

ICapeMINLP

CCapeTNLP

MaterialObject

ICapeThermoMaterialObject

ICapeThermoCalculationRoutine

ICapeThermoEquilibriumServer

ICapeThermoPropertySystemDMO Solver

ICapeUnitPort

IDispatchEO Mode SM Mode

ICapeUnstructuredMatrix

ICapeNumericMatrix

ICapeNumericESO

ICapeUnitPortVars

C-O Compliant PX Oxidation Reactor Model (continue)

•  CAPE-OPEN Compliant Interfaces

62

194 196 198 200 202 2045000

6000

7000

8000

9000

10000

11000

12000

13000

temperature, C

liq H

2O,k

g/h

COgCOfA+mapa+d

194 196 198 200 202 2046

6.1

6.2

6.3

6.4

6.5

6.6

6.7

6.8x 104

temperature, C

gas

H2O

,kg/

h

COgCOfA+mapa+d

194 196 198 200 202 2044.5

5

5.5

6

6.5

7

7.5

8

8.5

9

9.5x 104

temperature, C

liq H

AC,k

g/h

COgCOfA+mapa+d

194 196 198 200 202 2042.15

2.2

2.25

2.3

2.35

2.4

2.45

2.5

2.55

2.6

2.65x 105

temperature, C

gas

HAC,

kg/h

COgCOfA+mapa+d

C-O Compliant PX Oxidation Reactor Model (continue) •  Comparison Between C-O and ASPEN Models

Page 32: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

32  

63

Phase Equilibrium

input

Private Property Package for ɸ

Private Property Package for Volume

Private Property Package for Enthalpy

VFrac

LFrac

Molar Volume

Molar Enthalpy

C-O Compliant PX Oxidation Reactor Model (continue) •  Private Property Package for Distinct Stream

Method •  Create property package model for

specific stream based on its historical data

•  The property package includes the models for fugacity coefficient, molar volume, and molar enthalpy

Aim •  Reduce model complexity through

simplifying physical property calculation

•  Improve C-O model by separating property package from simulation environment

64

Monitoring Software

Operation Prediction

Consumption OPT

Quality OPT

Aspen PlusModel

Calculation Server

Data Exchange

TriggerData

CollectionSystem

HTTP

Layer

LIMS

PHD Server

Client PC

Alarm Signal

DataGridviewer

TM

Chart:RadarTrendContribution

CAPE-OPEN Model

System G

UI

Data Retriving LayerInterface Layer

Data Wash&Integrate

Multivariate Statistic

Algorithm

C-O Compliant PX Oxidation Reactor Model (continue)

•  Monitoring & Prediction System

Page 33: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

33  

65

C-O Compliant PX Oxidation Reactor Model (continue)

•  Large-Scale Model Verification (2009/10/3 – 2009/10/17, Process level)

CO CO2 4-CBA

O2 (reactor) O2 (crystallizer)

66

Plant Data

Simulation with rigorous model

Data Classification

Multiple Models

Model Integration

Input Rigorous Model Output

Exclude the variables that contribute little to the accuracy of the model to reduce the number of variables and simplify the model.

PCA Classify the data set into categories so as to guarantee that the data in the same category have the maximum similarity.

FCM

PLS-BP

Data-Driven Model

Rigorous Model •  wide application range with high fidelity •  complex structure and difficult to maintain •  less efficient in solving

Data-Driven Model •  narrow application range •  simple structure and easy to maintain •  quick and dirty

Data-Driven Model with help of rigorous model simulation

FCM

PCA

Page 34: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

34  

67

Operating mode O2 CO CO2 JO HAC PX 4CBA TA

1 PLS 0.139 0.237 0.144 6.068 0.208 0.023 2.020 0.026

BP 3.158 2.716 1.859 5.751 1.397 0.015 0.227 0.420

2 PLS 0.048 0.057 0.021 0.911 0.053 0.010 1.063 0.011

BP 0.329 1.182 0.330 0.464 0.046 0.002 0.027 0.011

3 PLS 0.087 0.124 0.059 2.451 0.128 0.017 1.462 0.019

BP 1.051 3.745 0.998 2.589 0.277 0.004 0.061 0.054

4 PLS 0.026 0.038 0.015 0.674 0.039 0.006 0.583 0.006

BP 0.966 0.405 0.226 0.260 0.046 0.002 0.022 0.022

5 PLS 0.056 0.074 0.031 1.138 0.063 0.011 0.851 0.011

BP 0.175 2.105 0.617 0.537 0.047 0.002 0.025 0.015

Data-Driven Model with Plant Data (continue)

•  Relative Error of Data-Driven Model

68

HAC Optimization

1

1

15.02800,

PX0PX

PXHAC

HAC

≤−

≤−

≤−≤−≤≤

=

LV0LV

C0C

R0R

4CBA

LVCR4CBA

XX

TT

TTyy

y18000)X,T,T,yy,yf(x,

s.ty min:

HACy

PXy

4CBAy

RT

CT

LVX

HAC consumption

PX consumption

4CBA molar ratio

T of reactor

T of crystallizer

Liquid level

DOF: 3

Solution: local model based on historical database

Data-Driven Model with Plant Data (continue)

•  Optimization Based on Data-Driven Model

1

1

1502800

≤−

≤−

≤−≤−≤≤

=

LV0LV

C0C

R0R

HAC0HAC

4CBA

LVCRPXHAC4CBA

PX

XX

TT

TT.yy

y18000)X,T,T,y,y,yf(x,

s.ty min:

PX Optimization

( )

1

1

1

2500 2

≤−

≤−

≤−=

LV0LV

C0C

R0R

LVCR4CBA

4CBA

XX

TT

TT0)X,T,T,yf(x,

s.ty min:

Quality Optimization

Problem: The accuracy of data-driven model is limited by the data it uses and there is no accuracy guarantee for extrapolation

Page 35: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

35  

69

Historical Database

Local Sample

Local Model Input

Fitting Algorithm

Similarity Analysis

Data-Driven Model with Plant Data (continue)

•  Local Model Based On Historical Database

Main Idea •  Choose the data in historical database

which are similar to the input data to generate real-time model

•  Once the input data change, re-generate the model

Advantages •  Expand the accuracy range •  Reliable (depending on the historical

data) •  Simple structure and high efficiency

•  Include historical data collected from plant Historical Database

Similarity Analysis

Fitting Algorithm

•  Choose the data in historical database that are the most similar to the input data

•  Use the local data to generate local model. It should be highly efficient for real-time applications

70

rela

tive

erro

r

rela

tive

erro

r

Data-Driven Model with Plant Data (continue)

Multi Model

Local Model

Page 36: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

36  

71

AGR

MHTGR

Magnox

HTR

History of G

as-cooled Reactor

High-temperature Gas-cooled Reactor Pebble-bed Module (HTR-PM)

Inherent Safety

• ceramic covered fuel particles

• safe shut down under any accident

• gas Helium coolant

Economical Efficiency

Various Application

• efficient in generating electricity

• generate high temperature gas

• modularization design • continuous fuel loading • short construction time

Advantages of MHTGR

Development & Advantages of Nuclear Energy

Advantages of Nuclear Energy •  Rich in reserves •  High energy density •  Low fuel costs •  Little environment pollution

72

Nuclear Steam Supply System (NSSS)

上部联箱

上升通

反射

下降通

中子动力学

控制棒系统

下部联箱

下腔室

出口联箱

外部导管

热气导管

主氦风机

金属管壁3

主给水泵

蒸汽联箱系

汽轮发电

系统

氦气3

过热

金属管壁2

氦气2

沸腾

金属管壁1

氦气1

过冷

上部联箱

上升通

反射

下降通

中子动力学

控制棒系统

下部联箱

下腔室

出口联箱

外部导管

热气导管

主氦风机

金属管壁3

主给水泵

氦气3

过热

金属管壁2

氦气2

沸腾

金属管壁1

氦气1

过冷

Module 1

Module 2

NSSS 1 Steam

Header

external reactivity

gas Helium flow

feed water flow

NSSS 2

Turbine external reactivity

gas Helium flow

feed water flow

valve value

Page 37: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

37  

73

•  According to load demand and running status of the two NSSS, determine assignment of two Reactors, so as to get the best operation

•  MIMO system, variables are seriously coupled. •  PID based algorithm cannot demonstrate good performance due to nonlinearity. •  When load changes in a wide range, nonlinearity and model mismatch occur, and

constant parameter feed-forward control strategy cannot work well •  The feasibility of control should be considered directly by the controller as well as

reliability and validness. •  MPC requires fast model solving ability, while current algorithms cannot meet this

requirement.

Operating features of HTR-PM & challenges of control

Hierarchy of Coordination and Control for HTR-PM

load assignment

basic control loops

according to load demand, implement MPC

Difficulties and Hierarchy

74

•  depend on water/steam property package •  inefficient nested calculation •  difficult to implement optimization

•  all the variables are flat •  model has no “onion” structure •  easy to do optimization

Two Strategies for Solving DAEs

Nest Approach Simultaneous Approach

develop water/steam property

equations

formulate simultaneous

equations

flat model

Y

water/steam property

calculation

solve ODE to update differential

variables

solve algebraic

equations to update algebraic variables

converged ?

solution

N

Page 38: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

38  

75

( ) ( ) ( )( )( )

( ) ( ) ( ) ( )( )( )

( ) ( ) ( )( )( )( )( ) ( ) ( )

, , ,

0 0

min

. . , , ,

0 , , ,

0

, ,

fz t u t y t p

f f

L U L U L U

z t

s t z t f z t y t u t p

z t z

g z t y t u t p

g z t

z z t z u u t u y y t y

φ

′ =

=

=

=

≤ ≤ ≤ ≤ ≤ ≤

Formulation

Dynamic Optimization (DO)

t, time tf, final time u, control variables z, differential variables y, algebraic variables p, time independent parameters

DAE Optimization Problem

Apply a NLP solver

Simultaneous Approach

Indirect/Variational

Sequential Approach

inefficient for constrained problems discretize controls

efficient for constrained problems

discretize all variables

large NLP

Intermediate solution failure inefficient to deal with path constraints

(Biegler 2005)

76

Discretization - Orthogonal Collocation on Finite Elements (OCFE)

( ) ( )

( ) ( )

( ) ( )

0

1

1

K

j ijj

K

j ijj

K

j ijj

z t l z

u t l u

y t l y

τ

τ

τ

=

=

=

⎧=⎪

⎪⎪⎪ =⎨⎪⎪

=⎪⎪⎩

where

0,

1,

Kk

jk k j j k

Kk

jk k j j k

l

l

τ ττ ττ ττ τ

= ≠

= ≠

−⎧ =⎪ −⎪⎨

−⎪ =⎪ −⎩

0t 1t 2t 1NEt − NEt

1h 2h NEh

!lk ! j( ) zik ! hi zij , yij ,uij , p( ) = 0k=0

K

"0 = g zij , yij ,uij , p( )

#

$%

&%

i =1..NE, j =1..K

after discretization

Simultaneous Approach

Simultaneous methods fully discretize the DAE system by approximating the control and state variables as piecewise polynomial functions over finite elements. Here we present the state and control profiles by Lagrange interpolation polynomials in each element as follows:

Page 39: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

39  

77

collocation method number of points order of accuracy

Gauss K 2K

Radau K 2K-1

Lobatto K 2K-2

Collocation Points - Legendre Polynomial Based Radau Points

•  high accuracy •  stiff decay •  natural for NMPC problems

Radau Points

Three kinds of widely used orthogonal collocation points: Gauss points, Gauss-Radau points, and Gauss-Lobatto points.

78

nested approach

simultaneous approach

CPU time 11h 20s

CPU time/ simulation horizon 2/1 1/1000

before descretization

after descretization

#equations 1081 239845

#variables

62 differentialvariables

239845 1019

algebraic variables

Problem Size Efficiency

0 0.5 1 1.5 2

x 104

85

90

95outlet helium flow

t

kg/s

0 500 1000 1500 20001015

1020

outlet helium temperature

t

k

0 200 400 600 8000.8

0.9

1

relative power ratio

t

nr

0 1000 2000 30001092109410961098

core temperature

t

k

0 0.5 1 1.5 2

x 104

510

520

530reflector temperature

t

k

0 0.5 1 1.5 2

x 104

6.9

6.92

6.94x 106outlet helium pressure

t

Pa

0 200 400 600 800 1000 1200

510

520

530outlet helium temperature

t

T/k

0 100 200 300 4001.38

1.4

1.42

1.44x 107 feed water flow

t

P/Pa

0 2000 4000 600082848688909294

outlet steam flow

t

G/(

kg/s)

0 200 400 600 80034.234.434.634.8

3535.235.4

length of region 1

t

L/m

0 100 200 300 400 500 60053.5

5454.5

5555.5

length of region 2&3

t

L/m

previous methodsimultaneous method

Simulation Results

key variables of reactor key variables of steam generator

Page 40: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

40  

79

( ) ( )( ) ( )2 200

:

min * *ft

objective

imize Q Y t Y t R U t dt⎡ ⎤− + Δ⎣ ⎦∫

( ) ( ) ( ) ( )( )( )

( ) ( ) ( )( )( ) ( )

0 0

. .

, , ,

0 , , ,

,li ui lj uj

s tz t f z t y t u t p

z t z

g z t y t u t p

a Y t a b U t b

′ =

=

=

≤ ≤ ≤ ≤

MV •  external reactivity •  gas Helium flow •  feed water flow •  value of valve

CV •  relative power ratio •  outlet helium temperature •  steam pressure •  outlet steam temperature

Formulation

t, time tf, final time z, differential variables u, control variables p, time independent parameters y, algebraic variables Y, CV’s measured value Y0, CV’s set value nh, number of finite elements nc, number of collocation points

Open-Loop Optimization of HTR-PM

( )2 20

1 1 1 1: min * *

nh nc nh nc

ij iji j i j

objective Q Y Y R Uφ= = = =

= − + Δ∑ ∑ ∑ ∑

Objective in Simultaneous Method

80

0 200 400 600 800

0.9

0.95

1relative power ratio

t

nr

set value/technological requirementsoptimized resultunoptimized result

0 500 1000 1500 20001010

1015

1020

1025outlet helium temperature

t

k

0 500 1000 1500 20001.31

1.32

1.33

1.34x 107 outlet steam pressure

t

P/Pa

0 500 1000 1500 2000565

570

575

580outlet steam temperature

t

P/Pa

0 500 1000 1500 2000

200

220

240

inlet helium temperature

t

T/k

0 200 400 600 800 1000 1200 1400 1600 1800 200080

90

100feedwater flow

t

G/(k

g/)

0 200 400 600 800 1000 1200 1400 1600 1800 200085

90

95helium flow

t

G/(k

g/)

0 200 400 600 800 1000 1200 1400 1600 1800 20001.5

2

2.5x 10-3 external reactivity

t

%

0 200 400 600 800 1000 1200 1400 1600 1800 20000.8

0.9

1valve value

t

%

Open-Loop Optimization of HTR-PM (continue)

CVs MVs

Page 41: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

41  

81

online optimization plant

predictive model

feedback

d(t)+

+

y(t)

+

-

u(t)

ym(t)+

+

-

+yr(t)

Optimization Formulation in NMPC

MV •  external reactivity •  gas Helium flow •  feed water flow •  value of valve

CV •  relative power ratio •  outlet helium temperature •  steam pressure •  outlet steam temperature

T, predictive period u, control variables y, CV’s measured value y*, CV’s set value Q/R, weight coefficient

NMPC for HTR-PM (first-principle model)

structure of NMPC

( )dtykykukuJT

QRyu ∫ −+−−=0

2*2

,||)(||||)1()(||min

82

0 200 400 600 800 1000

0.9

0.95

1relative power ratio

t

nr

0 200 400 600 800 1000

1016

1018

1020

outlet helium temperature

t

k

0 200 400 600 800 1000

1.324

1.3242

1.3244

x 107 outlet steam pressure

t

P/Pa

0 200 400 600 800 1000565

570

575outlet steam temperature

t

P/Pa

0 500 100080

90

100feedwater flow

t

G/(k

g/)

0 500 100080

90

100helium flow

t

G/(k

g/)

0 500 10001.5

2

2.5x 10-3 external reactivity

t

%

0 500 10000.5

1

1.5valve value

t

%

•  set-point value of power change from 100% to 90% •  control horizon 25s •  CPU time for optimization 20s

CVs

MVs

NMPC for HTR-PM (first-principle model)

Page 42: Advanced Strategies for Real-Time Process Optimizationold.chemeng.ntua.gr/seminars/download/NTUA_SZJ_20110602.pdf · Advanced Strategies for Real-Time Process Optimization Dr Zhijiang

11-6-25  

42  

83

Conclusions and Remarks

•  Growing economy and rapid-changing market demand for RTO

•  Solving large-scale NLP problems robustly and efficiently is the key issue for both steady-state optimization and dynamic optimization

•  Advanced strategies could be developed taking advantage of the problem formulation and scenario analysis

•  Process understanding and software integration are very important for RTO success

84

Acknowledgements

Research Associates Dr. Wang Kexin Dr. Fang Yuexi Mr. Jiang Pengfei Mr. Ji Peng

Graduate Students Chen Weifeng (PhD Cand.) Wan Jiaona (PhD Cand.) Wang Zhiqiang (PhD Cand.) Chen Yang (PhD Cand.) You Jianghong (MS Cand.) Zhan Zhiliang (MS Cand.) Huang Seng (MS Cand.) Zhang Zhengjiang (PhD) Zhao Xiaorui (MS) Zhou Zhou (MS) Yao Ketian (MS) Zhang Chen (Undergraduate)

Colleagues Prof. Chen Xi Prof. Qian Jixin Dr. Zhao Jun Dr. Xu Zuhua Dr. Zhao Yuhong Dr. Zhu Yucai

Joint Professors Lorenz T Biegler (CMU) Gao Furong (HKUST)

Financial support from MOST(863/973 Program) Sinopec NSF