Code: Select all
Energy_Exported(t) = PV_Generation(t) -Demand(t);
Energy_Exported(t)$[Energy_Exported(t)<0] = 0;
I tried enforcing Demand(t) to be positive variable and then
Code: Select all
Energy_Imported(t) =g= Demand(t) - PV_Generation(t);
The problem is that in some cases the outcome of PV_Generation(t) -Demand(t) may be positive or negative. If it's negative I want to set the variable to 0.
Many thanks for your help!