In Situ Adaptive Tabulation for Real-time Control J. D. Hedengren - - PowerPoint PPT Presentation

in situ adaptive tabulation for real time control
SMART_READER_LITE
LIVE PREVIEW

In Situ Adaptive Tabulation for Real-time Control J. D. Hedengren - - PowerPoint PPT Presentation

In Situ Adaptive Tabulation for Real-time Control J. D. Hedengren T. F. Edgar Department of Chemical Engineering The University of Texas at Austin Candidacy Presentation 9 Dec 2003 Outline Previous work ISAT: In situ adaptive


slide-1
SLIDE 1

In Situ Adaptive Tabulation for Real-time Control

  • J. D. Hedengren
  • T. F. Edgar

Department of Chemical Engineering The University of Texas at Austin Candidacy Presentation 9 Dec 2003

slide-2
SLIDE 2

Outline

  • Previous work
  • ISAT: In situ adaptive tabulation
  • Preliminary results
  • Proposed research
  • Contributions
slide-3
SLIDE 3

The Challenge

  • Increase profit margin

– reduce process variability – minimize costs from utilities, feed streams – reduce downtime

  • Model predictive control (MPC)

– incorporate fundamental knowledge of the process for tighter control – nonlinear model predictive control (NMPC) – “nonlinear” refers to the model form used in MPC

slide-4
SLIDE 4

The Challenge

  • Large scale models have been developed
  • Implementing the large scale nonlinear

models in MPC is often computationally prohibitive

  • Attempts to make NMPC computationally

feasible

– Approximating the explicit solution – Dynamic programming – Artificial neural networks

slide-5
SLIDE 5

Approximate Explicit Solution

  • Linear model with constraints
  • Piecewise linear approximation to the

exact solution

  • Pistikopoulos, Bemporad, Morari (2002)
slide-6
SLIDE 6

Dynamic Programming

  • Dynamic programming by Bellman (1962)

– Optimal cost-to-go function – Works well for NMPC with few states – “Curse of dimensionality”

  • Recent interest in this approach

– Approximate cost-to-go function

slide-7
SLIDE 7

Dynamic Programming

  • Approximation of the cost-to-go function

– Barto – reinforcement learning (1997) – Bertsekas – artificial neural nets (2001) – Lee – clustering of cost-to-go functions (2003)

slide-8
SLIDE 8

Neural Networks

  • Ideas have been around for ~50 years
  • Increased interest in the last 15 years
  • Applications in process control

– Warwick (1995) – Qin (1997)

slide-9
SLIDE 9

A New Approach

  • Turbulent reacting flow simulations can take up

to 6 years of CPU time

  • Through storage and retrieval of chemistry

integrations the simulation time was reduced by 1000x (Pope, 1997)

  • Could the same approach work for NMPC?
  • Is it applicable to large scale NMPC?
slide-10
SLIDE 10

In Situ Adaptive Tabulation (ISAT)

  • Developed by Pope for turbulent

combustion simulations (1997)

  • Integrated with FluentTM
slide-11
SLIDE 11

Desired Integration φ0 φf ?

          =           = Parameters States Inputs α φ x u

slide-12
SLIDE 12

Stored Integration Desired Integration φ0 φf ? φ0

s

φf

s

slide-13
SLIDE 13

Stored Integration Desired Integration φ0 φf ? φ0

s

φf

s

δφ0 φf ~ φf

s+δφ0

slide-14
SLIDE 14

Stored Integration Desired Integration φ0 φf ? δφ0 φf ~ φf

s+Aδφ0

φ0

s

φf

s

s s f

A φ φ ∂ ∂ =

First Order Sensitivities

slide-15
SLIDE 15

Stored Integration Desired Integration φ0 φf ? δφ0 φf ~ φf

s+Aδφ0

φ0

s

φf

s

First Order Sensitivities

s s f

A φ φ ∂ ∂ =

slide-16
SLIDE 16

Stored Integration Desired Integration φ0 φf ? δφ0 φf ~ φf

s+Aδφ0

φ0

s

φf

s

First Order Sensitivities

s s f

A φ φ ∂ ∂ =

slide-17
SLIDE 17

ISAT Integration

  • Scenario #1: Inside the region of accuracy

φ0

s

φ0

( ) ( )

2 tol

ε φ φ φ φ ≤ − −

s T s

M

slide-18
SLIDE 18

ISAT Integration

φ0

s

  • Scenario #2: Outside the region of accuracy but

within the error tolerance

φ0

( ) ( )

2 tol

ε φ φ φ φ > − −

s T s

M

( ) ( )

2 tol expanded

ε φ φ φ φ = − −

s T s

M

slide-19
SLIDE 19

ISAT Integration

φ0

s

  • Scenario #3: Outside the region of accuracy

and outside the error tolerance

φ0

slide-20
SLIDE 20

ISAT Search

  • Binary Tree Architecture

– Search times are O(log2(N)) compared with O(N) for a sequential search φ0 φ0

s

α φ <

query T

v

        + = 2

s T

v φ φ α

s

v φ φ − =

α φ >

query T

v

slide-21
SLIDE 21

Can ISAT make NMPC computationally feasible?

x32 x1 Inputs States RR x17 x31 x2 Feed Distillate Bottoms

Test Case 32 state binary distillation column model MV: reflux ratio CV: distillate composition Simplex optimizer Soft constraint on the MV Control Horizon = 10 min Prediction Horizon = 15 min

slide-22
SLIDE 22

Closed Loop Response

5 10 15 20 25 0.91 0.92 0.93 0.94 D i s t i l l a t e C

  • m

p

  • s

i t i

  • n

( xA ) Time (min) set point 32 states/ISAT 32 states 32 states/Linear 1 2 3 4 5 10 20 30 40 50 60 70 S p e e d

  • u

p F a c t

  • r

Optimization # 32 states/ISAT 32 states 32 states/Linear 0.28 sec average 0.84 sec average 12.6 sec average

NMPC with ISAT maintains the accuracy

  • f NMPC while achieving the computational time of linear MPC
slide-23
SLIDE 23

ISAT Preliminary Conclusions

  • Successful with ODE and DAE models
  • Computational speedup 20 – 500 times
  • Storage requirements are under 100 MB
  • Performs well for small scale NMPC

– 96 state DAE model (500x speedup)

  • What about large scale NMPC?
slide-24
SLIDE 24

Proposed Research

  • State and parameter estimation
  • Optimal input calculation
  • Reactive distillation model reduction
  • Real-time control of reactive distillation

NMPC

slide-25
SLIDE 25

State and Parameter Estimation

. . ) , ( ) , ( min

,

t s y x A y x J

E

N k k k def x

− =

=

α

h H u x F x given u given y

k k k

≤ =

+

α ), , ( , ,

1

  • NE
  • NE +1
  • 1

1 NO-1 NO

Estimation

Current Time

slide-26
SLIDE 26

State and Parameter Estimation

  • Estimation of x,α during real-time control

– Estimate x before every optimization – Frequency of α update is variable – New approach to nonlinear model identification

  • NE
  • NE +1
  • 1

1 NO-1 NO Current Time

slide-27
SLIDE 27

Proposed Research

  • State and parameter estimation
  • Optimal input calculation
  • Reactive distillation model reduction
  • Real-time control of reactive distillation

NMPC

slide-28
SLIDE 28

Optimal Inputs

  • NE
  • NE +1
  • 1

1 NO-1 NO Current Time

[ ]

, , ), , ( , . . ) ( ) , ( ) , , ( min

1 , ,

≥ ≤ − ≤ = + =

+ =

k k k k k k k N k k k k def u x

g Gx d Du u x F x given x t s E u x B u x J

O

η η η η

η

slide-29
SLIDE 29

Optimal Inputs

  • Calculate optimal path of states by

adjusting the inputs

– Success depends on the state and parameter estimation

  • NE
  • NE +1
  • 1

1 NO-1 NO Current Time

slide-30
SLIDE 30

Application of ISAT

  • Powell’s SQP requires 4 results at a given φ

φ φ φ φ φ φ d dC C d dJ J ) ( ) ( ISAT with ies sensitivit Compute ) ( ISAT with Integrate ) (

Cost Function Constraints

slide-31
SLIDE 31

Proposed Research

  • State and parameter estimation
  • Optimal input calculation
  • Reactive distillation model reduction
  • Real-time control of reactive distillation

NMPC

slide-32
SLIDE 32

Reactive Distillation Model Reduction

  • Develop model for control

– Synthesize work by Lextrait, Peng, Hahn, and Rueda – Current models (Lextrait and Peng)

  • 320 to 866 differential equations
  • 5596 to 24,522 algebraic equations

– Optimally reduce the model (Hahn) – Experimental verification with Rueda’s work

  • n the SRP pilot plant
slide-33
SLIDE 33
  • Reactive distillation model form

          =           = Parameters States Inputs α φ x u

) ( ) ( φ φ g f x = = ɺ

Upper Lower

φ φ φ < <

Kinetic parameters, diffusion coefficients, and other uncertain parameters that can be used to fit the model with experimental data

Reactive Distillation Model Reduction

slide-34
SLIDE 34

Modeling Conclusions

  • Implementing current models in Fortran
  • Develop heuristics for the selection of

adjustable parameters

– Long term validity of the model – Examples:

  • Catalyst deactivation
  • Fouling of a heat exchanger
slide-35
SLIDE 35

Proposed Research

  • State and parameter estimation
  • Optimal input calculation
  • Reactive distillation model reduction
  • Real-time control of reactive distillation

NMPC

slide-36
SLIDE 36

Real time control

DCS

y u y u FTP

NMPC with ISAT

slide-37
SLIDE 37

Contributions So Far

  • Developed 1st ISAT application in process

control

  • Extended ISAT to DAE systems
  • Augmented ISAT with stepwise constant

inputs/parameters - allows hybrid systems

  • Developed ISAT in MATLAB, Octave, and

Fortran

  • Compared ISAT to neural networks for open-

loop and closed loop simulations

  • Conducted preliminary tests of ISAT with NMPC
slide-38
SLIDE 38

Contributions So Far

  • Developed regulator and state estimator in

Fortran

– SQP code by Powell (HSL VF13) – “Watchdog” approach for constraints

slide-39
SLIDE 39

Summary of Future Contributions

  • Nonlinear model identification heuristics
  • Real-time control software package
  • Largest model application of ISAT (>5000

states)

  • Real-time NMPC of reactive distillation
slide-40
SLIDE 40

Publications and Presentations

Presented Hedengren, J. D. and T. F. Edgar, “In situ adaptive tabulation for nonlinear MPC,” Texas-Wisconsin Modeling and Control Consortium (TWMCC), Madison, WI, 22 Sept. 2003. Published Hedengren, J. D. and T. F. Edgar, “Nonlinear MPC computational reduction for real-time control applications,” AIChE 2003 National Meeting, presented at Systems and Process Control Poster Session, 19 Nov. 2003. Submitted Hedengren, J. D. and T. F. Edgar, “In situ adaptive tabulation for real- time control,” American Control Conference (ACC) 2004, Boston, MA.

slide-41
SLIDE 41
slide-42
SLIDE 42

Supplemental Slides

  • NMPC multiple shooting formulation
  • Replacing the Integrator and SSA
  • ISAT vs. Neural nets
  • Thoughts on cost functions
  • NMPC Formulations
  • Committee members
slide-43
SLIDE 43

NMPC Multiple Shooting Formulation

slide-44
SLIDE 44

Nonlinear MPC

[ ]

, , ), , ( , . . ) ( ) , ( ) , , ( min

1 , ,

≥ ≤ − ≤ = + =

+ =

k k k k k k k N k k k k def u x

g Gx d Du u x F x given x t s E u x D u x J

O

η η η η

η

Dynamic optimization Dynamic state and parameter estimation [ ]

. . ) , ( ) , ( min

,

t s y x A y x J

E

N k k k def x

− =

=

α

h H u x F x given u given y

k k k

≤ =

+

α ), , ( , ,

1

  • NE
  • NE+1
  • 1

1 NO-1 NO

slide-45
SLIDE 45

Replacing the Integrator and SSA

slide-46
SLIDE 46

ISAT with NMPC

  • ISAT replaces the DAE integrator and

sensitivity calculator

Optimizer ISAT u, xinitial xfinal, A

slide-47
SLIDE 47

ISAT vs Neural Nets

slide-48
SLIDE 48

ISAT vs. Neural Nets

CA1 Feed A B Reaction T1 Product q Q CA2 T2 V1 V2

7 I n p u t s Layer 1 Hyperbolic tangent sigmoid transfer function 20 neurons Layer 2 Linear transfer function 6 neurons 6 O u t p u t s

6 state dual CSTR model MV: cooling rate of CSTR 1 CV: product temperature ISAT and Neural Net used the same training data Compared in open loop and closed loop simulations Control Horizon = 0.4 min Prediction Horizon = 0.6 min

slide-49
SLIDE 49

Open Loop (ISAT vs. Neural Net)

1 2 3 4 5 6 7 8 9 10 340 360 380 400 420 440 460 T e m p e r a t u r e ( K ) Time (min) Actual Neural Net ISAT ISAT Retrieval ISAT Growth ISAT Addition

slide-50
SLIDE 50

Closed Loop (ISAT vs. Neural Net)

0.5 1 1.5 2 435 440 445 450 455 R e a c t

  • r

# 2 T e m p e r a t u r e ( K ) Time (min) set point 6 states/ISAT 6 states 6 states/Neural Net

slide-51
SLIDE 51

Some thoughts on cost functions

slide-52
SLIDE 52

Some thoughts on cost functions

  • Quadratic cost functions

– Advantages

  • Preserve convexity of NLP
  • Explicit cost function derivatives

– Disadvantages

  • Does not accurately reflect the true process costs
  • Maximizing a function with a solution that is not

necessarily optimal

slide-53
SLIDE 53

Some thoughts on cost functions

  • Generalized cost functions

– Advantages

  • Flexibility to reflect real dollar amounts
  • Explicit tie to real costs

– Incorporate changing utility costs for time of day pricing – Changing feed costs or product

  • Global solution will maximize profits
  • Incorporate plant-wide optimization results (use Lagrange

multipliers, etc.)

– Disadvantages

  • Numerical cost function derivatives
  • Convexity not guaranteed
  • Need a global optimizer
slide-54
SLIDE 54

NMPC Formulations

slide-55
SLIDE 55

NMPC Formulations

Model Based Optimization Indirect Methods Direct Methods Sequential Simultaneous Gradient Methods Multiple Shooting Collocation Direct Single Shooting Direct Multiple Shooting Direct Collocation

gOPT DYNOPT OPTISIM MUSCOD DASOPT NMPC Toolbox (Octave) SOCS OCPRSQP DIRCOL NOVA Binder, 2001

slide-56
SLIDE 56

Comparison of Direct Methods

Direct Collocation Direct Multiple Shooting Direct Single Shooting simultaneous hybrid sequential general solution approach no yes yes use of (state of the art) DAE solvers no partially yes DAE model fulfilled in each iteration step yes yes no applicable to highly unstable systems all node values all node values initial state initial guess for system states large intermediate small number of variables / size

  • f NLP

Binder, 2001

slide-57
SLIDE 57

Committee Members, Course Work, and Comments

slide-58
SLIDE 58

Suggestions and Comments

  • Jim Rawlings (ChE, Wisc)

– Storage and retrieval of the optimal solution is more efficient than storage and retrieval of the states – Look at the work on explicit LQR solutions

  • Melba Crawford (ME, UT)

– The current EOA expansion scheme is too aggressive

  • Robert Young (ExxonMobil)

– We solve optimization problems with thousands of variables with no problem – why not use collocation?

  • Keenan Thompson (Control Engineer)

– I’m going to stick with my PID loops

  • Joe Qin (ChE, UT)

– You need more rigor in your presentation, not that it works or doesn’t work but why it works or doesn’t – You need to account for unmeasured disturbances I am currently investigating these ideas – please let me know if you have others.

slide-59
SLIDE 59

Courses

  • Master’s degree from BYU (7 courses)
  • ASE 381P 3-Optimal control
  • ORI 391Q Nonlinear programming
  • ASE 381P 2-Multivariable control systems
  • CHE 391 Modern control theory
  • ORI 390R Multivariate statistical analysis
  • TA CHE 360 Process control
slide-60
SLIDE 60

Committee Members

  • Advisor: Tom Edgar
  • UT Professors

– Joe Qin – Bruce Eldridge

  • UWisc Professor

– Jim Rawlings

  • Cornell Professor

– Stephen Pope