0

As the title mentioned

sum((r,l), Mer.l(e,r) * Mel(e,l)) =e= 0;

I use a GAMS mip model to solve a problem, and Mer(e,r) and Mel(e,l) are both binary variables, and if I did not write the .l suffix, the compile will give Endogenous relational operations require model type "dnlp"" error message, but I am not sure the equation above staying the original meaning that is the Mer(e,r) still a variable? and is it still changeable with the mip solving process?

Patrick
  • 181
  • 1
  • 1
  • 11
  • You should almost never use .l in an equation. Either the variable is endogenous or it should be fixed before solving. Can you show a minimal working example to reproduce the error? – Martin Bonde Dec 20 '16 at 15:45

1 Answers1

1

If you use Mer.l, the model will not use Mer as a variable that gets optimized anymore, but will use the (initial) levels of the variables Mer as constant numbers. But you could reformualte your equation, so that it stays linear. As I understand it, you want to make sure that for each e and each combination of r and l you will never get Mer=1 and Mel=1 (one could be 1 or both should be 0). So you could formulate is as e.g.:

equation e(e,r,l);
e(e,r,l).. Mer(e,r) + Mel(e,l) =l= 1;

I hope that helps, Lutz

Lutz
  • 2,197
  • 1
  • 10
  • 12
  • it works, but this increase the the number of equations rapidly with the increasing of r and l, will it influence the solving time of the model? – Patrick Dec 22 '16 at 02:04
  • Yes, that could happen. But even if it runs a little longer, it does at least what you want. – Lutz Dec 22 '16 at 09:03
  • yeah, but I have some more equations are nonlinear, and they seem no so easy to to reformulated. is there any other model that allowing part of linear equations and others are not? – Patrick Dec 22 '16 at 12:12