01 - Intro
01 - Intro
Intro
Saverio Bolognani
Controller
1 / 33
A room full of control experts
2 / 33
1 2
3 4
5 6
7 8
2 / 33
We will go through these 8 examples one by one.
For each example I will describe the plant and present a control challenge.
Discuss how you would attack the challenge, given your team’s competences.
3 / 33
Case 1
Your job is to design the thermostatic valve that regulates the flow of coolant
through a car engine and a car radiator.
Goal: design the valve to ensure that the temperature of the engine lies in the
desired range.
4 / 33
Case 2
5 / 33
Case 3
6 / 33
Case 4
7 / 33
Case 5
A healthy pancreas produces insulin when a high level of sugar in the blood is
detected, to maintain it in an optimal range.
In people affected by diabetes, the pancreas does not perform this function
properly. It is possible to assiste them with an artificial pancreas that releases
insulin when needed.
The artificial pancreas can measure the sugar in the patient blood and the
patient can signal when they are having a meal. The level of sugar needs to
stay in a prescribed range, and absolutely above a critical lower limit.
Goal: design the artificial pancreas logic.
8 / 33
Case 6
9 / 33
Case 7
10 / 33
Case 8
Vin iB i Vout
RB β −RL
+
−
VE
RE
11 / 33
Computational Control
Cyber-physical systems
Systems in which the controller is an advanced embedded computer
that can sense and actuate a physical plant.
12 / 33
Automatic Control Lab http://control.ee.ethz.ch
Saverio Bolognani
[email protected] Sophie Hall
www.bsaver.io
Keith Moffat
Nicolas Lanzetti
Alberto Padoan
13 / 33
Course logistics
Lectures
▶ Every Monday 10:15 - 12:00 in HG D 1.1
Tutorials
▶ Every Wednesday 10:15 - 12:00 in HG E 1.2
Office hours
▶ Via the Moodle forum
▶ For any communication that cannot happen on the forum, via email
14 / 33
Grading and exam
6 credits
Performance assessment
▶ 30% of the final grade is based on a final project
▶ 70% based on a written final exam
- No aids, in August (location and exact date t.b.a.)
▶ No oral exam
Prerequisites
▶ Control systems fundamentals
▶ Linear algebra
15 / 33
Project
16 / 33
Basic concepts in convex optimization
What are computers good at?
0.8
0.6
0.4
0.2
0
-1 -0.5 0 0.5 1
17 / 33
Mathematical optimization
18 / 33
Convexity
x 00 x0 x 00 x0
t=0 t=1
tx 0 + (1 − t)x 00 tx 0 + (1 − t)x”
0≤t≤1 0≤t≤1
Convex sets
Convex functions
19 / 33
Convex sets and convex functions
?
g(x) convex ⇔ {g(x) ≤ c} convex
20 / 33
?
g(x) convex ⇒ {g(x) ≤ c} convex
?
g(x) convex ⇐ {g(x) ≤ c} convex
21 / 33
Common convex sets
Halfspaces
{x | a⊤ x ≤ b}
Balls
{x | ∥x − c∥ < r}
a> x ≤ b c c
a> x = b r
22 / 33
Supporting hyperplanes
Theorem
If a set is convex, then there exists a supporting hyperplane at every point z on its
boundary.
x
∇g (z)
z
23 / 33
Unions and intersection of set
Try to prove it
Given a statement, prove that it’s true (deductive proof) or false (counterexample).
Polytopes
Intersection of hyperplanes
{x | a⊤
i x ≤ b ∀i = 1, . . . , r} Ax ≤ b
ai> x = b
{x | Ax ≤ b}
24 / 33
Common convex functions
Affine functions
f (x) = a⊤ x + b
Norms
f (x) = ∥x − c∥
Quadratic functions
25 / 33
First and second derivatives
First-order condition
If f is differentiable on a convex domain, then
f (x) + ∇f (x)> (y − x)
Second-order condition
If f is twice differentiable on a convex domain, then
f convex ⇔ ∇2 f (x) ⪰ 0 ∀x
26 / 33
Convex optimization problems
X convex set
f convex function
g convex function
h affine function
27 / 33
Local optimality conditions (1)
Proposition
Any local optimum of a convex problem is a global optimum.
Proof:
Suppose x ∗ is locally optimal, but there exists y such that f (y) < f (x ∗ ).
Consider z = ty + (1 − t)x ∗ with t = R
2∥y−x ∗ ∥
. z is feasible, thanks to convexity.
z is inside the ball of radius R, because ∥z − x ∗ ∥ = t∥y − x ∗ ∥ = R/2.
Because of convexity,
28 / 33
Local optimality conditions (2)
Proposition
x ∗ is a local optimum for a differentiable problem if and only if
∇f (x ∗ ) ∇f (x ∗ )
x∗ x∗
y y
29 / 33
Constrained case
∇g (x)
∇f (x) ∇f (x) = 0
30 / 33
Constrained case
∇g (x)
∇f (x) ∇f (x) = 0
31 / 33
Solving convex optimization problems
KKT conditions
∇f (x) + µ⊤ ∇g(x) = 0
µ ≥ 0
∇g (x)
∇f (x) = 0
∇f (x)
g(x) ≤ 0
µi gi (x) = 0 ∀i
32 / 33
Resources
https://web.stanford.edu/~boyd/cvxbook/
Lecture slides
Book “Convex Optimization” free to download
Code and toolboxes (CVX)
Exercises
Open online course
33 / 33
This work is licensed under a
Creative Commons Attribution-ShareAlike 4.0 International License
https://bsaver.io/COCO