You are on page 1of 29

Optimization

MEL 806
Thermal System Simulation (2-0-2)
Dr. Prabal Talukdar
Associate Professor
Department of Mechanical Engineering
IIT Delhi

Introduction

In the preceding lectures, we focused our attention on obtaining a


workable, feasible, or acceptable design of a system. Such a design
satisfies the requirements for the given application, without violating
any imposed constraints. A system fabricated or assembled
b
because
off this
thi design
d i is
i expected
t d to
t perform
f
the
th appropriate
i t tasks
t k
for which the effort was undertaken.
However, the design would generally not be the best design, where
th d
the
definition
fi iti off b
bestt iis b
based
d on cost,
t performance,
f
efficiency
ffi i
or
some other such measure.
In actual practice, we are usually interested in obtaining the best
quality
lit or performance
f
per unit
it cost,
t with
ith acceptable
t bl environmental
i
t l
effects. This brings in the concept of optimization, which minimizes
or maximizes quantities and characteristics of particular interest to a
given application
application.

UNCONSTRAINED SEARCH WITH MULTIPLE


VARIABLES

Let us now consider the search for an optimal


design when the system is governed by two or
more independent variables.
However, the complexity of the problem rises
sharply as the number of variables increases and
and,
therefore, attention is generally directed at the most
important
p
variables, usually
y restricting
g these to two
or three.

In addition, many practical thermal systems can


be well characterized in terms of two or three
predominant variables.
Examples of this include the length and diameter
of a heat exchanger, fluid flow rate and
evaporator temperature in a refrigeration
system, and so on.

In order to graphically depict the iterative


approach to the optimum design, a
convenient method is the use of contours
or lines of constant values of the objective
function.
function

Lattice Search Method

Lattice search method in a two-variable space.

Univariate Search
An univariate search involves optimizing the
objective function with respect to one variable at
a time. Therefore, the multivariable problem is
reduced to a series of single-variable
optimization problems, with the process
converging
i tto th
the optimum
ti
as th
the variables
i bl are
alternated

Graphical
p
p
presentation

Various steps in the univariate search method.

The method
A starting point is chosen based on available information on the system
or as a point away from the boundaries of the region
region.
First, one of the variables, say x, is held constant and the function is
optimized with respect to the other variable y.
Point A represents the optimum thus obtained. Then y is held constant
at the value at point A and the function is optimized with respect to x to
obtain the optimum
p
g
given by
yp
point B.
Again, x is held constant at the value at point B and y is varied to obtain
the optimum, given by point C.
This process is continued, alternating the variable, which is changed
while keeping the others constant, until the optimum is attained.
y the change
g in the objective
j
function,, from one step
p
This is indicated by
to the next, becoming less than a chosen convergence criterion or
tolerance

Example
p
The objective
j
function U,, which represents
p
the cost of a
fan and duct system, is given in terms of the design
variables x and y, where x represents the fan capacity
and y the duct length
length, as

Both x and y are real and positive. Using the univariate


search, obtain the optimum value of U and the
corresponding values of x and y. Is this optimum a
minimum or a maximum?

If y is kept constant, the value of x at the optimum is given by

Similarly, if x is held constant, the value of y at the optimum is given by

let us choose x = y = 0.5 as the starting point.


First x is held constant and y is varied to obtain an optimum value
of U. Then y is held constant and x is varied to obtain an optimum
p
g equations
q
are used.
value of U. In both cases,, the preceding

Calculations
x
0.5
1.944161
2.437957
2 531677
2.531677
2.547644
2.550314
2.55076
2.550834
2.550847

y
1.632993
0.828139
0.739531
0 725714
0.725714
0.723436
0.723057
0.722994
0.722983
0.722982

u
9.839626
5.598794
5.427791
5 422513
5.422513
5.422363
5.422359
5.422359
5.422359
5.422359

Steepest
p Ascent/Descent Method
The steepest
p
ascent/descent method is a very
y efficient
search method for multivariable optimization and is
widely used for a variety of applications, including
thermal systems.
systems
It is a hill-climbing technique in that it attempts to move
toward the peak, for maximizing the objective function, or
toward the valley, for minimizing the objective function,
over the shortest possible path.
The method is termed steepest ascent in the former
case and steepest descent in the latter.

At each step, starting with the initial trial point, the


di ti iin which
direction
hi h th
the objective
bj ti ffunction
ti changes
h
att th
the
greatest rate is chosen for moving the location of the
point, which represents
p
p
the design
g on the multivariable
space.

Steepest ascent method, shown in terms of (a) the climb toward the peak
of a hill and (b) in terms of constant U contours.

It was shown that the g


gradient vector U is normal to
the constant U contour line in a two-variable space, to
the constant U surface in a three-variable space, and so
on.
on
Since the normal direction represents the shortest
distance between two contour lines, the direction of the
gradient vector U is the direction in which U changes at
the greatest rate.
For a multivariable problem
problem, the gradient vector may be
written as

At each trial p
point,, the gradient
g
vector is determined and
the search is moved along this vector, the direction being
chosen so that U increases if a maximum is sought, or U
decreases if a minimum is of interest
interest.
The direction represented by the gradient vector is given
by the relationship between the changes in the
independent variables. Denoting these by x1, x2 , --xn , we have

First approach
pp
Choose a starting
gp
point. Select x. Calculate the
derivatives.
Decide the direction of movement, i.e., whether x is
positive
iti or negative.
ti
C
Calculate
l l t y.
Obtain
Obt i the
th new values
l
of x, y, and U.
Calculate the derivatives again at this point. Repeat
previous steps to attain new point.
This procedure is continued until the change in the
variables
i bl b
between
t
ttwo consecutive
ti ititerations
ti
iis within
ithi a
desired convergence criterion.

Second Approach
pp
Choose a starting point.
Calculate the derivatives.
Decide the direction of movement, i.e., whether x must
increase or decrease
decrease.
Vary x, using a chosen step size x and calculating the
corresponding
p
g y.
y Continue to varyy x until the optimum
p
in U is reached.
Obtain the new values of x, y, and U. Calculate the
derivatives again at this point and move in the direction
given by the derivatives.
This p
procedure is continued until the change
g in the
variables from one trial point to the next is within a
desired amount.

Example
p Problem
Consider the simple problem discussed
before and apply the two approaches just
discussed for the steepest ascent/descent
method to obtain the minimum cost U.

The starting
gp
point is taken as x = y = 0.5. The results
obtained for different values of x are

Therefore,, if x1 is chosen,, the changes


g in the other
variables must be calculated from these equations. In
addition, x1 is taken as positive or negative, depending
on whether U increases or decreases with x1 and
whether a maximum or a minimum is sought

Multivariable Constrained
Optimization
We now come to the problem of constrained
optimization, which is much more involved than
the various unconstrained optimization cases
considered thus far.
The number of independent variables must be
larger than the number of equality constraints;
otherwise, these constraints may simply be used
to determine the variables and no optimization is
possible

Penalty
y Function Method
The basic approach
pp
of this method is to convert the
constrained problem into an unconstrained one by
constructing a composite function using the objective
function and the constraints
Let us consider the optimization problem given by the
equations

The composite function, also known as the penalty


function, may be formulated in many different ways.

If a maximum in U is being sought, a new objective


function V is defined as
and if a minimum in U is desired, the new objective
function is defined as
Here the rs are scalar quantities that vary the
importance given to the various constraints and are
known as penalty parameters
parameters.
They may all be taken as equal or different.
Higher values may be taken for the constraints that are
critical and smaller values for those that are not as
important.

If the penalty parameters are all taken as zero, the constraints


have no effect on the solution and, therefore, the constraints
are not satisfied.
On the other hand, if these parameters are taken as large, the
constraints are satisfied but the convergence to the optimum is
slow.
Therefore, by varying the penalty parameters we can vary the
rate of convergence and the effect of the different constraints
on the solution.
The general approach is to start with small values of the
penalty
pe
a ty parameters
pa a ete s a
and
dg
gradually
adua y increase
c ease tthese
ese as tthe
eG
Gs,
s,
which represent the constraints, become small.
This implies going gradually and systematically from an
unconstrained p
problem to a constrained one.

Penalty function method for the combined objective function V and


different values of the penalty parameter r.

Example
p

where U is to be minimized. The inequality constraints give the feasible


domain as 2 < x < 4. Without the constraints, the optimum is at x = 3,
where U is zero.
zero
With the constraints, the minimum is at x = 2, where U = 25/12 = 2.08.

Example
p Problem
In a two-component system, the cost is the objective function given by the
expression
U(x y) = 2x2 + 5y
U(x,
where x and y represent the specifications of the two components. These
variables are also linked by mass conservation to yield the constraint
( y) = xyy -12 = 0
G(x,
Solve this problem by the penalty function method to obtain minimum cost.
The new objective function V(x, y), consisting of the objective function and
th constraint,
the
t i t is
i d
defined
fi d as

Any method for unconstrained optimization may be used for obtaining


the optimum. An exhaustive search can be used because of the simplicity
of the method and the given functions.
If r is taken as zero,
zero the constraints are not satisfied
satisfied, and if r is taken as
large, the constraints are satisfied, but the convergence is slow.

We may also derive x and y in terms of the penalty parameter r, by


differentiating V with respect to x and yy, and equating the resulting
expressions to zero, as

See the spreadsheet

You might also like