On Tue, 2020-11-24 at 18:59 +0000, Manuel Castro wrote:
Hi there,
I am wondering how I can use an if statement to turn a constraint on
or off.
For example in my problem I have the following constraint:
subject to linctr14 {i in PeriodsCount: i == 1}: StorageEnergy[i] =
(StorageStateCharge * StorageEnergyRating + ((StorageEfficiencyCharge
* (StoragePowerCharge[i])) - ((StoragePowerDischarge[i]) /
StorageEfficiencyDischarge)));
Now, I only want to consider storage in my problem if an object
storage actually exists.
For that, I would have a StorageStatusFlag which if equal to "1" then
I would consider the constraint in my problem.
For example:
If (StorageStatusFlag == 1) then
subject to linctr14 {i in PeriodsCount: i == 1}: StorageEnergy[i]
= (StorageStateCharge * StorageEnergyRating +
((StorageEfficiencyCharge * (StoragePowerCharge[i])) -
((StoragePowerDischarge[i]) / StorageEfficiencyDischarge)));
end if