Hi,

Hi have a battery operating in several markets and I want to ensure that the model don’t charge ( charge(i) ) and discharge ( discharge(i) ) at the same time.

I use the solution charge(i) * discharge(i) = 0. The problem is this is a NLP model.

How can I change this, in order to transform this mutual exclusive condition into a LP model.

I’ve tried same binary variables but without success

Thanks

Paulo

Paulo,

are charge(i) and discharge(i) binary variables? If yes then charge(i) + discharge(i) =l= 1 should be enough.

If they are positive variables, then you need to define binary variables that are 1 if they are nonzero and 0 when they are 0. You have to use big-M condition to establish relation between binary and real variables. Let’s say the binary variables are c(i) and d(i). You can then use c(i) + d(i) =l= 1; just like the above condition.