# Sphere Function

# Mathematical Definition

# Plots

The contour of the function:

# Description and Features

- The function is continuous.
- The function is convex.
- The function can be defined on n-dimensional space.
- The function is differentiable.
- The function is separable.
- The function is unimodal.

# Input Domain

The function can be defined on any input domain but it is usually evaluated on the hypercube $x_i \in [-5.12, 5.12]$ for $i = 1..n$.

# Global Minima

$f(\textbf{x}^{\ast}) = 0$ at $\textbf{x}^{\ast} = (0, …, 0)$

# Implementation

An implementation of the **Sphere function** with MATLAB is provided below. **Sphere function** can be implemented with a `for`

loop that iterates over all the components of the input vector but, MATLAB and Octave have built-in facilities that makes the implementation more efficient and concise.

The function can be represented in Latex as follows:

# References:

- http://www.sfu.ca/~ssurjano/spheref.html
- https://en.wikipedia.org/wiki/Test_functions_for_optimization