From a7f6525545ad458c020d9d382e8dbcc41857f2e5 Mon Sep 17 00:00:00 2001 From: edwardxtg Date: Mon, 4 Nov 2024 17:09:15 +0000 Subject: [PATCH] readd ds["TradeCapacityToActivityUnit"] --- tz/osemosys/model/constraints/trade.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tz/osemosys/model/constraints/trade.py b/tz/osemosys/model/constraints/trade.py index d820d6fc..f844fe5f 100644 --- a/tz/osemosys/model/constraints/trade.py +++ b/tz/osemosys/model/constraints/trade.py @@ -60,17 +60,14 @@ def add_trade_constraints(ds: xr.Dataset, m: Model, lex: Dict[str, LinearExpress # Capacity con = lex["GrossTradeCapacity"] * ds["TradeRoute"] * ( - 1 - - ds["TradeLossBetweenRegions"] - # ) >= m["Export"] / (ds["TradeCapacityToActivityUnit"] * ds["YearSplit"]) - ) >= m["Export"] / (ds["YearSplit"]) + 1 - ds["TradeLossBetweenRegions"] + ) >= m["Export"] / (ds["TradeCapacityToActivityUnit"] * ds["YearSplit"]) m.add_constraints(con, name="TC1a_TradeConstraint_Export") con = lex["GrossTradeCapacity"] * ds["TradeRoute"] * ( 1 - ds["TradeLossBetweenRegions"] ) >= m["Import"].rename({"REGION": "_REGION", "_REGION": "REGION"}) / ( - # ds["TradeCapacityToActivityUnit"] * ds["YearSplit"] - ds["YearSplit"] + ds["TradeCapacityToActivityUnit"] * ds["YearSplit"] ) m.add_constraints(con, name="TC1b_TradeConstraint_Import")