20
Optimization Optimization unconstrained and unconstrained and constrained constrained Calculus part II

Optimization unconstrained and constrained Calculus part II

Embed Size (px)

Citation preview

Page 1: Optimization unconstrained and constrained Calculus part II

OptimizationOptimizationunconstrained and unconstrained and

constrained constrained

Calculus part II

Page 2: Optimization unconstrained and constrained Calculus part II

Setting-Up Optimization Setting-Up Optimization

ProblemsProblems

• Define the agent’s goal: objective function and identify the agent’s choice (control) variables

• Identify restrictions (if any) on the agent’s choices (constraints). If no constraints exist, then we have unconstrained minimization or maximization problems.

If constraints exist, what type? Equality Constraints (Lagrangian)Inequality Constraints (Linear Programming)

Page 3: Optimization unconstrained and constrained Calculus part II

Mathematically,Optimize y = f(x1, x2, . . . ,xn)

subject to (s.t.)gj (x1, x2, . . . ,xn) ≤ bj

or= bj j = 1, 2, . . ., m.

or

≥ bj

y = f(x1, x2, . . . ,xn) → objective function

x1, x2, . . . ,xn → set of decision variables (n)optimize → either maximize or minimize

gi(x1, x2, . . . ,xn) → constraints (m)

Page 4: Optimization unconstrained and constrained Calculus part II

Constraints refer to

• restrictions on resources• legal constraints• environmental constraints• behavioral constraints

Page 5: Optimization unconstrained and constrained Calculus part II

Review of DerivativesReview of Derivatives• y=f(x): First-order condition:

• Second-order condition: • Constant function:• Power function:• Sum of functions:

• Product rule:

• Quotient rule:

• Chain rule:

)(' xfdx

dy

)(''2

2

xfdx

yd

axfy )( 0)(' xfbaxxfy )( 1)(' bbaxxf

)()( xgxfy )(')(' xgxfdxdy

)()( xgxfy )(')()()(' xgxfxgxfdxdy

)(

)(

xg

xfy

2)(

)(')()()('

xg

xgxfxgxfdxdy

))(( xgfy )('))((' xgxgfdxdy

Page 6: Optimization unconstrained and constrained Calculus part II

Unconstrainted UnivariateUnconstrainted UnivariateMaximization Problems: max Maximization Problems: max

ff((xx))• Solution:

• Derive First Order Condition (FOC): f’(x)=0• Check Second Order Condition (SOC): f’’(x)<0

• Local vs. global: If more than one point satisfy both FOC and SOC, evaluate the objective function at each point to identify the maximum.

Page 7: Optimization unconstrained and constrained Calculus part II

ExampleExamplePROFIT = -40 + 140Q – 10Q2

Find Q that maximizes profit

Page 8: Optimization unconstrained and constrained Calculus part II

ExampleExamplePROFIT = -40 + 140Q – 10Q2

Find Q that maximizes profit

140 – 20Q = set 0

Q = 7

- 20 < 0

max profit occurs at Q = 7max profit = -40 + 140(7) – 10(7)2

max profit = $450

dQ

dPROFIT

2

2

dQ

PROFITd

Page 9: Optimization unconstrained and constrained Calculus part II

Minimization Problems: Minimization Problems: Min Min ff((xx))• Solution:

• Derive First Order Condition (FOC): f’(x)=0• Check Second Order Condition (SOC): f’’(x)>0

• Local vs. global: If more than one point satisfy both FOC and SOC, evaluate the objective function at each point to identify the minimum.

Page 10: Optimization unconstrained and constrained Calculus part II

ExampleExampleCOST = 15 - .04Q + .00008Q2

Find Q that minimizes cost

Page 11: Optimization unconstrained and constrained Calculus part II

ExampleExample

COST = 15 - .04Q + .00008Q2

Find Q that minimizes cost

-.04 + .00016Q = set 0

Q = 250

.00016 > 0

Minimize cost at Q = 250min cost = $10

dQ

dCOST

2

2

dQ

COSTd

Page 12: Optimization unconstrained and constrained Calculus part II

Unconstrained Unconstrained Multivariate OptimizationMultivariate Optimization

0),(g2

2

zxx

yxx

• Max

• FOC:

• SOC:

),( zxgy

),( zxgxy

x ),( zxgz

yz

0),(g zz2

2

zxz

y

0),(),(),(),(22

2

2

2

2

zxzxzxzx xz

yzxy

z

y

x

y

Page 13: Optimization unconstrained and constrained Calculus part II

ExampleExample

2122

2121 681010014060 QQQQQQPROFIT

Find Q1 and Q2 that maximize Profit

Page 14: Optimization unconstrained and constrained Calculus part II

ExampleExamplePROFIT is a function of the output of two products

(e.g.heating oil and gasoline)Q1 Q2

Solve Simultaneously Q1 = 5.77 units Q2 = 4.08 units

0616100 122

setQQdQ

dPROFIT

100166

140620

21

21

QQ

QQ

2122

2121 681010014060 QQQQQQPROFIT

0620140 211

setQQdQ

dPROFIT

Page 15: Optimization unconstrained and constrained Calculus part II

Second-Order Second-Order ConditionsConditions

202

1

2

dQ

PROFITd 621

2

dQdQ

PROFITd

1622

2

dQ

PROFITd

02

21

2

22

2

21

2

dQdQ

PROFITd

dQ

PROFITd

dQ

PROFITd

(-20)(-16) – (-6)2 > 0

320 – 36 > 0

we have maximized profit.

Page 16: Optimization unconstrained and constrained Calculus part II

Constrained Constrained OptimizationOptimization

• Solution: Lagrangian Multiplier Method• Maximize y = f(x1, x2, x3, …, xn)

• s.t. g(x1, x2, x3, …, xn) = b• Solution:

• Set up Lagrangian:

• FOC:

.),...,,(),...,,(),,...,,( 212121 bxxxgxxxfxxxL nnn

0),...,2,1(),,...,2,1(

0),,...,2,1(

...

0),,...,2,1(1

bxnxxgxnxxL

xnxxL

xnxxL

xn

x

Page 17: Optimization unconstrained and constrained Calculus part II

Lagrangian MultiplierLagrangian Multiplier

• Interpretation of Lagrangian Multiplier λ: the shadow value of the constrained resource.

o If the constrained resource increases by 1 unit, the objective function will change by λ units.

Page 18: Optimization unconstrained and constrained Calculus part II

ExampleExampleMaximize Profit =

subject to (s.t.) 20Q1 + 40Q2 = 200 Could solve by direct substitution

Note that 20Q1 = 200 – 40Q2 → Q1 = 10 – 2Q2

Maximize Profit =

2122

2121 681010014060 QQQQQQ

2222

2)222 )10(68210(10100)210(14060 QQQQQQ

units 56.5

units 22.2

1

2

Q

Q

Page 19: Optimization unconstrained and constrained Calculus part II

Lagrangian Multiplier MethodLagrangian Multiplier Method

)2004020(

681010014060L

Function Lagrangian Formulate

21

2122

2121PROFIT

QQ

QQQQQQ

0set )2004020(L

0set 40616100L

0set 20620140L

.,, are ariablesDecision v

.2004002 as long asfunction profit theMaximizes L Maximizing

2profit

122

profit

211

profit

21

21profit

QQd

d

QQdQ

d

QQdQ

d

QQ

QQ

Page 20: Optimization unconstrained and constrained Calculus part II

.constraint theof valuein the changeunit one a from resulting

function objective theof valuein the change themeasures

.774

units 22.2 and units 56.5en Wh

before asanswer Same

units 22.2

units 56.5

20040 20 also

180434

or

.1661001240280 Therefore,

21

2

1

21

21

2121

QQ

Q

Q

QQ

QQ

QQQQ