commonpower.modeling.robust_cost.WorstCaseRobustCost

class WorstCaseRobustCost(discount_factor: float = 1.0)[source]

Bases: _ScenarioBasedCost

Utility class to create a robust cost function from a given cost function expression.

Parameters:

discount_factor (float, optional) – Discount rate to give lower importance to costs further in the future. The logic is: sum_t (cost_t * df**t). Defaults to 1.0.

Methods

add_additional_constraints

Adds additional constraints for the worst-case cost.

initialize

Initializes the robust cost function.

obj_fcn

Creates the objective function for the worst-case cost.

add_additional_constraints(model: ConcreteModel) None[source]

Adds additional constraints for the worst-case cost. Specifically, the upper bound constraint for the worst-case cost ‘obj_fcn_ub’ and the constraint ‘obj_fcn_ub_c’ that the cost in each scenario is less or equal to the worst-case cost.

Parameters:

model (ConcreteModel) – Model instance.

obj_fcn(model: ConcreteModel) Expression[source]

Creates the objective function for the worst-case cost. This is simply the upper bound across all scenarios.

Returns:

Expression – Robust objective function.