Skip to content

Diagnostics toolbox: display_near_parallel_constraints() does not distinguish between equality and inequality constraints  #1502

@OOAmusat

Description

@OOAmusat

Running the diagnostics toolbox on a model with inequality constraints enforcing variable bounds is throwing up display_near_parallel_constraints() warnings:

MWE:

 @m.Constraint(m.periods)
    def eq_hw_tank_temperature_lb(m, key):
        return m.fs[key].hw_tank.T[0] >= (50 + 273.15) * pyunits.K

    @m.Constraint(m.periods)
    def eq_hw_tank_temperature_ub(m, key):
        return m.fs[key].hw_tank.T[0] <= (90 + 273.15) * pyunits.K

Diagnostics box output


====================================================================================
>>> dt.display_near_parallel_constraints()
WARNING: model contains export suffix 'scaling_factor' that contains 144
component keys that are not exported as part of the NL file.  Skipping.
====================================================================================
The following pairs of constraints are nearly parallel:

    eq_hw_tank_temperature_lb[0], eq_hw_tank_temperature_ub[0]
    eq_hw_tank_temperature_lb[1], eq_hw_tank_temperature_ub[1]
    eq_hw_tank_temperature_lb[2], eq_hw_tank_temperature_ub[2]
    eq_hw_tank_temperature_lb[3], eq_hw_tank_temperature_ub[3]
    eq_hw_tank_temperature_lb[4], eq_hw_tank_temperature_ub[4]
    eq_hw_tank_temperature_lb[5], eq_hw_tank_temperature_ub[5]
    eq_hw_tank_temperature_lb[6], eq_hw_tank_temperature_ub[6]
    eq_hw_tank_temperature_lb[7], eq_hw_tank_temperature_ub[7]
    eq_hw_tank_temperature_lb[8], eq_hw_tank_temperature_ub[8]
    eq_hw_tank_temperature_lb[9], eq_hw_tank_temperature_ub[9]
    eq_hw_tank_temperature_lb[10], eq_hw_tank_temperature_ub[10]
    eq_hw_tank_temperature_lb[11], eq_hw_tank_temperature_ub[11]
    eq_hw_tank_temperature_lb[12], eq_hw_tank_temperature_ub[12]
    eq_hw_tank_temperature_lb[13], eq_hw_tank_temperature_ub[13]
    eq_hw_tank_temperature_lb[14], eq_hw_tank_temperature_ub[14]
    eq_hw_tank_temperature_lb[15], eq_hw_tank_temperature_ub[15]
    eq_hw_tank_temperature_lb[16], eq_hw_tank_temperature_ub[16]
    eq_hw_tank_temperature_lb[17], eq_hw_tank_temperature_ub[17]
    eq_hw_tank_temperature_lb[18], eq_hw_tank_temperature_ub[18]
    eq_hw_tank_temperature_lb[19], eq_hw_tank_temperature_ub[19]
    eq_hw_tank_temperature_lb[20], eq_hw_tank_temperature_ub[20]
    eq_hw_tank_temperature_lb[21], eq_hw_tank_temperature_ub[21]
    eq_hw_tank_temperature_lb[22], eq_hw_tank_temperature_ub[22]
    eq_hw_tank_temperature_lb[23], eq_hw_tank_temperature_ub[23]

According to @andrewlee94, this issue is possibly because we do not distinguish between equality and inequality constraints in the check.

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions