System Planning 04 Lecture 7, F7: Optimization
System Planning 04 Lecture 7, F7: Optimization Course goals Appendi A Content: Generally about optimization Formulate optimization problems Linear Programming (LP) Mied Integer Linear Programming (MILP)
Course Goals Short term planning To pass the course, the students should show that they are able to formulate short-term planning problems of hydro-thermal power systems, To receive a higher grade the students should also show that they are able to create specialised models for short-term planning problems, Computation Ability solving short-term planning problems essential Computation, not a goal, not eamined Home assignments give bonus points some are mandatory
Optimization Generally (/) Applied mathematics Application: technology, science, economics, etc. Something to be maimized or minimized Profit, cost, energy, speed, losses Given some constraints Physical, technical, economical, legal, etc.
Optimization Generally (/) In general form min f( ), subject to g ( ) b h ( ) = c Constraints f objective function optimization variable (multidimensional, e.g. vector) g, h constraints (multidimensional, e.g. vector), variable bounds (like the variable)
Optimization Formulating problems (/6). Formulate it verbally:. Think the problem through. Define denotations. Which parameters and variables are needed? 3. Formulate the problem in equation form. That is; define the objective and constraints ( and 3 are interrelated)
Optimization Formulating problems (/6) Eample: A corporation owns a number of factories How to deliver items to consumers??
Optimization Formulating problems (3/6). Formulate verbally:. How to deliver the goods, while. Minimizing the transport costs? 3. Subject to:.each factory's production capacity limit.fulfil the consumer demand
Optimization Formulating problems (4/6). Define denotations:. Indices and parameters:. m factories, factory i has the capacity a i. n customers, customer j demands b j units 3. Transportation costs from factory i to customer j is c ij per unit. Variables. Let ij, i =,..., m, j =,..., n denote the number of units transported from factory i to customer j
Optimization Formulating problems (5/6) 3. Formulate the problem mathematically: Objective function Transportation cost: m n i= j= c ij ij Constraints Production capacity: Demand: Variable bounds: n j= m i= ij ai i =... m ij b j j =... n ij 0 i =... m, j =... n
Optimization Formulating problems (6/6) The optimization problem: min m i= j= n s.t. a, i =... m j= n m b, j =... n i= ij ij ij ij i j 0, i =... m, j =... n ij c
LP Generally (/) Linear problems (LP-problems) A class of optimization problems Linear objective, linear constraints All LPs may be formulated (standard form): T min c subject to A = b 0
LP Generally (/) Various types of LP-problems eplained Eamples similar to those in Appendi A We will study: Etreme points Slack variables No feasible solution Inactive constraints Unbounded problem Degenerate problem Flat optimum Dual formulation Solution methods
LP Basic Eample (/) The problem: min z = 5 + 0 subject to + 4 + 0, 0
LP Basic Eample (/) Optimum at: =.5 = 0.5 Objective value: z =.5
LP Etreme points Corners in feasible space Denoted etreme points Optimum always in etreme point(s) 4 3 0 0 z = 0 z = 30 z = 40 3 4 + 4 +
LP Slack variables (/) LP-problem in standard form: min s.t. T c A = b 0 Introduce slack variables All constraints can be equalities
LP Slack variables (/) Without slack variables (A b) : 0 0, 4 + + 0 0, 0, 0, 4 4 3 4 3 = + = + With slack variables (A = b):
LP Infeasible problem (/) Feasible space empty Bad formulation min z = 5 + 0 s.t. + 4 + + 0, 0 Added constraint
LP Infeasible problem (/) 4 (a) + + (c) Feasible space following (c) 3 0 0 Feasible following (a) & (b) 4 + 3 4 (b)
LP Inactive Constraints (/) Some constraints does not constrain Given the objective min z = 5 + 0 subject to + 4 + + 7 0, 0 Added constraint
LP Inactive Constraints (/) Active constraints + 4 + 4 z = 40 3 z = 30 z = 0 0 0 3 4 + 7 Inactive constraints (Some algorithms like it!)
LP Unbounded Problem (/) If no constraint is active The objective is unbounded z min z = Objective function modified subject to + 4+ 0, 0
LP Unbounded Problem (/) + 4 3 z = -3 z = -4 z = -5 min z 4 + 0 0 3 4
LP Degenerate solution (/) More than one etreme point optimal All linear combination of these optimal min z = 0 + 0 subject to + 4 + 0, 0 New objective function
LP Degenerate solution (/) Line between etreme points optimal
LP Flat optimum (/) Etreme points with similar objective values min z = 0 + 9.99 subject to + 4 + 0, 0 New objective function
LP Flat optimum (/)
LP Duality (/5) Any LP problem (primal problem) has a corresponding dual problem Primal problem: T min c subject to A = b 0 Dual problem: T ma b λ λ subject to A T λ c λ 0 λ is said to be a dual variable
LP Duality (/5) Theorem (strong duality): If the primal problem has an optimal solution, then also the dual problem has an optimal solution. The objective values of these two problems equals.
LP Duality (3/5) min subject to T c A = b 0 One dual variable for each constraint! Question: What dual variables technically describe? Answer: Marginal value of the corresponding constraint i.e. objective value s dependence on RHS
LP Duality (4/5) In optimum: λ > 0 (active) λ > 0 (active) λ 3 = 0 (inactive)
LP Duality (5/5) Dual variables: λ Small perturbations in the right-hand-side, b Changes in the objective value, z: z = λ T b
MILP Generally Mied Integer Linear Programming problems Class of optimization problems Linear objective functions and linear constraints Some variables may be integers min z = such that A = b 0 T c { } { }, i,,..., m i, i m+, m+,..., n i i = n
MILP Eample + 4 3 Optimum at: = (.5) = (0.5) 4 + 0 0 3 4 z = 40 z = 30 z = 0 Optimal objective: z = 5 (.5)
MILP Solution Integer variables are easily implemented Integer problems generally hard to solve Computation time may increase eponentially If possible, avoid integer variables! Special case integer variable: binary variable {0,}
MILP Applying Binary Variable (/6) Minimize cost buying certain product Variable, 0: amount of the product, Decreasing marginal cost, e.g.: Economies of scale (outside this course, square root) Volume discount Cost [SEK] b Amount consumed
MILP Applying Binary Variable (/6) Split up in two variables = + b Cost [SEK] z = c + c c > c b Amount consumed
MILP Applying Binary Variable (3/6) Segment cheaper Prevent being positive as long < b Typically done by using binary variable Cost [SEK] b Amount consumed
MILP Applying Binary Variable (4/6) Introduce the binary variable s And the constraints s 0 + Ms 0 b Note: In real-life, M not arbitrary Cost [SEK] b Amount consumed s=0 s=
MILP Applying Binary Variable (5/6) Sizing of parameter M Not a part of the course subject to: ( m) Or, simpler M = min m, ( ) min z = + m + 0 m> 0 m ( ) M = min Cost [SEK] b s=0 s= Amount consumed
If s=0: 0 0 0, 0 = If s=: M M b b b + = 0 0, Cost [SEK] Amount consumed b s=0 s= 0 0 + Ms s b MILP Applying Binary Variable (6/6)
End of lecture 7 Net time short-term planning