On the Use of Stochastic Optimization in Chemical and ...

35
On On the Use the Use of of Stochastic Stochastic Optimization in Optimization in Chemical and Chemical and Process Engineering Process Engineering Rzeszów Rzeszów University of Technology University of Technology Faculty of Chemistry Faculty of Chemistry Department of Chemical and Process Department of Chemical and Process Engineering, Engineering, Rzeszów Rzeszów , Poland , Poland Jacek Jeżowski Warszawa Kraków Rzeszów POLAND

Transcript of On the Use of Stochastic Optimization in Chemical and ...

Page 1: On the Use of Stochastic Optimization in Chemical and ...

On On the Usethe Use of of Stochastic Stochastic Optimization in Optimization in Chemical and Chemical and

Process EngineeringProcess Engineering

RzeszówRzeszów University of TechnologyUniversity of TechnologyFaculty of ChemistryFaculty of Chemistry

Department of Chemical and Process Department of Chemical and Process Engineering, Engineering, RzeszówRzeszów, Poland, Poland

Jacek Jeżowski

Warszawa

Kraków Rzeszów

POLAND

Page 2: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 3: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 4: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCHADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 5: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 6: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 7: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 8: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 9: On the Use of Stochastic Optimization in Chemical and ...

OUTLINEOUTLINE1.1. STOCHASTIC vs. DETERMNISTIC METHODS of STOCHASTIC vs. DETERMNISTIC METHODS of

OPTIMIZATIONOPTIMIZATION

2.2. ADAPTIVE RANDOM SEARCH ADAPTIVE RANDOM SEARCH

3.3. SIMULATED ANNEALING with SIMPLEX (SA/S)SIMULATED ANNEALING with SIMPLEX (SA/S)

4.4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)

5.5. COMPUTERCOMPUTER--SOLVER OPTISOLVER OPTI--STOSTO

6.6. EXAMPLES of APPLICATIONSEXAMPLES of APPLICATIONS

7.7. CONCLUSIONSCONCLUSIONS

Page 10: On the Use of Stochastic Optimization in Chemical and ...

1. DETERM1. DETERMIINISTIC vs. STOCHASTIC NISTIC vs. STOCHASTIC METHODS of OPTIMIZATIONMETHODS of OPTIMIZATION

or WHY STOCHASTIC METHODS ???

Because “classical “ deterministic approaches (i.e.mathematical programming) have serious drawbacks (particularly when applied by non-experts)

ARE NOT ABLE TO LOCATE the GLOBAL OPTIMUM (in NON-LINEAR PROBLEMS)

REQUIRE SMOOTH FUNCTIONS WITHOUT DISCONTINUITIES and (often) ALSO DIFFERENTIABLE (even twice)

DO NOT PERFORM WELL with MIXED-INTEGER VARIABLES (discrete & continuous – MINLP PROBLEMS)

Page 11: On the Use of Stochastic Optimization in Chemical and ...

Additional troubles with deterministic Additional troubles with deterministic approaches:approaches:

““goodgood”” solvers are commercialsolvers are commercial

Expensive

Black-box-like (for non-expert)

Work in equation mode (in practice external

modules of user are very useful)

Page 12: On the Use of Stochastic Optimization in Chemical and ...

1) PROVIDE HIGHER PROBABILITY of LOCATING

GLOBAL OPTIMUM („GLOBAL” OPIMIZERS)

2) SIMPLE (can be coded by non-experts)

3) DISCONTINUITIES DO NOT CAUSE TROUBLES

4) CAN WORK in EQUATION and MODULAR MODE

STOCHASTIC APPROACHESSTOCHASTIC APPROACHES

Page 13: On the Use of Stochastic Optimization in Chemical and ...

BUTBUT

LONG COMPUTATION (CPU) TIME

HEURISTIC CONTROL PARAMETERS VALUES (that

usually have to be adjusted by error-and-trial procedure)

DIFFICULTIES with EQUALITY CONSTRAINTS

One has to choose from variety of approaches (usually

not tested sufficiently)

Page 14: On the Use of Stochastic Optimization in Chemical and ...

ADAPTIVE RANDOM SEARCH (ARS) - single-point based

SIMULATED ANNEALING (SA) – single-point based

GENETIC ALGORITHMS (GA)- population based

Page 15: On the Use of Stochastic Optimization in Chemical and ...

2. ARS METHOD

CONCEPT of ADAPTIVE RANDOM SEARCH:

CONCENTRATE GENERATION „AROUND”

CURRENTLY BEST SOLUTION BY SEARCH

REGION CONTRACTION AND / OR THE USE

OF SPECIAL FUNCTION WITH INCREASED

PROBABILITY DENSITY

Page 16: On the Use of Stochastic Optimization in Chemical and ...

LUUS - JAAKOLA (LJ) ALGORITHM IT MAKES SEVERAL SEARCHES WITHIN CURRENT

SEARCH REGION without space decrease or density

change (EVEN IF THERE IS A „SUCCESS”) WHILE OTHER

METHODS (GADDY, SALCEDO,...) INCREASE

PROBABILITY DENSITY AND / OR CONTRACT REGION

AFTER EACH SUCCESS

LJ ALGORITHM features resemblance to population-based methods ⇒ should gives higher chance of global optimum (and is very SIMPLE)

Page 17: On the Use of Stochastic Optimization in Chemical and ...

x1

x2

the best pointin 1st loop

search spacein 1st loop

Page 18: On the Use of Stochastic Optimization in Chemical and ...

1) Adaptation of LJ for MINLP problems ( consistent

scheme of generating discrete variables)

2) Major changes in the scheme of decreasing the region

search sizes:

a) the decrease is variable dependent (i.e. Region

search size decrease varies dependent on a

variables),

b) a rate of region search size decrease is similar to

Gauss density distribution → to avoid local optima

traps in initial phase.

OUR MAJOR MODIFICATIONS and EXTENSIONOUR MAJOR MODIFICATIONS and EXTENSION

Page 19: On the Use of Stochastic Optimization in Chemical and ...

Illustration of space Illustration of space decrease scheme in decrease scheme in

original approachoriginal approach

0

0,2

0,4

0,6

0,8

1

0 20 40 60 80 100NEL

δik

0

0,2

0,4

0,6

0,8

1

0 20 40 60 80 100NEL

δik

Illustration of space Illustration of space decrease scheme in decrease scheme in modified approachmodified approach

Ad 2bAd 2b

Page 20: On the Use of Stochastic Optimization in Chemical and ...

FUNDAMENTAL CONCEPT:SOLUTION IS ACCEPTED WITH PROBABILITY P

3. SIMULATED ANNEALING

etemperatur - T ff=f :where

0f if )Tf/exp(-0<f if 1

P

i1i+ −Δ⎩⎨⎧

≥ΔΔΔ

=

THIS ALLOWS FOR JUMPING OFF OUT OF LOCAL OPTIMA !

Page 21: On the Use of Stochastic Optimization in Chemical and ...

1.Fix T (initial value) and generate X0

2.Generate Xs (neighboring point), calculate f(Xs) and accept Xs according to P.

3.REPEAT step 2 for decreasing value of T until stopping criteria are met

GENERAL ALGORITHM

Remark: X0 has to be feasible

Page 22: On the Use of Stochastic Optimization in Chemical and ...

NELDER - MEAD OPTIMIZATION ALGORITHM (SIMPLEX)EMBEDDED INTO SA SCHEME

/proposition of Press and Teukolsky ’91/

FUNDAMENTAL CONCEPT:Each vertex of a simplex is „disturbed” by:

P1 = -T × ln(z)z - random number from uniform distribution [0,1]HOW IT WORKS ?

1) P1 is added to each vertex generated by N-M scheme2) P1 is subtracted from „reflected” vertex of new simplex

MODIFICATION of SA for CONTINUOUS (NLP) PROBLEMS

RANDOM MOVEMENTS of SIMPLEX

Page 23: On the Use of Stochastic Optimization in Chemical and ...

Random movements uphill (for minimization)

AIM:

to give additional randomization for small

T values where SA/S performs similarly to

Nelder-Mead (i.e. works as deterministic

approach)

OUR MODIFICATION

Page 24: On the Use of Stochastic Optimization in Chemical and ...

Specific features of our approach (GENSpecific features of our approach (GEN--COM)COM)real coded numbers (not binary coded),

The use of sub-population consisting with genetically transformed solutions. The solutions from the subpopulation and its parent population compete with each others to create the next parent population ⇒ this is to eliminate premature problem, i.e. to escape from local optimum

9 mutation and crossover operators that can be used to both continuous and discrete variables

3 various mechanisms for dealing with inequality constraints

4. 4. GENETIC ALGORITHMS (GA)GENETIC ALGORITHMS (GA)Remark:Remark: this is population based approach that is often considered more robust (but also more time consuming)

Page 25: On the Use of Stochastic Optimization in Chemical and ...

Characteristic features:

coded in C++ with the use of DLL libraries

can operate under Windows and Linux,

can operate in equation and equation-modular mode.

55. . COMPUTERCOMPUTER--SOLVER OPTSOLVER OPTII--STOSTO

Most important: Most important:

Has his own generic modeling systemHas his own generic modeling system (similar(similarto that in GAMS). to that in GAMS).

Page 26: On the Use of Stochastic Optimization in Chemical and ...

Main goal:

easy to use framework for solving equalities

Remark:

equalities are major problems for stochastic approaches, penalty terms, relaxation – are not good solutions

Most efficient is:

solve the equations directly

but

they should be linear ones

Page 27: On the Use of Stochastic Optimization in Chemical and ...

User → select decision variables such that equalities become linear in regards to dependent variables

IMPORTANT:

balances involves bilinear terms:

0...YXYX 2211 =+⋅+⋅

SOLUTION SCHEME:

Choose X1, X2,... decisions variables and.... balances are linear in regards to Y1, Y2,....

Page 28: On the Use of Stochastic Optimization in Chemical and ...

SOLUTIONS FRAMEWORK:

decision variables (data)

solve equation set no. 1

check set of inequalities

Page 29: On the Use of Stochastic Optimization in Chemical and ...

SOLUTIONS FRAMEWORK:

decision variables (data)

solve equation set no. 1

check set of inequalities

Page 30: On the Use of Stochastic Optimization in Chemical and ...

SOLUTIONS FRAMEWORK:

decision variables (data)

solve equation set no. 1

check set of inequalities

solve equation set no. 2

Page 31: On the Use of Stochastic Optimization in Chemical and ...

6.1. Mathematical NLP and MINLP problems

designed for tests of optimization problems

about 20 NLP unconstrained functions (highly

multimodal)

more than 10 NLP constrained problems with

inequality and/or equality constraints

some MINLP problems of small scale in regards

to no. of discrete variables

Page 32: On the Use of Stochastic Optimization in Chemical and ...

1)To evaluate robustness and efficiency of various versions of solution algorithms

2)To find good values of control parameters

3)To get knowledge on properties of the algorithms: for what types of problems, limitations,...

Aims of the tests:

Page 33: On the Use of Stochastic Optimization in Chemical and ...

• Reaction equilibrium composition• Alkylation process optimization• Optimization of reactor train • Reactor selection from the superstructure• Multi-product batch train optimization • Optimal sequence for separating two-

component mixture • Cross-current extraction train with recycles

6.2. Small processes engineering problems

Page 34: On the Use of Stochastic Optimization in Chemical and ...

• Optimization of HENs with fixed structure

• Optimization of chromatography

• Retrofitting optimal HENs

• Designing optimal water usage networks

6.3. Applications for process system engineering

problems:

Page 35: On the Use of Stochastic Optimization in Chemical and ...

Our experiments (and literature information) show, that stochastic approaches are easy to use, robust methods.

RememberRemember, however, on„no free lunch theorem”„no free lunch theorem”

7. 7. CONCLUSIONSCONCLUSIONS

there is no universal optimization methodOne has toOne has to:

Choose proper approach and adjust parametersFormulate properly the problem for the chosen method