Schwefel
Mathematical Definition
Latex
f(x) = {418.9829d -{\sum_{i=1}^{n} x_i sin(\sqrt{|x_i|})}}
Description and Features
Dimensions: d
The Schwefel function is complex, with many local minima. The plot shows the two-dimensional form of the function.
- The function is continuous.
- The function is convex.
- The function is defined on n-dimensional space.
- The function is multimodal.
Input Domain
The function can be defined on any input domain but it is usually evaluated on $x_i \in [-500, 500]$ for $i = 1, …, d$ .
Global Minima
The function has one global minimum $f(\textbf{x}^{\ast})=0$ at $\textbf{x}^{\ast} = (420.9687, …, 420.9687)$.
Implementation
Python Code
def function(x):
x = np.array(x)
alpha = 418.9829
return alpha * len(x) - (x * np.sin(np.sqrt(np.abs(x)))).sum()