MAE Optimization Lecture 2 Handout
MAE Optimization Lecture 2 Handout
Introduction to Optimization
E. Flayac
Generalities on Optimization
Differential Calculus
Convexity
▶ Discrete or Continuous
▶ Finite or Infinite Dimension
▶ Static or Dynamic
▶ Defined by a finite number of equality and inequality constraints:
A = {x ∈ Rn : h(x) = 0, g (x) ≤ 0}
with h(x) ∈ Rm and g (x) ∈ Rp
Examples of constraints:
▶ Physical restrictions: positivity, equilibrium law, Newton’s second
law, . . .
▶ Goal to achieve: target point, production goal, . . .
▶ Safety constraints: ”stay on the road”, collision avoidance,
probability of failure, . . .
▶ Other constraints: budget, time, space, . . .
Going back to :
min f (x) (P)
x∈A
Definition: Solution
We say that x∗ ∈ Rn is a global solution of (P) if
▶ x∗ ∈ A;
▶ f (x∗ ) ≤ f (x), ∀x ∈ A.
The set of solutions is written as :
argmin f (x)
x∈A
Remarks
▶ A global solution is also called a global minimum
▶ Minimizing f is equivalent to maximize −f
A x
Global Minimum
Definitions
We denote by B(x∗ , r ) the ball centered at x∗ of radius r > 0 i.e.
B(x∗ , r ) = {x ∈ Rn | ∥x − x∗ ∥ ≤ r }
Local solutions
We say that x∗ ∈ Rn is a local solution of (P) if
▶ x∗ ∈ A
▶ ∃r > 0, ∀x ∈ B(x∗ , r ) ∩ A, f (x∗ ) ≤ f (x)
Strict local solution
We say that x∗ ∈ Rn is a strict local solution of (P) if
▶ x∗ ∈ A
▶ ∃r > 0, ∀x ∈ B(x∗ , r ) ∩ A\{x∗ }, f (x∗ ) < f (x)
Introduction to Optimization | Generalities on Optimization | March 4th | Slide 16/46
Example
y f (x) = 0.4x(sin(x) + cos(2x))
B(x ∗ , r )
A x∗ x
Local Minimum
Global Minimum
▶ Expert in trajectory
computation (orbital
mechanics)
Definition
We consider a smooth function f : Rn → R.
For a fixed x = [x1 , . . . , xn ]T ∈ Rn and y ∈ R set :
fi (y ) = f (x1 , . . . , xi−1 , y , xi+1 , . . . , xn )
|{z}
i th
∂f
The partial derivative of f with respect to xi at x, denoted by ∂xi reads:
∂f
(x) = fi ′ (xi )
∂xi
∂f ∂f
(x) = 2(x1 − x2 ) (x) = 2(xn − xn−1 )
∂x1 ∂xn
∂f
(x) = 2(xi − xi−1 ) + 2(xi − xi+1 ) for i = 3, . . . , n − 1
∂xi
Remarks
▶ Let ei = [0, . . . , 0, 1 , 0, . . . , 0]T be i th vector column of the
|{z}
i th
canonical basis of Rn
▶ The partial derivatives are in fact the directional derivatives in the
directions of the canonical basis
∂f f (x + ϵei ) − f (x)
(x) = f ′ (x; ei )(x) = lim
∂xi ϵ→0 ϵ
∂2f
2
∇ f (x) := (x)
∂xi ∂xj 1≤i,j≤n
∂2f ∂2f
2 (x) · · · ∂x ∂x (x)
∂x1. n
..
1
.. ∈ Rn×n
= .
. . .
∂2f ∂2f
∂x1 ∂xn (x) · · · ∂x 2
(x)
n
fm (x)
with scalar components fi : Rn → R for 1 ≤ i ≤ m
First-order derivative
If f is continuously differentiable on Rn , one defines for any x ∈ Rn the
Jacobian of f at x by
∂f1 ∂f1
∂x1 (x) · · · ∂xn (x)
Jf (x) := f ′ (x) := ... .. .. ∈ Rm×n
. .
∂fm ∂fm
∂x (x) · · · ∂xn (x)
1T
∇f1 (x)
′ ..
Jf (x) := f (x) := m × n rectangular matrix
.
T
∇fm (x)
Introduction to Optimization | Differential Calculus | March 4th | Slide 33/46
Differential form and Jacobian matrix
sin(x 2 ) + x 3
f (x) = u(v (x)) =
x3
One has:
′ 2x cos(y1 ) 1
′
v (x) = u (y1 , y2 ) =
3x 2 0 1
cos(x 2 ) 1 2x
′ ′ ′
f (x) = u (v (x))v (x) =
0 1 3x 2
2x cos(x 2 ) + 3x 2
′
f (x) =
3x 2
Example 1: f (x, y ) = 2x 2 + 5y 2
For a given z, we get the level curves by 2x 2 + 5y 2 = z.
⇒ It describes a family of ellipses.
Definition
A set C ∈ Rn is called convex if
∀(x, y) ∈ C , ∀t ∈ [0, 1], tx + (1 − t)y ∈ C .
x y x y
Examples
▶ Rn
▶ Ball: {x ∈ Rn | ∥x∥ ≤ 1}
f (y)
f (x) f (x)
f (y)
x
x y x y
(1 − t)x + ty (1 − t)x + ty
Remark
A function f : Rn → Rm is convex iff its components (f1 , . . . fm ) are convex
f (y)
f (x) + ∇f (x)T (y − x)
f (x)
x
x y
Convex function
Definition
Let S ∈ Rn×n be a real symmetric matrix, c ∈ Rn , and α ∈ R, a quadratic
form is a function f : Rn → R given by
1
f (x) = xT Sx + cT x + α
2
In this case, one has
∇f (x) = Sx + c ∈ Rn
∇2 f (x) = S
1
f (x) = xT Sx + cT x + α
2
Taylor expansion with x ∈ Rn and h ∈ Rn :
1
f (x + h) = (x + h)T S(x + h) + cT (x + h) + α
2
1 T
= x Sx + xT Sh + hT Sx + hT Sh + cT x + cT h + α
2
1 1
= f (x) + (xT Sh + hT
| {zSx} ) + hT Sh + cT h
2 T T T
2
=(h Sx) =x Sh
1
= f (x) + xT Sh + hT Sh + cT h
2
T 1 T
= f (x) + (Sx + c) h + h Sh
| {z } 2 | {z }
T 2 h ∇ f (x)h
∇f (x)T h