Schwefel 1.2

Mathematical Definition
f(x) = {\sum_{i=1}^{n} \left(\sum_{j=1}^{i}x_j\right)^2}
Description and Features

Dimensions: d

The function has many global minima. It is continuous, convex and unimodal. The plot shows its two-dimensional form.

  • 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 $x_i \in [-100, 100]$ for $i = 1, …, d$ .

Global Minima

The function has one global minimum $f(\textbf{x}^{\ast})=0$ at $\textbf{x}^{\ast} = (0, …, 0)$.

Python Code

def function(x):
    x = np.array(x)
    return np.sum([np.sum(x[:i]) ** 2
                   for i in range(len(x))])