Variable in Conditional Statement

Hi
I’m trying to model the below picture in gams:

and the code that I used is something like:

if(
off_time(j,k) <= a +b,
Cu(j,k)=e=hot(j);
elseif off_time(j,k) > a+ b,
Cu(j,k)=e=cool(j);
);

but it gives me many errors.
in y code Cu(j,k) and off_time(j,k) are both positive variables
and “a”, “b”, “hot(j)” and “cool(j)” are fixed value which are taken from a table.
so the question is how can I use the variable “off_time(j,k)” in a conditional statment ???
I would greatly appreciate any assistance or advice you could offer me.
aaa.jpg

Hi,

This has not so much to do with GAMS but is rather a general question on how to model logical conditions. If you manage to write down the logical condition in a way that fits with e.g. MIP, the implementation in GAMS will be easy. Perhaps you should look into some modeling book (e.g. HP Williams, Model building in mathematical programming) or at the following support wiki page: https://support.gams.com/gams:formulate_logical_expressions_in_equations

I hope this helps!

Fred