Bounds Analysis#
A number of utility functions are available for checking for common issues with variable bounds in a model.
This module contains tools for setting and checking variable bounds based on model metadata.
- idaes.core.util.diagnostics_tools.bounds.get_valid_range_of_component(component)[source]#
Return the valid range for a component as specified in the model metadata.
- Parameters:
component – Pyomo component to get valid range for
- Returns:
valid range for component if found. This will either be a 2-tuple (low, high) or None.
- Raises:
AttributeError if metadata object not found –
- idaes.core.util.diagnostics_tools.bounds.list_components_with_values_outside_valid_range(component, descend_into=True)[source]#
Return a list of component objects with values outside the valid range specified in the model metadata.
This function will iterate over component data objects in Blocks and indexed components.
- Parameters:
component – Pyomo component to search for component outside of range on. This can be a Block, Var or Param.
descend_into – (optional) Whether to descend into components on child Blocks (default=True)
- Returns:
list of component objects found with values outside the valid range.
- idaes.core.util.diagnostics_tools.bounds.set_bounds_from_valid_range(component, descend_into=True)[source]#
Set bounds on Pyomo components based on valid range recorded in model metadata. WARNING - this function will overwrite any bounds already set on the component/model.
This function will iterate over component data objects in Blocks and indexed components.
- Parameters:
component – Pyomo component to set bounds on. This can be a Block, Var or Param.
descend_into – (optional) Whether to descend into components on child Blocks (default=True)
- Returns:
None