create_subsystem_block

(function from pyomo.util.subsystems)

pyomo.util.subsystems.create_subsystem_block(constraints, variables=None, include_fixed=False)[source]

This function creates a block to serve as a subsystem with the specified variables and constraints. To satisfy certain writers, other variables that appear in the constraints must be added to the block as well. We call these the “input vars.” They may be thought of as parameters in the subsystem, but we do not fix them here as it is not obvious that this is desired.

Parameters:
  • constraints (List) – List of Pyomo constraint data objects

  • variables (List) – List of Pyomo var data objects

  • include_fixed (Bool) – Indicates whether fixed variables should be attached to the block. This is useful if they may be unfixed at some point.

Returns:

  • Block containing references to the specified constraints and variables,

  • as well as other variables present in the constraints