Content uploaded by Ghanim M. Alwan
Author content
All content in this area was uploaded by Ghanim M. Alwan on Jan 07, 2019
Content may be subject to copyright.
Optimization Technique
Lecturer: Assistant Professor Dr.Ghanim.M. Alwan
University of Technology, Iraq
Visitor Scholar, Missouri University of Science and Technology.
What is optimization?
Optimization technique is a powerful tool to obtain the desired design parameters and
best set of operating conditions .This would guide the experimental work and reduce
the risk and cost of design and operating.
Optimization refers to finding the values of decision variables, which correspond to
and provide the maximum or minimum of one or more desired objectives.
Reliability of optimum solutions depends on formulation of objective functions and
selected optimization technique.
Optimization requires a mathematical model that describes and predicts the process
behavior.
In complex non-linear processes, optimization search could help to estimate unknown
parameters.
Robust optimization could determine uncertainty variables in dynamic processes.
Optimization could be implemented as a tool to enable scale-up methodology and
design of multiphase reactors and flow systems.
Without optimization of design and operations, manufacturing and engineering
activities will not be as efficient as they are now.
Cautions Regarding Optimization
Optimization algorithms can powerfully assist the workers in operating and design.
1. The researcher should always carefully and thoroughly validate the engineering model.
Optimization of an inaccurate model is modestly illuminating at best and misleading
and a waste of time at worst. Often optimization algorithms will exploit weaknesses in
the model if they exist. As an example, regarding reaction system, you can get some
very high performance design if a model includes reliable kinetics mechanism!
2. We need to make sure the optimization problem represents the real problem, we need
to solve. Care must be taken to optimize with respect to the objective function, which
most nearly reflects the true goals of the optimization problem.
3. We need to be careful to optimize the whole process system and not just individual parts.
Objectives that could be minimized:cost, weight, distance, energy, loss, waste,
processing time, raw material consumption….etc.
Objectives that could be maximized:profit, conversion, yield, utility, efficiency,
capacity…etc.
Optimization process steps:
1. What is the optimization problem?
2. Selecting of the objective.
3. Selecting of the decision variables
4. Definition of constraints.
5. Formulation of the model: presenting the objective as a function of the variables and the
constraints as functional relationships, equalities and/or inequalities of the variables.
*Static and dynamic problems:
Most optimization problems are based on steady state models that could be formulated from
experimental data. Optimization problems involving dynamic models are more suitable for
"Optimal control".
**Continuous and discrete variables:
Continuous variable is any process variable that has real value such
as:pressure,temperature,concentration…..etc,while discrete variable(design variable) is
integer value only, number of tubes in a heat exchanger and number of distillation trays in a
distillation column ….etc.Optimization problems without discrete variables are far easier to
solve. Reliability of optimization technique depends on capturing of discrete variables.
Engineering Models in Optimization:
Engineering models play a key role in engineering optimization. In this section we will
discuss some further aspects of engineering models. We refer to engineering models as
analysis models.
In a very general sense, analysis models can be viewed as shown in Fig 1 below. A model
requires some inputs in order to make calculations. These inputs are called analysis
variables. Analysis variables include design variables (the variables we can change) plus
other quantities such as material properties, boundary conditions, etc. which typically would
not be design variables. When all values for all the analysis variables have been set, the
analysis model can be evaluated. The analysis model computes outputs called analysis
functions. These functions represent what we need to determine the “goodness” of a design.
For example, analysis functions might be stresses, deflections, cost, efficiency, heat transfer,
pressure drop, etc. It is from the analysis functions that we will select the design functions,
i.e., the objectives and constraints.
Fig. 1. The operation of analysis models
Thus from a very general viewpoint, analysis models require inputs—analysis variables—
and compute outputs—analysis functions. Essentially all analysis models can be viewed this
way.
Models and Optimization by Trial-and-Error:
The analysis model is to compute the values of analysis functions. The designer
specifies values for analysis variables, and the model computes the corresponding
functions.
Note that the analysis software does not make any kind of “judgment” regarding the
goodness of the design. If an engineer is designing a reactor, for example, and has software
to predict conversion and yield, the analysis software merely reports those values—it does
not suggest how to change the reactor design to increase conversion in a particular
location. Determining how to improve the design is the job of the designer.
To improve the design, the designer will often use the model in an iterative fashion, as shown
in Fig. 2 below. The designer specifies a set of inputs, evaluates the model, and examines the
outputs. Suppose, in some respect, the outputs are not satisfactory. Using intuition and
experience, the designer proposes a new set of inputs which he or she feels will result in a
better set of outputs. The model is evaluated again. This process may be repeated many
times.
Fig. 2. Common “trial-and-error” iterative design process.
We refer to this process as “optimization by design trial-and-error.” This is the way most
analysis software is used. Often the design process ends when time and/or money run out.
Note the mismatch of technology in Fig.2. On the right hand side, the model may be
evaluated with sophisticated software and the latest high-speed computers. On the left hand
side, design decisions are made by trial-and-error. The analysis is high tech; the decision
making is low tech.
Optimization with Computer Algorithms:
Computer-based optimization is an attempt to bring some high-tech help to the decision
making side of Fig. 2. With this approach, the designer is taken out of the trial-and-error
loop. The computer is now used to both evaluate the model and search for a better
operating conditions. This process is illustrated in Fig.3.
Fig..3. Moving the designer out of the trial-and-error loop with computer-based
optimization software.
The researcher now operates at a higher level. Instead of adjusting variables and
interpreting function values, the designer is specifying goals for the design problem and
interpreting optimization results. Usually a better design can be found in a shorter time.
Specifying an Optimization Problem:
1.Variables, Objectives, Constraints
2.Example: Specifying the Optimization Set-up of a Steam Condenser
It takes some experience to be able to take the description of a design problem and abstract
out of it the underlying optimization problem. In this example, a design problem for a steam
condenser is given. Can you identify the appropriate analysis/design variables? Can you
identify the appropriate analysis/design functions?
Description:
Fig. 4 below shows a steam condenser. The designer needs to design a condenser that will
cost a minimum amount and condense a specified amount of steam, mmin. Steam flow rate,
ms, steam condition, x, water temperature, Tw, water pressure Pw, and materials are
specified. Variables under the designer’s control include the outside diameter of the shell, D;
tube wall thickness, t; length of tubes, L; number of passes, N; number of tubes per pass, n;
water flow rate, mw; baffle spacing, B, tube diameter, d. The model calculates the actual
steam condensed, mcond, the corrosion potential, CP, condenser pressure drop, Pcond, cost,
Ccond, and overall size, Vcond. The overall size must be less than Vmax and the designer would
like to limit overall pressure drop to be less than Pmax.
Discussion:
This problem description is somewhat typical of many design problems, in that we have to
infer some aspects of the problem. The wording, “Steam flow rate, ms, steam condition, x,
water temperature, Tw, water pressure Pw, and materials are specified,” indicates these are
either analysis variables that are not design variables (“unmapped analysis variables”) or
constraint right hand sides. The key words, “Variables under the designer’s control…”
indicate that what follows are design variables.
Statements such as “The model calculates…” and “The designer would also like to limit”
indicate analysis or design functions. The phrase, “The overall size must be less than…”
clearly indicates a constraint.
Fig.4. Schematic of steam condenser.
Thus from this description it appears we have the following,
Process Variables:
Steam flow rate, ms
Steam condition, x
Water temperature, Tw
Water pressure, Pw
Material properties
Design Variables:
Outside diameter of the shell, D
Tube wall thickness, t
Length of tubes, L Number
of passes, N Number of
tubes per pass, n Water flow
rate, mw
Baffle spacing, B,
Tube diameter, d.
Objective Functions:
Minimize Cost
Overall size, Vcond
Steam condensed, mcond
Condenser pressure drop, Pcond
corrosion potential, CP
Constraints:
Vcond ≤Vmax
mcond ≥mmin
Pcond ≤Pmax
Formulating of objective function:
The objective is correlated with decision variables by using an available experimental data.
Several advanced nonlinear regression used that are; Newton-Quasi, Hook-Jeevs pattern
moves and the nonlinear least squares model estimation (Levenberg marquardt method) with
aid of the software (Statistica version10).
Examples:
Max Y=exp(-(x1-4)^2-(x2-4)^2)+exp(-(x1+4)^2-(x2-4)^2+2*exp(-x1^2-
(x2+4)^2)+2*exp(-x1^2-x2^2)
-5
0
5
-5
0
5
0
0.5
1
1.5
2
2.5
Fig. 5.Mesh plot which shows constrained optimum.
Y=4+4.5x1-4x2+x1^2+2x2^2-2x1x2+x1^4-2x1^2x2
Fig.6. Contour plot which shows unconstrained optimum.
2-Those based on Energy-mass balances, thermodynamics, chemical reaction
kinetics….etc.
*Tendency Model or gray model depends on inferential technique.
** Hybrid Model consists frame-work of heat/mass balance equations supplemented with
sub-models of of kinetic parameters and thermodynamic equations.
***Multilayer Model: The first layer is hybrid model and the optimum problem
represents the second modeling layer.
LP, linear programming problem: f(x) and ci(x) are linear.
NLP, nonlinear programming problem: f(x) is linear/nonlinear, ci(x):is
nonlinear/linear i.e,one of them is nonlinear.
MATLAB Tool box and the modeling language and optimizer (LINGO15)
Tool box are used throughout this workshop as computational tools for
implementing for cases study.
-Stochastic optimization:Deterministic algorithms for function optimization are
generally limited to convex regular functions. However, many functions are either not
differentiable or need a lot of difficult mathematical treatment (discretization, sensitivity
computation….etc) for differentiating. Therefore, stochastic sampling methods have
been found suitable for optimize such functions.
Genetic Algorithm, GA
Pattern search, PS
Firefly Algorithm,FA
Genetic Algorithm:
Genetic algorithms are search algorithms based on mechanics of natural selection
and natural genetics. Philosophically GAs are based on Darwins′theory.Genetic
algorithm have the following advantages over traditional methods:
GAs search from a population of points, not a single point. Hence GAs are said
to be Global optimization techniques.
GAs use only the value of convex (minimize) objective function. The
derivatives are not used in the search process.
GAs use probabilistic transition rules, not deterministic rules.
Genetic algorithms are the most popular form of evolutionary algorithms.
A population of chromosomes represents a set of possible solution. These solutions are
Classified by an evaluation function, giving better values, or fitness to better solutions.
The simplest representation is a value representation where the chromosome consists
of the values of the design variables placed side by side. For example, suppose we
have 6 discrete design variables whose values are integer values ranging from 1 to 5.
Suppose we also have 4 continuous design variables whose values are real numbers
ranging from 3.000 to 9.000. A possible chromosome is shown in Fig.7:
4
3
1
3
2
5
3.572
6.594
5.893
8.157
Fig. 7: Chromosome
The chromosome in Fig. 7 consists of ten genes, one for each design variable. The
value of each gene is the value of the corresponding design variable. Thus, a
chromosome represents particular design since values are specified for each of the
decision variables.
Fig.8 Process of GA for objective functions.
Genetic Formulation:
A genetic algorithm is search procedure modeled on the mechanics of natural
selection rather than simulated process. Domain knowledge is embedded in the
abstract representation of a candidate solution termed an organism.
Organisms are grouped into sets called populations.Succesive populations are called
Generations. Any string in the search space is evaluated for its fitness, depended on
which the particular string is either dropped or taken into the next generation. In
general a fitness function Ω(x) is first derived from the objective function f(x) and is
used in successive genetic operations.
The fitness function is a blend of objective & constraint function:
Ω(x)=f(x)*(1.0+
µ
(x)) (1)
where the penalty multiplier
µ
(x) that penalizes an infeasible string is given by
linear function:
µ
(x)=
Σ
Wj*Vj (2)
Where the constraint violation is measured by :
Vj=[0,Gm-Bm] (3)
(3)
(3)
Where ;
Gm: mth inequality constraint
Bm:bound on constraint
Wj:penalty weight
The penalty weight at Tth generation is calculated as given
by: Wj=log(1+T) (4)
Figure (3) shows the flow chart of the GA
To capture discrete (integer) decision variables, it is best GA is implemented with
hybrid functions, as pattern search. First does global search using GA and then switches
to Hooke-Jeeves algorithm to refine the decision variables.
Fig.10.Flow chart of GA.
Case study: Spouted bed
The objectives: UI (uniformity index) of solid particles and PD (pressure drop)across the bed are
correlated with the three decision variables(Vg, ρs and dp). Two-advanced nonlinear regression used which
are; Newton-Quasi and Hook-Jeevs pattern moves with the aid of the computer program (Statistica
version10). The conflicted optimization problems are:
UI=0.184Vg-0.214ρs0.12dp-0.267 (1)
PD=0.037Vg0.38 ρs0.407dp-0.221 (2)
Subject to inequality constraints:
0.74 ≤Vg ≤1.0
2400.0 ≤ ρs ≤ 7400.0 (3)
1.09 ≤dp ≤2.18
However, the spouted bed is highly nonlinear interacted process. GA is the best global search for solving
the optimization problem of the process.
Application of GA:
1. Single objective function:
Max UI= -0.184Vg-0.214ρs0.12dp-0.267 (1)
Subject to inequality constraints:
(3)
Adapted parameters of GA
Parameter
Type/value
Population type
Population size
Creation function
Scaling function
Selection function
Crossover function
Crossover fraction
Mutation function
Migration direction
Migration fraction
Hybrid function
Number of generation
Function tolerance
Double vector
80
Feasible population
Rank
Roulette
Scattered
0.8
Adaptive feasible
Forward
0.1
Pattern search
51
1.0E-6
Figure:Results/solution of genetic algorithm.
0 50 100
-0.55
-0.5
-0.45
Generation
Fitness value
Best: -0.53484 Mean: -0.53369
123
0
5000
10000
Number of variables (3)
Current best individual
Current Best Individual
-0.54 -0.535 -0.53 -0.525
0
5
Raw scores
Expectation
Fitness Scaling
20 40 60 80 100
-0.6
-0.5
-0.4
Generation
Best, Worst, and Mean Scores
-0.54 -0.535 -0.53 -0.525
0
10
20
Score Histogram
Score (range)
Number of individuals
0 5 10 15 20
0
5
10
Selection Function
Individual
Number of children
Best fitness
Mean fitness
0.538 0.5382 0.5384 0.5386 0.5388 0.539 0.5392 0.5394 0.5396 0.5398
0.7405
0.741
0.7415
0.742
0.7425
0.743
Uniformity Index
Gas Velocity,(m/s )
0.538 0.5382 0.5384 0.5386 0.5388 0.539 0.5392 0.5394 0.5396 0.5398
6646
6646.2
6646.4
6646.6
6646.8
6647
6647.2
6647.4
6647.6
6647.8
6648
Uniformity Index
Solid density ,(Kg/m3)
Mutation of decision variables corresponding to objective change.
Optimal values by single GA
Decision variables
Optimum value
Gas velocity(m/s)
0.741
Density of solid (Kg/m3)
6648
Diameter particle(mm)
1.09
0.538 0.5382 0.5384 0.5386 0.5388 0.539 0.5392 0.5394 0.5396 0.5398
1.09
1.091
1.092
1.093
1.094
1.095
1.096
1.097
1.098
1.099
Uniformity Index
Solid diameter,(mm)
2. Multi-objective optimization:
Multi-objective optimization technique is used to solve the conflicted optimization problems:
Max UI= - 0.184Vg-0.214ρs0.12dp-0.267 (1)
Min PD= 0.037Vg0.38 ρs0.407dp-0.221 (2)
Subject to inequality constraints:
0.74 ≤Vg ≤1.0
2400.0 ≤ ρs ≤ 7400.0 (3)
1.09 ≤dp ≤2.18
Adapted parameters of GA
Parameter
Type/Values
Population type
Population size
Creation function
Scaling function
Selection function
Crossover function
Crossover fraction
Mutation function
Migration direction
Migration fraction
Hybrid function
Number of generation
Function tolerance
Double vector
80
Feasible population
Rank
Roulette
Scattered
0.8
Adaptive feasible
Forward
0.1
Pattern search
107
1.0E-6
The objective functions are conflicted, so that 14 chromosomes were created. Each
chromosome represents the possible solution to the optimization problem, and each
bit(gene) represents the value of the variables of the problem.This means that the
optimization search created 26 sets for the process design and operating conditions.
-0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36
0.65
0.7
0.75
0.8
0.85
0.9
0.95
1
1.05
1.1
1.15
Objective 1
Objective 2
Pareto front
Decision variables
Min. .
Max.
Gas velocity (m/s)
0.740
0.756
Density of solid (KG/M3)
2400
6259
Diameter of particle(mm)
1.109
2.178
Value of objective
UI = 0.39 – 0.53
PD = 0.66 – 1.19
100 200 300 400 500 600
1000
2000
3000
Generation
Avergae Distance
Average Distance Between Individuals
-1 0 1 2
0
10
20
Score Histogram
Score (range)
Number of individuals
5 91317212529333741
0
10
20
Selection Function
Individual
Number of children
0 10 20 30 40
0
0.1
0.2
Distance of individuals
Individuals
Distance
1 2 3 4 5 6
0
10
20
Rank histogram
Rank
Number of individuals
0 200 400 600
0
0.5
Generation
Average Spread
Average Spread: 0.07348
fun1 [-0.537319 -0.399723]
fun2 [0.663763 1.19368]
Mutation change of decision variables corresponding to objectives.
0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56
0.74
0.742
0.744
0.746
0.748
0.75
0.752
0.754
0.756
0.758
0.76
Uniformity Index
Gas veloc ity,(m/s )
0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1. 1 1.15
0.74
0.742
0.744
0.746
0.748
0.75
0.752
0.754
0.756
0.758
0.76
Pressure drop,(Kpa)
Gas veloc ity,(m/s )