# Python Visualization¶

#### Created by: Kosal Chhin¶

The problem below is part of an exercise problem taken from the book: "Optimization - Theory and Practice" by Wilhelm Forst and Deiter Hoffmann, Springer New York, 2010. Chapter 2, Exercise 5.

#### However, is it really right to use this term so carelessly? Consider two typical representatives¶

$$f_i: \mathbb{R}^2 \longrightarrow \mathbb{R}, i \in \{1,2\}:$$ $$f_1(x,y) = x^2 + y^2$$ $$f_2(x,y) = x^2 - y^2$$

1) Let's begin by visualizing the 3d plots and contour plots of f1 and f2 defined above.

2) Then, define constraints, cons1, cons2, cons3, cons4 and cons5 below:

Let $cons_i \subset \mathbb{R}^2$ for $i \in \{1,2,3,4,5\}$ be a region in $\mathbb{R}^2$ with:

$$cons1 := \{(x,y) \in \mathbb{R}^2: x_1^2 + x_2^2 \leq 0.04\}$$ $$cons2 := \{(x,y) \in \mathbb{R}^2: (x_1 - 0.55)^2 + (x_2 - 0.7)^2 \leq 0.04\}$$ $$cons3 := \{(x,y) \in \mathbb{R}^2: (x_1 - 0.55)^2 + x_2 \leq 0.04\}$$

The outer boundary of the regions $cons4$ and $cons5$ is defined by:

$$x = 0.5(0.5 + 0.2\cos(6t))\cos(t) + x_c$$ $$y = 0.5(0.5 + 0.2\cos(6t))\sin(t) + y_c$$ $$t \in [\, 0, 2\pi]\,$$

where $(x_c, y_c) = (0, 0)$ for $cons4$ and $(x_c, y_c) = (0, -0.7)$ for $cons5$

3) solve the minimization problem using optimize minimize package.

4) Visualize the solutions along with all the constraints.

#### Conclusion¶

We see that the function f1 is strictly convex, and if there's no constraint, then we can say that strictly convex function always have exactly one minimizer.
However, the statement described above about strictly convex function should not be used carelessly because if I restrict this optimization problem with $cons5$ (see figure below), there are actually two minimizers, not one.