Exercise 30
Egg carton
Assume your cost function \(J\) is the following function of two parameters \((x,y)\):
\begin{equation} J(x,y) = -20 e^{A} - e^{B} + 20 + e \end{equation}where
\begin{equation} A = -0.2 \sqrt{0.5 (x^{2} + y^{2})} \end{equation}and
\begin{equation} B = 0.5 \left[ \mathrm{cos}(2 \pi x) + \mathrm{cos}(2 \pi y) \right] \end{equation}Map the cost landscape
Compute the cost function \(J\) for values of \((x,y)\) ranging from -10.0 to 10.0, and plot the cost landscape (plot \(J\) as a function of \((x,y)\)).
Hint: It should look something like this.
Optimize for (x,y)
Use whatever optimization method you wish, to find the values of \((x,y)\) that minimize the cost function \(J\). Justify that you have found the global minimum and not a local minimum.