Helper function used in penalized test functions (F12, F13). This function applies a penalty when variable values exceed specified bounds.

Ufun(x, a, k, m)

Arguments

x

Numeric vector of input values to penalize.

a

Threshold value. Penalty is applied when \(|x_i| > a\).

k

Penalty coefficient controlling the penalty magnitude.

m

Exponent for the penalty term.

Value

Numeric vector of penalty values (same length as x).

Details

Formula: $$u(x_i, a, k, m) = \begin{cases} k(x_i - a)^m & \text{if } x_i > a \\ 0 & \text{if } -a \leq x_i \leq a \\ k(-x_i - a)^m & \text{if } x_i < -a \end{cases}$$

The penalty function is zero within the interval \([-a, a]\) and grows polynomially outside this region. This is used to softly constrain optimization to a bounded region without hard constraints.

See also

F12, F13 for functions that use this helper.