From 66178a5a27625b7055d029403c66bd7ac6df1da5 Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Mon, 4 Dec 2023 16:46:45 +0100 Subject: [PATCH] solve_network: fix sign for country CO2 when bus0=atmosphere So that DAC extracts CO2 rather than pumping into air; for p>0, link withdraws from bus0, but injects into bus1/2/3, so you have to take account of this sign difference- --- scripts/solve_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 2413f4c9..53170da9 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -814,7 +814,7 @@ def add_co2limit_country(n, limit_countries, nyears=1.0): for port in [col[3:] for col in n.links if col.startswith("bus")]: if port == str(0): efficiency = ( - n.links["efficiency"].apply(lambda x: 1.0).rename("efficiency0") + n.links["efficiency"].apply(lambda x: -1.0).rename("efficiency0") ) elif port == str(1): efficiency = n.links["efficiency"]