sphere


The sphere function has \(d\) local minima except for the global one. It is continuous, convex and unimodal [1].

of = sphere(x)

Input variables

Name Description Type
x Current design variables of the i agent. List

Output variables

Name Description Type
of Objective function value of the i agent. Float

Problem

\[f(\mathbf{x}) = \sum_{i=1}^{n} x_{i}^{2}\]

(1)

\[ x_{i} \in [-5.12, 5.12], i = 1,..., d; \;...\; f(\mathbf{x}^*) = (0,..,0), \; \mathbf{x}^* = [0,...,0] \]

(2)

Example 1

Considering the design variable \(\mathbf{x} = [0,0]\), what value does the objective function expect?

# Data
x = [0, 0]

# Call function
of = sphere(x)

# Output details
print("of_best sphere: of = {:.4e}".format(of))
of_best sphere: of = 0.0000e+00

Reference list