A unimodal test function that calculates the sum of squared cumulative sums, also known as the Schwefel 2.22 variant.

F03(x)

Arguments

x

Numeric vector of input values.

Value

Numeric scalar representing the function value.

Details

Formula: $$f(x) = \sum_{i=1}^{n} \left(\sum_{j=1}^{i} x_j\right)^2$$

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

Characteristics:

  • Type: Unimodal

  • Separable: No

  • Differentiable: Yes

  • Convex: Yes

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

  • Default dimensions: 50

This function is non-separable because each term depends on all previous variables, making it useful for testing algorithms' ability to handle variable dependencies.

See also

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

Examples

F03(c(0, 0, 0))    # Returns 0 (global minimum)
#> [1] 0
F03(c(1, 2, 3))    # Returns 1^2 + (1+2)^2 + (1+2+3)^2 = 1 + 9 + 36 = 46
#> [1] 46