A multimodal test function with penalty terms that create a complex search landscape. Uses the Ufun helper function.

F12(x)

Arguments

x

Numeric vector of input values (minimum length 2).

Value

Numeric scalar representing the function value.

Details

Formula: $$f(x) = \frac{\pi}{n}\left\{10\sin^2(\pi y_1) + \sum_{i=1}^{n-1}(y_i-1)^2(1 + 10 \sin^2(\pi y_{i+1})) + (y_n-1)^2\right\} + \sum_{i=1}^{n}u(x_i,10,100,4)$$

where \(y_i = 1 + (x_i + 1)/4\) and \(u(x,a,k,m)\) is a penalty function.

Global minimum: \(f(-1, -1, ..., -1) = 0\)

Characteristics:

  • Type: Multimodal

  • Separable: No

  • Differentiable: Yes (in the interior)

  • Penalized: Yes (boundary penalty)

  • Default bounds: \([-50, 50]^n\)

  • Default dimensions: 50

The penalty term \(u(x,a,k,m)\) adds a cost when variables exceed the threshold \(a\), helping to constrain solutions to a feasible region.

See also

test-functions for an overview of all test functions, get_function_details to retrieve function parameters, Ufun for the penalty function.

Examples

F12(c(-1, -1, -1))  # Returns approximately 0 (near global minimum)
#> [1] 1.570545e-31
F12(c(0, 0, 0))     # Returns a small positive value
#> [1] 6.086836