Page 1 of 1

GAMS- Binary?

Posted: Fri Apr 06, 2018 11:44 am
by Moin
Hello,

I apologize for my English. I hope that my sentences are understandable.

In Gams I try to develop a small model. This is an e-car when it is parked in the garage to be loaded. My question is whether it is possible to formulate the availability of the car with binary numbers (0.1).I have an Excel list with the availability of the car, almost 0 = car is there and 1 = car is not there.

At the moment, I've tried this approach: (but the approach is wrong :( )

scalar zaehler,p/0/;
for (zaehler=0 to 8760,
p=p+1;);

NB1(h) $((ord(h)>8+24*p) and (ord(h)<20+24*p)).. posladen(h)=e=0;
NB2(h) $(ord(h)=7+24*p)..Soc(h)=g=1.5;

The constraints 1 states that in certain hours a positive charging of the battery can not be done. The constraints 2 states that one hour before no charging is possible the battery must be full.

MFG
Moin