• Ingen resultater fundet

Solution Methods

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "Solution Methods"

Copied!
39
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

Solution Methods

Richard Lusby

Department of Management Engineering Technical University of Denmark

(2)

Lecture Overview

(jg

Unconstrained Several Variables Quadratic Programming Separable Programming SUMT

(3)

One Variable Unconstrained Optimization

(jg

Let’s consider the simplest case: Unconstrained optimization with just a single variable x, where the differentiable function to be maximized is concave

The necessary and sufficient condition for a particular solutionx =x to be a global maximum is:

df

dx = 0 x=x If this can be solved directly you are done What if it cannot be solved easily analytically?

We can utilize search procedures to solve itnumerically

(4)

Bisection Method

One Variable Unconstrained Optimization(jg

Can always be applied when f(x) concave It can also be used for certain other functions

Ifx denotes the optimal solution, all that is needed is that df

dx >0 if x<x df

dx = 0 if x=x df

dx <0 if x>x

These conditions automatically hold when f(x) is concave The sign of the gradient indicates the direction of improvement

(5)

Example

(jg

f(x) df

dx = 0

(6)

Bisection Method

Overview(jg

Bisection

Given two values, x <x, with f0(x)>0, f0(x)<0 Find the midpoint ˆx = x+x2

Find the sign of the slope of the midpoint The next two values are:

I x= ˆx iff0x)<0

I x= ˆx iff0x)>0

What is the stopping criterion?

x−x <2

(7)

Bisection Method

Overview(jg

Bisection

Given two values, x <x, with f0(x)>0, f0(x)<0 Find the midpoint ˆx = x+x2

Find the sign of the slope of the midpoint The next two values are:

I x= ˆx iff0x)<0

I x= ˆx iff0x)>0

What is the stopping criterion?

x−x <2

(8)

Bisection Method

Example(jg

The Problem

maximize f(x) = 12x−3x4−2x6

(9)

Bisection Method

What does the function look like?(jg

0.5 1.0 1.5

1 2 3 4 5 6 7 8 9

−1

−2

(10)

Bisection Method

Calculations(jg

Iteration f0(ˆx) x x ˆx f(ˆx)

0 0 2 1 7.0000

1 -12.00 0 1 0.5 5.7812

2 10.12 0.5 1 0.75 7.6948

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

x≈0.836 0.828125<x <0.84375

f(x) = 7.8839

(11)

Bisection Method

Continued(jg

Intuitive and straightforward procedure Converges slowly

An iteration decreases the difference between the bounds by one half Only information on the derivative of f(x) is used

More information could be obtained by looking atf00(x)

(12)

Newton Method

Introduction(jg

Basic Idea: Approximatef(x) within the neighbourhood of the current trial solution by a quadratic function

This approximation is obtained by truncating the Taylor series after the second derivative

f(xi+1)≈f(xi) +f0(xi)(xi+1−xi) +f00(xi)

2 (xi+1−xi)2 Having set xi at iteration i, this is just a quadratic function of xi+1

Can be maximized by setting its derivative to zero

(13)

Newton Overview

max f(xi+1)≈f(xi) +f0(xi)(xi+1−xi) + f00(xi)

2 (xi+1−xi)2 f0(xi+1)≈f0(xi) +f00(xi)(xi+1−xi)

xi+1=xi − f0(xi) f00(xi) What is the stopping criterion?

|xi+1−xi|<

(14)

Newton Overview

max f(xi+1)≈f(xi) +f0(xi)(xi+1−xi) + f00(xi)

2 (xi+1−xi)2 f0(xi+1)≈f0(xi) +f00(xi)(xi+1−xi)

xi+1=xi − f0(xi) f00(xi) What is the stopping criterion?

|xi+1−xi|<

(15)

Same Example

(jg

The Problem

maximize: f(x) = 12x−3x4−2x6

f0(x) = 12−12x3−12x5 f00(x) =−36x3−60x4

xi+1 =xi+1−x3−x5 3x3+ 5x4

(16)

Newton Method

The function again(jg

0.5 1.0 1.5

1 2 3 4 5 6 7 8 9

−1

−2

(17)

Newton Method

Calculations(jg

Iteration xi f(xi) f0(xi) f00(xi) f(ˆx)

1 1 7 -12 -96 0.875

2 0.875 7.8439 -2.1940 -62.733 0.84003 3 0.84003 7.8838 -0.1325 -55.279 0.83763 4 0.83763 7.8839 -0.0006 -54.790 0.83762

x= 083763 f(x) = 7.8839

(18)

Several variables

Newton still works(jg

Newton: Multivariable

Given x1, the next iterate maximizes the quadratic approximation f(x1) +∇f(x1)(x−x1) + (x−x1)TH(x1)(x−x1)

2 x2=x1−H(x1)−1∇f(x1)T

Gradient search

The next iterate maximizes f along the gradient ray

maximize: g(t) =f(x1+t∇f(x1)T) s.t. t≥0 x2=x1+t∇f(x1)T

(19)

Example

(jg

The Problem

maximize: f(x,y) = 2xy+ 2y−x2−2y2

(20)

Example

Continued(jg

The vector of partial derivatives is given as

∇f(x) = ∂f

∂x1

, ∂f

∂x2

, . . . , ∂f

∂xn

Here ∂f

∂x = 2y−2x

∂f

∂y = 2x+ 2−4y

Suppose we select the point (x,y)=(0,0) as our initial point

∇f(0,0) = (0,2)

(21)

Example

Continued(jg

Perform an iteration

x = 0 +t(0) = 0 y = 0 +t(2) = 2t Substituting these expressions inf(x) we get

f(x+t∗ ∇f(x)) =f(0,2t) = 4t−8t2 Differentiate wrt to t

d

dt(4t−8t2) = 4−16t = 0

1 1 1

(22)

Example

Perform a second iteration(jg

Gradient atx= (0,12) is∇f(0,12) = (1,0) Determine step length

x=

0,1 2

+t(1,0) Substituting these expressions inf(x) we get

f(x+t∗ ∇f(x)) =f

t,1 2

=t−t2+1 2 Differentiate wrt to t

d

dt(t−t2+1

2) = 1−2t = 0 Therefore t = 12, andx= 0,12

+12(1,0) = 12,12

(23)

1 y

0,12 1

2,12

1

2,34 3

4,34

3

4,78 7

8,78

(24)

Quadratic programming

(jg

maximize: cTx−12xTQx

subject to: Ax ≤b (λ)

x ≥0 (µ) Q is symmetric and positive semidefinite

Lagrangian:

L(x,λ,µ) =cTx−1

2xTQx+λT(b−Ax) +µTx Applying KKT yields

Qx+ATλ−µ=c Ax+v=b

x,λ,µ,v≥0

xTµ= 0,λTv= 0 complementarity constraints

(25)

Example

(jg

Problem

minimize: f(x) subject to: g1(x) ≤0

g2(x) ≤0 KKT Conditions

∇f(x) +u1∇g1(x) +u2∇g2(x) =0 u1g1(x) =0

u1≥0 u2g2(x) =0

(26)

QP solution

(jg

KKT Conditions

Qx+ATλ−µ =c Ax+v =b x,λ,µ,v ≥0 xTµ = 0 λTv = 0

Add artificial variables to constraints with positivecj

Subtract artificial variables to constraints with negative bi

Initial basic variables are artificial variables some ofµ, and some ofv Do phase 1 of the Simplex method with a restricted entry rule,

I Ensures complementarity constraints are always satisfied

(27)

Example

(jg

The Problem

maximize: 15x+ 30y+ 4xy−2x2−4y2

subject to: x+ 2y ≤30

x,y ≥0

(28)

Example

Continued(jg

The Parameters are as follows:

c=

"

15 30

# ,A=

"

1 2

# ,x=

"

x y

# ,Q =

"

4 −4

−4 8

#

,b= 30 The Non-Linear Component of the objective function is

−1

2xTQx=−2x2+ 4xy−4y2

(29)

Example

New Linear Program(jg

Minimize: Z =z1+z2

subject to: 4x−4y+λ1−µ1+z1 = 15

−4x+ 8y+ 2λ1−µ2+z2 = 30

x+ 2y+v1 = 30

x,y, λ1, µ1, µ2,v1,z1,z2 ≥0 Complementarity Conditions

1 = 0,yµ2 = 0,v1λ1 = 0

(30)

Modified Simplex

Initial Tableau(jg

BV Z x y λ1 µ1 µ2 v1 z1 z2 rhs

Z -1 0 -4 -3 1 1 0 0 0 -45

z1 0 4 -4 1 -1 0 0 1 0 15

z2 0 -4 8 2 0 -1 0 0 1 30

v1 0 1 2 0 0 0 1 0 0 30

(31)

Modified Simplex

First Pivot(jg

BV Z x y λ1 µ1 µ2 v1 z1 z2 rhs

Z -1 -2 0 -2 1 12 0 0 12 -30

z1 0 2 0 2 -1 -12 0 1 12 30 y 0 -12 1 14 0 -18 0 0 18 308 v1 0 2 0 -12 0 14 1 0 -14 452

(32)

Modified Simplex

Second Pivot(jg

BV Z x y λ1 µ1 µ2 v1 z1 z2 rhs Z -1 0 0 -52 1 34 1 0 14 -152 z1 0 0 0 52 -1 -34 -1 1 34 152

y 0 0 1 18 0 -161 14 0 161 758 x 0 1 0 -14 0 18 12 0 -18 454

(33)

Modified Simplex

Final Tableau(jg

BV Z x y λ1 µ1 µ2 v1 z1 z2 rhs

Z -1 0 0 0 0 0 0 1 1 0

λ1 0 0 0 1 -25 -103 -25 25 103 3

y 0 0 1 0 201 -401 103 -201 401 9 x 0 1 0 0 -101 201 25 101 -201 12

(34)

Separable Programming

(jg

The Problem

maximize: P

jfj(xj) subject to: Ax ≤b

x ≥0

Each fj is approximated by a piece-wise linear function f(y) =s1y1+s2y2+s3y3

y =y1+y2+y3

0 ≤y1 ≤u1

0 ≤y2 ≤u2

0 ≤y3 ≤u3

(35)

Separable Programming

Continued(jg

Special restrictions:

I y2= 0 whenevery1<u1

I y3= 0 whenevery2<u2 If eachfj is concave,

I Automatically satisfied by the simplex method Why?

(36)

Sequential Unconstrained Minimization Technique

(jg

The Problem

maximize: f(x) subject to: g(x) ≤b

x ≥0

For a sequence of decreasing positiver’s, solve maximizef(x)−rB(x)

B is a barrier function approaching∞ as a feasible point approaches the boundary of the feasible region

For example

B(x) =X

i

1

bi−gi(x) +X

j

1 xj

(37)

The Problem

maximize: xy subject to: x2+y ≤3

x,y ≥0

r x y

1 1

1 0.90 1.36

10−2 0.987 1.925 10−4 0.998 1.993 Class exercise

(38)

Class exercises

(jg

Separable programming

maximize: 32x−x4+ 4y−y2 subject to: x2+y2 ≤9

x,y ≥0

Formulate this as an LP model using x= 0,1,2,3 and y = 0,1,2,3 as breakpoints for the approximating piece-wise linear functions

(39)

Class exercises

Continued(jg

Sequential Unconstrained Minimization Technique

Iff is concave and gi is convex ∀i, show that the following is concave f(x)−r

(X

i

1

bi−gi(x) +X

j

1 xj

Referencer

RELATEREDE DOKUMENTER

Finds the minimizer to an unconstrained optimization problem given by fun() by using the Quasi-Newton BFGS method. Extra parameters may be sent using the

A solution approach need only consider extreme points A constraint of a linear program is binding at a point x 0 if the inequality is met with equality at x 0.. It is

Considering our hypotheses, each of them consists of a necessary and sufficient condition to fulfil them. In the case of our progressing product life cycle hypothesis, the

The simplest way of formalising the Nelson and Winter theory of the firm in a way which opens up for a subsequent specialisation of firms is to consider the overall task of

Focusing on the unconstrained estimates in Panel E, we estimate a concave utility function over gains (&#34;&lt;1), a convex utility function over losses ($&lt;1), evidence of

THE SOLUTION MUST BE ABLE TO BOUNCE THE SOLUTION SHOULD BE USED IN A CAR THE SOLUTION SHOULD DEVELOP THE USER’S PEDAGOGICAL

Until now I have argued that music can be felt as a social relation, that it can create a pressure for adjustment, that this adjustment can take form as gifts, placing the

implicitly: When looking for the next basic variable, solve an optimization problem, finding the variable (column) with the most negative reduced cost.... c B is the cost vector for