get_residual

(function from pyomo.contrib.viewer.report)

pyomo.contrib.viewer.report.get_residual(ui_data, c)[source]

Calculate the residual (constraint violation) of a constraint. This residual is always positive.

Parameters:
  • ui_data (UIData) – user interface data, includes the cache for calculated values of the constraint body. This function uses the cached values and will not trigger recalculation. If variable values have changed, this may not yield accurate results.

  • c (ConstraintData) – a constraint or constraint data

Returns:

(float) residual