Hello, I wrote the following code in GAMS, but it shows the following error for WindSpeed after running. All symbols are scalars, and WindSpeed is data dependent on i and j. Could you please guide me?

This does just not work. If and ElseIf can’t be used to define different constraints. Assuming the symbols in the condition, i.e. WindSpeed, Vin_W, Vout_W, … are all exogenous (i.e. parameters, not variables) then you can just do

but my fear is that some of these symbols are variables. This is much more complicated and you need to look into ways how to linearize these logical constraints. Questions like this have been asked often in this forum and I suggest that you search for logical constraint and for the recommended book to study and linearize logical constraints by HP Williams.