Schwefel Function
Mathematical Definition
\[f(\textbf{x}) = f(x_1, x_2, ..., x_n) = 418.9829d -{\sum_{i=1}^{n} x_i sin(\sqrt{|x_i|})}.\]Plots
The contour of the function:
Description and Features
- The function is continuous.
- The function is not convex.
- The function can be defined on n-dimensional space.
- The function is multimodal.
- The function is not .
Input Domain
The function can be defined on any input domain but it is usually evaluated on the hypercube $x_i \in [-500, 500]$ for $i = 1..n$.
Global Minima
$f(\textbf{x}^{\ast}) = 0$ at $\textbf{x}^{\ast} = (420.9687, …, 420.9687)$
Implementation
Python
For Python, the function is implemented in the benchmarkfcns package, which can be installed from command line with pip install benchmarkfcns
.
MATLAB
An implementation of the Schwefel Function with MATLAB is provided below. Schwefel 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