l6 - continuous optimization

118
Continuous Optimization Davide Manca Lesson 6 of “Process Systems Engineering” – Master Degree in Chemical Engineering – Politecnico di Milano

Upload: others

Post on 18-Dec-2021

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: L6 - Continuous Optimization

L6—

Continuous Optimization

Davide Manca

Lesson 6 of “Process Systems Engineering” – Master Degree in Chemical Engineering – Politecnico di Milano

Page 2: L6 - Continuous Optimization

L6—

• There are at least three distinct fields that characterize the optimization of industrial processes– Management

• Project assessment• Selecting the optimal product• Deciding whether to invest in research or in production• Investment in new plants• Supervision of multiple production sites

– Design• Process design and Equipment design• Equipment specifications• Nominal operating conditions

– Operation• Plant operation• Process control• Use of raw materials• Minimizing energy consumption• Logistics (storage, shipping, transport)  Supply Chain Management

Optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 2

Page 3: L6 - Continuous Optimization

L6—

• The optimization problem is characterized by:– Objective function– Equality constraints (optional)– Inequality constraints (optional)

• The constraints may be:– Linear– Nonlinear

– Violable– Not violable

– Real constraints– Lower and upper bounds of the degrees of freedom

• The optimization variables are defined as: degrees of freedom (dof)

• Mathematically we have: Min

. . ( )( )

f

s t

xx

h x 0g x 0

Definition

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 3

Page 4: L6 - Continuous Optimization

L6—

Linear function and constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 4

Page 5: L6 - Continuous Optimization

L6—

Linear function and constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 5

Page 6: L6 - Continuous Optimization

L6—

Nonlinear function and constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 6

Page 7: L6 - Continuous Optimization

L6—

Nonlinear function and constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 7

Page 8: L6 - Continuous Optimization

L6—

Nonlinear function and constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 8

Page 9: L6 - Continuous Optimization

L6—

Nonlinear constraints + lower/upper bounds

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 9

Page 10: L6 - Continuous Optimization

L6—

Infeasible region

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 10

Page 11: L6 - Continuous Optimization

L6—

• The equality and inequality constraints may also include the model of the processto be optimized and the law limits, process specifications and degrees of freedom.

• The constraints identify a “feasibility” area where the degrees of freedom can bemodified to seek for the optimum.

• The constraints have to be consistent in order to define a “feasible” searchingarea.

• There is no theoretical limit to the number of inequality constraints.

• If the number of equality constraints is equal to the number of degrees offreedom the only solution is with the optimal point. If there are multiple solutionsof the nonlinear system, in order to obtain the absolute optimum, we will need toidentify all the solutions and evaluate the objective function at each point, andeventually selecting the point that produces the best result.

Constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 11

Page 12: L6 - Continuous Optimization

L6—

• If there are more variables than equality constraints then the problem is

UNDERDETERMINED and we must proceed to the effective search of the optimum

point of the objective function.

• If there are more equality constraints than degrees of freedom then the problem

is OVERDETERMINED and there is NOT a solution that satisfies all the constraints.

This is a typical example of data reconciliation.

Constraints

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 12

Page 13: L6 - Continuous Optimization

L6—© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 13

• If both the objective function and constraints are linear, the problem is called LINEAR PROGRAMMING (LP)

• If the objective function and/or the constraints are NOT linear with respect to the degrees of freedom, the problem is called NOT linear (NLP)

• A NLP is more complicated than a LP

• A LP has a unique solution only if it is feasible

• A NLP may have multiple local minima

• The research for the absolute optimum can be quite complicated

• Often we are NOT interested in the absolute optimum, especially if we are performing an online process optimization

• The research of the optimum point is influenced by the possible discontinuities of the objective function and/or constraints

• If there is a functional dependency among the dof, the optimization is strongly affected and the numerical method can fail. For example: 

23121 3, xxxxfobj

Features

Page 14: L6 - Continuous Optimization

L6—

• Usually the objective function is based on an economic assessment of the involved problem. For instance:

(revenues – costs), 

• Also, the objective function may be based on other criteria such as: 

• pollutant minimization, 

• conversion maximization, 

• yield, reliability, response time, efficiency, 

• energy production

• environmental impact

• With reference to the process, if consider only the operating costs and the investment costs are neglected, then we have to solve the so called SUPERVISION problems (also CONTROL in SUPERVISION)

Structure of the objective function

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 14

Page 15: L6 - Continuous Optimization

L6—

• If we consider both operating and investment costs then we fall in the field of 

“Conceptual Design” and “Dynamic Conceptual Design”.

• Since in CD and DCD the CAPEX terms [€] and OPEX terms [€/y] are not directly 

comparable (due to the different units of measure) a suitable comparing basis 

must be found. This can be the discounted back approach together with the 

annualized approach to CAPEX assessment where the depreciation period 

allows transforming the CAPEX contribute from [€] into [€/y].

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 15

Structure of the objective function

Page 16: L6 - Continuous Optimization

L6—

Introductory examples

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 16

Page 17: L6 - Continuous Optimization

L6—

PROCESS DATA 1) A + B E

2) A + B F

3) 3A + 2B + C G

RAW MATERIALSComponent Availability kg/d Cost €/kg

A 40,000 1.5

B 30,000 2.0

C 25,000 2.5

PRODUCTSProcess Product Reactant required

for [kg] of productProcessing costs Selling price

1 E 2/3 A, 1/3 B 1.5 €/kg E 4.0 €/kg E

2 F 2/3 A, 1/3 B 0.5 €/kg F 3.3 €/kg F

3 G 1/2 A, 1/6 B, 1/3 C 1.0 €/kg G 3.8 €/kg G

A

B

C

x1

x2

x3

Process 1

Process 2

Process 3

E

x4

F

x5

G

x6

Example #1: Operating profit

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 17

Page 18: L6 - Continuous Optimization

L6—

Statement: We want to find the maximum daily profit.The dof are the flowrates of the single components [kg/d]

• Profit from selling the products [€/d]

4x4 + 3.3x5 + 3.8x6• Cost of raw materials [€/d]

1.5x1 + 2.0x2 + 2.5x3• Operating costs [€/d]

1.5x4 + 0.5x5 + 1.0x6• Objective function

f(x) = 4x4 + 3.3x5 + 3.8x6 ‐ 1.5x1 ‐ 2.0x2 ‐ 2.5x3 ‐ 1.5x4 ‐ 0.5x5 +‐ 1.0x6 = 2.5x4 – 2.8 x5 + 2.8 x6 – 1.5 x1 – 2x2 – 2.5x3

• Constraints on material balances

x1 = 2/3 x4 + 2/3 x5 + 1/2 x6x2 = 1/3 x4 + 1/3 x5 + 1/6 x6x3 = 1/3 x6

Example #1: Operating profit

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 18

Page 19: L6 - Continuous Optimization

L6—

• Upper & lower limits on the dof

0  x1 40,000

0  x2 30,000

0  x3 25,000

• The problem is LINEAR in the objective function and constraints.

• We use LINEAR PROGRAMMING techniques (e.g., the simplex method) to solve 

the optimization problem. Since the objective function is a hyperplane with a 

research area bounded by hyper‐lines (i.e. equality and inequality linear 

constraints) the optimal solution is on the intersection of constraints and more 

specifically of equality constraints.

Example #1: Operating profit

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 19

Page 20: L6 - Continuous Optimization

L6—

Statement:

We want to determine the optimal ratio, L/D, for a given cylindrical pressurized vessel with a given volume, V.

Hypotheses:The extremities are closed and flat.Constant wall thickness t.The thickness t does not depend on the pressure.The density  of the metal does not depend on the pressure.Manufacturing costs M [€/kg] are equal for both the side walls and the bottoms. There are not any production scraps

Unrolling:

We can write three equivalent objective functions:

DLDDLDStot

242

22

tDLDMf

tDLDf

DLDf

2

2

2

2

3

2

2

2

1

Example #2: Investment costs

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 20

Page 21: L6 - Continuous Optimization

L6—

By using the specification on the volume V:

By differentiating we obtain:

Then:

N.B.: by modifying the assumptions and considering the bottoms characterized by 

an ellipsoidal shape with higher manufacturing cost, the thickness being also a 

function of the diameter D, the pressure and the corrosiveness of the liquid, 

we get a different optimal L/D :  

DVD

DVDDf 4

24

2

2

2

2

1

042

1 DVD

dDdf 3

4VDopt 3

4VLopt

1

optDL

42

optDL

Example #2: Investment costs

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 21

Page 22: L6 - Continuous Optimization

L6—

Statement: we want to determine the optimal thickness s of the insulator for a large diameter pipe and a high internal heat exchange coefficient. We need to find a compromise between the energy savings and the investment cost for the installation of the refractory material.

• Heat exchanged with the environment in presence of the refractory:Q = U A T = A T / (1/he+s/k)

• Cost of installation of the refractory material [€/m2]F0 + F1 s

• The insulator has a five‐year life. The capital for the purchase and installation is borrowed. r is the percentage of the capital + interests to be repaid each year. It follows that r > 0.2

• Ht is the cost of the energy losses [€/kcal]• Y are the working hours in a year [h/y]• Each year we must return to the bank which provided the loan:

(F0 + F1 s ) A r [€/y]

Example #3: CAPEX + OPEX

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 22

Page 23: L6 - Continuous Optimization

L6—

• Heat exchanged with the environment without the refractory material:

Q = U A T = he A T

• Annual energy savings due to the refractory:

[he A T ‐ A T / (1/he+s/k)] Ht Y [€/y]

• The objective function in the dof s becomes:

fobj = [he A T ‐ A T / (1/he+s/k)] Ht Y – (F0 + F1 s) A r 

• The problem is solved analytically by calculating:

d fobj / ds = 0

• We obtain:

sopt = k [((T Ht Y)/(k F1 r))½ ‐ 1/he] 

• Note that sopt depends neither on A nor on F0

Example #3: CAPEX + OPEX

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 23

Page 24: L6 - Continuous Optimization

L6—

Solution methods

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 24

Page 25: L6 - Continuous Optimization

L6—

• The problem:                       can always be turned into:by changing the sign of the objective function

• The optimization problem can deal with two distinct approaches:

• Equation oriented: based on an overall approach model that describes the process through a single system of equations (in general differential‐algebraic) that solves the problem by considering it as a set of constraints

• Black‐box or Sequential modular: the process model is called by the optimization routine and returns the data required to evaluate the objective function

• The simulation model can then work in terms of either  FEASIBLE PATH or INFEASIBLE PATH, depending on whether the equations related to the recycle streams are solved for each call or if the consistency of the recycles is introduced as a linear constraint in the structure of the optimization problem

)( xfMax )( xfMin

Solution methods

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 25

Page 26: L6 - Continuous Optimization

L6—

Equation-oriented formulation

The equality constraints h contain all the equations describing the model of the 

device/equipment/process/plant to be optimized.

In general h can be a system of differential‐algebraic equations, DAE, in the form:

, , , t h x x p 0

Optimization routine

xUser defined:

f(x)h(x) = 0g(x) ≤ 0, ,f h g

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 26

Page 27: L6 - Continuous Optimization

L6—

Black-box formulation

Optimization routine

x User defined:f(x,v)

hreal (x,v) = 0g(x,v) ≤ 0

User defined solver:

hmodel (x,v) = 0

The model of the device/equipment/process/plant 

is solved by a user‐defined solver outside of the 

real constraints that are directly dealt and satisfied 

by the optimization routine.

Also in this case, hmodel can be a DAE system: , , , ,model t h x x v v 0

x

, ,realf h g

v

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 27

Page 28: L6 - Continuous Optimization

L6—

Methods for multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 28

Page 29: L6 - Continuous Optimization

L6—

• There is a necessary condition to be fulfilled for the optimal point:that is the gradient of f(x) must be zero (this is not true for cusp points and more in general for discontinuous functions)

• Sufficient condition for the minimum is that:                         the Hessian matrix of 

f(x) must be positive definite.

• There are three distinct classes of methods that differ in the use of the 

derivatives of the objective function during the search for the minimum:

• HEURISTIC methods do not use the derivatives of f(x). They are more robust because they are slightly if not affected by the discontinuities of the problem to be solved.

• FIRST ORDER methods work with the first order partial derivatives of f(x) i.e. the GRADIENT of the objective function.

• SECOND ORDER methods use also the second order partial derivatives of f(x) i.e. the HESSIAN of the objective function.

0)( * xf

0)( *2 xf

Multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 29

Page 30: L6 - Continuous Optimization

L6—

• The numerical algorithms are intrinsically iterative and usually perform a series of direction‐searches. At the k‐th iteration we have the k‐th direction sk and the method minimizes f(x) along sk.

• DIRECT or HEURISTIC methods:• Random search (Montecarlo)• Grid search (heavy but exhaustive)• Univariate research we identify n directions (where n is the number of 

dof) with respect to which perform iteratively the optimization.

x0

xOtt

Multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 30

Page 31: L6 - Continuous Optimization

L6—

Simplex method (Nelder & Mead, 1965)• The simplex is a geometric figure having n+1 vertices for n dof. We identify the worst 

vertex (i.e. having the highest value for f(x)) and we reverse it symmetrically with respect to the center of gravity of the remaining n‐1 vertices. We identify a new simplex respect to which continue the search. The overturning of the simplex may be subject to expansion or contraction according to the actual situation.

x0

xOtt

Multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 31

Page 32: L6 - Continuous Optimization

L6—

Conjugate directions methodConsidering a quadratic approximation of the objective function it is possible to identify its conjugate directions.

Hp.: f(x) is quadratic1. x0 generic2. s generic3. xa minimum on s4. x1 generic5. t parallel to s6. xb minimum on s7. u from joining xa and xb

u is the conjugated direction with respect to s and t and by minimizing it we identify the optimal point xott of f(x) (for that quadratic approximation).

x0

x1

xa

xb

xott

s

t

u

Multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 32

Page 33: L6 - Continuous Optimization

L6—

First order indirect methodsA possible candidate search direction smust decrease the function f(x). It must satisfy the condition: 

In fact:

only if:

The gradient method selects the gradient of the objective function (in the opposite direction) as the search direction .The idea of moving in the direction of the maximum slope (i.e. “Steepest Descent”) may be not optimal.

0)( sfT x

)(xf

s

10 8 6

0cos)()( sfsf TT xx

cos 0 90

Multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 33

Page 34: L6 - Continuous Optimization

L6—

Gradient method

Easy search

Difficult searchx0

x0

xott

Multidimensional unconstrained optimization

xott

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 34

Page 35: L6 - Continuous Optimization

L6—

Second order indirect methodsThey exploit the second order partial derivatives of the objective function.Implementing the Taylor series truncated at the second term and equating the gradient to zero we get:

Consequently, it must be:

N.B.: the Hessian matrix is not inverted, we solve the resulting linear system via LU factorization.In addition, the Hessian matrix is NOT calculated directly as it would be very expensive in terms of CPU computing time. On the contrary, the BFGS formulas (Broyden, Fletcher, Goldfarb, Shanno) allow starting from an initial estimation of H(often the identity matrix) and through the gradient of f(x) they evaluate iteratively H(x).The solving numerical methods are: Newton, Newton modified: Levemberg‐Marquardt, Gill‐Murray.

0)()( kkkf xxHx

)()(11 kkkk f xxHxx

Multidimensional unconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 35

Page 36: L6 - Continuous Optimization

L6—

Some peculiar objective functions

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 36

Page 37: L6 - Continuous Optimization

L6—

Some peculiar objective functions

-10-5

05

10

-10-5

05

100

50

100

150

200

250

Rastrigin

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 37

Page 38: L6 - Continuous Optimization

L6—

Some peculiar objective functions

01

23

4

01

23

40

0.5

1

1.5

2

Michalewicz

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 38

Page 39: L6 - Continuous Optimization

L6—

Methods for multidimensionalconstrained optimization

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 39

Page 40: L6 - Continuous Optimization

L6—

• The objective function and the equality and inequality constraints are all LINEAR. Thus, the objective function is neither concave nor convex. Actually, it is either a plane (2D) or a hyperplane (with n dof).If the region identified by the constraints is consistent we have to solve a problem (“feasible”) that will take us through the constraints and more specifically towards their intersection.

• Simplex Method LP

1210

86

4

xOtt

x0

It is first necessary to identify a starting point that belongs to the “feasible” region.Then we move along the sequence of constraints until we reach the optimal point.The problem may also NOT have a “feasible” region of research.

Linear Programming

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 40

Page 41: L6 - Continuous Optimization

L6—

Method of the Lagrange multipliers

The inequality constraints,  , if violated, are rewritten as equality 

constraints by introducing the slack variables: 0)( 2 xg

( ) 0g x

Nonlinear Programming

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 41

Page 42: L6 - Continuous Optimization

L6—

Method of the Lagrange multipliers

The objective function is reformulated to contain both equality and inequality 

constraints:

There are necessary and sufficient conditions to identify the optimal point that 

simultaneously satisfies the imposed constraints.

It is easy to see how the dimensionality of the problem increases.

2

1 1

( , , ) ( ) ( ) ( )NEC NCTOT

i i i i ii i NEC

L f h g

x ω σ x x x

Nonlinear Programming

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 42

Page 43: L6 - Continuous Optimization

L6—

Penalty Function method

We change the objective function by summing some penalty terms that quantify 

the violation of inequality and equality constraints:

More generally: 

2 ( ) ( ) min 0, ( )Min f h g x x x

1 1

22

( ) ( ) ( )

( ) ( ) min(0, )

NEC NCTOT

i ii i NEC

nn

Min f h g

y y y y

x x x

Nonlinear Programming

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 43

Page 44: L6 - Continuous Optimization

L6—

SQP method  (Successive Quadratic Programming)The objective function f(x) is approximated iteratively through a quadratic function, while the constraints are linearized and added to the objective function:

the search for the optimal point is made through a direction s (identified by the vector x) over which the objective function and constraints have been formulated.Matrix B is an approximation of the Hessian matrix H and is calculated through the BFGS formulas (Broyden, Fletcher, Goldfarb, Shanno).

bAx

Bxxxcx

..21 )(

ts

MinfMin TT

Nonlinear Programming

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 44

Page 45: L6 - Continuous Optimization

L6—

Case-study #1

On-line optimization ofcontinuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 45

Page 46: L6 - Continuous Optimization

L6—

Waste to energy plant with DeNOx catalytic section

On-line optimization of continuous processes

D. Manca, M. Rovaglio, G. Pazzaglia, G. Serafini. Comp. & Chem. Eng., 22(12), 1879‐1896, (1998)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 46

Page 47: L6 - Continuous Optimization

L6—

• Requirements of the optimization procedure

• Economic optimization of the process: 

• maximize the steam production and then electrical energy. 

• Minimize the operating costs

• Respect the process constraints for a correct plant operation

• Respect the law constraints

• Alternatively

• Minimize the production of micropollutants

• Reduce environmental impact

• Optimal mixing of wastes having different nature

On-line optimization of continuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 47

Page 48: L6 - Continuous Optimization

L6—

Objective function to be maximized

Degrees of freedomWaste flowrate Total air flowrate to the furnace Air flow first drumAir flow rate second drum Air flow third drum Air flow fourth drumSecondary air flow to furn. Air flow afterburner       CH4 flow rate afterburnerFirst drum speed   Second drum speed  Third drum speed Fourth drum speed  NaOH flow CH4 DeNOx flowNH3 DeNOx flowrate

Law constraints Process constraints% vol. min. O2 afterburner    Delta P max on every drumT out min. afterburner T in max. and min. DeNOx reactorHCl max to the stack % max. unburnt in ashesSO2 max to the stack Max. and min. steam producedNOx max to the stack  % vol. max. O2 afterburnerNH3 max to the stack  Delta max. combustion on the first 3 drums

T out max. and min. primary combustion chamber

Higher and lower constraints on the degrees of freedom

4 4 4 3 3, ,obj rif rif vap vap CH PC CH DeNOx CH NH NHF W c W c W W c W c

On-line optimization of continuous processes

D. Manca, M. Rovaglio, G. Pazzaglia, G. Serafini. Comp. & Chem. Eng., 22(12), 1879‐1896, (1998)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 48

Page 49: L6 - Continuous Optimization

L6—

Problem solution

• We must adopt a nonlinear constrained multivariable optimization routine which is efficient (in terms of CPU time) and robust (able to identify the solution).

• We must implement a detailed model of the process able to simulate the response of the system whenever the optimization routine proposes a new degrees of freedom vector.

• The process optimizer has as its main task to bring the system to operate in the “feasible” region, where the constraints are respected. In some cases, it may happen that the objective function worsens compared to the initial conditions since the process is brought to operate within the feasibility region. Then, within this region, the optimizer maximizes the objective function.

• Note that the explicit computation of the objective function is almost instantaneous. This does not occur for the evaluation of each single term which composes the objective function as they come from the simulation procedure of the process.

On-line optimization of continuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 49

Page 50: L6 - Continuous Optimization

L6—

1

2

2.1

2.2

2.3

2.4

2.5

3.1 3.2 3.3 3.4

4

Homogeneous combustion section

Heterogeneous

combustion section

Process Model – Primary kiln

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 50

Page 51: L6 - Continuous Optimization

L6—

i,RIFOUT

i,RIFIN

i,RIFi,RIF RFF

dtdM

Solid phase

Gaseous phase

0 OUTi,kk

rif

i,RIFOUTi,k Wx

PMR

W

NGiNCk ,1,1

OUTi,RIFFIN

i,RIFF

OUTi,kW

INi,kW

i‐th drum

NGi ,1

Material balances on each drum

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 51

Page 52: L6 - Continuous Optimization

L6—

OHkmNxy

NOxpSOkHClnCONClOSHC iiykqpmn

iO222 22

,2

yx i,NOi

1

315025001

2

2

100

outi,OG

%i,NOG

i,NO

i,NO

W)T/exp(TW

Combustion reactions in the solid phase

(Bowman, 1975)

2 21CO O CO2

2 21 1N O NO2 2

Combustion reactions in the homogeneous phase

Chemical reactions

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 52

Page 53: L6 - Continuous Optimization

L6—

),,,( ,,,, iinertiirifiipisc MMdfA

)exp(11 ,

iCG

i

Nisciisc AA ,

*,

rifisciO

iOixiRIF PMA

xkR

*

,,

,,,

2

2

Corrective factors:(adaptive parameters)

),,,,( ,,,, TxWdfk ikiariaiipix Granular solid bed

Kinetic determining step: O2 diffusion

,

Primary kiln – combustion kinetics

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 53

Page 54: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 54

Page 55: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 55

Page 56: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 56

Page 57: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 57

Page 58: L6 - Continuous Optimization

L6—

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 58

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Page 59: L6 - Continuous Optimization

L6—

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 59

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Page 60: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 60

Page 61: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 61

Page 62: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 62

Page 63: L6 - Continuous Optimization

L6—

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 63

Page 64: L6 - Continuous Optimization

L6—

<

Manca D., M. Rovaglio, Ind. Eng. Chem. Res. 2005, 44, 3159‐3177

Process model – the equations

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 64

Page 65: L6 - Continuous Optimization

L6—

Results:

On-line optimization of continuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 65

Page 66: L6 - Continuous Optimization

L6—

Results:

On-line optimization of continuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 66

Page 67: L6 - Continuous Optimization

L6—

On-line optimization of continuous processes

Rovaglio, M., Manca, D., Rusconi, F. Waste Management 18, 525‐538, (1998)© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 67

Page 68: L6 - Continuous Optimization

L6—

On-line optimization of continuous processes

Rovaglio, M., Manca, D., Rusconi, F. Waste Management 18, 525‐538, (1998)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 68

Page 69: L6 - Continuous Optimization

L6—

Case-study #2

On-line optimization ofdiscontinuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 69

Page 70: L6 - Continuous Optimization

L6—

Slop‐cutP1

P2

Two-components batch distillation

1. Total reflux

2. Collection of P1 in the dedicated tank

3. Out-of-spec collection in the “slop-cut”

4. Collection of P2 in the still pot

On-line optimization of discontinuous processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 70

Page 71: L6 - Continuous Optimization

L6—

0 0.05 0.1

0.15 0.2

0.25 0.3

0.35 0.4

0.45 0.5

0.55 0.6

0.65 0.7

0.75 0.8

0.85 0.9

0.961

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55

Fraz

ione

mol

are

Tempo (h)

In the distillate

-0.10

0.10.20.30.40.50.60.70.80.9

1 1.1

0 0.5 1 1.5 2 2.5 3 3.29 4

Fraz

ione

nel

ser

bato

io P

1

Tempo (h)

In tank P1

0.40.45

0.50.55

0.60.65

0.70.75

0.80.85

0.9

0.961

0 0.5 1 1.5 2 2.68 3.29 4

Fraz

ione

mol

are

Tempo (h)

In the distillate

0 0.05 0.1

0.15 0.2

0.25 0.3

0.35 0.4

0.45 0.5

0.55 0.6

0.65 0.7

0.75 0.8

0.85 0.9

0.96 1

0 0.5 1 1.5 2 2.5 3 3.51 4

Fraz

ione

mol

are

Tempo (h)

In the reboiler

3.29

Light component Heavy component

Optimal trajectory

D. Manca.  Chemical Product and Process Modeling, 2,12 (2007)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 71

Page 72: L6 - Continuous Optimization

L6—

• There are three distinct approaches to the selection of the objective functionwhen distillation batch processes are involved:

1. Maximizing the product quantity

Converse and Gross (1963) were the first researchers to face the optimizationproblem for a batch distillation column. Logsdon et al. (1990) solved the NLP.

2. Minimization of the distillation time

The reflux profile is divided into a number of intervals with the target ofreducing the total distillation time (Coward, 1967). Mujtaba and Macchietto(1988) solved the problem adopting the SQP algorithm.

3. Profit maximization

The method is based on a profit function, for instance the capacity factor, thattakes into account both the quantity/quality of the product and the totaldistillation time. Kerkhof and Vissers (1978), Logsdon et al. (1990), Diwekar(1992).

Optimal trajectory

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 72

Page 73: L6 - Continuous Optimization

L6—

• There are three distinct approaches to the selection of the degrees of freedomwhen distillation batch processes are involved:

1. Constant reflux distillation

The degrees of freedom are: pressure, vapor flowrate inside the column,distillate flowrate.

2. Constant composition

The degrees of freedom are: pressure, vapor flowrate and the purity of the keycomponent that remains constant throughout the batch.

3. Variable reflux profile

The degrees of freedom are: pressure and reflux ratio (or equivalently thedistillate flowrate) at every time of the batch Optimal trajectory.

Optimal trajectory

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 73

Page 74: L6 - Continuous Optimization

L6—

t  (h)

D (mol/h)

Δti Di

t (h)

D (mol/h) Variable reflux profile

Optimal trajectory

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 74

Page 75: L6 - Continuous Optimization

L6—

1 2

, 0.5i it D tot

P PtMax

Capacity FactorLuyben (1978)

, , , , 0g x x u t spec

Pi Dix x

max0 iD D

max0 it t

. .s tThe DAE system comprises

(NS+2)(NC‐1)+1 ODE (mass + energy balances)

(NS+1) NC AE (thermodynamic equilibria)

(NS+2) AE (stoichiometric equations)

Optimal trajectory

D. Manca.  Chemical Product and Process Modeling, 2,12 (2007)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 75

Page 76: L6 - Continuous Optimization

L6—

Objective function + constraints Variables

Initial values

OPTIMIZER

Optimal solution

MODEL

SQP

Simplex

Robust method searching the solution within the entire domain of the dof

OPTIMIZATION METHODS

Optimal trajectory

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 76

Page 77: L6 - Continuous Optimization

L6—

CAP

D1

3039

4857

6675

t1

0.2

2.44

0.76

1.32

1.88

Optimal trajectory

D. Manca.  Chemical Product and Process Modeling, 2,12 (2007)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 77

Page 78: L6 - Continuous Optimization

L6—

Second group

First group

Third group

30 39 48 75

D1

3

2.44

1.88

1.32

0.76

0.2

t1

Optimal trajectory

D. Manca.  Chemical Product and Process Modeling, 2,12 (2007)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 78

Page 79: L6 - Continuous Optimization

L6—

Optimal trajectory

D. Manca.  Chemical Product and Process Modeling, 2,12 (2007)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 79

Page 80: L6 - Continuous Optimization

L6—

10 20 30 40 50 60 70 80

0 0.5 1 1.5 2 2.5 3 3.5

CA

P

t1

0

10

20

30

40

50

60

70

80

0 0.5 1 1.5 2 2.5 3 3.5

CA

P

t3

20

30

40

50

60

70

80

10 20 30 40 50 60 70 80 90 100

CA

P

D2

25 30 35 40 45 50 55 60 65 70 75 80

0 0.5 1 1.5 2 2.5 3 3.5

CA

P

t2

20

25

30

35

40

45

50

55

60

65

30 40 50 60 70 80 90 100

CA

P

D1

25

30

35

40

45

50

55

60

65

70

75

80

30 40 50 60 70 80 90 100

CA

P

D3

The objective function, CAP, as a function of the six dof respect to the absolute optimum value.

Optimal trajectory

D. Manca.  Chemical Product and Process Modeling, 2,12 (2007)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 80

Page 81: L6 - Continuous Optimization

L6—

Case-study #3

Model based control ofindustrial processes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 81

Page 82: L6 - Continuous Optimization

L6—

• Industrial processes are characterized by the following control problems:

1. The process is almost usually multivariate

• several controlled variables: y1, y2,…, yn

• several manipulated variables: u1, u2,…, um

• several disturbance variables: d1, d2,…, dk

2. Complex dynamic behaviour:

• time delays due to the inertia of the system (either material or energetic), 

mass flow in the pipes, long measuring times

• Inverse response

• possible instability at open‐loop

Introduction

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 82

Page 83: L6 - Continuous Optimization

L6—

3. Intrinsic nonlinearity of the system

4. Operative constraints that are quite dissimilar and complex

• constraints on the input and output variables

• constraints on the changing rate of the input variables

• Constraints on the optimal value of the input variables (e.g., economic 

value)

• process and law constraints

• soft and hard constraints

Introduction

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 83

Page 84: L6 - Continuous Optimization

L6—

An ideal control system should be:

• Multivariable and capable of managing:

• time delays, 

• inverse response,

• process and law constraints, 

• measurable and non‐measurable disturbances

• Minimize the control effort

• Able of inferring the unmeasured/unmeasurable variables from the measured ones

• Robust respect to the modeling errors/simplifications and the noise of the measured variables

• Able to manage both the startups and shutdowns (either programmed or emergency) as well as the steady‐state conditions

Model based control

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 84

Page 85: L6 - Continuous Optimization

L6—

• The availability of dynamic numerical models of:

• chemical/industrial processes, 

• unit operations

• process units,

• plant subsections

• …

allows forecasting the response of the simulated plant/process to possible disturbances and manipulated variables.

• The availability of such dynamic numerical models paves the way to the so‐called: model based control.

• The model of the process can be used to forecast the system response to a set of control actions originated by modifying a suitable set of manipulated variables.

Model based control

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 85

Page 86: L6 - Continuous Optimization

L6—

• We are going to answer the following question:

Whatistheresponseofthesystemtoamodificationofthemanipulatedvariables?

• More specifically, we can imagine to deploy an optimizing procedure that looks for the best response of the system subject to the manipulation of the process variables.

• According to the most simplified approach, we have:

• the control specifications, i.e. the setpoint

• the objective function that measures the distance of the controlled variable from the setpoint

• the dynamic model of the system usuallydescribed by a DAE system, which playsthe role of the equality constraints

• the manipulated variables that are thedegrees of freedom of optimizationproblem

Model based control

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 86

Page 87: L6 - Continuous Optimization

L6—

ysp = y set point (setpoint trajectory)y = y model responseyr = y real, measured responseu = manipulated variable

y(k‐1)

y(k)y(k+1)

u(k)

FuturePast

k k+1 k+2 k+3 k+4 k+5 …

Time horizon

yr(k‐1)

yr(k)

ysp(k‐1)

ysp(k)ysp(k+1)

Model predictive control

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 87

Page 88: L6 - Continuous Optimization

L6—

• The system follows a specified trajectory  optimal setpoint trajectory, ysp

• The model is called to produce a prediction, y, of the real response of the system.

• We have:

• response in the future: y(k+1), y(k+2), y(k+3), …

• respect to past real inputs: u(k), u(k1), u(k2), …

• respect to future manipulated inputs: u(k+1), u(k), …

• The numerical model of the process to be controlled is used to evaluate a sequence 

of control actions that optimize an objective function to: 

• Minimize the system response y respect to the optimal set‐point trajectory, ysp

• Minimize the control effort

MPC features

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 88

Page 89: L6 - Continuous Optimization

L6—

• Since the model is a simplified representation of the real system, it is intrinsically not 

perfect. This means that there is a discrepancy between the real system and the 

modeled one.

• The present error k between the real system and the model is:

• This error is kept constant and it is used for future forecasts. 

k ry k y k

MPC features

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 89

Page 90: L6 - Continuous Optimization

L6—© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 90

1 12 2 2

( ), ( 1), , ( 1) 1

2

min

, ,

p p p

c

k h k h k h

y y y u u T Tk k k h j k i k l k

y spy y r real model

sp

MAXy

MAX

j j i i l

j k jj k k k k k

j

j jj Max Min

u u uω e PF ω Δu PF ω δu

y δ ye δ y y y y

y

y y yPF 0 0

y

2

2 2

1

1

, ,

, , ,. .

, , , ,

MIN

MIN

MIN MAX

MAX MINu

MAX MIN

T T

i ii i

i

i ii Max Min

l l l

ts t

t

yy

u uΔu Δu Δu Δu

u

u u u uPF 0 0

u u

δu u u

h y u d 0

f y y u d 0

MPC mathematical formulation

Page 91: L6 - Continuous Optimization

L6—

( ), ( 1), , ( 1)

min ...ck k k h u u u

MPC mathematical formulation

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 91

Page 92: L6 - Continuous Optimization

L6—

2

( ), ( 1), , ( 1) 1

2 2

min ...

, ,

p

c

k h

y y yk k k h j k

y spy y r real model

sp

MAX MINy

MAX MIN

j j

j k jj k k k k k

j

j jj Max Min

u u uω e PF

y δ ye δ y y y y

y

y y y yPF 0 0

y y

MPC mathematical formulation

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 92

Page 93: L6 - Continuous Optimization

L6—

12

( ), ( 1), , ( 1)

2 2

min ... ...

1

1

, ,

p

c

k h

u uk k k h i k

MIN MAX

MAX MINu

MAX MIN

i i

i ii i

i

i ii Max Min

u u uω Δu PF

u uΔu Δu Δu Δu

u

u u u uPF 0 0

u u

In general,             is negativeMINΔu

MPC mathematical formulation

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 93

Page 94: L6 - Continuous Optimization

L6—

12

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

p

c

k h

T Tk k k h l k

T T

l

l l l

u u uω δu

δu u u

T =  target. 

It can be the same optimal value of the steady state conditions for the

manipulated variables (e.g., nominal operating conditions).

MPC mathematical formulation

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 94

Page 95: L6 - Continuous Optimization

L6—

1 12 2 2

( ), ( 1), , ( 1) 1

2

min

, ,

p p p

c

k h k h k h

y y y u u T Tk k k h j k i k l k

y spy y r real model

sp

MAXy

MAX

j j i i l

j k jj k k k k k

j

j jj Max Min

u u uω e PF ω Δu PF ω δu

y δ ye δ y y y y

y

y y yPF 0 0

y

2

2 2

, ,

1

,. .

, , , ,

1

, ,

MIN

MIN

MIN MAX

MAX MINu

MAX MIN

T T

i ii i

i

i ii Max Min

l l l

ts t

t

yy

u uΔu Δu Δu Δu

u

u u u uPF 0 0

u u

δu u

h y u d 0

f y y u d 0

u

MPC mathematical formulation

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 95

Page 96: L6 - Continuous Optimization

L6—

c

p

y

u

T

y

model

T

hh

k

y yu

u

Critical elements of the MPC

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 96

Page 97: L6 - Continuous Optimization

L6—

stack fan

inlet water

outlet water

auxiliary burners

vapor inlet

vapor outlet

vapor inlet

vapor outlet

primary burners

inlet water

inlet stream

MPC of the steam reforming process

CH4 + H2O  CO + 3H2 H = +206 kJ/mol CH4 + H2O  CO + 3H2 H = +206 kJ/mol 

CO + H2O  CO2 + H2 H = ‐41 kJ/mol CO + H2O  CO2 + H2 H = ‐41 kJ/mol 

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 97

Page 98: L6 - Continuous Optimization

L6—

natural gas

Furnace

TTTT

Control System

FT

setpoint

fuelsteam

smokes

syn‐gas

FT

Control layout of the steam reforming section

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 98

Page 99: L6 - Continuous Optimization

L6—

We start from the steady‐state model of Singh and Saraf (1979)

Main assumptions:

• pseudo‐homogeneous

• monodimensional model: neither axial nor radial dispersions

• discretization into a series of CSTR

• subdivision into layers of the pipe thickness

Process model

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 99

Page 100: L6 - Continuous Optimization

L6—

dWdt

F F R Vi ki k i k i j j k

j

NR,

, , , , 1

1

c W c V dTdt

T T c Fp mix k tot k p cat catk

k k p mix k tot k, , , , , , , 1 1 1

D h T T dz R H Vin in k p in k k j k j kj

NR

, , , , ,1

Material balance

Energy balance on the gas-catalyst system

V

k-th reactor

Tk-1 Pk-1

Fk-1,i

Tk Pk

Fk,i

k NCSTR i NC 1 1,..... , ......

Process model: inside the reforming pipes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 100

Page 101: L6 - Continuous Optimization

L6—

met met p meti met

i ii i

i

i

V c dTdt

kx T T dz D D

DD

, /

/

/ln2

1 21 2

1 2

kx T T dz D D

DD

meti i

i i

i

i

2

1 21 2

1 2

//

/

ln

Balance on the i-th discretized layer

Flux continuity

h T Tk T T

D DD

in p inmet p in

inin

,,

ln

2 1

1

( )

ln

, ,GS T TA N

k T T

D DD

t R gas p out

t t

met p out N

outout

N

4 4 2

Internal surface External surface

Process model: pipes

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 101

Page 102: L6 - Continuous Optimization

L6—

Q Q Qf t g t

Q GS E Eg t t R g t Q N A Ef t B f f g t f 1

in in outfuel gas smokes dispH H H Q H

adiabaticT

Flames Smokes

Process model: firebox (radiative chamber)

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 102

Page 103: L6 - Continuous Optimization

L6—

700

750

800

850

900

950

1000

1050

1100

1150

1200

0 2 4 6 8 10 12

reactor length ‐m

Temperature ‐ K

process gas

internal wall

external wall

experimental dataliterature datasimulation

Validation of the numerical model

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 103

Page 104: L6 - Continuous Optimization

L6—

1036

1038

1040

1042

1044

1046

1048

1050

1052

1054

1056

10 15 20 25 30 35

time ‐min

Outlet temperature ‐ K

inlet temperature step disturbance

fuel flowrate step disturbance

initial time of the step

System dynamics at open loop

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 104

Page 105: L6 - Continuous Optimization

L6—

2.46e‐03

2.48e‐03

2.50e‐03

2.52e‐03

2.54e‐03

2.56e‐03

2.58e‐032.60e‐03

Fuel flowrate step

time ‐min10 15 20 25 30

Hydrogen flowrate ‐ kmol/s

Dry flowrate step

time ‐min

2.48e‐03

2.52e‐03

2.56e‐03

2.60e‐03

2.64e‐03

2.68e‐03

10 15 20 25 30

Over‐response:  slow dynamics + fast dynamics

System dynamics at open loop

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 105

Page 106: L6 - Continuous Optimization

L6—

Input

Output

Controlled variables:

• outlet gas temperature• hydrogen flowrate

Process

Manipulated variables:• fuel flowrate• steam flowrate

Measurable disturbances:• dry flowrate• inlet gas temperature

Definition of the main variables

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 106

Page 107: L6 - Continuous Optimization

L6—

Real plant

ProcessModel

Optimizer+

+

+

+ +‐ ‐

yset u

u

u

Constraints

d1 d2+

d1 : measurable disturbances

d2 : unmeasurable disturbances

y

y

y

y

minu set

i

h

y i y ip

2

1min ( ( )) ( ( ))

( ).... ( )u k u k h y yj k

k h

ui k

k h

c

p p

e j u i

1

2

1

21

ProcessModel

Model Predictive Control scheme

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 107

Page 108: L6 - Continuous Optimization

L6—

hp: prediction horizon

High values of hpproduce:

• increased predictive capability

• less vigorous control actions

• higher distances from setpoints

1053.5

1054.0

1054.5

1055.0

1055.5

1056.0

1056.5

1057.0

0 5 10 15 20 25 30 35

time  ‐min

Outlet temperature ‐ K

Step time

hpsetpoint

hp = 1hp = 3hp = 5hp = 7

Control horizon and prediction horizon

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 108

Page 109: L6 - Continuous Optimization

L6—

hc: control horizon

High values of hcproduce:

• better controllability

• more vigorous control actions

• higher number of dof

dof c cn h n N.B.

1053.5

1054.0

1054.5

1055.0

1055.5

1056.0

1056.5

1057.0

0 5 10 15 20 25 30 35

time ‐min

Outlet temperature ‐ K

hc = 1 hc = 3 hc = 5 

setpoint

Step time

Control horizon and prediction horizon

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 109

Page 110: L6 - Continuous Optimization

L6—

u

High values of u produce:

• small variations of the

manipulated variables

• more sluggish controllers

• more stable controllers

1053.5

1054.0

1054.5

1055.0

1055.5

1056.0

1056.5

1057.0

0 5 10 15 20 25 30 35 40

time  ‐min

Outlet temperature ‐ K

u u

Step time

The parameter u

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 110

Page 111: L6 - Continuous Optimization

L6—

0.490

0.495

0.500

0.505

0.510

0.515

0.520

0 5 10 15 20 25 30 35

Hydrogen flowrate ‐ kmol/s

0.090

0.091

0.092

0.093

0.094

0.095

0.096

0.097

0 5 10 15 20 25 30 35

time ‐min

Fuel flowrate ‐ kmol/s

0.82

0.83

0.84

0.85

0.86

0.87

0.88

0.89

0.90

0 5 10 15 20 25 30 35

time ‐min

Steam flowrate ‐ kmol/s

1051.0

1051.5

1052.0

1052.5

1053.0

1053.5

1054.0

1054.5

1055.0

0 5 10 15 20 25 30 35

Outlet temperature ‐ K

Step time

MPC: closed loop response

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 111

Page 112: L6 - Continuous Optimization

L6—

1054105610581060106210641066106810701072

0 5 10 15 20 25 30 35

Outlet temperature ‐ K

0.494

0.496

0.498

0.500

0.502

0.504

0.506

0.508

0 5 10 15 20 25 30 35

Hydrogen flowrate ‐ kmol/s

Fuel flowrate ‐ kmol/s

0.090

0.095

0.100

0.105

0.110

0.115

0 5 10 15 20 25 30 35

time ‐min

Steam flowrate ‐ kmol/s

0.840

0.850

0.860

0.870

0.880

0.890

0.900

0.910

0.920

0 5 10 15 20 25 30 35

time ‐min

MPC: closed loop response

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 112

Page 113: L6 - Continuous Optimization

L6—

1050

1055

1060

1065

1070

1075

1080

1085

1090

5 10 15 20 25 30 35

time ‐min

Outlet temperature ‐ K

MPC

PI

0.480

0.485

0.490

0.495

0.500

0.505

5 10 15 20 25 30 35

time ‐min

Hydrogen flowrate ‐ kmol/s

MPC

PI

Comparison between MPC and PI control

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 113

Page 114: L6 - Continuous Optimization

L6—© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 114

• Edgar T. F., D. M. Himmelblau, “Optimization of chemical processes”, McGraw Hill, Singapore, (1989)

• Peters M.S., K.D. Timmerhaus, “Plant Design and Economics for Chemical Engineers, McGraw Hill, New York,

(1993)

• Reklaitis G. V., A. Ravindran, K.M. Ragsell, “Engineering Optimization”, John Wiley, New York, (1983)

• Fletcher R., “Practical methods of optimization”, John Wiley, New York, (1981)

• Gill P.E., W. Murray W., M.H. Wright, “Practical Optimization”, Academic press, London, (1981)

• Manca D. , Rovaglio M., Pazzaglia G., Serafini G. , “Inverse Response Compensation and Control Optimization

of Incineration Plants with Energy Production”, Comp. & Chem. Eng., Vol. 22, 12, 1879‐1896, (1998)

• Manca D., Rovaglio M., “Numerical Modeling of a Discontinuous Incineration Process with On Line Validation”,

Ind. Eng. Chem. Res., 44, 3159‐3177 (2005)

• Manca D., “Optimization of the Variable Reflux Ratio in a Batch Distillation Column Through a Heuristic

Method”, Chemical Product and Process Modeling: Vol. 2, 12, (2007)

• Rovaglio M., D. Manca, F. Rusconi, “Supervisory control of a selective catalytic reactor for NOx removal in

incineration plants”, J. Waste Manag., 18, 525‐538, (1998)

References

Page 115: L6 - Continuous Optimization

L6—

• Biegler L T., R.R. Hughes, “Infeasible Path Optimization with Sequential Modular Simulators”, AIChE Journal,28, 994, (1982)

• Biegler L.T., R.R. Hughes, “Feasible Path Optimization with Sequential Modular Simulators”, Comp. Chem.Eng., 9, 379, (1985)

• Biegler L.T., “Improved Infeasible Path Optimization for Sequential Modular Simulators: The Interface”,Comp. Chem. Eng., 9, 245, (1985)

• Biegler L.T., J.E. Cuthrell, “Improved Infeasible Path Optimization for Sequential Modular Simulators: TheOptimization Algorithm”, Comp. Chem. Eng., 9, 257, (1985)

• Biegler L.T., I.E. Grossmann, A.W. Westerberg, “A Note on Approximation Techniques Used for ProcessOptimization”, Comp. Chem. Eng., 9, 201, (1985)

• Coward I., “The Time Optimal Problems in Binary Batch Distillation”, Chem. Eng. Sci., 22, 503, (1967)

• Coward I., “The Time Optimal Problems in Binary Batch Distillation a further note”, Chem. Eng. Sci., 22, 1881,(1967)

• De Deken J. C., E. F. Devos, G. F. Froment, “Steam reforming of natural gas: intrinsic kinetics, diffusionalinfluences, and reactor design”, Chemical Reaction Engineering‐Boston, ACS Symposium series, (1982)

• Diwekar, U. M., R. K. Malik, K. P. Madhavan, “Optimal Reflux Rate Policy Determination for MulticomponentBatch Distillation Columns”, Comp. Chem. Eng., 11, 629, (1987)

References

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 115

Page 116: L6 - Continuous Optimization

L6—

• Diwekar U. M., “Unified Approach to Solving Optimal Design Control Problems in Batch Distillation”, AIChE J.,38, 1551, (1992)

• Diwekar, U. M., “Batch Distillation. Simulation, Optimal Design and Control”, Taylor and Francis, WashingtonDC, (1994)

• Douglas, J. M., “Conceptual Design of Chemical Processes”, McGraw Hill, New York, (1988)

• Eaton J. W., J. B. Rawlings, “Model‐predictive control of chemical processes”, Chem. Eng. Sci., 47, (1992)

• Farhat S., S. Domenech, “Optimization of multiple fraction batch distillation by nonlinear programming”,AIChE J., 36(9), 1349, (1990)

• Gallier P.W., T.P. Kisala, “Process Optimization by Simulation”, Chem. Eng. Progress, 60, (1987)

• Grossmann I.E., K.P. Halemane, R.E. Swaney, “Optimization Strategies for Flexible Chemical Processes”,Comp. Chem. Eng., 7, 439, (1983)

• Hutchinson H.P., D.J. Jackson, W. Morton, “The Development of an Equation‐Oriented Flowsheet Simulationand Optimization Package. The Quasilin Program”, Comp. Chem. Eng., 10, 19, (1986)

• Kerkhof L.H.J., H.J.M Vissers, “On the profit of optimum control in batch distillation”, Chem. Eng. Sci., 33,961, (1978)

• Kilkas A.C., H.P. Hutchinson, “Process Optimization Using Linear Models”, Comp. Chem. Eng., 4, 39, (1980)

References

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 116

Page 117: L6 - Continuous Optimization

L6—

• Kisala T.P., “Successive Quadratic Programming in Sequential Modular Process Flowsheet Simulation andOptimization”, PhD Thesis, (1985)

• Kisala T.P., R.A. Trevino Lozano, J.F. Boston, H.I. Britt, L.B. Evans, “Sequential Modular Approach andSimultaneous Modular Strategies for Process Flowsheets Optimization”, Comp. Chem. Eng., 11, 567, (1987)

• Lang. P., L.T. Biegler, “A Unified Algorithm for Flowsheet Optimization”, Comp. Chem. Eng., 11, 143, (1987)

• Locke M.H., R.H. Edahl, A.W. Westerberg, “An Improved Successive Quadratic Programming OptimizationAlgorithm for Engineering Design Problems”, AIChE J., 29, 871, (1983)

• Logsdon, J. S., U. M. Diwekar, L. T. Biegler, “On the Simultaneous Optimal Design and Operation of BatchDistillation Columns”, Trans. of IChemE, 68, 434, (1990)

• Luenberger D.G., “Linear and Nonlinear programming”, Addison Wesley, Amsterdam, (1984)

• Luyben W. L., “Batch distillation. Binary Systems”, Ind. Eng. Chem. Res., 10, 54, (1971)

• Luyben W. L., “Multicomponent Batch Distillation. Ternary Systems with Slop Recycle”, Ind. Eng. Chem. Res,27, 642, (1988)

• Mujtaba I. M. S. Macchietto, “Optimal Operation of Multicomponent Batch Distillation”, Comp. Chem. Eng.,17, 1191, (1993)

• Mujtaba I. M. S. Macchietto, “Optimal Recycles Policies in Batch Distillation‐Binary Mixtures”, Proc. SIMO’88, 6, 191, (1988)

References

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 117

Page 118: L6 - Continuous Optimization

L6—

• Nelder J.A., R. Mead, “A Simplex method for function minimization”, Comp. J., 7, 308, (1965)

• Ostrovsky G.M., M.C. Ostrovsky, T.A. Berezhinsky, “Optimization of Chemical Plants with Recycles”, Comp. Chem. Eng., 12, 289, (1988)

• Palacios Gomez F., L. Lasdon, M. Engquist, “Nonlinear Optimization by Successive Linear Programming”, Management Science, 28, 1106, (1982)

• Rangaiah G.P., “Studies in Constrained Optimization of Chemical Process Problems”, Comp. Chem. Eng., 9,395, (1985)

• Singh P. P. C., D. N. Saraf, “Simulation of side fired steam‐hydrocarbon reformers”, Ind. Eng. Chem. Process Des. Dev., Vol. 18, No. 1, (1979)

• Stadtherr M.A., H.S. Chen, “Numerical Techniques for Process Optimization by Successive Quadratic Programming”, III Int. Conf. on Computers and Chemical Eng., (1993)

• Thompson, G. L., S. P. Sethi, “Optimal Control Theory”, Martinus Nijhoff Publishing, Boston, (1994)

References

© Davide Manca – Process Systems Engineering – Master Degree in ChemEng – Politecnico di Milano 118