4. Outline
◮ Convex Optimization
◮ Sum of Squares
◮ Control Applications
▽Control Synthesis by Sum of Squares Optimization – p.1/30
5. Outline
◮ Convex Optimization
◮ Sum of Squares
◮ Control Applications
◮ Conclusion
Control Synthesis by Sum of Squares Optimization – p.1/30
6. Convex set
C ⊆ Rn is convex if
x, y ∈ C, θ ∈ [0, 1] =⇒ θx + (1 − θ)y ∈ C
"Convex Optimization with Engineering Applications", Professor Stephan Boyd, Stanford University
Control Synthesis by Sum of Squares Optimization – p.2/30
7. Convex function
f : Rn −→ R is convex if
x, y ∈ Rn, θ ∈ [0, 1]
⇓
f(θx + (1 − θ)y) ≤ θf(x) + (1 − θ)f(y)
"Convex Optimization with Engineering Applications", Professor Stephan Boyd, Stanford University
Control Synthesis by Sum of Squares Optimization – p.3/30
8. Convex optimization problem
minimize f(x)
subject to x ∈ C
f convex, C convex
"Convex Optimization with Engineering Applications", Professor Stephan Boyd, Stanford University
▽Control Synthesis by Sum of Squares Optimization – p.4/30
9. Convex optimization problem
minimize f(x)
subject to x ∈ C
f convex, C convex
Convex optimization problems
◮ can be solved numerically with great efficiency
◮ have extensive useful theory
◮ occur often in engineering problems
◮ often go unrecognized
"Convex Optimization with Engineering Applications", Professor Stephan Boyd, Stanford University
Control Synthesis by Sum of Squares Optimization – p.4/30
10. Linear programming
minimize aT
0 x
subject to aT
i x ≤ bi, i = 1, . . . , m.
"Convex Optimization with Engineering Applications", Professor Stephan Boyd, Stanford University
Control Synthesis by Sum of Squares Optimization – p.5/30
11. Semidefinite programming
minimize cT
x
subject to x1F1 + · · · + xnFn + G ≤ 0
Ax = b,
"Convex Optimization with Engineering Applications", Professor Stephan Boyd, Stanford University
Control Synthesis by Sum of Squares Optimization – p.6/30
12. In fact the great watershed in
optimization isn’t between
linearity and nonlinearity,
but
convexity and nonconvexity.
Rockafellar 1993
Control Synthesis by Sum of Squares Optimization – p.7/30
13. Nonnegativity of polynomials
Polynomials of degree d in n variables:
p(x) p(x1, x2, . . . , xn) =
k1+k2+···+kn≤d
ak1k2...kn
xk1
1 xk2
2 · · · xkn
n
▽Control Synthesis by Sum of Squares Optimization – p.8/30
14. Nonnegativity of polynomials
Polynomials of degree d in n variables:
p(x) p(x1, x2, . . . , xn) =
k1+k2+···+kn≤d
ak1k2...kn
xk1
1 xk2
2 · · · xkn
n
How to check if a given p(x) (of even order) is globally
nonnegative?
p(x) ≥ 0, ∀x ∈ Rn
▽Control Synthesis by Sum of Squares Optimization – p.8/30
15. Nonnegativity of polynomials
Polynomials of degree d in n variables:
p(x) p(x1, x2, . . . , xn) =
k1+k2+···+kn≤d
ak1k2...kn
xk1
1 xk2
2 · · · xkn
n
How to check if a given p(x) (of even order) is globally
nonnegative?
p(x) ≥ 0, ∀x ∈ Rn
◮ For d = 2, easy (check eigenvalues). What happens
in generel?
◮ Decidable, but NP-hard when d ≥ 4.
◮ "Low complexity" is desired at the cost of possibly
being conservative.
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.8/30
16. A sufficient condition
A "simple" sufficient condition: a sum of squares (SOS)
decomposition:
p(x) =
m
i=1
f2
i (x)
If p(x) can be written as above, for some polynomials fi,
then p(x) ≥ 0.
▽Control Synthesis by Sum of Squares Optimization – p.9/30
17. A sufficient condition
A "simple" sufficient condition: a sum of squares (SOS)
decomposition:
p(x) =
m
i=1
f2
i (x)
If p(x) can be written as above, for some polynomials fi,
then p(x) ≥ 0.
◮ p(x) is an SOS if and only if a positive semidefinite
matrix Q exists such that
p(x) = ZT
(x)QZ(x)
where Z(x) is the vector of monomials of degree less
than or equal to deg(p)/2
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.9/30
18. Example
p(x, y) = 2x4
+ 5y4
− x2
y2
+ 2x3
y
=
x2
y2
xy
T
q11 q12 q13
q21 q22 q23
q13 q23 q33
x2
y2
xy
= q11x4
+ q22y4
+ (q33 + 2q12)x2
y2
+ 2q13x3
y + 2q23xy3
An SDP with equality constraints.
▽Control Synthesis by Sum of Squares Optimization – p.10/30
19. Example
p(x, y) = 2x4
+ 5y4
− x2
y2
+ 2x3
y
=
x2
y2
xy
T
q11 q12 q13
q21 q22 q23
q13 q23 q33
x2
y2
xy
= q11x4
+ q22y4
+ (q33 + 2q12)x2
y2
+ 2q13x3
y + 2q23xy3
An SDP with equality constraints. Solving, we obtain:
Q =
2 −3 1
−3 5 0
1 0 5
= LT
L, L =
1
√
2
2 −3 1
0 1 3
And therefore p(x, y) = 1
2(2x2 − 3y2 + xy)2 + 1
2(y2 + 3xy)2.
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.10/30
20. Sum of squares programming
A sum of squares program is a convex optimization
program of the following form:
Minimize
J
j=1
wjαj
subject to fi,0 +
J
j=1
αjfi,j(x) is SOS, for i = 1, . . . , I
where the αj’s are the scalar real decision variables, the
wj’s are some given real numbers, and the fi,j are some
given multivariate polynomials.
"Nonlinear control synthesis by sum of squares optimization: a Lyapunov-based approach", Stephen Prajna et al, ASCC 2004
Control Synthesis by Sum of Squares Optimization – p.11/30
21. SOSTOOLS: Sum of squares toolbox
◮ SOSTOOLS handles the general SOS programming.
◮ MATLAB toolbox, freely available.
◮ Requires SeDuMi (a freely available SDP solver).
◮ Natural syntax, efficient implementation
◮ Developed by S. Prajna, A. Papachristodoulou and P.
Parrilio
◮ Includes customized functions for several problems
Get it from:
http://www.aut.ee.ethz.ch/~parrilo/sostools
http://www.cds.caltech.edu/sostools
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.12/30
22. Global optimization
Consider for example:
min
x,y
F(x, y)
with F(x, y) = 4x2 − 21
10x4 + 1
3x6 + xy − 4y2 + 4y4
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.13/30
23. Global optimization
◮ Not convex, many local minima. NP-Hard in general.
▽Control Synthesis by Sum of Squares Optimization – p.14/30
24. Global optimization
◮ Not convex, many local minima. NP-Hard in general.
◮ Find the largest γ s.t.
F(x, y) − γ is SOS.
▽Control Synthesis by Sum of Squares Optimization – p.14/30
25. Global optimization
◮ Not convex, many local minima. NP-Hard in general.
◮ Find the largest γ s.t.
F(x, y) − γ is SOS.
◮ A semidefinite program (convex!).
▽Control Synthesis by Sum of Squares Optimization – p.14/30
26. Global optimization
◮ Not convex, many local minima. NP-Hard in general.
◮ Find the largest γ s.t.
F(x, y) − γ is SOS.
◮ A semidefinite program (convex!).
◮ If exact, can recover optimal solution.
▽Control Synthesis by Sum of Squares Optimization – p.14/30
27. Global optimization
◮ Not convex, many local minima. NP-Hard in general.
◮ Find the largest γ s.t.
F(x, y) − γ is SOS.
◮ A semidefinite program (convex!).
◮ If exact, can recover optimal solution.
◮ Surprisingly effective.
▽Control Synthesis by Sum of Squares Optimization – p.14/30
28. Global optimization
◮ Not convex, many local minima. NP-Hard in general.
◮ Find the largest γ s.t.
F(x, y) − γ is SOS.
◮ A semidefinite program (convex!).
◮ If exact, can recover optimal solution.
◮ Surprisingly effective.
Solving, the maximum value is −1.0316. Exact value.
Many more details in Parrilio & Strumfels, 2001
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.14/30
29. Lyapunov stability analysis
◮ To prove asymptotic stability of ˙x = f(x),
V (x) > 0, x = 0, ˙V (x) =
∂V
∂x
T
f(x) < 0, x = 0
▽Control Synthesis by Sum of Squares Optimization – p.15/30
30. Lyapunov stability analysis
◮ To prove asymptotic stability of ˙x = f(x),
V (x) > 0, x = 0, ˙V (x) =
∂V
∂x
T
f(x) < 0, x = 0
◮ For linear systems ˙x = Ax, quadratic Lyapunov
functions V (x) = xT Px
P > 0, AT
P + PA < 0
▽Control Synthesis by Sum of Squares Optimization – p.15/30
31. Lyapunov stability analysis
◮ To prove asymptotic stability of ˙x = f(x),
V (x) > 0, x = 0, ˙V (x) =
∂V
∂x
T
f(x) < 0, x = 0
◮ For linear systems ˙x = Ax, quadratic Lyapunov
functions V (x) = xT Px
P > 0, AT
P + PA < 0
◮ With an affine family of candidate Lyapunov functions
V , ˙V is also affine.
▽Control Synthesis by Sum of Squares Optimization – p.15/30
32. Lyapunov stability analysis
◮ To prove asymptotic stability of ˙x = f(x),
V (x) > 0, x = 0, ˙V (x) =
∂V
∂x
T
f(x) < 0, x = 0
◮ For linear systems ˙x = Ax, quadratic Lyapunov
functions V (x) = xT Px
P > 0, AT
P + PA < 0
◮ With an affine family of candidate Lyapunov functions
V , ˙V is also affine.
◮ Instead of checking nonnegativity, use an SOS
condition
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.15/30
33. Lyapunov stability - Example
A jet engine model (derived from Moore-Greitzer), with
controller:
˙x = −y +
3
2
x2
−
1
2
x3
˙y = 3x − y
Try a generic 4th order polynomial Lyapunov function.
▽Control Synthesis by Sum of Squares Optimization – p.16/30
34. Lyapunov stability - Example
A jet engine model (derived from Moore-Greitzer), with
controller:
˙x = −y +
3
2
x2
−
1
2
x3
˙y = 3x − y
Try a generic 4th order polynomial Lyapunov function.
Find a V (x, y) that satisfies the conditions:
◮ V (x, y) is SOS.
◮ − ˙V (x, y) is SOS
Can easily do this using SOS/SDP techniques...
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.16/30
35. Lyapunov stability - Example
After solving the SDPs, we obtain a Lyapunov function.
"Certificates, convex Optimization, and their applications", Pablo A. Parrilo, Swiss Federal Institute of Technology Zurich
Control Synthesis by Sum of Squares Optimization – p.17/30
36. Lyapunov stability - Example
◮ Consider the nonlinear system
˙x1 = −x3
1 − x1x2
3
˙x2 = −x2 − x2
1x2
˙x3 = −x3 −
3x3
x2
3 + 1
+ 3x2
1x3
▽Control Synthesis by Sum of Squares Optimization – p.18/30
37. Lyapunov stability - Example
◮ Consider the nonlinear system
˙x1 = −x3
1 − x1x2
3
˙x2 = −x2 − x2
1x2
˙x3 = −x3 −
3x3
x2
3 + 1
+ 3x2
1x3
◮ Looking for a quadratic Lyapunov function s.t.
V − (x2
1 + x2
2 + x2
3) is SOS,
(x2
3 + 1)(− ∂V
∂x1
˙x1 − ∂V
∂x2
˙x2 − ∂V
∂x3
˙x3) is SOS,
we have V (x) = 5.5489x2
1 + 4.1068x2
2 + 1.7945x2
3.
"SOSTOOLS: control applications and new developments", Stephen Prajna et al, CACSD 2004
Control Synthesis by Sum of Squares Optimization – p.18/30
38. Parametric robustness analysis - Example
◮ Consider the following linear system
d
dt
x1
x2
x3
=
−p1 1 −1
2 − p2 2 −1
3 1 −p1p2
x1
x2
x3
where p1 ∈ [p1, p1] and p2 ∈ [p2, p2] are parameters.
▽Control Synthesis by Sum of Squares Optimization – p.19/30
39. Parametric robustness analysis - Example
◮ Consider the following linear system
d
dt
x1
x2
x3
=
−p1 1 −1
2 − p2 2 −1
3 1 −p1p2
x1
x2
x3
where p1 ∈ [p1, p1] and p2 ∈ [p2, p2] are parameters.
◮ Parameter set can be captured by
a1(p) (p1 − p1)(p1 − p1) ≤ 0
a2(p) (p2 − p2)(p2 − p2) ≤ 0
"SOSTOOLS: control applications and new developments", Stephen Prajna et al, CACSD 2004
Control Synthesis by Sum of Squares Optimization – p.19/30
40. Parametric robustness analysis - Example
Find V (x; p) and qi,j(x; p), such that
◮ V (x; p) − x 2 + 2
j=1 q1,j(x; p)ai(p) is SOS,
◮ − ˙V (x; p) − x 2 + 2
j=1 q2,j(x; p)ai(p) is SOS,
qi,j(x; p) is SOS, for i, j = 1, 2.
"SOSTOOLS: control applications and new developments", Stephen Prajna et al, CACSD 2004
Control Synthesis by Sum of Squares Optimization – p.20/30
41. Safety verification - Example
◮ Consider the following system
˙x1 = x2
˙x2 = −x1 +
1
3
x3
1 − x2
◮ Initial set
X0 = {x : g0(x) = (x1 − 1.5)2
+ x2
2 − 0.25 ≤ 0}
◮ Unsafe set
Xu = {x : gu(x) = (x1 + 1)2
+ (x2 + 1)2
− 0.16 ≤ 0}
"SOSTOOLS: control applications and new developments", Stephen Prajna et al, CACSD 2004
Control Synthesis by Sum of Squares Optimization – p.21/30
43. Safety verification - Example
Barrier certificate B(x)
◮ B(x) < 0, ∀x ∈ X0
◮ B(x) > 0, ∀x ∈ Xu
◮ ∂B
∂x1
˙x1 + ∂B
∂x2
˙x2 ≤ 0
SOS program: Find B(x) and σi(x)
◮ −B(x) − 0.1 + σ1(x)g0(x) is SOS,
◮ B(x) − 0.1 + σ2(x)gu(x) is SOS,
◮ − ∂B
∂x1
˙x1 − ∂B
∂x2
˙x2 is SOS
◮ σ1(x) and σ2(x) are SOS
"SOSTOOLS: control applications and new developments", Stephen Prajna et al, CACSD 2004
Control Synthesis by Sum of Squares Optimization – p.22/30
44. Safety verification - Example
"SOSTOOLS: control applications and new developments", Stephen Prajna et al, CACSD 2004
Control Synthesis by Sum of Squares Optimization – p.23/30
45. Nonlinear control synthesis
◮ Consider the system
˙x = f(x) + g(x)u
▽Control Synthesis by Sum of Squares Optimization – p.24/30
46. Nonlinear control synthesis
◮ Consider the system
˙x = f(x) + g(x)u
◮ State dependent linear-like representation
˙x = A(x)Z(x) + B(x)u
where Z(x) = 0 ⇔ x = 0
▽Control Synthesis by Sum of Squares Optimization – p.24/30
47. Nonlinear control synthesis
◮ Consider the system
˙x = f(x) + g(x)u
◮ State dependent linear-like representation
˙x = A(x)Z(x) + B(x)u
where Z(x) = 0 ⇔ x = 0
◮ Consider the following Lyapunov function and control
input
V (x) = ZT
(x)P−1
Z(x)
u(x) = K(x)P−1
Z(x)
"Nonlinear control synthesis by sum of squares optimization: a Lyapunov-based approach", Stephen Prajna et al, ASCC 2004
Control Synthesis by Sum of Squares Optimization – p.24/30
48. Nonlinear control synthesis
For the system ˙x = A(x)Z(x) + B(x)u, suppose there
exist a constant matrix P, a polynomial matrix K(x), a
constant ǫ1 and a sum of squares ǫ2(x), such that
◮ vT (P − ǫ1I)v is SOS,
◮ −vT (PAT (x)MT (x) + M(x)A(x)P +
KT (x)BT (x)MT (x) + M(x)B(x)K(x) + ǫ2(x)I) is SOS,
where v ∈ RN and Mij(x) = ∂Zi
∂xj
(x). Then a controller that
stabilizes the system is given by:
u(x) = K(x)P−1
Z(x)
Furthermore, if ǫ2(x) > 0 for x = 0, then the zero
equilibrium is globally asymptotically stable.
"Nonlinear control synthesis by sum of squares optimization: a Lyapunov-based approach", Stephen Prajna et al, ASCC 2004
Control Synthesis by Sum of Squares Optimization – p.25/30
49. Nonlinear control synthesis - Example
Consider a tunnel diode circuit:
˙x1 = 0.5(−h(x1) + x2)
˙x2 = 0.2(−x1 − 1.5x2 + u)
where the diode characteristic:
h(x1) = 17.76x1 − 103.79x2
1 + 229.62x3
1 − 226.31x4
1 + 83.72x5
1
"Nonlinear control synthesis by sum of squares optimization: a Lyapunov-based approach", Stephen Prajna et al, ASCC 2004
Control Synthesis by Sum of Squares Optimization – p.26/30
50. Nonlinear control synthesis - Example
"Nonlinear control synthesis by sum of squares optimization: a Lyapunov-based approach", Stephen Prajna et al, ASCC 2004
Control Synthesis by Sum of Squares Optimization – p.27/30
51. How conservative is SOS?
◮ It is proven by Hilbert that "nonnegativity" and "sum
of squares" are equivalent in the following cases.
⊲ Univariate polynomials, any (even) degree
⊲ Quadratic polynomials, in any number of variables
⊲ Quartic polynomials in two variables
▽Control Synthesis by Sum of Squares Optimization – p.28/30
52. How conservative is SOS?
◮ It is proven by Hilbert that "nonnegativity" and "sum
of squares" are equivalent in the following cases.
⊲ Univariate polynomials, any (even) degree
⊲ Quadratic polynomials, in any number of variables
⊲ Quartic polynomials in two variables
◮ When the degree is larger than two it follows that
⊲ There are signitcantly more nonnegative
polynomials than sums of squares.
⊲ There are signitcantly more sums of squares than
sums of even powers of linear forms.
[G. Blekherman, University of Michigan, submitted for
publication]
Control Synthesis by Sum of Squares Optimization – p.28/30
53. Conclusion
◮ Sum of squares, conservative but much more
tractable than nonnegativity
▽Control Synthesis by Sum of Squares Optimization – p.29/30
54. Conclusion
◮ Sum of squares, conservative but much more
tractable than nonnegativity
◮ Many applications in control theory
▽Control Synthesis by Sum of Squares Optimization – p.29/30
55. Conclusion
◮ Sum of squares, conservative but much more
tractable than nonnegativity
◮ Many applications in control theory
◮ Try your problem!
Control Synthesis by Sum of Squares Optimization – p.29/30
56. References
◮ Convex optimmization by Stephen Boyd and Lieven
Vandenberghe, available online
http://www.stanford.edu/~boyd/cvxbook
◮ SOSTOOLS, MATLAB toolbox, freely available
http://www.cds.caltech.edu/sostools
Control Synthesis by Sum of Squares Optimization – p.30/30