Professional Documents
Culture Documents
University
c of Waterloo 1 / 20
Constrained Optimization
University
c of Waterloo 2 / 20
Modeling: Linear Programs
University
c of Waterloo 3 / 20
Affine Functions
Definition
A function f : Rn → R is affine if f (x) = aT x + β for a ∈ Rn , β ∈ R.
It is linear if, in addition, β = 0.
Example
(i) f (x) = 2x1 + 3x2 − x3 + 7 (affine, but not linear)
(ii) f (x) = −3x1 + 5x3 (linear)
√
(iii) f (x) = 5x − 3 cos(x) + x (not affine and not linear)
University
c of Waterloo 4 / 20
Definition
The optimization problem
Comments:
• Instead of set notation, we often write
LPs more verbosely. max − 2x1 + 7x3
• Often give non-negativity constraints subject to x1 + 7x2 ≤ 3
separately 3x2 + 4x3 ≤ 2
• May use max instead of min x1 , x3 ≥ 0
• Sometimes replace subject to by s.t.
University
c of Waterloo 5 / 20
• We often write x ≥ 0 as a min − x1 − 2x2 − x3
short form for all variables s.t. 2x1 + x3 ≥ 3
are non-negative. x1 + 2x2 = 2
x≥0
University
c of Waterloo 6 / 20
Production Revisited
University
c of Waterloo 7 / 20
Multiperiod Models
University
c of Waterloo 8 / 20
A main feature of the WaterTech production model:
Decisions about production levels have to be made once and for all.
In practice, we often have to make a series of decisions that influence
each other.
One such example is multiperiod models:
• Time is split into periods.
• We have to make a decision in each period.
• All decisions influence the final outcome.
University
c of Waterloo 9 / 20
KW Oil
University
c of Waterloo 10 / 20
KW Oil
Question: When should we purchase how much oil when the goal is to
minimize overall total cost?
Additional Complication: The company has a storage tank that
• has a capacity of 4000 litres of oil, and
• currently (beginning of month 1) contains 2000 litres of oil.
University
c of Waterloo 11 / 20
KW Oil Model – Variables
Month 1 2 3 4
Demand (`) 5000 8000 9000 6000
Month 1 2 3 4
Price ($/`) 0.75 0.72 0.92 0.90
(i) Need to decide how many litres of oil to purchase in each month i.
−→ variable pi for i ∈ [4]
(ii) How much oil is stored in the tank at beginning of month i?
−→ variable ti for i ∈ [4]
University
c of Waterloo 12 / 20
Objective Function
Constraints: When do
t1 , . . . , t4 , p1 , . . . , p4
University
c of Waterloo 13 / 20
Constraints
Assumptions:
(i) Oil is purchased
at beginning of
month. Time
beginning of end of
(ii) Oil is consumed month i month i
afterwards.
Variables:
pi : oil purchased in month i
ti : tank level in month i
University
c of Waterloo 14 / 20
Constraints
University
c of Waterloo 15 / 20
KW Oil: Entire LP
University
c of Waterloo 16 / 20
KW Oil: Add-Ons
pi ≤ M
University
c of Waterloo 18 / 20
Minimizing the Maximum Purchase: LP
min M
s.t.
p 1 + t1 = 5000 + t2
p 2 + t2 = 8000 + t3
p 3 + t3 = 9000 + t4
p 4 + t4 ≥ 6000
t1 = 2000
ti ≤ 4000 (i = 2, 3, 4)
pi ≤ M (i = 1, 2, 3, 4)
ti , pi ≥ 0 (i = 1, 2, 3, 4)
University
c of Waterloo 19 / 20
KW Oil: Correctness
University
c of Waterloo 20 / 20