Numerical Optimization
Numerical Optimization
Optimization
Finding minima and maxima
11 April, 2023
𝑉 (𝑥) = 𝐻 × 𝐿 × 𝑊
= 𝑥(12 − 2𝑥)(10 − 2𝑥)
= 4𝑥(6 − 𝑥)(5 − 𝑥)
= 4𝑥(𝑥2 − 11𝑥 + 30)
maximum: one of the solutions of:
𝑑𝑉 (𝑥)
= 12𝑥2 − 88𝑥 + 120 = 0
𝑑𝑥
Roots: 𝑥 = 5.52, 𝑥 = 1.81
𝑉 (5.52) ≈ −5.81,
𝑉 (1.81) ≈ 96.77
max Volume ≡ corner cut:1.81 × 1.81
Note: Solution can be approximated by
inspecting the plot of 𝑉 (𝑥) for 𝑥 > 0
𝑓(𝑥) = 0
Root
Root Root 𝑥
Optimum:
Where the curve is flat
′
′ ≡ 𝑓 (𝑥) = 0
Minimum 𝑓 (𝑥) = 0 ″
″ 𝑓 (𝑥) ⇒ maximum or minimum:
𝑓 (𝑥) > 0 ″
⎧𝑓 (𝑥) > 0 Minimum
′ { ″
𝑓 (𝑥) = 0 ⎨𝑓 (𝑥) < 0 Maximum
{𝑓 ″ (𝑥) = 0 Inflection
⎩
′
One Optimization approach: solving the root problem: 𝑓 (𝑥) = 0
Dr. Amadou Toure Numerical Methods (Engr-280) Optimization 11 April, 2023 5 / 12
𝑓(𝑥) Minimization of 𝑓(𝑥) ≡ Maximization of −𝑓(𝑥)
𝑓(𝑥)
𝑥∗ Minimum 𝑓(𝑥)
𝑥
Maximum −𝑓(𝑥)
−𝑓(𝑥)
𝑥1 = 𝑥𝑙 + 𝑑
𝑥2 = 𝑥𝑢 − 𝑑
xl 𝑑 𝑥1 𝑥 𝑑 = (𝜙 − 1)(𝑥𝑢 − 𝑥𝑙 )
𝑥2 𝑑 xu
𝑙1 𝑙2
𝑙1 + 𝑙2
𝑓(𝑥) 𝑙1 + 𝑙2 𝑙 𝑙
= 1 , Let 𝜙 = 1
Old Old 𝑙1 𝑙2 𝑙2
𝑥2 𝑥1 → 𝜙2 − 𝜙 − 1 = 0
√
1+ 5
+ve root: 𝜙 = = 1.6180339 …
2
xl 𝑥2 𝑥1 xu 𝑥
Second step: define a new interval that en-
compasses the optimum
New
Dr. Amadou Toure Numerical Methods (Engr-280) Optimization 11 April, 2023 9 / 12
Parabolic search, for minimum
We use a bracket as well, and some given point in the interior.
Let the bracket be [𝑥1 , 𝑥3 ] and the point in the interior 𝑥2 .
There is only one parabola connecting three points.
▶ Then we can differentiate it,
▶ set the result equal to zero, and solve for an estimate of the optimal 𝑥 .
4
The new point is found by fitting a degree 2 polynomial through the points
(𝑥1 , 𝑓(𝑥1 )), (𝑥2 , 𝑓(𝑥2 )) and (𝑥3 , 𝑓(𝑥3 )).
The new point 𝑥4 is found as the minimum to this degree 2 polynomial.
1 (𝑥1 − 𝑥2 )2 (𝑓(𝑥2 ) − 𝑓(𝑥3 )) − (𝑥3 − 𝑥2 )2 (𝑓(𝑥2 ) − 𝑓(𝑥1 ))
▶ 𝑥4 = 𝑥2+
2 (𝑥1 − 𝑥2 )(𝑓(𝑥2 ) − 𝑓(𝑥3 )) − (𝑥3 − 𝑥2 )(𝑓(𝑥2 ) − 𝑓(𝑥1 ))
▶ Then one of the enpoints of the bracket is moved to the one of the
True Function
Parabolic Function
𝑥1 𝑥2 𝑥4 𝑥3 𝑥
Dr. Amadou Toure Numerical Methods (Engr-280) Optimization 11 April, 2023 11 / 12
MATLAB Function: fminbnd