CADETProcess.optimization.OptimizationProblem.add_variable

CADETProcess.optimization.OptimizationProblem.add_variable#

OptimizationProblem.add_variable(name, evaluation_objects=-1, parameter_path=None, lb=-inf, ub=inf, transform=None, indices=None, pre_processing=None)[source]#

Add optimization variable to the OptimizationProblem.

The function encapsulates the creation of OptimizationVariable objects in order to prevent invalid OptimizationVariables.

Parameters:
namestr

Name of the variable.

evaluation_objectsEvaluationObject or list of EvaluationObjects

Evaluation object to set parameters. If -1, all evaluation objects are used. If None, no evaluation object is associated (dummy variable). The default is -1.

parameter_pathstr, optional

Path of the parameter including the evaluation object. If None, name is used.

lbfloat

Lower bound of the variable value.

ubfloat

Upper bound of the variable value.

transform{‘auto’, ‘log’, ‘linear’, None}:

Variable transform. The default is auto.

indicesint or tuple, optional

Indices for variables that modify entries of a parameter array. If None, variable is assumed to be index independent.

pre_processingcallable, optional

Additional step to process the value before setting it. This function must accept a single argument (the value) and return the processed value.

Raises:
CADETProcessError

If the Variable already exists in the dictionary.

See also

evaluation_objects
OptimizationVariable
remove_variable