You are on page 1of 27

Chapter 7: Constrained optimization

M. Lutfor Rahman, PhD

Institute of Statistical Research and Training


University of Dhaka
Email: lutfor@isrt.ac.bd
http://www.isrt.ac.bd/lutfor

September 10, 2020


Introduction: Constrained optimization

We consider optimization models where the values of decision


variables (independent variables) are restricted-singly or jointly.

Examples:
limited supply of key resources
budgetary restrictions
finite capacity of plant
the fact that the negative values may be meaningless
and other realistic requirements
7.1 Constrained optimization

The optimization problem can be addressed in more than one way-


for example, through mathematical programming, of which linear
programming (LP) is one instance, and numerical methods.
Three methods:
I Tangency
I Substitution
I Lagrange multipliers
Unconstrained optimization
§Consider the function

z = 60x + 80y − 2xy − x 2 − 2y 2 ............(1)


Find the maximum of this function without restrictions on the
choice of variables x and y.
→ The partial derivative of z with respect to x is given by
∂z
= 60 − 2y − 2x = 0 ..........(2)
∂x
and similarly
∂z
= 80 − 2x − 4y = 0 ..........(3)
∂y

Now solving (2) and (3) we get, x=20 and y=10.


Unconstrained optimization
Again, differentiating (2) with respect to x we obtain second order
derivative as
∂2z
= −2
∂x 2
Similarly
∂2z ∂2z
= −4 = −2
∂y 2 ∂x∂y
All conditions are fulfilled since the direct 2nd order derivatives are
negative.
Thus the points with x and y co-ordinates (20, 10) is a maximum,
and by putting these values into (1) we find the maximum value of
z is

z = 60 × 20 + 80 × 10 − 2 × 20 × 10 − 202 − 2 × 102 = 1000

The point (20, 10, 1000) is the unconstrained maximum of the


function z.
7.2 The method of substitution
§Consider the problem:
Maximize z = 60x + 80y − 2xy − x 2 − 2y 2
Subject to 2x + y = 40
→ To solve the problem, the constraint is rearranged to express in
terms of x:

y = 40 − 2x
Now substitute y in the objective function.
z ∗ = 60x + 80(40 − 2x) − 2x(40 − 2x) − x 2 − 2(40 − 2x)2
We use z ∗ instead of z to remind us that what we shall be
optimizing is the value of z provided that the constraint is satisfied.

z ∗ = 60x + 3200 − 160x − 80x + 4x 2 − x 2 − 2(1600 − 160x + 4x 2 )


= 140x − 5x 2
7.2 The method of substitution

dz ∗
= 140 − 10x = 0
dx
x = 14

and
d 2z ∗
= −10 < 0
dx 2
which implies that the function is maximum at x=14.
When x=14, y=40-2×14=12, so that

z = 60x + 80y − 2xy − x 2 − 2y 2


= ...........
= 980
7.2 The method of substitution
The plot of z ∗ against x is shown in Figure 7.3.

The figure shows that z ∗ parabola has its vertex above x=14. It
was purely convenience that we selected the variable y to be
substituted out.
7.2 The method of substitution (continued...)
§ Consider the problem:

Maximize z = −180y + x 2 y
Subject to 2x + y = 12

→ We can rewrite the constraint as

2x + y = 12
⇒y = 12 − 2x

Substituting the value of y into the objective function

z ∗ = −180(12 − 2x) + x 2 (12 − 2x)


= −2160 + 360x + 12x 2 − 2x 3
7.2 The method of substitution (continued...)
§ Consider the problem:

Maximize z = xy
Subject to x +y = 12
7.2 The method of substitution (continued...)
The most common type of constraint used in business and
economic models is linear, to which the method of substitution is
well suited. But it is possible to use the method with non-linear
constraint which can be expressed as an explicit function.
§ Consider the problem:

Maximize z = 30x + 5y
2
subject to 4x + 2y − 20 = 0
7.2 The method of substitution (continued...)
§ Consider the following problem:

Maximize z = wx + wy + xy + 6x
subject to 2x + y + w = 16
x + 3y − 2w = 23
7.2 The method of substitution (continued...)

§ Do Exercises 7.2
§ Problems: 1, 2, 3.
7.3 Lagrange multipliers and equality constraints

§ Consider the problem:

Maximize z = 60x + 80y − 2xy − x 2 − 2y 2


Subject to 2x + y = 40

Now express the constraint implicitly as

40 − 2x − y = 0

and incorporate the left hand side into a revised objective function:

L = 60x + 80y − 2xy − x 2 − 2y 2 + j(40 − 2x − y )


This is the Lagrangian function in which new unknown j is the
Lagrange multiplier. Note that L is the function of x, y, and j. If
j(40 − 2x − y ) is zero, L will have the same value as z.
7.3 Lagrange multipliers and equality constraints
(continued...)
Differentiate L partially with respect to x, y, and j.

∂L
Lx = = 60 − 2y − 2x − 2j = 0 (1)
∂x
∂L
Ly = = 80 − 2x − 4y − j = 0 (2)
∂y
∂L
Lj = = 40 − 2x − y = 0 (3)
∂j

x=?
y=?
j=?
The value of the objective function:
F=?
7.3 Lagrange multipliers and equality constraints
(continued...)
From (1)

60 − 2y − 2x − 2j = 0
⇒ j = 30 − y − x (4)
(2)⇒ 80 − 2x − 4y − j = 0
⇒ 80 − 2x − 4y − (30 − y − x) = 0
..............
⇒ 2x + 6y = 100 (5)
(3) ⇒ 2x + y = 40 (6)
(5)-(6)⇒
5y = 60
⇒y = 12
7.3 Lagrange multipliers and equality constraints
(continued...)
(6)⇒

2x + 12 = 40
⇒ 2x = 28
⇒x = 14

(4)⇒

j = 30 − 12 − 14
= 4

and the value of the objective function is

F = 60 × 14 + 80 × 12 − 2 × 12 × 14 − 142 − 2 × 122
= ........
= 980
7.3 Lagrange multipliers and equality constraints
(continued...)

Two questions here:


1. Is the point a local maximum of z subject to the constraint?
2. Is the point a constrained global maximum?

A sufficient second-order condition for a function of two variables


maximized subject to one equality constraint proves useful.
7.3 Lagrange multipliers and equality constraints
(continued...)

Given the problem:


Maximize f (x, y )
subject to g (x, y ) = 0
the Lagrangian for which will be

L(x, y , j) = f (x, y ) + j[g (x, y )]


then at the second-order it is sufficient that the value E defined by-

E = Lxx gy2 − 2Lxy gx gy + Lyy gx2


should be negative to maximize the objective function, where
7.3 Lagrange multipliers and equality constraints
(continued...)
where
∂2L
Lxx =
∂x 2
∂2L
Lxy =
∂x∂y
∂2L
Lyy =
∂y 2
∂g
gx =
∂x
∂g
gy =
∂y
Decisions:
I E < 0 implies constrained maximum
I E > 0 implies constrained minimum
I E = 0 implies no statement can be made on the basis of the
test about the nature of the stationary value.
7.3 Lagrange multipliers and equality constraints
(continued...)
Back to the current problem:

∂2L
From (1): Lxx = = −2
∂x 2
∂2L
From (2): Lyy = = −4
∂y 2
∂2L
From (1) or (2): Lxy = = −2
∂x∂y
∂g
gx = = −2
∂x
∂g
gy = = −1
∂y

where g = 40 − 2x − y [from constraint]


7.3 Lagrange multipliers and equality constraints
(continued...)

Now

E = (−2)(−1)2 − 2(−2)(−2)(−1) + (−4)(−2)2


= −2 + 8 − 16 = −10 < 0

which implies the point is a constrained maximum.


7.3.1 Minimization problem solved by Lagrange multipliers
Use Lagrangian method to solve the following problem.

Minimize F = 0.5x 2 + 8y 2 + 4xy − 80x − 240y + 5000


subject to 2.5x + 5y = 75


The Lagrangian function is

L = 0.5x 2 +8y 2 +4xy −80x−240y +5000+j(75−2.5x−5y ) .........(1)


and the first order conditions are:

Lx = x + 4y − 80 − 2.5j = 0 .............(2)
Ly = 16y + 4x − 240 − 5j = 0 ...........(3)
Lj = 75 − 2.5x − 5y = 0 ...................(4)
7.3.1 Lagrange multipliers (continued...)
(2)⇒
2.5j = x + 4y − 80
⇒ 5j = 2x + 8y − 160
(3)⇒
16y + 4x − 240 − 5j = 0
⇒ 16y + 4x − 240 − (2x + 8y − 160) = 0
⇒ ........
⇒ 8y + 2x − 80 = 0
⇒ x = 40 − 4y ...........(5)
(4)⇒
75 − 2.5(40 − 4y ) − 5y = 0
⇒ 75 − 100 + 10y − 5y = 0
⇒ 5y = 25
⇒ y =5
7.3.1 Lagrange multipliers (continued...)

(5)⇒

x = 40 − 4 × 5 = 20

(3)⇒

5j = 16 × 5 + 4 × 20 − 240
⇒ j = −16

Thus, we have x=20, y=5, and j= -16.


To check other conditions, we have:

Lxx = 1, Lyy = 16, Lxy = 4, gx = −2.5, gy = −5.


7.3.1 Lagrange multipliers (continued...)

These evaluates E as

E = 1(−5)2 − 2(4)(−2.5)(−5) + 16(−2.5)2


= 25 − 100 + 100 = 25 > 0

which is the required sign for a constrained minimum.


The minimum value of F with x=20, y=5 is

F = 0.5(20)2 + 8(5)2 + 4(20)(5) − 80(20) − 240(5) + 5000


= 3000
7.3.1 Lagrange multipliers (continued...)

Use Lagrangian method to solve the following problem.

Maximize z = 1000x + 200y − x 2 y − 55x 2


subject to 2x + y = 20

Done at class (also see page 268, FM Wilkes).

DO Exercise 7.3: Problems 1, 5.

You might also like