From a61cf95e64d6c5ba6571ba0080c5e43ad58436eb Mon Sep 17 00:00:00 2001 From: HauHe Date: Fri, 22 Sep 2023 13:52:50 +0200 Subject: [PATCH 1/2] This commit removes the rounding of the NewCapacity, when adding it to the ResidualCapacity of the next step. This implies that the TotalAnnualMaxCapacity parameter needs to be used with caution when runnin models with OSeMOSYS_step. For safe use the parameter should be defined from the first year onwards and if changing only relax. However, there still might be issues with very small values due to solver tolerance. --- src/main.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main.py b/src/main.py index 3976334..276dc4c 100644 --- a/src/main.py +++ b/src/main.py @@ -510,9 +510,6 @@ def main(input_data: str, step_length: int, path_param: str, cores: int, solver= op_life = pd.read_csv(str(Path(step_dir_data, "OperationalLife.csv"))) new_cap = pd.read_csv(str(Path(step_dir_results, "NewCapacity.csv"))) - new_cap["VALUE"] = new_cap["VALUE"] * 10 - new_cap['VALUE'] = new_cap['VALUE'].apply(np.floor) - new_cap['VALUE'] = new_cap['VALUE'] / 10 res_cap = mu.update_res_capacity( res_capacity=old_res_cap, @@ -555,9 +552,6 @@ def main(input_data: str, step_length: int, path_param: str, cores: int, solver= # Get updated residual capacity values op_life = pd.read_csv(str(Path(option_dir_data, "OperationalLife.csv"))) new_cap = pd.read_csv(str(Path(option_dir_results, "NewCapacity.csv"))) - new_cap["VALUE"] = new_cap["VALUE"] * 10 - new_cap['VALUE'] = new_cap['VALUE'].apply(np.floor) - new_cap['VALUE'] = new_cap['VALUE'] / 10 # overwrite residual capacity values for all subsequent steps next_step = step + 1 @@ -600,9 +594,6 @@ def main(input_data: str, step_length: int, path_param: str, cores: int, solver= op_life = pd.read_csv(str(Path(option_dir_data, "OperationalLife.csv"))) new_cap = pd.read_csv(str(Path(option_dir_results, "NewCapacity.csv"))) - new_cap["VALUE"] = new_cap["VALUE"] * 10 - new_cap['VALUE'] = new_cap['VALUE'].apply(np.floor) - new_cap['VALUE'] = new_cap['VALUE'] / 10 # overwrite residual capacity values for all subsequent steps next_step = step + 1 From ceb4a47673eb1260a7332b82a475f9f9bd0aade7 Mon Sep 17 00:00:00 2001 From: HauHe Date: Fri, 22 Sep 2023 14:14:17 +0200 Subject: [PATCH 2/2] Add disclaimer to README to not make use of the . --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2d00de8..e7013fb 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,8 @@ about allowing investment in coal. Drop in an osemsosys file (called `osemosys.txt`) into the `model/` directory ## 2. Add the base data file +**NB:** Neither the model data nor the scenario data should make use of the parameter _TotalAnnualMaxCapacity_. It can cause problems when passing _NewCapacity_ from one step to the next step. + Drop in a MathProg formatted data file in the `data/` folder. The data file can be long formatted (otoole) or wide formatted (momani)