From a73eea9379e7c385aa28ca050a8397bb8cacedf8 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 9 Nov 2022 17:14:44 +0100 Subject: [PATCH] update solve_network --- scripts/solve_network.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 7b287688..077b7cb1 100755 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -224,11 +224,12 @@ def add_minRenew_constraints(n, config, o): renewables_i = n.generators[renewables_b].index conventionals_i = n.generators[~renewables_b].index weightings = n.snapshot_weightings.generators - coeff = pd.DataFrame({c: weightings for c in renewables_i}) + coeff_vres = pd.DataFrame({c: weightings for c in renewables_i}) + coeff_conv = pd.DataFrame({c: weightings for c in conventionals_i}) vres = get_var(n, "Generator", "p")[renewables_i] conv = get_var(n, "Generator", "p")[conventionals_i] - lhs = linexpr(((1 - share) * coeff, vres)).sum().sum() - lhs += linexpr((- share * coeff, conv)).sum().sum() + lhs = linexpr(((1 - share) * coeff_vres, vres)).sum().sum() + lhs += linexpr((- share * coeff_conv, conv)).sum().sum() rhs = 0 define_constraints(n, lhs, '>=', rhs, 'Carrier', 'min_generation_renewables') else: