Sie sind auf Seite 1von 37

Optimization Techniques

Graphical Optimization for Two


Variable Functions
Dr. Nasir M Mirza
Email: nasirmm@yahoo.com

Graphical Constraint Surface


For illustration, consider only inequality constraints gj (X) < 0.
The set of values of X that satisfy the equation gj (X) = 0 forms a
hyper-surface in the design space and is called a constraint
surface.
this is an (n-1)-dimensional subspace, where n is the number of
design variables.
The constraint surface divides the design space into two regions:
one in which gj (X) < 0 and the other in which gj (X) > 0.
Thus the points lying on the hypersurface will satisfy the
constraint gj (X) critically,
whereas the points lying in the region where gj (X) > 0 are
infeasible or unacceptable,
and the points lying in the region where gj (X) < 0 are
feasible or acceptable.

Figure 1.3 shows a hypothetical two-dimensional

design space where the infeasible region is


indicated by hatched lines.
A design point that lies on one or more than one
constraint surface is called a bound point, and the
associated constraint is called an active constraint.
Design points that do not lie on any constraint
surface are known as free points.
Depending on whether a particular design point
belongs to the acceptable or unacceptable region, it
can be identified as one of the following four types:
1. Free and acceptable point
2. Free and unacceptable point
3. Bound and acceptable point
4. Bound and unacceptable point

1.4.5 Objective Function Surfaces

The locus of all points satisfying f(X) = c =

constant forms a hypersurface in the design


space, and for each value of c there corresponds
a different member of a family of surfaces.
These surfaces, called objective function
surfaces, are shown in a hypothetical twodimensional design space in Fig. 1.4.
Once the objective function surfaces are drawn
along with the constraint surfaces, the optimum
point can be determined without much difficulty.
But the main problem is that as the number of
design variables exceeds two or three.

Example 1

A design a uniform column of tubular section (Fig. 1.5) to carry a

compressive load P = 2500 kgf for minimum cost.


The column is made up of a material that has a yield stress (y) of 500
kgf/cm2, modulus of elasticity (E) of 0.85 x 106 kgf/cm2, and density () of
0.0025 kgf/cm3.
The length of the column is 250 cm.
The stress induced in the column should be less than the buckling stress as
well as the yield stress.
The mean diameter of the column is restricted to lie
between 2 and 14 cm, and columns with thicknesses
outside the range 0.2 to 0.8 cm are not available in
the market.
The cost of the column includes material and
construction costs and can be taken as 5W + 2d,
where W is the weight in kilograms force and d is the
mean diameter of the column in centimeters.

SOLUTION: The design variables are the mean diameter (d)

and tube thickness (t): (d, t)T = (x1 , x2)T


The objective function to be minimized is given by
f(X) = 5W + 2d = 5ldt + 2d = 9.82x1 x2 + 2x1
The behavior constraints can be expressed as
stress induced < yield stress
stress induced < buckling stress
The induced stress is given by
induced stress = i = (P/(dt))= 2500/(dt)
Buckling stress for the pin-connected column = euler buckling
load/cross-section area = 2EI/(l2)(dt)

I = second moment of the area of the cross-section of the column


I = dt(d2 + t2) = x1x2(x12 + x22)
Thus the behavior constraints can be restated as
g1(X) = 2500/(x1x2) - 500 0
g2(X) = 2500/(x1x2) [2(0.85 x 106)(x12 + x22)]/(8(250)2 0
The side constraints are given by
2 d 14
0.2 t 0.8
which can be expressed in standard form as
g3(X) = x1 + 2.0 < 0 ; g4(X) = x1 14.0 < 0
g5(X) = x2 + 0.2 < 0 ;

g6(X) = x2 0.8 < 0

Since there are only two design variables, the problem can be
solved graphically as shown below.
First, the constraint surfaces are to be plotted in a twodimensional design space where the two axes represent the two
design variables x1 and x2.

To plot the first constraint surface, we have


g1(X) = 2500/(x1x2) - 500 0
x1 x2 500

Thus the curve x1x2 = 1.593 represents the constraint surface


g1(X) = 0. This curve can be plotted by finding several points on
the curve.

The points on the curve can be found by giving a series of values to

x1 and finding the corresponding values of x 2 that satisfy the


relation x1x2 = 1.593
These points are plotted and a curve P1 Q1 passing through all these
points is drawn as shown in Fig. 1.6, and the infeasible region,
represented by g1(X) > 0 Or x1x2 < 1.593, is shown by hatched lines.

x1

10

12

14

x2

0.796
5

0.398
3

0.265
5

0.199
0

0.159
3

0.132
8

0.114
0

These points are


plotted and a curve P1
Q1 passing through all
these points is drawn
as shown in Fig. 1.6,
and the infeasible
region, represented by
g1(X) > 0
Or x1x2 < 1.593, is
shown by hatched
lines.

Similarly, the second constraint:


g2(X) < 0 can be expressed as x1 x2(x12 + x22) > 47.3 and the
points lying on the constraint surface g2(X) = 0 can be
obtained as follows:
x1 x2(x12 + x22) = 47.3
x1

10

12

14

x2

2.41

0.716

0.219

0.0926

0.0473

0.0274

0.0172

These points are plotted


as curve P2Q2, the feasible
region is identified, and
the infeasible region is
shown by hatched lines
as shown in Fig. 1.6.
The plotting of side
constraints is very simple
since they represent
straight lines.
After plotting all the six
constraints, the feasible
region can be seen to be
given by the bounded
area ABCDEA.

Next, the contours of the objective function are to be plotted


before finding the optimum point.
For this, we plot the curves given by
f(X) = 9.82x1x2 + 2x1 = c = constant
for a series of values of c.
By giving different values to c, the contours of function f(X)
can be plotted with the help of the following points.
For
9.82x1x2 + 2x1 = 50.0:
x2

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

x1

16.77

12.62

10.10

8.44

7.24

6.33

5.64

5.07

For
x2
x1

9.82x1x2 + 2x1 = 40.0:


0.1
13.40

For

0.2

0.3

0.4

0.5

0.6

0.7

0.8

10.10

8.08

6.75

5.79

5.06

4.51

4.05

9.82x1x2 + 2x1 = 31.58:

x2

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

x1

10.57

7.96

6.38

5.33

4.57

4.00

3.56

3.20

For

9.82x1x2 + 2x1 = 26.53:

x2

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

x1

8.88

6.69

5.36

4.48

3.84

3.36

2.99

2.69

For
x2
x1

9.82x1x2 + 2x1 = 20.0:


0.1
6.70

0.2
5.05

0.3

0.4

0.5

0.6

0.7

0.8

4.04

3.38

2.90

2.53

2.26

2.02

These contours are


shown in Fig. 1.6 and it
can be seen that the
objective
function cannot be
reduced below a value of
26.53 (corresponding to
point B)
without violating some of
the constraints.
Thus the optimum
solution is given by point
B with
d* = x1* = 5.44 cm ;
t* = X2* = 0.293 cm with
fmin = 26.53.

Program to draw contours


x1 = 1:0.5:14; x2 = 1.593./x1;
axis([0 15 0 0.9])
hold on
line(x1,x2, 'Color','r','LineWidth',2)
x1 = 1.0;
for j=1:26
x1= x1 + 0.5; x2 = 0.0 ;
for i=1: 5
f= x1*x2*(x1*x1 + x2*x2) - 47.3 ;
g = x1*x1*x1 + 3.*x1*x2*x2 ;
x2 = x2 - f/g ;
end
xx1(j)=x1; xx2(j)=x2;
hold on
end
line(xx1,xx2, 'Color','r','LineWidth',2)
z1 = -1.0;
for i=1:16
z1 = z1 + 1.0; z2 = 0.2; z3= 0.8;
zz1(i)=z1; zz2(i)=z2; zz3(i)=z3;
end
line(zz1,zz2, 'Color','b','LineWidth',2)
line(zz1,zz3, 'Color','b','LineWidth',2)
% continued - - -

Program to draw contours


y2 = -1.0;
for i=1:9
y1 = 2.0; y2 = y2 + 1.0; y3= 14;
yy1(i)=y1; yy2(i)=y2; yy3(i)=y3;
end
line(yy1,yy2, 'Color','b','LineWidth',2)
line(yy3,yy2, 'Color','b','LineWidth',2)
%
for j=1:6
if(j==1) w2 = 0.0; c = 50.0; end
if(j==2) w2 = 0.0; c = 40.0; end
if(j==3) w2 = 0.0; c = 31.58;end
if(j==4) w2 = 0.0; c = 30.0; end
if(j==5) w2 = 0.0; c = 26.53;end
if(j==6) w2 = 0.0; c = 20.0; end
for i=1:16
w2 = w2 + 0.05;
w1=c/(9.82*w2 + 2.0);
ww1(i)=w1; ww2(i)=w2;
end
line(ww1,ww2, 'Color','g','LineWidth',2)
end

Graphical Optimization
Choice of an Appropriate Range for Optimization Variables

The first task is to select a suitable range of values for the two
optimization variables.

A certain trial-and-error period is usually necessary before a


suitable

range is determined.
The range must obviously include the optimum point.
A large range may result in very small contour graphs making it
difficult to differentiate between different constraints.

On the other hand, a vary small range of variable values may


not show the region that represents the optimum solution.

For practical problems, a suitable range can be determined


based on prior experience with similar designs.

Graphical Optimization
For problems for which one has no prior

knowledge of the optimum solution at all, the


following procedure may be used.
1. Pick lower and upper limits for one of the
variables, say for x.

Arbitrary values can be chosen if nothing is known about


the solution.

2. Solve for the corresponding x values from


each of the constraint equations.

Set the minimum and maximum values of x based on


these values.

Example
As an illustration, consider a graphical solution of
the following problem:
Minimize: f(x, y) = 4x2 5xy + y2
Subject to: g(x, y) = x2 y + 2 0
h(x, y) = x + y 6 = 0
Assuming we have no idea of the optimum point,
we arbitrarily pick lower and upper limits for x
such as 0 and 10, respectively.
Next, we solve for the corresponding y- values
from each of the constraint equations, treating all
constraints as equalities.

Example
g
g
h
h

:
:
:
:

with
with
with
with

x
x
x
x

=
=
=
=

0, x2 y + 2 = 0 gives y = 2
10, x2 y + 2 = 0 gives y = 102
0, x + y 6= 0 gives y = 6
10, x + y 6= 0 gives y = 4

Thus for our first trial, we select the range for x as


(0, 10) and that for y as (-4, 102).

Contours of Constraint Feasible


Region

The second task is to draw contours for constraint functions

and determine the region over which all constraints are


satisfied. This region is called the feasible region.
Assuming that the constraints are written in the standard
form (less than or equal to type with the right-hand side
being 0), we need to draw lines representing equations g i(x,
y) = 0 and hi(x, y) = 0.
These contour lines can be drawn by selecting several
values for one of the variables and solving for the other
variable from the constraint function.
That is, to plot the contour for constraint g i, select a few
different values for xi over the chosen range.
For each selected value of x, compute the corresponding y
by solving the equation gj(x, y) = 0. A line passing through
pairs of such (x, y) values represents a contour for the
function gi = 0.

Example
Continuing with the example from the previous

section, our task is to draw lines passing through


points that satisfy the following equations:
Boundary of constraint 1: x2 y + 2 = 0
Boundary of constraint 2: x + y 6 = 0
To generate the data to draw these contours, we
take several points along the x- axis and compute
the corresponding y- values by solving the
corresponding equation.
The computed values are shown in the following
table:

Example
x

y from
x2 y + 2
=0

y from
x+y2=
0

2.

6.

8.25

3.5

60

2.
5

40

5.

27.

1.

7.
5

58.25

-1.5

10

102.

-4.

100

80

constraint 1: y = x*x + 2

Feasible region

20

constraint 2: y = 6 - x
0
0

10

Example
After all constraint contours are drawn, the intersection of

feasible sides of all constraints represents the feasible


region for the optimization problem.
The points inside the feasible region satisfy all constraints.
Depending on the problem formulation, the feasible region
may be disjoint, bounded, unbounded, empty, or just a
single point.
An empty feasible region obviously means that the problem
as formulated does not have a solution.
One must go back and reconsider the formulation.
A single feasible point also represents a special situation
where no further consideration is necessary.
There is only one suitable solution that meets all
constraints.

Contours of the Objective Function


The method is to pick two distinct points on the graph
and evaluate the objective function at these two points.

For most problems, using f-values at the third point of


the solution domain works well for the initial objective
function contours.

In this case, the two values are computed as follows:


c1 = f((xmax xmin)/3 , ( ymax ymin)/3)
c2 = f(2(xmax xmin)/3 ,

2( ymax ymin)/3)

Most likely, the values of f at these two points will be


different, say c1 and c2. If not, different points are
chosen until two distinct values of the objective function
are found.

Continuing with the example, the third points of the

chosen optimization space are computed as follows:


Point 1: x1 = (10 0)/3 = 10/3;
Point 1: y1 = (102 (-4))/3 = 106/3;
Point 2: x2 = 2(10 0)/3 = 20/3;
Point 2: y2 = 2(102 (-4))/3 = 212/3;
c1 = f(x1, y1) = 700
c2 = f(x2, y2) = 2810
Objective function contour1: 4x2 5xy + y2 = 700
Objective function contour2: 4x2 5xy + y2 = 2810

y from
f = 700

y from
f = 2810

26.46

53.01

2.5

32.97

59.39

5.

40.

66.04

7.5

47.5

72.94

10

55.41

80.09

Solution of the Example Problem


We continue with the

example problem.
We see that the feasible
region (area where all
constraints are satisfied) is
the small line near the
origin.
It is clear that we should
adjust ranges for both x and
y to get an enlarged view of
the feasible domain.
Also, the contour lines for
nonlinear functions are not
very smooth.
Thus, we should use more
points in plotting these
contours.

Solution of the Example Problem


For the second attempt, we repeat the steps used in the previous

sections but with the following range: xmin = 0 and xmax= 3


ymin = 0 and ymax = 15
The third points of this domain, and the corresponding objective
function values, are as follows:
Point 1: x = 1 ; y = 5 and f = 4
Point 2: x = 2 ; y = 10 and f = 16

Solution of the Example Problem


Figure here is a big
improvement over
Figure 2.2 but still
shows the feasible
region that is a
little smaller than
the overall graph.
To get even a
better graph, the
limits are adjusted
again and the
process repeated.
The resulting
graph is shown in
Figure next

Solution of the Example Problem


Figure here shows

the feasible region


very clearly.
The objective
function contours
show that the
minimum point is at
the intersection of
the two constraints.
Solving the two
constraint equations
simultaneously, we
get the following
coordinates of the
intersection point:
Optimum: x* = 1.56
y* = 4.4 and f = -5.2

Solution of the Example Problem


The final graph shown

in Figure 2.5 shows


several different
objective function
contours.
Also, more points are
used in drawing these
contours for a
smoother appearance.
The contour with f =
-5.2 just touches the
feasible region.
As the contour for f =
-10 demonstrates, all
contours with smaller
objective function
values will lie outside of
the feasible region.
Thus, the minimum
point is as shown in the
figure.

Contours for different values of f


Optimum:
x* = 1.56
y* = 4.4
and f = -5.2

Many different contours and


optimum
Optimum:
x* = 1.56
y* = 4.4
and f = -5.2

Das könnte Ihnen auch gefallen