[AMPL 24563] Constraint not being recognized by AMPL/KNitro


I am running into an issue when attempting to impose a constraint within my model. The constraint that I want to impose is that all values for a variable in a set are >=0. Unfortunately, when I solve the model, I get results that do not account for this constraint (i.e., many values for the variable are negative). As you can see in the output below, AMPL/knitro is stating that there is no constraints in my model.

I have set my constraint up as follows:

subject to effort_constraint {(t,o) in CHOICE_SETS}: effort[t,o] >=0;

where I have the following sets, variables, and data (for reserve):

set TIMES;

var a0 >= -3, <= 3 default .1;

var a_reserve >= -3, <= 3 default .1;
var effort {(t,o) in CHOICE_SETS} = a0 + a_reserve * reserve[t,o] ;

Below is the output from AMPL.

Substitution eliminates 1822104 variables.
Adjusted problem:
87 variables, all nonlinear
0 constraints
1 nonlinear objective; 87 nonzeros.

#presolve 0.016568 16777224 3103628912
#output 1.50372 0 3103628912
Artelys Knitro 12.4.0: outlev=6

I tried out the AMPL statements that you show, with some made-up test data, but I did not observe the “0 constraints” that you are seeing. So, the error must be originating in some other part of your model and data. Some possibilities are that:

  • CHOICE_SETS is an empty set, due to some error in reading the data for it.
  • Your constraint “effort_constraint” is not being actually read by AMPL.

If you need more help, try replying with your complete model and data file uploaded. (Judging from the message “Substitution eliminates 1822104 variables,” your set “effort” may be very large; if so, it may be helpful to create a smaller data example for testing.)

This question was cross-posted to our new user forum at https://discuss.ampl.com, and an answer has been posted there.