optimization and control of chemical processes - ucnuno/cim2003/present.pdf · “the synthesis,...

91
Optimization and Control of Chemical Processes Nuno M.C. Oliveira <http://www.eq.uc.pt/~nuno/cim2003/> GEPSI — PSE Group, Department of Chemical Engineering University of Coimbra, Portugal Workshop on Modeling and Simulation in Chemical Engineering June 30 - July 4, 2003

Upload: tranliem

Post on 19-Feb-2018

222 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Optimization and Control ofChemical Processes

Nuno M.C. Oliveira<http://www.eq.uc.pt/~nuno/cim2003/>

GEPSI — PSE Group, Department of Chemical EngineeringUniversity of Coimbra, Portugal

Workshop on Modeling and Simulation in Chemical EngineeringJune 30 - July 4, 2003

Page 2: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

In memoriam.José Almiro A.M. Castro (1953–2002)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 2

Page 3: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Outlineo An overview of PSE.

o Numerical methods:

• Nonlinear equations.

• Continuous optimization

• Combining discrete decisions, logical and heuristic information.

o Major application areas of PSE:

• Design.

• Operations.

• Control.

o Software tools.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 3

Page 4: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

1. An overview of Process Systems EngineeringThe essence of Chemical Engineering has always been

“the synthesis, design, testing, scaleup, operation, control andoptimization of processes that change the physical state or the

composition of materials” (Westerberg, 1998).

PSE has traditionally been concerned with

“understanding and developing systematic procedures for design,control and operation of chemical processes” (Sargent, 1991).

PSE can be identified with a major paradigm in Chemical Engineering.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 4

Page 5: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

1.1. Major paradigms in Chemical Engineering:

À unit operations (A.D. Little, 1915).

Á basis on physical sciences and mathematical analysis:

• Aris, Bird et al. (2002), ∼ 60s.

 systematic decision making methods for design and operation:

• volume in AIChE Symposium Series (1961).

• Rudd and Watson (1968).

• journal Computers and Chemical Engineering, (1977–).

• Douglas (1988)

• Biegler et al. (1997)

• ESCAPE meetings (1992–)

. ESCAPE-14, Lisbon, May 16–19, 2004, see<http://www.escape14.online.pt>

í PSE area is 35–40 years old.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 5

Page 6: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

1.2. Basic ChemE economic data (US, 2001)

Distribution of revenues

Basic chemicals

Pharmaceuticals

Speciality chemicals

Consumer products

Crop protection

Fertilizers

Total revenues: Chemicals (447 bil.) + Oil (595 bil.) ' 1 000 billion USD.

Typical profit margins (Grossmann, 2004):

Biotechnology: 20–30%Pharmaceutical: 15–20%

Petroleum: 6 – 10%Chemicals: 5 – 8%

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 6

Page 7: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

The concept of PSE has recently evolved to include improvement of the decision making processof the entire chemical supply chain — creation and operation:

• Micro-scale:

. Product engineering: synthesize new products (solvents, refrigerants, polymers), shorterdevelopment phases, agile manufacturing.

• Macro-scale:

. Enterprise level: logistics for manufacturing, production planning and distribution.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 7

Page 8: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

í Discover, design, manufacture and distribute chemicalproducts in the context of many conflicting goals.

Important characteristics of decision making methodologies:

• essential to compete in global markets.

. reduce costs, operate efficiently, environmental safe and sustainable, innovative prod-ucts, improved quality.

• with both practical and theoretical implications.

. while largely driven by industrial needs, address fundamental theoretical aspects.

• integrate physical sciences, mathematics, operations research (& A.I.), and computer sci-ence.

. models often without closed form solutions.

. efficient problem representations for alternatives.

. product is often a (complex) computer code.

Representations and models are the natural tools to generate reasonable alternatives. Onlysystematic methods for exploring alternatives guarantee solutions that meet constraints and op-timize an objective.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 8

Page 9: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

1.3. A simple example: Alternative heat transfer networks

Extreme configurations:

Non-integrated Fully integrated

Need to consider both thermodynamic constraints and specific heat needs!

For 1 CS + 1 HS, only one pairing possible.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 9

Page 10: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

With 2 CS + 1 HS, superstructure is (Biegler et al., 1997):

Alternatives embedded in superstructure:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 10

Page 11: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

For more general cases, possible to use a pairing matrix, e.g.:

H1 H2 H3C1C2 • •C3

0 dots — 1 alternative.1 dot — 9 alternatives.2 dots — vertical (1 + 2 streams) or diagonal (2 + 2 streams).3 dots — etc.

+ serial / parallel arrangements ⇒ Thousands of alternatives can be enumerated.

í Representation and solution efficiencies are important becausethe selection problems generated are often NP-hard.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 11

Page 12: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Current PSE applications (Grossmann and Westerberg, 2000)

Design OperationsEnergy recovery networks SchedulingDistillation systems Multiperiod planning and optimizationReactor networks Data reconciliationHierarchical decomposition of flowsheets Real-time optimizationSuperstructure optimization Flexibility analysisMultiproduct & multipurpose batch plants Fault diagnosis

Control Support toolsModel predictive control Sequential-modular simulationControllability Equation-based simulationRobust control A.I. / Expert SystemsNonlinear control Large-scale NLPStatistical process control Optimization of DAEsProcess Monitoring Mixed-integer NLP

Global optimization

í Process improvement and diagnosis are often major drivingforces behind process modeling.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 12

Page 13: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2. Numerical methods for solution and optimization of pro-cess models

Solution methods provide often inspiration for optimization.

2.1. Nonlinear equations

f (x) = 0x ∈ Rn, f nonlinear, solution is f (x∗) = 0

Basic algorithm is Newton’s method. Defining

Jk = ∇ f T(xk) ∈ Rn×n

dN,k = xk+1− xk ⇒ Jk ·dN,k =− fk (1)

fk = f (xk)

Assume f (x) 2x differentiable, |Jk| 6= 0, ∀xk, x0 close to solution (Kantarovich, 1937).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 13

Page 14: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2.1.1. Convergence characteristics

• local quadratic convergence:‖xx+1− x∗‖‖xk− x∗‖2 ≤ K

• global convergence:

. (1) can fail, need to be extended as optimization problem:

f (x) = 0 → minx φ(x) = f T(x) f (x)f(x)

0xx*

φ(x)

0xx*

Try to enforce descent property for φ(x):

φ(xk+1)≤ φ(xk)

Directional derivative:∇φ

T(xk) ·dN.k =−2φ(xk)≤ 0

í descent direction guaranteed.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 14

Page 15: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Use line-search procedure:

xk+1 = xk +αdN,k, α ∈ R.

• Armijo (1966):φ(xk +αdk)≤ φ(xk)+δ (∇φ

T(xk) ·dk)α

• Also non-monotonic line searches (Grippo et al., 1986).

Derivatives Jk can be difficult and expensive to obtain, especially for large problems:

• consider sparsity of Jacobian matrix.

• approximate by finite-differences:

∂ fi

∂x j'

f (· · · ,x j + ε j, · · ·)− f (· · · ,x j, · · ·)ε j

. n+1 function evaluations, ε∗ ∼√

Ea.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 15

Page 16: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2.1.2. Quasi-Newton methods

Similar to (1):Bk (xk− xk−1)︸ ︷︷ ︸

sk

= ( fk− fk−1)︸ ︷︷ ︸yk

(2)

For n > 1, (2) not uniquely defined. Popular choice is Broyden’s method:

minBk

‖Bk−Bk−1‖F

s.t. Bksk = yk

Solution is recursive update (rank-1):

Bk = Bk−1−(yk−Bk−1sksT

k )sT

k sk

Also possible inverse, factored updates.

Convergence is now just superlinear (local property).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 16

Page 17: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2.1.3. Trust-region approaches

Instead of line-search, constrain size of allowed steps:

mindk

φ(xk)+∇φT(xk) · xk +

12

dTk H(xk)dk (3)

s.t. ‖dk‖2 ≤ δc

For δc ∈ [0,+∞[, direction is combination of steepest descent and Newton directions. Thereforepossible:

• direct (approximate) solution of (3).

• empirical solution (Levenberg-Marquardt):

(Hk +λ I)dk =−∇φ(xk)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 17

Page 18: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• double-dogleg strategy:

(Dennis and Schabel, 1983)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 18

Page 19: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2.1.4. Homotopy (continuation) methods

Instead of tackling f (x) = 0, solve a continuous of subproblems, e.g.,

h(x,λ ) = f (x)− (1−λ ) f (x0)

λ = 0 ⇒ x∗ = x0, λ = 1 ⇒ h(x,1) = f (x).

Also possible to use dynamic form of models:

f (x) = 0 →

dxdt

= f (x)

x(0) = x0

Using, e.g., Euler’s method:

xk+1− xk

∆t= f (xk) ⇒ xk+1 = xk +∆t f (xk).

Hence, effect of nonlinearities attenuated when ∆t → 0.

• Can also be used to find multiple solutions.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 19

Page 20: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2.2. Practicalities

For more difficult cases, reformulation might be convenient:

f (x) = 0 ⇔minx,ε

‖ε‖

s.t. f (x) = ε

This feasible path approach can also be used to handle constraints. For a problem of the form

f (x) = 0l ≤ x≤ u

the direct application of variations of Newton’s method or trust region can lead to failures in themodel equations. Instead of (1), consider

mindk,ε

‖ε‖

s.t. f (xk)+ Jk ·dk = ε

l ≤ dk + xk ≤ u

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 20

Page 21: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Combine with a line-search strategy.

• Requires the solution of an LP at each iteration (expensive).

• Directions generated are always feasible.

• When possible, ε = 0 ⇒ basic Newton direction.

• Possible to use l1, l2, or l∞ norms. Distinct work involved, convergence properties. Inpractice, search directions generated are very similar.

Preferred l1 norm. Behavior similar to mixed complementarity problems (MCP).

• Extremely useful to avoid multiple solutions, e.g., without physical meaning.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 21

Page 22: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Example: Ethanol production with biomass immobilization

Model equations for particles:

1r2

∂ r

(r2∂Cp

∂ r

)+ψ(Ca,Cp) = 0

1r2

∂ r

(r2∂Ca

∂ r

)−ψ(Ca,Cp) = 0

r = 0 ⇒ ∂Ca

∂ r=

∂Ca

∂ r= 0

r = 1 ⇒ ∂Ca

∂ r= Bia(1−Ca);

∂Ca

∂ r= Bip(1−Cp)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 22

Page 23: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Solution profiles:

0 0.2 0.4 0.6 0.8 1r

0

0.2

0.4

0.6

Cpa[r]

0 0.2 0.4 0.6 0.8 1r

0.1

0.15

0.2

0.25

Cpp[r]

• Finite differences, 2nd order centered, 40 points.

• Many solutions without physical meaning!

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 23

Page 24: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

2.3. Application: Process Flowsheeting

(Turton et al., 1998)

• Very large problems (104 – 105 variables).

• Highly sparse.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 24

Page 25: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Typical sparsity diagram:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 25

Page 26: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Sequential-modular:

. Follow order of material processing.

. Need to identify tear streams. Can be used with simple numerical methods (e.g., suc-cessive substitutions).

. Little flexibility for process specifications.

• Simultaneous solution:

. Identify subsets of equations that require simultaneous solution (strongly connected inprocess digraph).

. Block partition, at equation level. Derivatives only required for diagonal blocks.

. Very fast, with good starting values.

• Based on split-fractions:

. 2-step successive substitutions. Very robust!

• Require the aid of special simulators:

. ASPEN <http://www.aspentech.com/>.

. gPROMS <http://www.psenterprise.com/>

. ASCEND <http://www.cs.cmu.edu/~ascend/>

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 26

Page 27: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 27

Page 28: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

3. Nonlinear optimization

minx

φ(x)

s.t. h(x) = 0 (4)g(x)≤ 0x ∈ Rn

Important problem characteristics:

• Linear / nonlinear:

Objective Constraints

LP L LQP Q L

NLP NL NL

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 28

Page 29: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Convexity:

. Functions:

φ [λx1 +(1−λ )x2]≤

≤ λφ(x1)+(1−λ )φ(x2), λ ∈ [0,1].

φ(x)

x

x1 x2

λ

. Domains:

z = λx1 +(1−λ )x2, λ ∈ [0,1].

φ(x)

x

x1 x2

λ

D

If φ(x) is convex, h(x) linear, g(x) convex, a local solution of (4) isalso a global solution.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 29

Page 30: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Implications for process design:

Superstructure for 2 CS + 1 HS:

Need to optimize separately each alternative:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 30

Page 31: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Example: Reactor network design (Ryoo and Sahinidis, 1995)

A->B->C

A

A->B->C

CA1, CB1

CA2, CB2

Design system that maximizes CB at output, assuming isothermal operation:

minCi,Vi

−CB2

s.t. CA1 + k1CA1V1 = 1CA2−CA1 + k1k2CA2V2 = 0CB1 +CA1 + k3CB1V1 = 1CB2−CB1 +CA2−CA1 + k3k4CB2V2 = 0

V 0.51 +V 0.5

2 ≤ 40≤Ci ≤ 10≤Vi ≤ 16

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 31

Page 32: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Problem has 3 local solutions, with close objective values.

• Global solution:

CA1 = 0.772 CB1 = 0.204 V1 = 3.04CA2 = 0.517 CB2 = 0.388 V2 = 5.10

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 32

Page 33: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

3.1. Optimality conditions

L (x,λ ,µ) = φ(x)+λTh(x)+ µ

Tg(x)

∇xL = 0 ⇒ ∇φ(x∗)+∇h(x∗) ·λ +∇g(x∗) ·µ = 0 (5)

∇λL = 0 ⇒ h(x) = 0

complementarity ⇒µigi(x∗) = 0µi ≥ 0

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 33

Page 34: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

(5) can be interpreted as a force balance for equilibrium:

x 2

x 1

h(x)=0

-∇f(x*)

-∇h(x*)

g (x)≤02

g (x)≤01

-∇g (x*)1

x*

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 34

Page 35: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

3.2. Successive Quadratic Programming (SQP)

K.T. conditions of (5) are system of NL equations ⇒ iterative solution. Consider:

minx

φ(x)

s.t. c(x) = 0⇒ L (x,λ ) = φ(x)+λ

Tc(x)

K.T. conditions:

∇φ(x)+∇c(x)λ = 0c(x) = 0

First order expansion around (xk,λk):[∇φ(xk)+∇c(xk)λk

c(xk)

]+

[∇2φ(xk)+∇2c(xk)λk ∇c(xk)

∇cT(xk) 0

]·[

∆x∆λ

]= 0

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 35

Page 36: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

These are equivalent to the K.T. conditions of

min∆xk

φ(xk)+∇φT(xk)∆xk +

12

∆xTk[∇

2φ(xk)+∇

2c(xk)λk]

∆xk

s.t. c(xk)+∇c(xk)T∆x = 0

• QP solution at each iteration for search direction.

• Need 2nd order derivatives for both objective and constraints.

• Can also use quasi-Newton approximation:

Bk = Bk−1−Bk−1sksT

k Bk−1

sTk Bk−1xk

+ykyT

k

yTk sk

BFGS (rank-2 update)

sk = xk+1− xk

yk = ∇L (xk+1,λk+1)−∇L (xk,λk)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 36

Page 37: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

3.3. Interior-point methods

Complementarity conditions of K.T. equations can be difficult to solve (combinatorial, ill-conditioned).

Barrier methods

minx

φ(xk)−µ ∑i

lnsi

s.t. h(xk) = 0g(xk)+ s = 0

Solve sequence of problems, where µ → 0 (homotopy parameter).

active setIP

Tradeoff: more iterations (several µ) vs. more expensive QPs.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 37

Page 38: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

3.4. Reduced gradient methods (GRG)

Similar to simplex methods for LP.

• Decide which constraints are active / inactive.

• Partition variables as dependent / independent.

• Solve unconstrained problem in the space of independent variables.

Consider:min

zφ(x)

s.t. h(z) = 0l ≤ z≤ u

+ slack variables.

Partition variables as:

z =[

zIzD

]⇒ h(zI,zD) = 0

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 38

Page 39: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Constrained derivative:

dzI=

∂φ

∂ zI+

dzD

dzI

∂φ

∂ zD

dzD

dzI= [∇zIh] · [∇zDh]−1 implicit form

• Always takes feasible steps.

• Very robust implementations available (e.g., CONOPT3).

. practical details (initialization, scaling, sparsity).

. combined with other solution techniques (Newton steps, SQP).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 39

Page 40: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Example: Kinetic parameter estimation (CSTR)

A Bk

minθ ,z

r

∑j=1

m

∑i=1

(zi j− zi j,mod)2

σ2i

s.t.(z1− z2)

τ− kz2 = 0

− z3

τ+ kz2 = 0

z4− z5

τ+

(−∆H)ρCp

kz2 = 0

k = θ1 exp(−θ2

z5

)

• For batch data, need optimization of a DAE model.

• Can easily be solved within GAMS or AMPL — local solutions.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 40

Page 41: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

4. Discrete optimization

minx,y

φ(x,y)

s.t. h(x,y) = 0g(x,y)≤ 0x ∈ Rn, y ∈ Nm

Possible integer variables (y∈N) or binary variables (y∈{0,1}). Can assume only binary present.Some algorithms take advantage of both, others require just binary (e.g., like simple bounds).

Problem classes:

Type Objective Constraints Variables

IP L L ILP L L R

MILP L L I, RNLP NL NL R

MINLP NL NL I, RNIP NL NL I

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 41

Page 42: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Process example: Design of a chemical complex (Sahinidis and Grossmann, 1991)

Decisions:

• C produced, and how much?

• Which alternatives II or III (exclusive)?

• How to obtain B?

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 42

Page 43: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Process data:

Conversion Fixed VariableProcess (%) cost cost

I 90 1000 250II 82 1500 400III 95 2000 550

Species Prices Constraints

A 500 ≤ 16B 950C 1800 ≤ 10

Solution:

yi ={

1, process i selected.0, if not.

Exclusivity of II and III:y2 + y3 ≤ 1

Mass balances:

B1 +PB = B2 +B3 B1 = 0.9PA

C2 +C3 = SC C2 = 0.82B2

C3 = 0.95B3

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 43

Page 44: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Constraints:

PA ≤ 16y1 B3 ≤ (10/0.95)y3

B2 ≤ (10/0.82)y2 SC ≤ 10

Objective:

φ (Profit) =−(1000y1 +250PA+ → investment1500y2 +400B2+2000y3 +550B3)

−500PA−950PB → purchases+1800SC → sales

í MILP problem.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 44

Page 45: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Optimal solution:

φ = 459.3 B2 = 12.195PA = 13.55 SC = 10

Solution much more complex if formulation was MINLP.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 45

Page 46: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

4.1. Solution methods for MILP

• Real relaxation (LP) + solution rounding.

. Dangerous with binary variables.

• Explicit enumeration: Build complete decision tree:

. Only possible with very small problems (brute force).

For m discrete variables, with ni distinct values, need to solvem

∏i=1

ni continuous optimization problems, in (nv−m) variables.

. Several strategies to visit nodes (depth-first, breadth-first, specific A.I. heuristics).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 46

Page 47: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Method of cutting planes:

. Start with LP relaxation.

. If not integer solution already, add constraints to previous problems, solve new LP.

. Incremental characterization of convex hull of problem.

• Boolean methods (only binary variables):

. Exploit similarities with propositional logic and theorem proving (e.g., PROLOG).

• Branch & Bound: (implicit enumeration)

. Create decision tree (branch). Use solution bounds to reduce search space (bound).

Reference formulation:

minx,y

aTy+ cTx

s.t. By+Ax≤ bx≥ 0, y ∈ {0,1}

Lower bound: solution of relaxed LP.Upper bound: best integer solution so far.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 47

Page 48: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Simple example:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 48

Page 49: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Example: Process heat integration (targeting)

Specify ∆Tmin

↓Minimum utility cost (transshipment LP)

↓Minimum number of matches (transshipment MILP)

↓Minimum investment cost (NLP)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 49

Page 50: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

(Linnhoff et al., 1982)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 50

Page 51: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

4.2. Solution of MINLPs

minx,y

(max) φ(x)+ cTy

s.t. g(x)+Hy(•)b (•) = {≤,=,≥}

l ≤ x≤ u, y ∈ {0,1}

NOTE: If f (y) nonlinear, can replace:

f (y)→ f (y′),y = y′

y′ ∈ R0≤ y′ ≤ 1

Algorithms for MINLPs (Grossmann, 2001):

• Generalized Benders decomposition.

• Outer approximation (OA).

• Extended Cutting Planes.

• Simple Branch & Bound (SBB) (Bussieck and Drud, 2001).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 51

Page 52: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

4.3. Modeling with discrete variables

Simple cases:

• Multiple choice:

. Select only 1 item: ∑i

yi = 1

. Select at most 1 item: ∑i

yi ≤ 1

• If y = 0, associated x or f (x) must be 0:

f (x)−My≤ 0, f (x) ∈ [0,M]

• Implications (K ⇒ J):

yk− y j ≤ 0

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 52

Page 53: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Systematic incorporation of logical information (Ramesh and Grossmann, 1991)

Simple logic relations:

Combine with reduction to normal conjunctive form using logic equivalences, DeMorgan laws,and distributive properties.

Example: If product A or B (or both) produced, at least one of the products C,D, or E must alsobe manufactured.Let Pi ≡ product i manufactured. Associate yi ∈ {0,1} with Pi. Equivalent proposition is

(PA∨PB)⇒ (PC∨PD∨PE)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 53

Page 54: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Simplification:

(PA∨PB)⇒ (PC∨PD∨PE) → (PA∨PB)∨ (PC∨PD∨PE) →

→ (PA∧ PB)∨ (PC∨PD∨PE) →

→ [PA∨ (PC∨PD∨PE)]∧ [PB∨ (PC∨PD∨PE)]

Using the previous table, originates:

(1− yA)+ yC + yD + yE ≥ 1(1− yB)+ yC + yD + yE ≥ 1

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 54

Page 55: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Other uses:

• This approach can also be used to model heuristics:

A⇒ B →yA− yB ≤ 0 (logic)yA− yB ≤ s (heuristic)

Penalty can be associated with constraint violations.

• Discrete variables also useful to approximate non-convex regions (Williams, 1993) or func-tions. Typical cost functions in ChemE:

C = avb, b∼ 2/3 ⇒ nonconvex

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 55

Page 56: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Using discrete variables, the cost functions can be approximated as:

C ={

0, v = 0C f +Cvv, v > 0

with:

y = 0 ⇒ v = 0 →{

v−Mvy≤ 0v≥ 0

C

0v

C

0v

Can also be generalized to approximation using several linear segments, or discontinuouschanges in costs.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 56

Page 57: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Examples:

• Distillation design.

• Flowsheet optimization with detailed models (fixed structure).

• Process design.

• Trim loss minimization.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 57

Page 58: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Distillation design:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 58

Page 59: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5. Optimization of systems described by differential equa-tions

In general, more detailed and accurate models in ChemE involve differential equations (e.g.,PDE) ⇒ need to solve and optimize.

5.1. Problem types

• Optimal control:

minu(t)

φ(z(tF))

s.t. z = f (z,u,θ), z(0) = z0

h(z,u,θ) = 0g(z,u,θ)≤ 0

. u(t) ∈ Rn infinite dimensional → calculus of variations.

. E.g., process control, discontinuous processes.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 59

Page 60: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• State or parameter estimation:

minθ

∑i

[yobs(ti)− ymod(ti,θ)]2

s.t. process modelconstraints

. Now finite no. of DOF. Hence can be solved as conventional NLP, if DAE model treatedas an entire I/O block (black-box approach).

• Design problems:

minv

(cost, -performance)

s.t. process modelconstraints

. E.g., optimize catalyst, nonhomogeneous reactor, etc.

Can involve ODEs or PDEs; here just ODEs.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 60

Page 61: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5.2. Strategies for optimization of DAE models

• Direct solution of optimality conditions (Euler-Lagrange) → variational methods.

• Analogy with solution methods; these usually involve a discretization of the ODEs:

. Partial discretization: only input profile u(t) parametrized. Since the derivatives kept,the optimization and solution are done sequentially:

DAEs Optim.

u(t), θ

φ, g, h

. Full discretization: input u(t) and state z(t) profiles discretized → scalar (large-scale)NLP, for simultaneous solution and optimization.

DAEs + Optim.

• Also possible dynamic programming, e.g. after partial discretization.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 61

Page 62: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5.2.1. Optimality conditions for ODE systems

Using Mayer form:

minu(t)

J(z(tf))

s.a z = f (z,u,θ), z(0) = z0

h(z,u,θ) = 0g(z,u,θ)≤ 0hf(z) = 0gf(z)≤ 0

L = J(zf, tf)+ µTf gf +ν

Tf hf +

∫ tf

0

(λ (t)T ( f (z,u,θ)− z)+ µ

T(t)g(z,u,θ)+νT(t)h(z,u,θ)

)dt

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 62

Page 63: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Necessary conditions:

∂L

∂ z(t):

∂ f∂ z

λ + λ (t)+∂g∂ z

µ +∂h∂ z

ν = 0 (adjoint equations)

∂L

∂u(t):

∂ f∂u

λ +∂g∂u

µ +∂h∂u

ν = 0

∂L

∂ zf:

∂J∂ zf

+∂gf

∂ zfµf +

∂hf

∂ zfνf−λ (tf) = 0 (transversality)

Dificulties:

• nonlinear TPBVP (z(t), λ (t) ∈ Rn).

• Initialization, path constraints.

General algorithms (e.g. CVI) difficult to implement. However analytical solutions for specialcases. (e.g., linear — Kalman).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 63

Page 64: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5.2.2. Sequential solution and optimization

DAE model treated as an indivisible block (black box), solved by a specific routine.

• IVP.

• BVP, can require the use of shooting or multiple shooting.

Other characteristics:

• Optimization iterates are always feasible solutions of the DAE system (advantageous forsome applications).

• Size of NLP generated are also smaller than simultaneous approach.

• Sequential method is only reliable when model equations contain only stable modes.

• Bounds on state variables difficult to specify (hidden). However, can penalize severalmeasures of constraint violation in the objective.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 64

Page 65: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Gradient information can be computed by:

• Perturbation:∂φ(tF)

∂θ=

φ(tF ,θ +∆θ)−φ(tF ,θ)∆θ

. Simple to use.

. Choose ∆θ , considering accuracy of integration.

. np +1 integrations required.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 65

Page 66: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Sensitivities: Define

s(t)=∂ z(t)∂θ

Differentiate model equations:∂

∂θ[z = f (z,θ)]

∂θ[z(0) = z0]

s =

∂ f T

∂ zs+

∂ f∂θ

s(0) =∂ z0

∂θ

. Linear system, also IVP.

. Jacobian already available, in implicit methods.

Then∂φ(z(tF))

∂θ=

∂φ(z)∂ z

∣∣∣∣zF

· s(tF)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 66

Page 67: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Adjoint equations (Sargent and Sulivan, 1979): Similarly to previous analysis, define

φ(tF) =∫ tF

T(z− f (z,θ))dt

Integrate by parts, and set variations to 0:

λ =−∂ f∂ z

λ adjoint equations

λ (tF) =∂φ

∂ z(tF)final condition

∂φ(tF)∂θ

=∫ tF

T ∂ f∂θ

dt +λ (0)∂ z0

∂θ

. Now BVP, solution can be decoupled, storing trajectory and Jacobian.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 67

Page 68: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5.2.3. Simultaneous solution and optimization

DAE model converted to AE model, by parametrization of the input and state profiles:

• Solve model just once, to optimality. If algorithms fails, . . . (infeasible path approach).

• Originates large-scale NLPs.

• Can handle more easily path constraints.

• Based on a method for solution of the DAE system:

Relaxation methods (finite differences):

z = f (t,z)g(z(a),z(b)) = 0

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 68

Page 69: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Classical 2nd order schemes:

• Trapezoidal:

zi+1− zi

hi=

12

( f (ti+1,zi+1)+ f (ti,zi)) , i = 1, . . . ,N

g(z1,zN+1) = 0

• Midpoint:

zi+1− zi

hi= f

(ti+1

2,12(zi + zi+1)

), i = 1, . . . ,N

• Sparse system of NL equations.

• Higher order schemes can be used, e.g., implicit Runge-Kutta (Ascher et al., 1995).

• Adaptive grids can also be used.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 69

Page 70: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Method of weighted residuals:

For z = f (t,u,z,θ), z(0) = z0

approximate solution:

z(t)' zN(t) = z0(t)+∑i

aiφi(t)

Residuals of approximation:R(a, t) = zN(t)− f (t,u,zN,θ)

Solve integral error equations:

E(wi,R) =∫ tF

0wi(t)R(a, t)dt = 0, i = 1, . . . ,N

For particular choices of wi(t), methods of least squares, Galerkin, or collocation result.

A common choice is orthogonal collocation at roots of Legendre polynomial, using Lagrangeinterpolation formulas:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 70

Page 71: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Lagrange interpolation polynomials:

z(t) =nk

∑k=0

zklk(t) u(t) =nk

∑k=0

uklk(t)

l j(t) =nk

∏k=0k 6= j

(t− tk)(t j− tk)

• Orthogonal collocation at ti:

R(a, ti) = ∑i

zil′j(ti)− f (zi,ui,θ) = 0

• ti chosen as roots of Legendre polynomial of degree n, shifted to t ∈ [0, tF ].This can be shown to be equivalent to a Runge-Kutta method of O(2nc).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 71

Page 72: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Can also be extended to collocation of finite elements:

z(t)

tα1 α2 α3

. Better control of approximation error:

‖e(αi+1)‖= O(|∆αi‖2nc)

Can be used to control the element length, to equidistribute the solution error.

. Include continuity of solution and derivatives across elements.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 72

Page 73: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5.3. Process applications

5.3.1. Nonlinear model-predictive control

t

Output, y

Set-point, sp

Input, u

Control horizon

Output horizon

y

tk tk+1 tk+2 ... tk+m ... tk+p

y

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 73

Page 74: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Requires a process model.

• Based on online optimization.

• feedback / feedforward structure.

• can also be adapted to observation, parameter estimation.

Examples:

• QDMC — linear convolution model, quadratic objective, QP (Garcia and Morshedi, 1986).

• Newton-control — nonlinear model, quadratic objective, NLP (Oliveira and Biegler, 1995).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 74

Page 75: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Process

Control

Optimization

Long term: Market fluctuations

Disturbance type:

Mean term: Price fluctuations

Catalyst deactivationRaw materials

Short term: Process variations

Disturbances Outputs

MeasuresManipulations

sSet-pointConstraints Model parameters

Production volumesChoice of raw materials Cost coeficients

Scheduling and planning

Hierarchical process supervision

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 75

Page 76: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Problem formulation

minu(t)∈Hik

J2(u,y) =∫ tk+toh

tk(y− ysp)TQy(t)(y− ysp)+(u−ur)TQu(t)(u−ur)dt

s.t. x = fp(x,u,d;θ)y = gp(x;θ)

ul ≤ u≤ uu

xl ≤ x≤ xu

yl ≤ y≤ yu

• ur is input reference trajectory.

• If tih ≤ toh, assume inputs remain constant.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 76

Page 77: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Flash and CSTR example:

3 3.5 4 4.5 5 5.5 6

T2 [K/100]

-0.0005

-0.0004

-0.0003

-0.0002

-0.0001

0

0.0001

Heat release rates [K/s]

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 77

Page 78: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Reactor equations:

dVdt

= F1 +F5−F2

dC2

dt=

F1C1 +F5C4− (F1 +F5)C2

V+ r(T2,C2)

dT2

dt=

F1T1 +F5T3− (F1 +F5)T2

V+

(−∆H)ρcp

r(T2,C2)−UA

ρcpV(T2−Ts)

Flash equations:

C3 = Ke1(T3)C4

(1−C3) = Ke2(T3)(1−C4)F2 = F3 +F4

F2C2 = F3C3 +F4C4Mixed equations:

r(T2,C2) =−Kr1(T2)C2 +Kr2(T2)(1−C2)Kr1 = A1 exp(−Ea1/T2)Kr2 = A2 exp(−Ea2/T2)

Ke1(T3) = a110−b1/T3

Ke2(T3) = a210−b2/T3

F2 = kvVC3 +C4 = 1

F5 = αF4

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 78

Page 79: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Input multiplicities:

3.8 4 4.2 4.4 4.6

T3

-0.05

0

0.05

0.1

0.15

0.2

0.25

f2

3.94 3.96 3.98 4 4.02

T3

-0.0002

-0.00015

-0.0001

-0.00005

0

0.00005

0.0001

f2

u =

{ [4.500 2.485×10−2 4.000

]T[6.861 3.179×10−2 3.947

]T ⇒ x =[1 0.4899 4.352

]T

• 6= manipulations have significant economic impact.

• linear control can originate sudden instability.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 79

Page 80: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Steady state sensitivities:

3 4 5 6 7 8 9

Ts

0.98

0.99

1

1.01

1.02

1.03

1.04

1.05

States

0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

kv

0.6

0.8

1

1.2

1.4

1.6

States

3.925 3.95 3.975 4 4.025 4.05 4.075

T3

0.8

0.9

1

1.1

1.2

States

3 4 5 6 7

T1

0.8

1

1.2

1.4

1.6

1.8

States

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 80

Page 81: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Schedule change in recycle ratio:

0 100 200 300 400

t

0.9

0.92

0.94

0.96

0.98

1

1.02Normalized inputs

0 100 200 300 400

t

0.98

0.99

1

1.01

1.02

Normalized states

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 81

Page 82: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

5.3.2. Optimal design of catalyst pellets

Catalytic reactions very common in ChemE:

G-L

inte

rface

L-S

inte

rface

Gas phase Liquid phase Solid phase

Ci,G

Ci,L

Ci,S

Catalyst

Active materials generally expensive. Where to concentrate activity?

Non-uniform distribution can lead to improved performance (e.g., efficiency, selectivity andduration).

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 82

Page 83: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Significant no. of cases studied. Sometimes solution is (e.g., Chemburkar et al. (1987)):

a(r) = δ (r− r∗)

• Need to consider detailed information, e.g., catalyst poisoning or coking.

Here consider optimal activity profiles, for pellets with single arbitrary reaction, without cata-lyst deactivation:

Objective: Maximize effectiveness factor, using simultaneous solution and optimization.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 83

Page 84: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Mathematical model:

maxa(r)

(n+1)∫ 1

0ψ(c,θ)a(x)xn dx

s.t.1xn

ddx

(xndc

dx

)= (n+1)φ 2a(x)ψ(c,θ)

1xn

ddx

(xndθ

dx

)=−(n+1)βφ

2a(x)ψ(c,θ)∫ 1

0a(x)xn dx =

1(n+1)

x = 0 ⇒ dcdx

=dθ

dx= 0

x = 1 ⇒ dcdx

= Bim(1− c);dθ

dx= Bit(1−θ)

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 84

Page 85: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Optimization results:

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 85

Page 86: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Orthogonal collocation with nk = 3, using 20 finite elements.

• Physical data:

• Model results:

• Multiple solutions possible!

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 86

Page 87: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

• Empirical strategy for element length adaptation:

If∣∣∣∣maxi Rnci

mini Rnci

∣∣∣∣≥ ξ then ∆αi,new =∆αi,old

‖Rnci‖ε

. η ∼ 0.2, 5 or 6 NLP iterations required.

. Only 2–3 elements active at solution.

• Example code available at<http://www.eq.uc.pt/~nuno/cim2003/fopslab6.gms>.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 87

Page 88: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

Conclusions• Representations and models are the natural tools in PSE.

• Systematic methods are required to explore alternatives that meet constraints and optimizeobjective. Their use depend significantly on key model characteristics.

• PSE has both practical and theoretical implications.

• Current research areas also at micro-scale (molecular simulation, CFD, product design) andmacro-scale (logistics, production planning), and integration of all levels.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 88

Page 89: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

References

U.M. Ascher, R.M.M. Mattheij, R.D. Russel (1995). Numerical Soltution of Boundary Value Problems for Ordinary DifferentialEquations, SIAM, Philadelphia, PA.

B.M. Bhatti (2000). Practical Optimization Methods with Mathematica Applications, Springer-Verlag, Berlin.

L.T. Biegler, I.E. Grossmann, A.W. Westerberg (1997). Systematic Methods of Chemical Process Design, Prentice-Hall PTR,Upper Saddle River, NJ.

L.T. Biegler, A.M. Cervantes, A. Wächter (2002). “Advances in Simultaneous Strategies for Dynamic Process Optimization”,Chem. Eng. Sci., 57(4), 575–593.

R.B. Bird, W.E. Stewart, E.N. Lightfoot, Transport Phenomena, 2nd Edition, J. Wiley & Sons, New York.

A. Brooke, D. Kendrick, A. Meeraus (1992). Gams: A User’s Guide, The Scientific Press, San Francisco.

M.R. Bussieck, A.S. Drud (2001). “SBB: A New Solver for Mixed Integer Nonlinear Programming”, <http://www.gams.com/presentations/or01/sbb.pdf>.

R.M. Chemburkar, M. Morbidelli, A. Varma, “Optimal Catalyst Activity in Pellets - VII”, Chem. Eng. Sci., 42(11), 2621–2632.

J.E. Cuthrell, L.T. Biegler (1987). “On the Optimization of Differential-algebraic Process Systems”, AIChE J., 33, 1257–1270.

J.E. Dennis, R.B. Schnabel (1983). Numerical Methods for Unconstrained Optimization and Nonlinear Equations, Prentice-HallInt., Englewood Cliffs, NJ.

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

C.A. Floudas (1995). Nonlinear and Mixed-Integer Optimization, Theory and Applications, Oxford University Press, New York.

R. Fourer, D.M. Gay, B.W. Kernighan (1993). AMPL, A Modeling Language for Mathematical Programming, Scientific Press.

F. Friedler, K. Tarjan, Y.W. Huang, L.T. Fan (1993). “Graph-Theoretic Approach to Process Synthesis: Polynomial Algorithm forMaximal Structure Generation”, Comp. & Chem. Eng., 17, 929–942.

F. Friedler, J.B. Varga, L.T. Fan (1995). “Decision-Mapping: A Tool for Consistent and Complete Decisions in Process Synthesis”,Chem. Eng. Sci., 50, 1755–1768.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 89

Page 90: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

C.E. Garcia, A.M. Morshedi (1986). “Quadratic Programming Solution of Dynamic Matrix Control (QDMC)”, Chem. Eng. Com-mun., 46, 73–87.

P.E. Gill, W. Murray, M.H. Wright, Practical Optimization, Academic Press, London.

L. Grippo, F. Lampariello, S. Lucidi (1986). “A Nonmonotone Line Search Technique for Newton’s Method”, SIAM J. Num.Anal. 23, 707–716.

I.E. Grossmann, A.W. Westerberg (2000). “Research Challenges in Process Systems Engineering”, AIChE J., 46(9), 1700–1703.

I.E. Grossmann (2001). “Review of Non-Linear Mixed Integer and Disjunctive Programming Techiques for Process SystemsEngineering”, <http://egon.cheme.cmu.edu/Group/Papers/MINLPOPTE.pdf>.

I.E. Grossmann (2004). “Challenges in the New Millennium: Product Discovery and Design, Enterprise and Supply ChainOptimization, Global Life Cycle Assessment”, Proc. PSE2003.

B. Linnhoff, D.W. Townsend, D. Boland, G.F. Hewitt, B.E.A. Thomas, A.R. Guy, R.H. Marsland (1982). A User Guide on ProcessIntegration for the Efficient Use of Energy, The Institution of Chemical Engineers, Rugby, UK.

W. Marquardt, L.v. Wedel, B. Bayes (2000). “Perspectives on Lifecycle Process Modeling”, in M.F. Malone, J.A. Trainham, B.Barnahan (Eds.), AIChE Symp. Ser. 323, 96, 192–214.

Z. Michalewicz, D.B. Fogel (2002). How to Solve It: Modern Heuristics, Springer-Verlag, Berlin.

J. Nocedal, S.J. Wright (1999). Numerical Optimization, Springer-Verlag, Berlin.

N.M.C. Oliveira, L.T. Biegler (1995). “An Extension of Newton-type Algorithms for Nonlinear Process Control”, Automatica,31(2), 281–286.

M.S. Peters, K.D. Timmerhaus, R.E. West (2002). Plant Design and Economics for Chemical Engineers, 5th edition, McGraw-Hill,New York.

R. Raman, I.E. Grossmann (1991). “Relation Between MILP Modeling and Logical Inference for Chemical Process Synthesis”,Comp. & Chem. Eng., 15(2), 73–84.

D.F. Rudd, C.C. Watson (1968). Strategy of Process Engineering, J. Wiley & Sons, New York.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 90

Page 91: Optimization and Control of Chemical Processes - UCnuno/cim2003/present.pdf · “the synthesis, design, testing, scaleup ... Optimization and Control of Chemical Processes — CIM

H.S. Ryoo, N.V. Sahinidis (1995). “Global Optimization of Nonconvex NLPs and MINLPs with Applications in Process Design”,Comp. & Chem. Eng., 19, 551–566.

N.V. Sahinidis, I.E. Grossmann (1991). “Design of a Chemical Complex”, in I.E. Grossmann (Ed.), CACHE Design Case StudyVolume 6: Chemical Engineering Optimization Models with GAMS, CACHE Corp., Austin, TX.

R.W.H. Sargent, G.R. Sullivan (1979). “Development of Optimal Feed Changeover Policies for Refinery Distillation Units”, Ind.& Eng. Chem. Proc. Des. Dev., 18(1), 113.

R.W.H. Sargent (1991). “What is Chemical Engineering?”, CAST Newsletter, 14(1), 9–11.

W.D. Seider, J.D. Seader, D.R. Lewin (1999). Process Design Principles. Synthesis, Analysis and Evaluation, J. Wiley & Sons,New York.

U.V. Shenoy (1995). Heat Exchanger Network Synthesis. Process Optimization by Energy and Resource Analysis, Gulf PublishingCompany, Houston, TX.

R. Turton, R.C. Bailie, W.B. Whiting, J.A. Shaeiwitz (1998). Analysis, Synthesis, and Design of Chemical Processes, Prentice-HallPTR, Upper Saddle River, NJ.

A.W. Westerberg, H.P. Hutchison, R.L. Motard, P. Winter (1979). Process Flowsheeting, Cambridge University Press, Cam-bridge.

A.W. Westerberg (1998). “Process Engineering II — A System’s View”, AIChE Meeting, Miami, FL.

H.P. Williams (1993). Model Building in Mathematical Programming, 3rd Edition, J. Wiley & Sons, New York.

Optimization and Control of Chemical Processes — CIM Workshop, July 2003 91