Page 1 of 1

Re: how to control the number of variables

Posted: Tue Mar 14, 2017 10:11 pm
by Manassaldi
Hi, the final number of variables depends on the constraints.

Re: how to control the number of variables

Posted: Wed Mar 15, 2017 8:20 pm
by cladelpino
For more detail: You don't need to declare the domain of the variable (as in variable P(A,B)). You can just write variable p;

Then, if the variable appears in the constraints, it will be part of the model. Check out this example:

Code: Select all

sets A /1*5/
     A1(A) /2,3/

variable d,t;

equation Q,dummy;

Q(A1).. d(a1) =E= 0;
dummy.. t=l=2;

model p /all/;

solve p using lp maximizing t