Skip to content

failing asserts regarding problem properties #193

Description

@svigerske

For GAMS model library model gasnet, I get an assert failing in the first updateProperties call (

updateProperties();
):

SHOT/src/Model/Problem.cpp

Lines 699 to 701 in cf7ec3a

assert(properties.numberOfNumericConstraints
== properties.numberOfLinearConstraints + properties.numberOfQuadraticConstraints
+ properties.numberOfNonlinearConstraints);

The problem is that there are 2 quadratic constraints that have no quadratic terms, so they are not accounted in

SHOT/src/Model/Problem.cpp

Lines 651 to 662 in cf7ec3a

for(auto& C : quadraticConstraints)
{
if(C->properties.hasQuadraticTerms)
{
properties.numberOfQuadraticConstraints++;
if(C->properties.convexity == E_Convexity::Convex)
properties.numberOfConvexQuadraticConstraints++;
else
properties.numberOfNonconvexQuadraticConstraints++;
}
}

These are

qbal(s0):  -Q(s1) -3*b(c1) +600 <= 0
crdef(c1,s0,s1):   -Pd(s1) +500*CR(c1) <= 0

This might be due to the quadratic terms becoming linear due to variable fixing (e.g., q.fx('s0') = 600).
Does this need some change in the GAMS interface, or in Problem.cpp ?

Similarly, on GAMS model library model hda, this assert is failing:

assert(C->variablesInNonlinearExpression.size() > 0);

Constraint antdistb(1,27,ch4)_rf became +(-15.2243) <= -15.2243 after applying variable fixings.

I believe that the GAMS interface creates fixed variables as variables and does not fold constants in expressions. Somewhere there may be a simplification step that forgets to move constraints into different categories when necessary?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions