get_penalty_from_piecewise_constant_target

(function from pyomo.contrib.mpc.modeling.cost_expressions)

pyomo.contrib.mpc.modeling.cost_expressions.get_penalty_from_piecewise_constant_target(variables, time, setpoint_data, weight_data=None, variable_set=None, tolerance=0.0, prefer_left=True)[source]

Returns an IndexedExpression penalizing deviation between the specified variables and piecewise constant target data.

Parameters:
  • variables (List of Pyomo variables) – Variables that participate in the cost expressions.

  • time (Iterable) – Index used for the cost expression

  • setpoint_data (IntervalData) – Holds the piecewise constant values that will be used as setpoints

  • weight_data (ScalarData (optional)) – Weights for variables. Default is all ones.

  • tolerance (Float (optional)) – Tolerance used for determining whether a time point is within an interval. Default is zero.

  • prefer_left (Bool (optional)) – If a time point lies at the boundary of two intervals, whether the value on the left will be chosen. Default is True.

Returns:

Pyomo Expression, indexed by time, for the total weighted tracking cost with respect to the provided setpoint.

Return type:

Set, Expression