# optimization_variable¶

static OperationNamespace.optimization_variable(count, lower_bound, upper_bound, is_lower_unbounded=False, is_upper_unbounded=False, *, name=None)

Creates optimization variables, which can be bounded, semi-bounded, or unbounded.

Use this function to create a sequence of variables that can be tuned by the optimizer (within specified bounds) in order to minimize the cost function.

Parameters
• count (int) – The number $$N$$ of individual real-valued variables to create.

• lower_bound (float) – The lower bound $$v_\mathrm{min}$$ for generating an initial value for the variables. This will also be used as lower bound if the variables are lower bounded. The same lower bound applies to all count individual variables.

• upper_bound (float) – The upper bound $$v_\mathrm{max}$$ for generating an initial value for the variables. This will also be used as upper bound if the variables are upper bounded. The same upper bound applies to all count individual variables.

• is_lower_unbounded (bool, optional) – Defaults to False. Set this flag to True to define a semi-bounded variable with lower bound $$-\infty$$; in this case, the lower_bound parameter is used only for generating an initial value.

• is_upper_unbounded (bool, optional) – Defaults to False. Set this flag to True to define a semi-bounded variable with upper bound $$+\infty$$; in this case, the upper_bound parameter is used only for generating an initial value.

• name (str, optional) – The name of the node.

Returns

The sequence $$\{v_n\}$$ of $$N$$ optimization variables. If both is_lower_unbounded and is_upper_unbounded are False, these variables are bounded such that $$v_\mathrm{min}\leq v_n\leq v_\mathrm{max}$$. If one of the flags is True (for example is_lower_unbounded=True), these variables are semi-bounded (for example $$-\infty \leq v_n \leq v_\mathrm{max}$$). If both of them are True, then these variables are unbounded and satisfy that $$-\infty \leq v_n \leq +\infty$$.

Return type

Tensor

anchored_difference_bounded_variables()
calculate_optimization()