Hey guys

I’m new to GAMS (which seems to be a common introduction of a problem, here), and I’m developing a cost minimisation model for adding capacity to the electricity system and the generation dispatch of the different technologies. Apart from conventional and renewable generation technologies, I also include several storage technologies for which the model calculates the required capacity and the dispatch (charge or discharge) of that capacity. Should it be relevant to my question below, I would be happy to go more into detail, but I figure this would be enough.

For now the model is completely linear, and successfully solved by cplex.

The problem in my results is that it suggests to charge and discharge my storage capacity simultaneously. However, this is physically not possible, so it should be constrained. The relevant parameters, variables and constraints are given below.

set t; → time step

parameter PC_stor_old; → installed storage capacity

positive variable SC SD PC_stor_new; → storage charge, storage discharge, storage capacity to be installed

max_charge(t) … SC(t) =l= PC_stor_old + PC_stor_new; → storage charge is limited to the storage capacity

max_discharge(t) … SD(t) =l= PC_stor_old + PC_stor_new; → storage discharge is limited to the storage capacity

Now, what I’d like to do is modify these equations or add a new constraint so that either SC(t) or SD(t) (or both) equals zero for every time t. I thought about modifying it like this:

binary variable(t) … z;

max_charge(t) … SC(t) =l= (PC_stor_old + PC_stor_new)*z(t);
max_discharge(t) … SD(t) =l= (PC_stor_old + PC_stor_new)*(1-z(t));

However, as we multiply two variables (PC_stor_new and z) by each other, this cannot be done through a linear solver like cplex.

Another approach could be to add following logical constraint:

no_simult_cd(t) … ((SC(t) =e= 0) or (SD(t) =e= 0)) =e= 1;

But this failed due to error: “57 equation no_simult_cd… VAR operands relational or boolean”

Of course, a possibility would be to just use the first solution and use a non-linear solver. If that’s the way to go: can someone recommend a commonly used non-linear solver?

However, I believe (hope) there is a more elegant way to go around this, because using a non-linear solver will probably take up more CPU time as well?

Any thoughts? Feel free to ask for more information if you need it!

Thanks in advance

Michiel