From 11a05ade824f04361d97762598a32f4f5b662c74 Mon Sep 17 00:00:00 2001 From: john whately <18461782+GeoDerp@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:01:09 +0930 Subject: [PATCH] P_PV_curtailment, add minimum of 0 Related to: https://github.com/davidusb-geek/emhass/issues/305#issuecomment-2165428574 --- src/emhass/optimization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emhass/optimization.py b/src/emhass/optimization.py index 3795710a..31858d1a 100644 --- a/src/emhass/optimization.py +++ b/src/emhass/optimization.py @@ -314,7 +314,7 @@ def perform_optimization(self, data_opt: pd.DataFrame, P_PV: np.array, P_load: n else: constraints.update({"constraint_curtailment_{}".format(i) : plp.LpConstraint( - e = P_PV_curtailment[i] - P_PV[i], + e = P_PV_curtailment[i] - max(P_PV[i],0), sense = plp.LpConstraintLE, rhs = 0) for i in set_I})