iwopy.wrappers.SimpleConstraint.g(var, *x, components=None)[source]

The analytical derivative of the function f, df/dvar, if available.

Parameters

var: int

The index of the derivation varibable within the function float variables

x: tuple

The int and float variables in that order.

components: list of int, optional

The selected components, or None for all

Returns

result: float or list of float

For one component, a float, else a list of floats. The length of list is 0 or 1 in case of single component, or n_sel_components otherwise.