how to control the number of variables

Problems with modeling
Post Reply
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: how to control the number of variables

Post by Manassaldi »

Hi, the final number of variables depends on the constraints.
cladelpino
User
User
Posts: 108
Joined: 7 years ago

Re: how to control the number of variables

Post 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
Post Reply