IE437 · Data-Driven Decision Making and Control — Lecture 1
Optimization Problem Modeling
Before you can learn a decision, you must be able to state one
Jinkyoo Park · KAIST The atom every later method is built from
Optimization Problem ModelingLecture 1
Where we are — the simplest cell of the map
Previous step
This chapter's question
Lecture 0 identified a decision and its evidence.
Now make the objective and constraints explicit.
We begin with a known one-step model. Convexity will tell us when a local condition certifies a global answer.
Solve a bounded one-variable problem and check its KKT conditions.
Lecture 1 · Optimization Problem Modeling2 / 93
Optimization Problem ModelingLecture 1
Learning route — formulate, solve, and certify
Bring: Derivatives, vectors and basic algebra.
First pass
What to do
Follow the idea
Formulate → recognize convexity → state and check optimality → inspect a local approximation
Work without the solution
Solve a bounded one-variable problem and check its KKT conditions.
Return later
Optimization layers, the two design case studies and full sensitivity derivations follow the main route.
For the temperature thread: predict → calculate → reveal and check → change one condition. Complete the core calculation before reading the research extensions.
Lecture 1 · Optimization Problem Modeling3 / 93
Act 1
The standard form
Q1. One shape that every optimisation problem can be poured into.
ACT 1The standard formLecture 1
The standard form — one shape for all of them
Q1 State it?Q2 Solve it?Q3 Certify it?Q4 Convexify it?
Every mathematical optimisation problem can be written:
x∈Dminf(x)s.t.gi(x)≤0,i=1,…,m,hj(x)=0,j=1,…,p
x∈Rn — the decision vector; D — its allowed domain; f(x) — the cost;
the optimal valuep∗=inf{f(x):x feasible} — the lowest achievable cost, or the lower limit if no point attains it.
Two degenerate cases worth naming: p∗=+∞ if the problem is infeasible (no x satisfies the constraints), and p∗=−∞ if it is unbounded below. Both are usually signs of a modelling error, not a solver failure.
Maximising f is minimising −f; everything is phrased as minimisation without loss of generality.
Lecture 1 · Optimization Problem Modeling5 / 93
ACT 1The standard formLecture 1
A production decision, written all the way downan illustrative two-product model
A workshop makes x1 units of product A and x2 of product B. Each unit earns 3 or 2, respectively. Machine time is limited to 4 units; product A uses two units of time and B uses one. Demand for A is at most one unit. Quantities are divisible.
x≥0max3x1+2x2s.t.2x1+x2≤4,x1≤1
In minimisation standard form, f(x)=−3x1−2x2, g1(x)=2x1+x2−4 and g2(x)=x1−1. Non-negativity can be included in the domain D=R+2 or written as −xi≤0.
B earns 2 per unit of machine time; A earns only 1.5. Thus x∗=(0,4) earns 8. Indeed 3x1+2x2=2(2x1+x2)−x1≤8: a feasible answer and a bound that proves it optimal.
Lecture 1 · Optimization Problem Modeling6 / 93
ACT 1The standard formLecture 1
Formulation is a balance
A model that keeps every detail of the world cannot be solved; a model a solver loves may no longer be the problem you had. Formulation is the act of balancing the two — and it is where most of the real difficulty of applied decision making lives.
Lecture 1 · Optimization Problem Modeling7 / 93
ACT 1The standard formLecture 1
Equivalent problems — four rewrites worth knowing
The standard form is a shape, and most problems must be put into it. Four transformations do almost all of that work, and each leaves the optimal value unchanged.
rewrite
from
to
equality constraints
f(Aix+bi) inside
f(zi) with zi=Aix+bi
slack variables
ai⊤x≤bi
ai⊤x+si=bi,s≥0
epigraph form
minxf(x)
minx,tt s.t. f(x)−t≤0
minimise out a variable
minx1,x2f(x1,x2)
minx1f^(x1),f^=infx2f
The epigraph form is the one to remember: every convex problem can be written with a linear objective, because the difficulty pushes into the single constraint f(x)≤t.
Lecture 1 · Optimization Problem Modeling8 / 93
ACT 1The standard formLecture 1
Check — putting it in the standard form
A plant requirement reads "output must be at least 100 units." Written into the standard form minf s.t. g(x)≤0, the constraint becomes:
The standard form admits one inequality direction, so every "at least" is flipped by negating both sides. It is bookkeeping, but it is the bookkeeping that lets a single solver read every problem in the course — and getting the sign backwards silently optimises the opposite plant.
Lecture 1 · Optimization Problem Modeling9 / 93
Act 2
Convexity, the watershed
Q2. When does a local solution settle the global question?
ACT 2Convexity, the watershedLecture 1
Convexity — the line between easy and hard
Q1 State it?Q2 Solve it?Q3 Certify it?Q4 Convexify it?
A problem is convex when f is a convex function and the feasible set is a convex set — gi convex, hj affine.
Why convexity is the dividing line
Local minimum: no better feasible point nearby. Global minimum: no better feasible point anywhere. For a convex problem, every local minimum is global.
That fact gives local search a global meaning, provided a solution exists and the algorithm reaches it:
converged local minima cannot be worse than a hidden global minimum;
many standard convex classes admit reliable, efficient solvers;
KKT conditions can certify a global optimum; their necessity needs regularity;
duality supplies lower bounds and, under suitable conditions, exact certificates.
Convexity alone does not guarantee existence or convergence. The convex function ex has infimum zero but no minimiser on R. For f(x)=x2, gradient descent gives xk+1=(1−2α)xk and diverges from nonzero starts when α>1. Step sizes, conditioning and stopping tolerances still matter.
Lecture 1 · Optimization Problem Modeling11 / 93
ACT 2Convexity, the watershedLecture 1
Convex sets — the segment test
Non-convex problems enjoy none of those guarantees for free, so much of practical optimisation is the art of getting a convex problem — or a sequence of them. And both halves of one are the same test.
A set is convex when the segment joining any two of its points stays inside it. A function is convex when the segment joining any two points of its graph stays above it — equivalently, when its epigraph is a convex set. Both halves of a convex problem are this one test.
Lecture 1 · Optimization Problem Modeling12 / 93
ACT 2Convexity, the watershedLecture 1
The same convexity, seen through the gradientthe inequality the rest of this lecture rests on
The segment test is the definition. Differentiate it and convexity takes the form that actually does the work — for differentiable f:
f(y)≥f(x)+∇f(x)⊤(y−x)for all x,y
Read the right-hand side. That is the first-order Taylor expansion of f at x — the tangent plane. For a general function it says something about a neighbourhood of x and nothing beyond it. For a convex function the inequality holds everywhere: the tangent never rises above the graph, so a linearisation built from purely local information is a global underestimator.
Why a local minimum is a global minimum
This is the promise Act 2 opened with, and it is now one line. If x∗ is an unconstrained local minimum then ∇f(x∗)=0, so for everyy:
f(y)≥f(x∗)+0=f(x∗)
Local information about a convex function is global information. Nothing about y was assumed — it may be arbitrarily far away.
Lecture 1 · Optimization Problem Modeling13 / 93
ACT 2Convexity, the watershedLecture 1
The watershed, run twice
The same descent rule, the same twelve starting points, two objectives. For this strictly convex quadratic and this stable step size, the walkers approach the same minimiser. On the non-convex objective they can settle in different basins. The example isolates the effect of geometry; it does not make algorithm settings irrelevant.
Lecture 1 · Optimization Problem Modeling14 / 93
ACT 2Convexity, the watershedLecture 1
The convex family — LP, QP, QCQP
Named convex forms, in order of generality.
Class
Objective
Each constraint
The shape it carves
Linear program (LP)
c⊤x+d
ai⊤x≤bi
a half-space; m of them cut a polyhedron — flat faces, sharp corners
Quadratic program (QP)
21x⊤Px+q⊤x, P⪰0
ai⊤x≤bi
the same polyhedron; only the objective bent, plane into bowl
QCQP
convex quadratic
21x⊤Pix+qi⊤x+ri≤0
an ellipsoid when Pi≻0; the walls are curved now, not flat
The progression matters because modelling is often a matter of recognising which named class your problem — or its convexified version — falls into; each has mature, reliable solvers. When a finite LP optimum exists and the feasible polyhedron has vertices, an optimal vertex exists; a whole face may also be optimal. The QP's optimum occurs where the lowest attainable objective level set meets the feasible region.
These same quadratic models reappear in Act 4 as the local approximation of hard problems — and, much later, as the trust-region subproblem inside TRPO (Lecture 10).
Lecture 1 · Optimization Problem Modeling15 / 93
ACT 2Convexity, the watershedLecture 1
Diet — where linear programming startedExample 1.2
Buy quantities xj of n foods as cheaply as possible, while meeting every nutritional requirement.
The data is a price list and a nutrition table: food j costs cj, and one unit of it carries aij of nutrient i. The diet must supply at least bi of each nutrient, and no quantity may be negative.
x∈R+nminc⊤xs.t.j∑aijxj≥bi∀i
Look at the shape rather than the story. The objective is a price vector dotted with a quantity vector; each constraint is one row of the nutrition table held against one requirement. In the standard form of Act 1, “at least bi” becomes bi−ai⊤x≤0 — the same content with one sign flipped.
If a finite optimum exists, an optimal basic feasible diet can be chosen: it uses no more positive food quantities than there are linearly independent binding nutrient constraints. This is a property of one sparse optimal solution, not of every optimal mixture.
Stigler posed this in 1945 and narrowed it by hand; Dantzig's simplex method settled it a few years later. The optimal diet was cheap, adequate, and close to inedible — a first lesson in what a model leaves out.
Lecture 1 · Optimization Problem Modeling16 / 93
ACT 2Convexity, the watershedLecture 1
Least squares with bounds — nothing to checka quadratic programme that is convex for every A
Four problems follow, and each is put the same question: convex, and on what condition? This first one carries no condition at all.
xmin∥Ax−b∥22s.t.l≤x≤u
Expanded, the objective is x⊤A⊤Ax−2b⊤Ax+b⊤b — a quadratic programme outright, with P=2A⊤A and q=−2A⊤b. Along any direction v, its Hessian 2A⊤A gives
v⊤A⊤Av=∥Av∥22≥0.
A squared length cannot be negative, so A⊤A⪰0 for everyA — whatever its shape, its rank, or how badly conditioned it is. The bounds are an intersection of 2n half-spaces, so the feasible set is a box. Both halves of the problem are convex by construction.
Convexity here is structural, not conditional. There is no assumption to verify and no data that could break it.
Lecture 1 · Optimization Problem Modeling17 / 93
ACT 2Convexity, the watershedLecture 1
Check — why convexity is the watershed
What does convexity actually buy you?
A local minimum of a convex problem is global. This is a statement about a point that really is a local minimum; it does not guarantee that an arbitrary algorithm or stopping rule finds one. Next we derive conditions that let us check a candidate.
Lecture 1 · Optimization Problem Modeling18 / 93
Act 3
Certifying optimality
Q3. A solver returns a point. How do you know it is the point?
ACT 3Certifying optimalityLecture 1
When is a point optimal? — the first-order condition
Q1 State it?Q2 Solve it?Q3 Certify it?Q4 Convexify it?
Let X be the full feasible set. Assume X is convex, f is convex and differentiable on an open set containing X, and x∗∈X.
x∗ is globally optimal⟺∇f(x∗)⊤(y−x∗)≥0,∀y∈X
Here ∇f collects the partial derivatives, y−x∗ is a direction, and their dot product is the initial rate of cost change in that direction. Call the right-hand statement C(x∗), the first-order condition: no feasible direction initially decreases the cost.
Necessary · optimal ⇒ condition
Must every optimum pass this test? If a point fails, it cannot be optimal.
Sufficient · condition ⇒ optimal
Does passing certify an optimum? If it passes, no feasible point can have lower cost.
Exact means both necessary and sufficient. We prove each arrow separately to show that the condition completely characterises optimality.
Lecture 1 · Optimization Problem Modeling20 / 93
ACT 3Certifying optimalityLecture 1
Necessary — an optimum cannot have a feasible downhill direction
Question: if x∗ really is optimal, must it satisfy C(x∗)? We prove optimal ⇒ condition by ruling out a violation.
See why a candidate fails
Here f′(0.5)(2.5−0.5)=−6<0. Move t to take a small feasible step and watch the cost fall.
The general argument
Suppose some y∈X violates the condition. Set d=y−x∗, so ∇f(x∗)⊤d<0.
The segment stays feasible because X is convex:
xt=(1−t)x∗+ty∈X,0≤t≤1.
The cost initially falls because f is differentiable:
dtdf(xt)t=0=∇f(x∗)⊤d<0.
Thus f(xt)<f(x∗) for all sufficiently small t>0, contradicting optimality.
An optimum must pass. Necessity uses the convexity of X; it does not require convexity of f. The same argument applies to a local minimum.
Lecture 1 · Optimization Problem Modeling21 / 93
ACT 3Certifying optimalityLecture 1
Sufficient — a convex tangent bound certifies every feasible point
Question: if x∗ satisfies C(x∗), can we certify a global optimum? Now prove condition ⇒ optimal.
Watch the two inequalities
Illustration: minimise x2 over X=[1,3]. At x∗=1, the orange tangent is T(y)=1+2(y−1). Move the feasible comparison point y.
The general argument
Convexity of f gives a global lower bound:
f(y)≥T(y)f(x∗)+∇f(x∗)⊤(y−x∗).
The assumed condition lifts that bound above the candidate cost: for every y∈X,
T(y)≥f(x∗).
Combine them:
f(y)≥T(y)≥f(x∗),∀y∈X.
Every feasible comparison point has at least the candidate's cost. This certifies a global minimum.
Convexity of f turns first-order information into a global certificate. A tangent to a general non-convex function need not be a lower bound.
Lecture 1 · Optimization Problem Modeling22 / 93
ACT 3Certifying optimalityLecture 1
Necessary alone does not certify a minimum
Remove convexity of the objective. Keep the convex feasible set X=R and take f(x)=x3.
Zero slope, but lower points arbitrarily close
The orange horizontal tangent passes through the candidate x∗=0. Move y to the left: the curve falls below the tangent.
The condition passes — optimality fails
At zero, f′(0)=0. Therefore the full first-order condition holds:
f′(0)(y−0)=0≥0,∀y∈R.
Yet for every ϵ>0,
f(−ϵ)=−ϵ3<0=f(0).
There are better points arbitrarily close to zero. It is not even a local minimum.
The necessary implication still holds. The sufficient implication fails because this tangent is not a global lower bound.
Passing a necessary test only keeps a candidate in consideration. It does not, by itself, prove optimality.
Lecture 1 · Optimization Problem Modeling23 / 93
ACT 3Certifying optimalityLecture 1
Why the condition is exact — the two arrows do different work
For a differentiable f and feasible x∗, the two proofs use different geometric facts:
Direction
Convexity used in the proof
What it gives
Necessary: optimal ⇒C(x∗)
Convex set X
The segment toward any feasible y stays feasible; a negative initial slope would disprove optimality.
Sufficient:C(x∗)⇒ global optimal
Convex function f
The tangent is a global lower bound; the condition puts that bound above f(x∗) on X.
If only necessity has been proved
Failing the condition rules out optimality. Passing alone is inconclusive — as x3 demonstrates.
If only sufficiency has been proved
Passing the condition certifies optimality. Failing alone is inconclusive: this arrow does not say that every optimum must pass.
With both assumptions in place, combine the arrows:
x∗ globally optimal⟺∇f(x∗)⊤(y−x∗)≥0,∀y∈X
Opening line: We prove both directions because this condition does more than describe something an optimum must satisfy: it completely characterises optimality. The previous two columns describe what one implication alone permits; after both proofs, passing and failing are decisive for this convex problem.
Lecture 1 · Optimization Problem Modeling24 / 93
ACT 3Certifying optimalityLecture 1
Unconstrained optimality — combine two equivalences
Keep fconvex and differentiable. The conclusion follows in two steps; the second step simplifies the condition from the first.
Step 1 — the general convex problem, already proved. For a convex feasible set X and x∗∈X,
x∗ globally optimal⟺∇f(x∗)⊤(y−x∗)≥0,∀y∈X.
Step 2 — no constraints means X=Rn. Every direction is available, so the first-order inequality simplifies to
∇f(x∗)⊤(y−x∗)≥0,∀y∈Rn⟺∇f(x∗)=0.
We prove this second equivalence on the next slide. It is a statement about which directions are feasible.
Combine the two — convex + differentiable + unconstrained:
x∗ globally optimal⟺∇f(x∗)=0.
Under these three assumptions, zero gradient is both necessary and sufficient for global optimality.
Lecture 1 · Optimization Problem Modeling25 / 93
ACT 3Certifying optimalityLecture 1
Why the first-order inequality becomes a zero gradient
Proving Step 2. Set X=Rn and write C(x∗) for ∇f(x∗)⊤(y−x∗)≥0 for every y∈Rn.
Zero gradient ⇒ first-order inequality
If ∇f(x∗)=0, then for every y,
∇f(x∗)⊤(y−x∗)=0≥0.
So C(x∗) holds immediately.
First-order inequality ⇒ zero gradient
Assume C(x∗). Because every point is feasible, choose y=x∗−t∇f(x∗) with any t>0:
0≤∇f(x∗)⊤(y−x∗)=−t∥∇f(x∗)∥22.
Because t>0 and a squared norm is non-negative, the gradient must be zero.
Necessary for an unconstrained optimum
A nonzero gradient gives a feasible descent direction −∇f(x∗), so a small step would lower the cost and contradict optimality.
Sufficient when f is also convex
The global tangent bound becomes
f(y)≥f(x∗)+0=f(x∗),∀y.
Thus a zero gradient certifies a global minimum.
Step 2 needs no convexity of f; optimality ⟺∇f=0 also needs Step 1. Without convexity, f(x)=x3 still has f′(0)=0 but no minimum at zero.
Lecture 1 · Optimization Problem Modeling26 / 93
ACT 3Certifying optimalityLecture 1
The condition, made draggable
Minimise ∥x−c∥2 over the polygon. Drag the point: the red arrow shows a feasible decrease. At the optimum, −∇f points outside the allowed set. The gradient need not be zero when constraints block descent.
The first-order test checks every feasible y. KKT gives a finite set of conditions using the objective and constraint gradients. We first see the idea with one bound.
Lecture 1 · Optimization Problem Modeling27 / 93
ACT 3Certifying optimalityLecture 1
Why can the optimum stop at a wall?one variable, one constraint — the idea behind KKT
Choose a setting x with cost x2. The setting must be at least 1:
xminx2subject to x≥1(g(x)=1−x≤0)
Three small steps
Without the wall: choose x=0, where the cost is smallest.
With the wall: stop at x∗=1. The cost still pulls left: −f′(1)=−2.
Balance the pull:g′(x)=−1, so the inward correction −λg′(x)=+λ points right. Balance requires −2+λ=0, giving λ=2.
The nonzero objective gradient is balanced by a constraint. The multiplier λ is a mathematical weight; the “wall force” is a geometric interpretation.
Lecture 1 · Optimization Problem Modeling28 / 93
ACT 3Certifying optimalityLecture 1
KKT setup — the problem and its Lagrangianintroduce the variables before stating the conditions
Assume f,gi,hj:Rn→R are continuously differentiable. Consider
Every inequality condition holds for i=1,…,m; every equality condition for j=1,…,p. Expanded stationarity is
∇f(x∗)+i=1∑mλi∗∇gi(x∗)+j=1∑pνj∗∇hj(x∗)=0.
Feasible point, valid multipliers, complementary slackness, and balanced gradients — all four together. We next interpret them, then state their optimality guarantee.
Lecture 1 · Optimization Problem Modeling30 / 93
ACT 3Certifying optimalityLecture 1
Read the four conditions in plain languagea constraint is active when its boundary is reached
For an inequality gi(x)≤0, active (tight) means gi(x)=0; slack means gi(x)<0.
Condition
Meaning
Our one-bound example
Primal feasibility
The decision obeys the constraints.
x≥1
Dual feasibility
Non-negative weights give inward constraint reactions.
λ≥0
Complementary slackness
A slack constraint has zero weight.
x>1⇒λ=0
Stationarity
Objective and weighted constraint gradients sum to zero.
2x−λ=0
Equality weights may have either sign. For minx2 with x−1=0, stationarity gives 2x+ν=0: at x=1, ν=−2.
Active does not mean positive weight. For minx2 subject to x≥0, the optimum x=0 is active but λ=0.
Lecture 1 · Optimization Problem Modeling31 / 93
ACT 3Certifying optimalityLecture 1
KKT optimality theorem — necessary and sufficientconditions first; their guarantee second; the proof follows the examples
For the differentiable problem just stated, suppose f,gi are convex and hj are affine: hj(x)=aj⊤x−bj.
Sufficient: KKT certifies an optimum
If (x∗,λ∗,ν∗) satisfies all four KKT conditions, then x∗ is a global minimizer.
KKT⟹global optimality.
This direction does not require Slater's condition.
Necessary: an optimum has multipliers
If Slater's condition holds, every global minimizer x∗ admits multipliers satisfying KKT.
global optimality⟹KKT.
Slater requires some point xˉ with all gi(xˉ)<0 and all hj(xˉ)=0. For x≥1, choose xˉ=2. The optimum itself may lie on the boundary.
Under the stated convexity assumptions and Slater: x∗ is globally optimal if and only if suitable KKT multipliers exist.
For a non-convex differentiable problem, a local minimum still has KKT multipliers under an appropriate constraint qualification, but a KKT point need not be a local minimum. Reference: Boyd & Vandenberghe, Convex Optimization, §5.5.3.
Lecture 1 · Optimization Problem Modeling32 / 93
ACT 3Certifying optimalityLecture 1
Solve the example — where do x and the multiplier come from?complementary slackness gives two cases to check
For minx2 subject to x≥1, KKT reads
x≥1,λ≥0,λ(1−x)=0,2x−λ=0.
Case 1: the bound is slack
Suppose x>1. Complementary slackness forces λ=0.
Stationarity then gives 2x=0, so x=0. This contradicts x>1.
Discard this case.
Case 2: the bound is active
Set x=1. Stationarity gives 2−λ=0, so λ=2.
The point is feasible, the multiplier is non-negative, and λ(1−x)=0.
All four conditions hold.
We obtained x∗=1, λ∗=2 from the equations. Convexity makes this KKT solution globally optimal; Slater tells us that every optimum must appear among the KKT candidates.
Lecture 1 · Optimization Problem Modeling33 / 93
ACT 3Certifying optimalityLecture 1
KKT example — check the four conditionscheck the same example at x∗=1 and λ∗=2
Combine the cost and the constraint in one expression — the Lagrangian:
L(x,λ)=x2+λ(1−x)∂x∂L=2x−λ
Question
KKT condition
Check at (x,λ)=(1,2)
Is the setting allowed?
Primal feasibility: 1−x≤0
1−1=0≤0 ✓
Does the wall push inward?
Dual feasibility: λ≥0
2≥0 ✓
Is any unused wall powerless?
Complementary slackness: λ(1−x)=0
2(1−1)=0 ✓
Do the two pushes balance?
Stationarity: 2x−λ=0
2(1)−2=0 ✓
All four checks pass. For this convex problem, that certifies the global optimum.
Quick check:x=2, λ=4 passes stationarity. Is it optimal? No: λ(1−x)=−4=0 fails complementary slackness. Stationarity alone is not enough.
Lecture 1 · Optimization Problem Modeling34 / 93
ACT 3Certifying optimalityLecture 1
Certifying the production decision with actual multipliers
Return to the workshop: minimise −3x1−2x2. Check the proposed decision x∗=(0,4).
1 · Check constraints and identify zero weights
Constraint
Value at the candidate
Implication
g1=2x1+x2−4
0 — active
Solve for λ1.
g2=x1−1
−1 — slack
λ2=0
g3=−x1
0 — active
Solve for λ3.
g4=−x2
−4 — slack
λ4=0
2 · Solve the stationarity equations
Set each partial derivative of the Lagrangian to zero. With λ2=λ4=0:
In x2:In x1:−2+λ1=0,λ1=2.−3+2λ1−λ3=0,λ3=1.
λ∗=(2,0,1,0)≥0. The point is feasible, every λi∗gi(x∗)=0, and stationarity holds. All four conditions pass: profit 8 is globally optimal.
The machine-time multiplier is 2. An extra unit of machine capacity is worth 2 units of profit in this model.
Lecture 1 · Optimization Problem Modeling35 / 93
ACT 3Certifying optimalityLecture 1
Temperature thread — solve the one-step heater problemshared teaching example · predict before revealing the calculation
Use x=−2, x′=x+u and c(u)=(−2+u)2+u2, with 0≤u≤2. The dynamics and cost are known in this chapter.
Predict: Will the optimum use zero, half, or all of the maximum command?
Calculate and check.c′(u)=4u−4=0 gives u∗=1. It is feasible and c′′(u)=4>0, so it is the unique global minimizer. Both bound multipliers are zero; the resulting cost is 2.
The command stops short of reaching 22°C because the objective also charges for effort.
Lecture 1 · Optimization Problem Modeling36 / 93
ACT 3Certifying optimalityLecture 1
Try it — the heater limit becomes 0.5work independently · reveal only after writing an answer
Replace only the upper bound by u≤0.5. Find the optimal command and the multiplier for u−0.5≤0. Check feasibility, multiplier sign, stationarity and complementary slackness.
Check your answer.u∗=0.5, c=2.5. The lower-bound multiplier is zero. Stationarity gives (4u−4)+λ=0, so λ=2. The upper constraint binds and λ(u−0.5)=0.
A constrained optimum can have a nonzero objective gradient. The constraint multiplier balances it.
Lecture 1 · Optimization Problem Modeling37 / 93
ACT 3Certifying optimalityLecture 1
Why KKT certifies a global optimumreuse the zero-gradient result we already proved
Let f,gi be convex and hj affine, and suppose all four KKT conditions hold. Fix the multipliers and write ℓ(x)=L(x,λ∗,ν∗).
1 · Stationarity gives a minimum of the Lagrangian
ℓ is convex: it sums convex f, non-negative multiples of convex gi, and affine equality terms.
KKT gives ∇ℓ(x∗)=0. By the earlier unconstrained result,
ℓ(y)≥ℓ(x∗)for every y.
2 · Feasibility connects it to the actual cost
For feasible y, λi∗gi(y)≤0 and hj(y)=0, so ℓ(y)≤f(y).
At x∗, complementary slackness makes every λi∗gi(x∗)=0; equality terms are also zero. Thus ℓ(x∗)=f(x∗).
Combine the two steps for any feasible y:
f(y)≥ℓ(y)≥ℓ(x∗)=f(x∗).
Every feasible point costs at least as much as x∗. This proves sufficiency. The expanded gradient calculation is kept in the appendix.
Lecture 1 · Optimization Problem Modeling38 / 93
ACT 3Certifying optimalityLecture 1
What is a little more freedom worth?the same multiplier also measures the value of relaxing the wall
Now let the minimum allowed setting be a: minimise x2 subject to x≥a.
Move a left to relax the bound. Once a<0, the preferred point x=0 is inside the allowed region: the bound is slack and its price is zero.
Relax the bound from 1 to 0.9
Before: best x=1, cost 1, multiplier λ=2.
After: best x=0.9, cost 0.81. The actual saving is 0.19.
Predict the saving using the original price:
λ×relaxation=2×0.1=0.20.
Close to 0.19: the price gives a local approximation for a small change.
λ is the shadow price: how much the best cost improves per small unit of extra freedom. At a=0, the bound is tight but its price is already zero.
Lecture 1 · Optimization Problem Modeling39 / 93
ACT 3Certifying optimalityLecture 1
Duality — a lower bound you get for free
The proof used a function below the feasible cost. Now fix anyλ≥0,ν and minimise that function over all x, even infeasible ones:
Thus d(λ,ν)≤p∗: weak duality. A feasible decision gives an upper bound; these multipliers give a lower bound. The dual problem chooses the highest lower bound, d∗=supλ≥0,νd(λ,ν). The difference p∗−d∗≥0 is the duality gap.
For a convex problem with a constraint qualification the gap is zero, so the dual optimum proves the primal one. Even when you cannot solve the primal, any dual point brackets how far you might still be from optimal — which is the practical value of duality. With additional differentiability and regularity conditions, the KKT system also provides sensitivities for optimisation layers. The following examples separate that question from optimality.
Lecture 1 · Optimization Problem Modeling40 / 93
ACT 3Certifying optimalityLecture 1
Duality in numbers — the same example, one last timean achievable cost and a lower bound meet at 1
For minx2 subject to x≥1, complete the square in the Lagrangian:
L(x,λ)=x2+λ(1−x)=(x−2λ)2+λ−4λ2.
Minimising over all real x sets x=λ/2, so d(λ)=λ−λ2/4, with λ≥0.
A feasible decision gives an upper bound
x=1 is allowed and costs f(1)=1.
The best possible cost cannot be higher:
p∗≤1.
The KKT multiplier gives a lower bound
λ=2 is allowed and gives d(2)=1.
Weak duality says the cost cannot be lower:
p∗≥1.
1≤p∗≤1, so p∗=1. The decision and the bound agree. This is the certificate from the KKT proof, written as a dual bound.
Lecture 1 · Optimization Problem Modeling41 / 93
ACT 3Certifying optimalityLecture 1
Check — the price of a slack constraint
At the optimum, an inequality constraint turns out to be slack — it is satisfied strictly, not at its boundary. What do the KKT conditions say about its multiplier λ?
Since g(x∗)<0, the equation λg(x∗)=0 forces λ=0. The converse is false: zero multiplier does not prove that a constraint is slack. Under suitable sensitivity assumptions, zero multiplier means no first-order change in the optimal value; it does not generally guarantee an unchanged optimizer after a finite relaxation.
Lecture 1 · Optimization Problem Modeling42 / 93
Act 4
When the problem is not convex
Q4. Real problems are not convex. Do we give up the guarantees, or manufacture them?
ACT 4When the problem is not convexLecture 1
Successive convexification — solve a sequence of easy problems
Q1 State it?Q2 Solve it?Q3 Certify it?Q4 Convexify it?
Real engineering problems are usually non-convex — non-convex objective, non-convex constraints. One useful strategy is to solve a sequence of local convex approximations, then evaluate each proposed step in the original problem.
At the current iterate x(k), choose B(k)⪰0 and build a local convex model for minimisation
construct suitable constraint approximations, and add a trust region∥x−x(k)∥≤ρ(k) so the model stays trustworthy.
The trust region is the key idea: only trust the approximation nearby.
Accept a feasible candidate only when actual improvement agrees sufficiently with predicted improvement. Shrink after rejection; expand after strong agreement at the boundary. General constraint linearisations need a feasibility or merit-function strategy. Convergence, when obtained under suitable assumptions, is usually to a stationary point rather than a global optimum.
Lecture 1 · Optimization Problem Modeling44 / 93
ACT 4When the problem is not convexLecture 1
The trust region, iterated
Watch the ratio of actual to predicted decrease. Poor agreement rejects a step; strong agreement at the boundary can enlarge the interval. The boxed problem uses a projected-gradient stopping test, so a boundary optimum is recognised. Lecture 10 applies the same idea of limiting an update through a KL constraint in TRPO, with a different step-selection procedure.
Lecture 1 · Optimization Problem Modeling45 / 93
ACT 4When the problem is not convexLecture 1
Wind-farm layout — the wakes make it a joint decision
Visible wakes behind offshore turbines. Photograph reproduced from original PowerPoint, slide 43, which credits WindAction.
The decision in the photograph
A turbine extracts energy from the wind and leaves slower, more turbulent air behind it. Downstream turbines therefore see a different inflow from the undisturbed wind.
Variables: the turbine coordinates l=(l1,…,lN).
Objective: expected total farm power, accounting for wake interactions.
Constraints: installation boundaries and a prescribed minimum separation dmin.
Moving one turbine changes several turbines' power. Optimise the layout as a system.
Lecture 1 · Optimization Problem Modeling46 / 93
ACT 4When the problem is not convexLecture 1
Read the engineering case using the same four questions
Question
Wind-farm decision
What do we choose?
Turbine locations, subject to site and separation constraints.
What do we value?
Predicted power over stated wind scenarios.
Why is it difficult?
Moving one turbine changes wakes and other turbines' outputs.
What does the algorithm check?
A local convex subproblem proposes a step; the original model evaluates whether the step deserves trust.
The full wake model, figures and optimization results are retained in the case-study appendix. First explain the decision, objective, constraints and validation without the network architecture.
Lecture 1 · Optimization Problem Modeling47 / 93
ACT 4When the problem is not convexLecture 1
Check — what a trust region is for
Why does a trust-region method bound the size of its step?
The method builds a simple model — usually quadratic — of a complicated f around the current point. That model is only trustworthy in a neighbourhood, so the step is capped at a radius that is grown or shrunk according to how well the model just predicted reality. Lecture 10 uses the same principle to limit a policy update with a KL constraint; its step-selection procedure differs.
Lecture 1 · Optimization Problem Modeling48 / 93
CLOSING
Closing
We can state a decision and, when it is convex, prove we have solved it. Now the assumption we drop.
CLOSINGLecture 1
Where we are — and the assumption we now drop
Model-based
Data-driven
Static, single
optimisation (Lec 1 ✓)
Bayesian / learned opt. (Lec 2–6 →)
We can now state a decision, certify a convex optimum, and use convex subproblems to improve a non-convex problem. The research cases already fitted models and used wind distributions, but each optimisation treated those inputs as fixed:
the chosen model and its coefficients defined one optimisation problem.
We hand off the template min f s.t. g ≤ 0. Now ask what data tells us about its unknown parameters. A fixed surrogate or one fitted distribution hides uncertainty about that fit; Lecture 2 represents this uncertainty as a belief and updates it with observations.
Lecture 1 · Optimization Problem Modeling50 / 93
Optimization is how a decision becomes mathematics — and, when the problem is convex, an answer we can not only find but prove.
An objective to minimise, levers to pull, limits to respect.
Questions?
Hold onto two pieces: the standard form — it is the skeleton of every objective to come — and the trust region, which returns in surrogate optimisation and again in trust-region RL. Everything else this term is this atom, perturbed by uncertainty.
APPENDIX
Backup slides
Complete statements, kept out of the narrative.
APPENDIXBackup slidesLecture 1
Reading guide — certify an optimum, then differentiate a decisionone main idea to explain, one comparison, one application
How does changing a QP input change its optimal decision?
Apply
The production example, followed by the original heater and wind-farm cases
What remains convex, and what requires an approximation?
KKT conditions and a small worked example come before optimization layers. OptNet is the advanced application of sensitivity analysis; ICNN describes a different choice: how to parameterize a convex function.
Lecture 1 · Optimization Problem Modeling54 / 93
APPENDIXBackup slidesLecture 1
Backup — the successive convex programming loop
Algorithm — trust-region SCP.
Start from a feasible x(0), radius ρ0>0 and tolerance ϵ>0.
Check feasibility and a suitable first-order residual; stop only when both meet their tolerances. For a box, use ∥x−ΠD(x−∇f(x))∥.
Build a model with Bk⪰0 and a feasible inner constraint approximation. Solve it inside the trust region to get x^.
Set pred=mk(x(k))−mk(x^). If it is not meaningfully positive, check stationarity or report stalling; do not divide by zero.
Set rk=[f(x(k))−f(x^)]/pred. Accept a feasible candidate if rk≥η; otherwise keep x(k+1)=x(k) and shrink the radius.
Grow the radius only after strong agreement at the boundary. Return to step 2. A rejected step is never, by itself, evidence of convergence.
Why the ratio test. It measures whether the convex model can be trusted at the proposed step. Trust grows where the model predicts well and shrinks where it does not — the same modelling principle that motivates the KL-constrained update in TRPO, though TRPO uses a different step-selection procedure.
Lecture 1 · Optimization Problem Modeling55 / 93
APPENDIXBackup slidesLecture 1
Backup — the general Lagrangian and KKT conditions
For minxf(x) subject to gi(x)≤0 and hj(x)=0, combine all constraints:
L(x,λ,ν)=f(x)+i∑λigi(x)+j∑νjhj(x).
Allowed point and inward reactions
Primal feasibility:
gi(x∗)≤0,hj(x∗)=0.
Dual feasibility:λi∗≥0. Equality multipliers νj∗ are free in sign: an equality has no allowed side.
No unused reaction and balanced forces
Complementary slackness:
λi∗gi(x∗)=0∀i.
Stationarity:
∇f(x∗)+i∑λi∗∇gi(x∗)+j∑νj∗∇hj(x∗)=0.
For differentiable convex f,gi and affine hj, these four conditions are sufficient for global optimality. A constraint qualification such as Slater's makes them necessary as well. Without convexity, they are generally not sufficient. A slack inequality must have zero multiplier; a tight inequality can have either zero or a positive multiplier.
Lecture 1 · Optimization Problem Modeling56 / 93
APPENDIXBackup slidesLecture 1
Backup — KKT sufficiency, expanded gradient proofproof of the sufficient direction stated in the KKT theorem
Let f and every gi be differentiable and convex, every hj affine, and suppose (x∗,λ∗,ν∗) satisfies the stated KKT conditions. Take any feasible y:
f(y)≥f(x∗)+∇f(x∗)⊤(y−x∗)=f(x∗)−i∑λi∗∇gi(x∗)⊤(y−x∗)≥f(x∗)−i∑λi∗(gi(y)−gi(x∗))=f(x∗)−i∑λi∗gi(y)≥f(x∗)convexity of fstationarity; the hj terms vanishconvexity of gi,λi∗≥0complementary slacknessλi∗≥0,gi(y)≤0
The hj terms vanish because an affine hj has ∇hj⊤(y−x∗)=hj(y)−hj(x∗)=0 for feasible y. So f(y)≥f(x∗) for every feasible y: not a local claim but a global one. This proves the sufficient direction: a KKT certificate gives global optimality for the stated convex problem. The converse requires the constraint qualification stated in the theorem.
Lecture 1 · Optimization Problem Modeling57 / 93
EXTENSION
Research extension — optimization layers and joint design/control
Read after completing the main route.
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
An LP inside a policy — LPMARLapplication preview — follow how an optimisation output becomes a decision
A score network feeds an allocation LP; each agent's policy is conditioned on the resulting task weights. Source: original PowerPoint, slide 36.
The core KKT argument is complete. In this application, learned scores cij enter an LP, and its allocation weights zij guide decisions:
Each row of z sums to one, but it can split across tasks. Here kj bounds a weighted total, not the number of assigned agents. A hard assignment requires an additional discrete decision or a feasibility-preserving decoding rule.
Lecture 1 · Optimization Problem Modeling59 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
An allocation LP need not return a matching
One agent, two tasks: let c=(2,1) and k=(1,1). The weighted-capacity model becomes
max2z1+z2s.t.z1+z2=1,2z1≤1,z2≤1,z≥0.
The optimum is z=(21,21), with value 1.5. The only feasible hard assignment is (0,1), with value 1. The relaxation is fractional even at its best vertex.
When the familiar integrality theorem does apply
For a standard bipartite assignment model, use count capacities∑izij≤kj, integer kj, row sums of one and z≥0. If feasible, an integral optimal vertex exists. Ties can still admit fractional optimal mixtures; arbitrary weighted capacities lose this structural guarantee.
Lecture 1 · Optimization Problem Modeling60 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Training through an optimisation layeroptimality and differentiability are separate questions
The learned coefficients change the optimisation problem; its solution changes the actions seen by the critic. Source: original PowerPoint, slide 37. Each agent reads its row of allocation weights.
dθdJ=∂z∗∂J∂c∂z∗∂θ∂c
This chain rule is useful only if the middle sensitivity exists. For an exact LP with a fixed feasible region, changing objective coefficients can leave the optimal vertex unchanged, then make it jump. A differentiable layer must specify its regularisation, smoothing or derivative convention; an exact discrete argmax does not supply useful gradients automatically. The weighted model above also changes its feasible region through c.
Lecture 1 · Optimization Problem Modeling61 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
OptNet in one dimension — the decision is the layer outputAmos & Kolter · ICML 2017 · scalar illustration of a differentiable QP layer
A neural network predicts c. Instead of treating c as the final answer, solve a constrained decision:
z∗(c)=z≥0argmin21(z−c)2=max(c,0).
Predicted input
Optimal decision
Sensitivity away from the boundary
c=−1
z∗=0
dz∗/dc=0; the constraint binds
c=2
z∗=2
dz∗/dc=1; the constraint is inactive
If the desired decision is 3, use L=21(z∗−3)2. At c=2, dL/dc=(2−3)(1)=−1. A gradient step of size 0.1 changes c to 2.1, and the decision loss falls from 0.5 to 0.405.
Training follows network input → optimal decision → task loss. At c=0 this solution map has a kink; differentiability needs conditions. The next slide states those conditions. OptNet
Lecture 1 · Optimization Problem Modeling62 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
What differentiating KKT actually requiresadvanced derivation — optional on a first reading
Collect the primal variables and multipliers into y=(z,λ,ν). Locally, write a suitable KKT system as F(y,c)=0. If it is differentiable and its Jacobian in y is nonsingular, the implicit function theorem gives
dcdy∗=−(∂y∂F)−1∂c∂F.
Convexity makes a feasible KKT solution globally optimal. It does not by itself give uniqueness, a nonsingular KKT system or smooth dependence on the data. Regularisation and active-set regularity are additional issues.
A stable local minimum of a non-convex problem can also have a correct local sensitivity; it need not describe the global optimum. LP layers commonly use quadratic or barrier regularisation to obtain useful sensitivities. Mandi & Guns, 2020.
Lecture 1 · Optimization Problem Modeling63 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Convexity can be imposed on a learned model
Input Convex Neural Networks (ICNNs) constrain a network to be convex in selected inputs while remaining flexible in its parameters. OptNet and differentiable convex layers make an optimisation problem part of a trainable network. (Amos, Xu & Kolter, 2017; Amos & Kolter, 2017; Agrawal et al., 2019)
Check the complete control problem
A convex prediction function is not enough. A nonlinear equality xt+1=f(xt,ut) generally defines a non-convex set, and composing a convex predictor with an arbitrary cost can destroy convexity. After eliminating the dynamics, check the whole objective and every remaining constraint in the control variables.
The modelling opportunity is to learn a useful function while preserving the structure that the downstream decision problem needs.
Lecture 1 · Optimization Problem Modeling64 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Heater placement changes the control problemheat diffusion — a physical example of bilevel design
Heater inputs ut inject heat into a field; diffusion changes the temperatures observed at sensors, ot→ot+1. Source: original PowerPoint, slide 26.
We observe temperatures at a few sensor locations rather than the whole field. The model must predict how today's heating changes later observations. Moving a heater changes that response, so choosing a location also changes the controller's job.
Lecture 1 · Optimization Problem Modeling65 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Design is chosen once; heating is chosen repeatedly
Red squares are heater locations pi; grey circles are fixed sensor locations qj. Source: original PowerPoint, slide 26.
Two decisions, two time scales
Design variables: heater coordinates p, constrained to an installation region.
Operation variables: heat inputs u0,…,uT−1, constrained by actuator bounds.
Objective: track target sensor temperatures while accounting for the cost of heating.
To compare two layouts fairly, optimise the heating schedule for each layout. A poor controller should not make a useful design look bad.
Lecture 1 · Optimization Problem Modeling66 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Bilevel design — evaluate a layout through its best operation
For a fixed initial condition and a fixed design p, let Jp(u) be the cost of rolling out the dynamics under the input sequence u. For one operating scenario,
The source averages this evaluation over several target scenarios. Each outer design update therefore requires several inner control solves. If those problems have stable solutions, their sensitivities tell us how a small heater movement changes the best achievable cost.
Convex inner problems make global operation optima certifiable. The outer design problem can remain non-convex, and a surrogate model can still be wrong about the physical plant. These are separate questions. Source: original PowerPoint, slides 24–27.
Lecture 1 · Optimization Problem Modeling67 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
The graph separates operation inputs from geometry
Sensor and heater histories feed a graph model. Geometry enters through a separate path; selected operation inputs pass through convex subnetworks. Source: original PowerPoint, slide 27.
Holding the layout fixed defines the inner problem. For that problem, verify convexity of the reduced cost Jp(u) and of Up, including the conditions needed when model outputs are composed over time. The network architecture provides part of this argument; the objective and constraints provide the rest.
Lecture 1 · Optimization Problem Modeling68 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
A design update combines several control solves
Build the layout graph, solve K operating scenarios and use their implicit sensitivities to update the heater positions. Source: original PowerPoint, slide 27.
This separates optimisation over operations from optimisation over geometry. A valid implicit derivative requires a sufficiently solved, regular inner problem. It is a sensitivity of the surrogate problem; testing the resulting layout on the physical dynamics remains essential.
Lecture 1 · Optimization Problem Modeling69 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
What convexity certifies in the inner problem
The source compares a joint search, an implicit solve with a general GNN and an implicit solve with an input-convex model. Source: original PowerPoint, slide 25.
Read the last row narrowly: KKT is sufficient for global optimality of a differentiable convex inner problem. In a non-convex problem, a regular local minimum can still be differentiated correctly, but global optimality is not certified. Neither column alone establishes model accuracy or global optimality of the outer design.
Lecture 1 · Optimization Problem Modeling70 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
A lower predicted cost can hide a worse design
Predicted cost and true cost, with the heater layouts reached by each model. Source: original PowerPoint, slide 28.
The linear surrogate's predicted cost falls, but its reported true cost rises from 0.0706 to 0.1305. The final reported costs are 0.0391 for GNN and 0.0319 for ICGNN. This experiment illustrates why a good optimisation result must also survive evaluation on the true dynamics; it is not a universal ranking of model classes.
Lecture 1 · Optimization Problem Modeling71 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Compare surrogates using the same optimisation method
Compare Linear, GNN and ICGNN, all using implicit differentiation. Source: original PowerPoint, slide 28.
Read the logarithmic vertical axes as true design cost; lower is better. The panels vary sensor count, and the horizontal axes vary heater count. The linear model performs worse across the plotted settings; the gap between GNN and ICGNN is smaller and varies with the setting.
Holding the optimiser fixed helps isolate the contribution of the learned surrogate. The plotted comparisons are empirical results, not an ordering guaranteed by convexity.
Lecture 1 · Optimization Problem Modeling72 / 93
EXTENSIONResearch extension — optimization layers and joint design/controlLecture 1
Compare optimisers using the same surrogate
Compare CMA-ES, joint single-level search and implicit differentiation, all using ICGNN. Source: original PowerPoint, slide 28.
Here the model class is fixed, so differences reflect the optimisation procedure and its configuration. The implicit approach is competitive across the plotted settings; read the error bars and the logarithmic scale before judging the size of a difference.
The optimiser can exploit a surrogate's errors. Evaluate the decision on the system it is meant to improve. Lecture 5 develops this failure in detail.
Lecture 1 · Optimization Problem Modeling73 / 93
EXTENSION
Case study — the full wind-farm optimization
Read after completing the main route.
EXTENSIONCase study — the full wind-farm optimizationLecture 1
A wake model turns geometry into a power prediction
Turbine j is upstream of i; dij is downstream distance and rij is the radial offset. Source: original PowerPoint, slide 44.
Read the model term by term
The source uses a smooth wake-deficit profile:
δu(d,r)=2α(R0+κdR0)2e−(R0+κdr)2
Here R0 is rotor radius, κ controls wake spreading and α controls extraction. For an upstream turbine, the local speed is modelled as U(1−δu) before combining multiple wakes.
Increasing d spreads and weakens this wake; increasing ∣r∣ moves a turbine away from its centre. The optimiser uses these geometry-dependent changes in its power calculation.
Lecture 1 · Optimization Problem Modeling75 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
Recovering from one wake does not remove the others
Wake recovery with distance
The wake widens and its central deficit decreases downstream. Source: original PowerPoint, slide 44.
The profiles at 5D, 7D and 9D describe different downstream distances; D=2R0 is rotor diameter. More spacing helps this pair, but land and site boundaries limit how far turbines can move.
Several upstream neighbours
Turbine i can be affected by several upstream wakes. Source: original PowerPoint, slide 44.
The power function Pi(l;U,θ) depends on the whole layout and the wind scenario, not only the nearest neighbour.
Lecture 1 · Optimization Problem Modeling76 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
Wind direction and speed determine the scenario weights
How often does each direction occur?
The wind rose supplies direction-bin frequencies. Source: original PowerPoint, slide 45.
What speeds occur within that direction?
Conditional Weibull speed densities, one for each direction bin. Source: original PowerPoint, slide 45.
The wind rose and the conditional speed distributions play different roles. A direction that occurs often should receive more weight, and its speed distribution determines how much power that direction can supply.
Lecture 1 · Optimization Problem Modeling77 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
An expectation is a weighted collection of wind scenarios
Joint wind direction–speed distribution. Integrate the plotted density over each bin to obtain its probability mass. Source: original PowerPoint, slide 45.
πjk=Pr(θ in bin k)Pr(U in bin j∣θ in bin k),j,k∑πjk=1.
Powerful but rare winds need not dominate the expected objective. Use bin masses rather than raw density heights, especially when bins have different widths.
Lecture 1 · Optimization Problem Modeling78 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
The layout problem, with one consistent separation rule
Let li∈R2 be turbine i's position. Treat the fitted wind distribution and the wake model as fixed inputs to this optimisation:
lmaxF(l),F(l)=j,k∑πjki=1∑NPi(l;Uj,θk).
s.t.∥li−lj∥2≥dmin(i<j),c≤Cl≤cˉ.
The linear constraints encode the site. The minimum-distance constraint excludes a ball around each neighbour, which is non-convex. The wake-coupled objective is also generally non-concave. dmin denotes the same prescribed distance throughout the original problem and every subproblem.
A known expectation is still an ordinary objective function. Here the challenge is its geometry; uncertainty about the fitted model itself comes next in Lecture 2.
Lecture 1 · Optimization Problem Modeling79 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
A convex inner region keeps turbines out of exclusion zones
Pink discs exclude positions too close to neighbours. The green polygon is a conservative convex region; blue boxes restrict movement. Source: original PowerPoint, slide 49.
This picture holds neighbouring positions fixed to explain one turbine's allowable motion. The joint algorithm uses relative displacements of both turbines. Its linear constraints should preserve the original separation, not quietly replace it with a smaller distance.
Lecture 1 · Optimization Problem Modeling80 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
Deriving the safe linearised spacing constraint
Write dij=li−lj and dij(k)=li(k)−lj(k). At a feasible iterate dij(k)=0, the convex norm has a global affine lower bound:
∥dij∥2≥∥dij(k)∥2(dij(k))⊤dij.
Therefore enforce
(dij(k))⊤dij≥dmin∥dij(k)∥2.
Its left side is linear in the new positions. The lower-bound inequality proves that satisfying this constraint also gives ∥dij∥2≥dmin.
This is an inner approximation: it can exclude useful feasible layouts, but it does not admit layouts that violate the prescribed separation. The current feasible layout remains allowed.
Lecture 1 · Optimization Problem Modeling81 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
A concave local power model gives a convex subproblem
For this maximisation, use a negative semidefinite curvature model Hk⪯0; an arbitrary approximate Hessian would not suffice. With s=l−l(k),
The box trust region keeps this a QP: equivalently minimise −mk, whose Hessian is positive semidefinite, over linear constraints. All inequalities are non-strict, so the boundary is available to the solver. The original F remains non-concave.
Lecture 1 · Optimization Problem Modeling82 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
Accept a step only when the power model earns trust
Let l^ solve the subproblem. Compare actual power gain with predicted gain:
Form the ratio only when the predicted gain is positive and numerically meaningful.
Accept when rk≥η for 0<η<1; otherwise keep the current layout and shrink the radius.
Increase the radius only after strong agreement, typically when a successful step also reaches the trust-region boundary.
A rejected step changes no coordinates. Zero movement after rejection is not convergence. Check first-order optimality and feasibility; a tiny radius with a large residual indicates stalling.
Lecture 1 · Optimization Problem Modeling83 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
The optimised layout breaks repeated wake alignments
Blue squares: initial positions. Red circles: optimised positions. Coordinates are normalised by rotor diameter D. Source: original PowerPoint, slide 50.
Read the displacement pattern
The optimiser perturbs a regular initial grid while respecting the site's geometry. These movements change the chains of upstream and downstream turbines for common wind directions.
The layout is the decision, not the proof of success. It must be evaluated using the same wind scenarios and power model as the initial layout, with separation and boundary constraints checked separately.
These are the source study's reported layouts, not a new simulation. The general derivation uses dmin so that the separation requirement is carried consistently through each step.
Lecture 1 · Optimization Problem Modeling84 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
The reported efficiency improves, then levels off
Reported wind-farm power efficiency versus optimisation iteration. Source: original PowerPoint, slide 50.
What the curve supports
The plotted efficiency rises from approximately 0.69 to 0.77, about eight percentage points. Most of the improvement occurs in the early iterations, followed by a plateau.
The curve demonstrates improvement in this modelled case. A plateau alone does not prove global optimality of the original non-convex layout problem, and modelled efficiency is not a measured increase in a real farm's annual energy production.
Lecture 1 · Optimization Problem Modeling85 / 93
EXTENSIONCase study — the full wind-farm optimizationLecture 1
Better average power does not mean better in every direction
Efficiency by wind direction: initial layout in blue, optimised layout in red. Source: original PowerPoint, slide 50.
Several deep troughs become shallower, while some peaks decrease. The optimiser trades power between directions according to the scenario probabilities. This is compatible with an increase in the weighted average; it is not pointwise improvement for every wind direction.
The case closes the modelling loop: state the decision, preserve feasibility, solve local models and evaluate the resulting layout. Convex subproblems do not make the original problem globally convex.
Lecture 1 · Optimization Problem Modeling86 / 93
EXTENSION
Modelling extensions — alternative convex formulations
Read after completing the main route.
EXTENSIONModelling extensions — alternative convex formulationsLecture 1
Piecewise-linear — the epigraph earns its keepExample 1.3
A maximum of affine pieces is not linear. Its epigraph is, and that turns out to be enough.
The problem
Minimise the largest of several affine pieces:
xminimax(ai⊤x+bi)
The objective is convex — a maximum of affine functions always is — but it is not itself a linear objective. Rewrite it before passing it to an LP solver.
The rewrite
Give the maximum a name, then push it down:
x,tmints.t.ai⊤x+bi≤t
One new variable, one constraint per piece, and it is an LP.
Why it is sound: nothing in the objective rewards a large t, so at the optimum t is squeezed down until it meets the largest piece. Minimising over the epigraph {(x,t):t≥f(x)} therefore returns exactly minxf(x).
The move is general — any convex objective can be traded for a linear one over its epigraph. It returns in Act 3, and again as the surrogate in Lecture 10.
Lecture 1 · Optimization Problem Modeling88 / 93
EXTENSIONModelling extensions — alternative convex formulationsLecture 1
Chebyshev centre — an infinity of constraints, collapsedExample 1.4
Where inside a polyhedron can you put the largest ball? The unknowns are its centre xc and its radius r.
Let P={x:ai⊤x≤bi}. The ball of radius r about xc lies inside P exactly when every point of it satisfies every face:
∥u∥2≤rsupai⊤(xc+u)≤bi∀i
As written that is one constraint for every u in a ball — infinitely many. But the supremum is available in closed form: ai⊤u is largest when u points along ai, so it equals r∥ai∥2 by Cauchy–Schwarz. The infinity collapses to one linear constraint per face:
xc,r≥0maxrs.t.ai⊤xc+r∥ai∥2≤bi∀i
∥ai∥2 is data, not a variable — so the constraint is linear in (xc,r), which is all an LP asks.
Lecture 1 · Optimization Problem Modeling89 / 93
None of the three looked linear when it was stated
Diet was already an LP and only had to be written down. The piecewise-linear objective needed a new variable. The Chebyshev centre needed an infinite family of constraints reduced by an inequality. Modelling is the act of finding the rewrite — and it is where the expertise lives, because the solver is a commodity.
EXTENSIONModelling extensions — alternative convex formulationsLecture 1
A linear programme with random costa non-negative variance penalty preserves convexity
The cost vector c is not known, only its mean cˉ and covariance Σ. The objective c⊤x is then itself a random number:
E[c⊤x]=cˉ⊤x,Var(c⊤x)=x⊤Σx.
Minimising a random number is not yet a decision, so you must say what its spread is worth. Charge for it linearly:
xmincˉ⊤x+γx⊤Σx
γ is the first risk parameter of the course — the price, in units of expected cost, that you put on variance. A covariance matrix is positive semidefinite by construction, since v⊤Σv=Var(c⊤v)≥0 for every v. Scaling a convex quadratic by a non-negative number keeps it convex and by a negative one flips it, so γ≥0guarantees convexity. If γ<0 and Σ=0, the objective is not convex on the full space; a zero covariance or a restricted feasible subspace can be a degenerate exception.
γ>0 is risk-averse and γ=0 risk-neutral, returning the plain LP; risk-seekingγ<0 produces a concave quadratic objective, generally making its minimisation non-convex. The condition is a modelling decision, not a technicality.
Lecture 1 · Optimization Problem Modeling91 / 93
EXTENSIONModelling extensions — alternative convex formulationsLecture 1
Robust LP — the worst case is convex for freedeterministic — the constraint must hold for every gi in a set Ei
Now the constraint is the uncertain thing rather than the objective. Lecture 0's split between deterministic and stochastic uncertainty gives two honest formulations of it, and the two do not fare alike.
Demand that the constraint survive every outcome in an uncertainty set Ei:
gi⊤x≤hi∀gi∈Ei
This is not one constraint but one per element of Ei — infinitely many of them when Ei is a continuum. Every one is a half-space in x, and an intersection of half-spaces is convex however many there are. The feasible set is therefore convex for any Ei whatever, a nonconvex or disconnected one included.
What the shape of Ei decides is tractability, not convexity. An ellipsoidal Ei collapses that infinite family into a single second-order cone constraint, gˉi⊤x+∥Pi⊤x∥2≤hi; a polyhedral one collapses by duality into finitely many linear constraints.
Lecture 1 · Optimization Problem Modeling92 / 93
EXTENSIONModelling extensions — alternative convex formulationsLecture 1
Robust LP — the chance constraint is notstochastic — the constraint need hold only with probability η
Ask instead that the constraint hold merely often enough:
P(gi⊤x≤hi)≥η
For a general distribution that set is not necessarily convex. Take gi Gaussian, though, and it can be written out: gi⊤x is then a scalar Gaussian with mean gˉi⊤x and standard deviation ∥Σi1/2x∥2, so standardising the requirement gives
gˉi⊤x+Φ−1(η)∥Σi1/2x∥2≤hi.
The norm is convex, so the whole is a second-order cone constraint — but only if the number multiplying it is non-negative, and Φ−1(η)≥0 exactly when η≥21. Below even odds the sign flips, so this convexity guarantee is lost; special or degenerate instances can still have a convex feasible set.
Not "the usual choices", then, but three conditions: γ≥0, any Ei at all, and η≥21. These are structural convexity guarantees; particular instances may have additional structure. Lecture 2 takes the stochastic reading much further; Lecture 5 meets the worst-case one again when a surrogate must be trusted only where the data supports it.
Lecture 1 · Optimization Problem Modeling93 / 93
IE437 · Lecture 1 — Optimization Problem Modeling
1Optimization Problem Modeling
2Where we are — the simplest cell of the map
3Learning route — formulate, solve, and certify
Act 1 — the standard form
5The standard form — one shape for all of them
6A production decision, written all the way down
7Formulation is a balance
8Equivalent problems — four rewrites worth knowing
9Check — putting it in the standard form
Act 2 — convexity, the watershed
11Convexity — the line between easy and hard
12Convex sets — the segment test
13The same convexity, seen through the gradient
14The watershed, run twice
15The convex family — LP, QP, QCQP
16Diet — where linear programming started
17Least squares with bounds — nothing to check
18Check — why convexity is the watershed
Act 3 — certifying optimality
20When is a point optimal? — the first-order condition
21Necessary — an optimum cannot have a feasible downhill direction
22Sufficient — a convex tangent bound certifies every feasible point
23Necessary alone does not certify a minimum
24Why the condition is exact — the two arrows do different work
25Unconstrained optimality — combine two equivalences
26Why the first-order inequality becomes a zero gradient
27The condition, made draggable
28Why can the optimum stop at a wall?
29KKT setup — the problem and its Lagrangian
30KKT conditions — formal statement
31Read the four conditions in plain language
32KKT optimality theorem — necessary and sufficient
33Solve the example — where do x and the multiplier come from?
34KKT example — check the four conditions
35Certifying the production decision with actual multipliers
36Temperature thread — solve the one-step heater problem
37Try it — the heater limit becomes 0.5
38Why KKT certifies a global optimum
39What is a little more freedom worth?
40Duality — a lower bound you get for free
41Duality in numbers — the same example, one last time
42Check — the price of a slack constraint
Act 4 — when the problem is not convex
44Successive convexification — solve a sequence of easy problems
45The trust region, iterated
46Wind-farm layout — the wakes make it a joint decision
47Read the engineering case using the same four questions
48Check — what a trust region is for
Closing
50Where we are — and the assumption we now drop
51Optimization is how a decision becomes mathematics — and, when the problem is convex, an answer we can not only find but prove.
52Questions?
Appendix — backup slides
54Reading guide — certify an optimum, then differentiate a decision
55Backup — the successive convex programming loop
56Backup — the general Lagrangian and KKT conditions