B For I 1,, M: N J J J
B For I 1,, M: N J J J
The firm’s profit from producing and selling x units is the sales revenue xp(x)
minus the production costs. That is, P(x) = xp(x) – cx.
If each of the firm’s products has a similar profit function, say, Pj(xj) for
producing and selling xj units of product j, then the overall objective function is
n
In actuality, the shipping costs may not be fixed. Volume discounts sometimes
are available for large shipments, which cause a piecewise linear cost function.
It is desired to know the conditions under which any local optimal is guaranteed
to be a global optimal.
If a nonlinear programming problem has no constraints, the objective
function being concave (convex) guarantees that a local maximum (minimum)
is a global maximum (minimum).
What is a concave (convex) function?
A function that is always ―curving downward‖ (or not curving at all) is called a
concave function.
1
1 2 1 2
x 2 x 2
2
x1 x2
1 2
2 f (x , x ) 0 0
1 2
x 2
1
2 f (x , x ) 0 0
1 2
x 2
2
,
Example: f (x , x ) x 2 2x x x 2
1 2 1 1 2 2
If there are constraints, then one more condition will provide the guarantee,
namely, that the feasible region is a convex set.
Convex set
A convex set is a collection of points such that, for each pair of points in the
collection, the entire line segment joining these two points is also in the
collection.
What happens when just one of these gi(x) is a concave function instead?
Max Z = 3x1 + 5x2
S.T. x1 4
2x2 14
8x1 – x12 + 14x2 – x22 49
x1 , x2 0
Iteration:
df ( x)
Evaluate at x x' .
dx
df (x)
If 0 , reset x x ' .
dx
df (x)
If 0 , reset x x ' .
dx
xx
Select a new x
'
.
2
'
df(x)/dx x x New x f (x ' )
0
1
2
3 4.09 0.75 1 0.875 7.8439
4 -2.19 0.75 0.875 0.8125 7.8672
5 1.31 0.8125 0.875 0.84375 7.8829
6 -0.34 0.8125 0.84375 0.828125 7.8815
7 0.51 0.828125 0.84375 0.8359375 7.8839
,
Newton’s Method
The bisection method converges slowly.
Only take the information of first derivative into account.
The basic idea is to approximate f(x) within the neighborhood of the current trial
solution by a quadratic function and then to maximize (or minimize) the
approximate function exactly to obtain the new trial solution.
This quadratic function can be optimized in the usual way by setting its first
derivative to zero and solving for xi+1.
f ' (x )
Thus, xi1
xi i'' .
f (xi )
Example: Max f(x) = 12x – 3x4 – 2x6 (same as the bisection example)
f ' (x )
xi1 xi ''i
f (xi )
Select 0.00001, and choose x1 = 1.
Iteration i xi f (xi ) f ' (x ) f '' (x ) xi+1
i i
1
2
3 0.84003 7.8838 -0.1325 -55.279 0.83763
4 0.83763 7.8839 -0.0006 -54.790 0.83762
Multivariable Unconstrained Optimization
Usually, there is no analytical method for solving the system of equations given
by setting the respective partial derivatives equal to zero.
Thus, a numerical search procedure must be used.
,
A natural approach is to use the values of the partial derivatives to select the
specific direction in which to move.
f f f
The gradient at point x = x’ is f (x) = ( , ,..., ) at x = x’.
x1 xx xn
The direction of the gradient is interpreted as the direction of the directed line
f f ,..., f
segment from the origin to the point ( , ) , which is the direction of
x1 xx xn
changing x that will maximize f(x) change rate.
However, normally it would not be practical to change x continuously in the
direction off (x), because this series of changes would require continuously
f
reevaluating the and changing the direction of the path.
xi
A better approach is to keep moving in a fixed direction from the current trial
solution, not stopping until f(x) stops increasing.
The stopping point would be the next trial solution and reevaluate gradient. The
gradient would be recalculated to determine the new direction in which to move.
Reset x’ = x’ + t* f (x’), where t* is the positive value that maximizes
f(x’+t* f(x’)) =
The iterations continue until f (x) 0 with a small tolerance .
x j
j = 1, 2,…, n, and then substituting these expressions into f(x).
f
Stopping Rule: Evaluate f(x’) at x = x’. Check if , for all j = 1,2,…, n.
xi
If so, stop with the current x’ as the desired approximation of an optimal solution
x*. Otherwise, perform another iteration.
Example for multivariate unconstraint nonlinear programming
Max f(x) = 2x1x2 + 2x2 – x12 – 2x 22
f f
2x2 2x1 , 2x1 2 4x2
x1 x2
We verify that f(x) is .
Suppose pick x = (0, 0) as the initial trial solution.
f (0,0)
Iteration 1: x = (0, 0) + t(0, 2) = (0, 2t)
Iteration x' f (x ' ) x' tf (x ' ) f (x' tf (x' )) t* x ' t *f (x ' )
1
2
Assume that f(x) is a concave function and that g1(x), g2(x), …, gm(x) are
convex functions. Then x* = (x 1*, x *2, … , x *n) is an optimal solution if and only
if all the KKT conditions are satisfied.
An Example
Max f(x) = ln(x1 + 1) + x2
S.T. 2x1 + x2 3
x1 , x2 0
n = 2; m = 1; g1(x) = 2x1 + x2 is convex; f(x) is concave.
1
1. ( j = 1) 2u1 0
x1 1
1
2. ( j = 1) x1 ( 2u1 ) 0
x1 1
1. (j = 2) 1 u1 0
2. (j = 2) x2 (1 u1 ) 0
3. 2x1 x2 3 0
4. u1 (2x1 x2 3) 0
5. x1 0, x2 0
6. u1 0
Therefore, There exists a u1 = 1 such that x1 = 0, x2 = 3, and u1 = 1 satisfy KKT
conditions. The optimal solution is (0, 3).
How to solve the KKT conditions
Sorry, there is no easy way.
In the above example, there are 8 combinations for x1( 0), x2( 0), and u1( 0).
Try each one until find a fit one.
What if there are lots of variables?
Quadratic Programming
Max f(x) = cx – 1/2 xTQx
S.T. Ax b
x0
j 1 c j xj 12 qij xi x j .
n n n
The objective function is f(x) = cx – 1/2 xTQx
i1 j 1
The qij are elements of Q. If i = j, then xixj = xj2, so –1/2qij is the coefficient of
xj2. If i j, then –1/2(qij xixj + qji xjxi) = –qij xixj, so –qij is the coefficient for the
product of xi and xj (since qij = qji).
An example
Max f(x1, x2) = 15x1 + 30x2 + 4x1x2 – 2x12 – 4x 22
S.T. x1 + 2x2 30
x1 , x2 0
Introduce slack variables (y1, y2, and v1) for condition 1 (j=1), 1 (j=2), and 3.
1. (j = 1) – 4x1 + 4x2 – u1 + y1 = –15
1. (j = 2) 4x1 – 8x2 – 2u1 + y2 = –30
3. x1 + 2x2 + v1 = 30
Notice that the last m equations are equivalent to the constraints in the
original problem, so only feasible solutions are considered.
Back to our example
h(x1, x2) = x12 + 2x2 – ( x1 2 + x22 – 1).
h =
x1
h
=
x21
h
=
,
ii i 1 2 3
i1
When all the ci are strictly positive and the objective function is to be
minimized, this geometric programming can be converted to a convex
programming problem by setting x j e y . j
Fractional Programming
Suppose that the objective function is in the form of a (linear) fraction.
Maximize f(x) = f1(x) / f2(x) = (cx + c0) / (dx + d0).
Also assume that the constraints gi(x) are linear. Ax b, x 0.
We can transform it to an equivalent problem of a standard type for which
effective solution procedures are available.
We can transform the problem to an equivalent linear programming
problem by letting y = x / (dx + d0) and t = 1 / (dx + d0), so that x = y/t.
The original formulation is transformed to a linear programming problem.
Max Z = cy + c0t
S.T. Ay – bt 0
dy + d0t = 1
y,t0