diff --git a/.github/.codecov.yml b/.github/.codecov.yml index d18b06e66..d4abe6dc7 100644 --- a/.github/.codecov.yml +++ b/.github/.codecov.yml @@ -3,4 +3,4 @@ coverage: patch: off comment: - layout: "diff, flags, files" + layout: "diff, flags, files" \ No newline at end of file diff --git a/.github/workflows/commit-ci.yml b/.github/workflows/commit-ci.yml index 71f287c32..c68986693 100644 --- a/.github/workflows/commit-ci.yml +++ b/.github/workflows/commit-ci.yml @@ -40,5 +40,16 @@ jobs: - name: Install jupyter kernel run: python -m ipykernel install --user --name calliope - - name: run tests + - name: run tests without coverage + if: github.ref != 'refs/heads/main' run: pytest + + - name: run tests with coverage + if: github.ref == 'refs/heads/main' + run: pytest --cov + + - name: upload coverage report to Codecov + if: github.ref == 'refs/heads/main' + uses: codecov/codecov-action@v3 + env: + directory: "./reports/coverage/" diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 12e89ff2b..4be44298f 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -69,11 +69,17 @@ jobs: - name: Install jupyter kernel run: python -m ipykernel install --user --name calliope - - name: run tests + - name: run tests with coverage + if: matrix.os == 'ubuntu-latest' && matrix.py3version == '11' + run: pytest --cov + + - name: run tests without coverage + if: matrix.os != 'ubuntu-latest' || matrix.py3version != '11' run: pytest - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 if: matrix.os == 'ubuntu-latest' && matrix.py3version == '11' - env: + with: + fail_ci_if_error: true directory: "./reports/coverage/" \ No newline at end of file diff --git a/README.md b/README.md index 10dcda68f..5f09c120c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Chat on Gitter](https://img.shields.io/gitter/room/calliope-project/calliope.svg?style=flat-square)](https://app.gitter.im/#/room/#calliope-project_calliope:gitter.im) -[![Main branch build status](https://img.shields.io/azure-devops/build/calliope-project/371cbbaa-fa6b-4efb-9b23-c4283a8e33eb/1?style=flat-square)](https://dev.azure.com/calliope-project/calliope/_build?definitionId=1) +[![Main branch build status](https://github.com/calliope-project/calliope/actions/workflows/commit-ci.yml/badge.svg?branch=main)](https://github.com/calliope-project/calliope/actions/workflows/commit-ci.yml) [![Documentation build status](https://img.shields.io/readthedocs/calliope.svg?style=flat-square)](https://readthedocs.org/projects/calliope/builds/) -[![Test coverage](https://img.shields.io/codecov/c/github/calliope-project/calliope?style=flat-square&token=b4fd170f0e7b43679a8bf649719e1cea)](https://codecov.io/gh/calliope-project/calliope) +[![Test coverage](https://codecov.io/gh/calliope-project/calliope/graph/badge.svg?token=UM542yaYrh)](https://codecov.io/gh/calliope-project/calliope) [![PyPI version](https://img.shields.io/pypi/v/calliope.svg?style=flat-square)](https://pypi.python.org/pypi/calliope) [![Anaconda.org/conda-forge version](https://img.shields.io/conda/vn/conda-forge/calliope.svg?style=flat-square&label=conda)](https://anaconda.org/conda-forge/calliope) [![JOSS DOI](https://img.shields.io/badge/JOSS-10.21105/joss.00825-green.svg?style=flat-square)](https://doi.org/10.21105/joss.00825) diff --git a/doc/_static/math.rst b/doc/_static/math.rst index 3da29fe68..5b38efe04 100644 --- a/doc/_static/math.rst +++ b/doc/_static/math.rst @@ -5,7 +5,7 @@ Objective minmax_cost_optimisation ^^^^^^^^^^^^^^^^^^^^^^^^ -Minimise the total cost of installing and operation all technologies in the system. If multiple cost classes are present (e.g., monetary and co2 emissions), the weighted sum of total costs is minimised. Cost class weights can be defined in `run.objective_options.cost_class`. +Minimise the total cost of installing and operation all technologies in the system. If multiple cost classes are present (e.g., monetary and co2 emissions), the weighted sum of total costs is minimised. Cost class weights can be defined in the top-level parameter `objective_cost_class`. .. container:: scrolling-wrapper @@ -15,20 +15,26 @@ Minimise the total cost of installing and operation all technologies in the syst \end{array} \begin{cases} \sum\limits_{\text{cost} \in \text{costs}} (\sum\limits_{\substack{\text{node} \in \text{nodes} \\ \text{tech} \in \text{techs}}} (\textbf{cost}_\text{node,tech,cost}) \times \textit{objective_cost_class}_\text{cost}) + \sum\limits_{\text{timestep} \in \text{timesteps}} (\sum\limits_{\substack{\text{carrier} \in \text{carriers} \\ \text{node} \in \text{nodes}}} (\textbf{unmet_demand}_\text{node,carrier,timestep} - \textbf{unused_supply}_\text{node,carrier,timestep}) \times \textit{timestep_weights}_\text{timestep}) \times \textit{bigM}&\quad - \text{if } (\text{run_config.ensure_feasibility}\mathord{=}\text{true}) + \text{if } (\bigvee\limits_{\substack{\text{node} \in \text{nodes} \\ \text{tech} \in \text{techs} \\ \text{cost} \in \text{costs}}} (cost))\land{}(\text{config.ensure_feasibility}\mathord{=}\text{true}) \\ \sum\limits_{\text{cost} \in \text{costs}} (\sum\limits_{\substack{\text{node} \in \text{nodes} \\ \text{tech} \in \text{techs}}} (\textbf{cost}_\text{node,tech,cost}) \times \textit{objective_cost_class}_\text{cost})&\quad - \text{if } (\neg (\text{run_config.ensure_feasibility}\mathord{=}\text{true})) + \text{if } (\bigvee\limits_{\substack{\text{node} \in \text{nodes} \\ \text{tech} \in \text{techs} \\ \text{cost} \in \text{costs}}} (cost))\land{}(\neg (\text{config.ensure_feasibility}\mathord{=}\text{true})) + \\ + \sum\limits_{\text{timestep} \in \text{timesteps}} (\sum\limits_{\substack{\text{carrier} \in \text{carriers} \\ \text{node} \in \text{nodes}}} (\textbf{unmet_demand}_\text{node,carrier,timestep} - \textbf{unused_supply}_\text{node,carrier,timestep}) \times \textit{timestep_weights}_\text{timestep}) \times \textit{bigM}&\quad + \text{if } (\neg (\bigvee\limits_{\substack{\text{node} \in \text{nodes} \\ \text{tech} \in \text{techs} \\ \text{cost} \in \text{costs}}} (cost)))\land{}(\text{config.ensure_feasibility}\mathord{=}\text{true}) + \\ + 0&\quad + \text{if } (\neg (\bigvee\limits_{\substack{\text{node} \in \text{nodes} \\ \text{tech} \in \text{techs} \\ \text{cost} \in \text{costs}}} (cost)))\land{}(\neg (\text{config.ensure_feasibility}\mathord{=}\text{true})) \\ \end{cases} Subject to ---------- -energy_capacity_per_storage_capacity_min -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_per_storage_capacity_min +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the lower bound of a `storage`/`supply_plus` technology's energy capacity relative to its storage capacity. +Set the lower bound of a `storage`/`supply_plus` technology's flow capacity relative to its storage capacity. .. container:: scrolling-wrapper @@ -38,17 +44,17 @@ Set the lower bound of a `storage`/`supply_plus` technology's energy capacity re \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{storage_cap}_\text{node,tech}) \land \exists (\textit{energy_cap_per_storage_cap_min}_\text{node,tech}) \land \neg (\exists (\textit{energy_cap_per_storage_cap_equals}_\text{node,tech}))) + \text{if } (\exists (\textbf{storage_cap}_\text{node,tech}) \land \exists (\textit{flow_cap_per_storage_cap_min}_\text{node,tech})) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} \geq \textbf{storage_cap}_\text{node,tech} \times \textit{energy_cap_per_storage_cap_min}_\text{node,tech}&\quad + \textbf{flow_cap}_\text{node,tech} \geq \textbf{storage_cap}_\text{node,tech} \times \textit{flow_cap_per_storage_cap_min}_\text{node,tech}&\quad \\ \end{cases} -energy_capacity_per_storage_capacity_max -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_per_storage_capacity_max +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound of a `storage`/`supply_plus` technology's energy capacity relative to its storage capacity. +Set the upper bound of a `storage`/`supply_plus` technology's flow capacity relative to its storage capacity. .. container:: scrolling-wrapper @@ -58,17 +64,17 @@ Set the upper bound of a `storage`/`supply_plus` technology's energy capacity re \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{storage_cap}_\text{node,tech}) \land \exists (\textit{energy_cap_per_storage_cap_max}_\text{node,tech}) \land \neg (\exists (\textit{energy_cap_per_storage_cap_equals}_\text{node,tech}))) + \text{if } (\exists (\textbf{storage_cap}_\text{node,tech}) \land \exists (\textit{flow_cap_per_storage_cap_max}_\text{node,tech})) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} \leq \textbf{storage_cap}_\text{node,tech} \times \textit{energy_cap_per_storage_cap_max}_\text{node,tech}&\quad + \textbf{flow_cap}_\text{node,tech} \leq \textbf{storage_cap}_\text{node,tech} \times \textit{flow_cap_per_storage_cap_max}_\text{node,tech}&\quad \\ \end{cases} -energy_capacity_per_storage_capacity_equals -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +source_capacity_equals_flow_capacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set a fixed relationship between a `storage`/`supply_plus` technology's energy capacity and its storage capacity. +Set a `supply_plus` technology's flow capacity to equal its source capacity. .. container:: scrolling-wrapper @@ -78,17 +84,17 @@ Set a fixed relationship between a `storage`/`supply_plus` technology's energy c \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{storage_cap}_\text{node,tech}) \land \exists (\textit{energy_cap_per_storage_cap_equals}_\text{node,tech})) + \text{if } (\exists (\textbf{source_cap}_\text{node,tech}) \land \textit{source_cap_equals_flow_cap}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} = \textbf{storage_cap}_\text{node,tech} \times \textit{energy_cap_per_storage_cap_equals}_\text{node,tech}&\quad + \textbf{source_cap}_\text{node,tech} = \textbf{flow_cap}_\text{node,tech}&\quad \\ \end{cases} -resource_capacity_equals_energy_capacity -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +force_zero_area_use +^^^^^^^^^^^^^^^^^^^ -Set a `supply_plus` technology's energy capacity to equal its resource capacity. +Set a technology's area use to zero if its flow capacity upper bound is zero. .. container:: scrolling-wrapper @@ -98,17 +104,17 @@ Set a `supply_plus` technology's energy capacity to equal its resource capacity. \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{resource_cap}_\text{node,tech}) \land \textit{resource_cap_equals_energy_cap}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{area_use}_\text{node,tech}) \land \textit{flow_cap_max}_\text{node,tech}\mathord{=}\text{0}) \end{array} \begin{cases} - \textbf{resource_cap}_\text{node,tech} = \textbf{energy_cap}_\text{node,tech}&\quad + \textbf{area_use}_\text{node,tech} = 0&\quad \\ \end{cases} -force_zero_resource_area -^^^^^^^^^^^^^^^^^^^^^^^^ +area_use_per_flow_capacity +^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set a technology's resource area to zero if its energy capacity upper bound is zero. +Set a fixed relationship between a technology's flow capacity and its area use. .. container:: scrolling-wrapper @@ -118,56 +124,55 @@ Set a technology's resource area to zero if its energy capacity upper bound is z \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{resource_area}_\text{node,tech}) \land \textit{energy_cap_max}_\text{node,tech}\mathord{=}\text{0}) + \text{if } (\exists (\textbf{area_use}_\text{node,tech}) \land \exists (\textit{area_use_per_flow_cap}_\text{node,tech})) \end{array} \begin{cases} - \textbf{resource_area}_\text{node,tech} = 0&\quad + \textbf{area_use}_\text{node,tech} = \textbf{flow_cap}_\text{node,tech} \times \textit{area_use_per_flow_cap}_\text{node,tech}&\quad \\ \end{cases} -resource_area_per_energy_capacity -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +area_use_capacity_per_loc +^^^^^^^^^^^^^^^^^^^^^^^^^ -Set a fixed relationship between a technology's energy capacity and its resource area. +Set an upper bound on the total area that all technologies with a area_use can occupy at a given node. .. container:: scrolling-wrapper .. math:: \begin{array}{r} \forall{} - \text{ node }\negthickspace \in \negthickspace\text{ nodes, } - \text{ tech }\negthickspace \in \negthickspace\text{ techs } + \text{ node }\negthickspace \in \negthickspace\text{ nodes } \\ - \text{if } (\exists (\textbf{resource_area}_\text{node,tech}) \land \exists (\textit{resource_area_per_energy_cap}_\text{node,tech})) + \text{if } (\exists (\textbf{area_use}_\text{node,tech}) \land \exists (\textit{available_area}_\text{node})) \end{array} \begin{cases} - \textbf{resource_area}_\text{node,tech} = \textbf{energy_cap}_\text{node,tech} \times \textit{resource_area_per_energy_cap}_\text{node,tech}&\quad + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{area_use}_\text{node,tech}) \leq \textit{available_area}_\text{node}&\quad \\ \end{cases} -resource_area_capacity_per_loc -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_systemwide_max +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set an upper bound on the total area that all technologies with a resource_area can occupy at a given node. +Set an upper bound on flow capacity of a technology across all nodes in which the technology exists. .. container:: scrolling-wrapper .. math:: \begin{array}{r} \forall{} - \text{ node }\negthickspace \in \negthickspace\text{ nodes } + \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{resource_area}_\text{node,tech}) \land \exists (\textit{available_area}_\text{node})) + \text{if } (\exists (\textit{flow_cap_max_systemwide}_\text{tech})) \end{array} \begin{cases} - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{resource_area}_\text{node,tech}) \leq \textit{available_area}_\text{node}&\quad + \sum\limits_{\text{node} \in \text{nodes}} (\textbf{flow_cap}_\text{node,tech}) \leq \textit{flow_cap_max_systemwide}_\text{tech}&\quad \\ \end{cases} -energy_capacity_systemwide -^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_systemwide_min +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set an upper bound on, or a fixed total of, energy capacity of a technology across all nodes in which the technology exists. +Set a lower bound on flow capacity of a technology across all nodes in which the technology exists. .. container:: scrolling-wrapper @@ -176,21 +181,17 @@ Set an upper bound on, or a fixed total of, energy capacity of a technology acro \forall{} \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textit{energy_cap_equals_systemwide}_\text{tech}) \lor \exists (\textit{energy_cap_max_systemwide}_\text{tech})) + \text{if } (\exists (\textit{flow_cap_min_systemwide}_\text{tech})) \end{array} \begin{cases} - \sum\limits_{\text{node} \in \text{nodes}} (\textbf{energy_cap}_\text{node,tech}) = \textit{energy_cap_equals_systemwide}_\text{tech}&\quad - \text{if } (\exists (\textit{energy_cap_equals_systemwide}_\text{tech})) - \\ - \sum\limits_{\text{node} \in \text{nodes}} (\textbf{energy_cap}_\text{node,tech}) \leq \textit{energy_cap_max_systemwide}_\text{tech}&\quad - \text{if } (\neg (\exists (\textit{energy_cap_equals_systemwide}_\text{tech}))) + \sum\limits_{\text{node} \in \text{nodes}} (\textbf{flow_cap}_\text{node,tech}) \geq \textit{flow_cap_min_systemwide}_\text{tech}&\quad \\ \end{cases} balance_conversion_plus_primary ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Fix the relationship between total carrier production and total carrier consumption of `conversion_plus` technologies for `in` (consumption) and `out` (production) carrier flows. +Fix the relationship between total outflow and total inflow of `conversion_plus` technologies for `in` (consumption) and `out` (production) carrier flows. .. container:: scrolling-wrapper @@ -201,17 +202,17 @@ Fix the relationship between total carrier production and total carrier consumpt \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\text{tech_group=conversion_plus} \land \textit{carrier_ratios}_\text{node,tech,carrier_tier,carrier,timestep}\mathord{>}\text{0}) + \text{if } (\text{tech_group=conversion_plus} \land \textit{carrier_ratios}_\text{node,tech,carrier_tier,carrier}\mathord{>}\text{0}) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier,timestep} }) = -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier,timestep}) \times \textit{energy_eff}_\text{node,tech,timestep}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier}) \times \textit{flow_eff}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_max_conversion_plus -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_out_max_conversion_plus +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound in each timestep of a `conversion_plus` technology's total carrier production on its `out` carrier flows. +Set the upper bound in each timestep of a `conversion_plus` technology's total outflow on its `out` carrier flows. .. container:: scrolling-wrapper @@ -225,14 +226,14 @@ Set the upper bound in each timestep of a `conversion_plus` technology's total c \text{if } (\text{tech_group=conversion_plus} \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer})) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) \leq \textit{timestep_resolution}_\text{timestep} \times \textbf{energy_cap}_\text{node,tech}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) \leq \textit{timestep_resolution}_\text{timestep} \times \textbf{flow_cap}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_min_conversion_plus -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_out_min_conversion_plus +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the lower bound in each timestep of a `conversion_plus` technology's total carrier production on its `out` carrier flows. +Set the lower bound in each timestep of a `conversion_plus` technology's total outflow on its `out` carrier flows. .. container:: scrolling-wrapper @@ -243,10 +244,10 @@ Set the lower bound in each timestep of a `conversion_plus` technology's total c \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{energy_cap_min_use}_\text{node,tech}) \land \text{tech_group=conversion_plus} \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer})) + \text{if } (\exists (\textit{flow_out_min_relative}_\text{node,tech}) \land \text{tech_group=conversion_plus} \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer})) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) \geq \textit{timestep_resolution}_\text{timestep} \times \textbf{energy_cap}_\text{node,tech} \times \textit{energy_cap_min_use}_\text{node,tech}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) \geq \textit{timestep_resolution}_\text{timestep} \times \textbf{flow_cap}_\text{node,tech} \times \textit{flow_out_min_relative}_\text{node,tech}&\quad \\ \end{cases} @@ -265,37 +266,37 @@ Fix the relationship between a `conversion_plus` technology's total `in_2`/`in_3 \text{ carrier_tier }\negthickspace \in \negthickspace\text{ carrier_tiers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\text{tech_group=conversion_plus} \land \text{carrier_tier} \in \text{[in_2,out_2,in_3,out_3]} \land \textit{carrier_ratios}_\text{node,tech,carrier_tier,carrier,timestep}\mathord{>}\text{0}) + \text{if } (\text{tech_group=conversion_plus} \land \text{carrier_tier} \in \text{[in_2,out_2,in_3,out_3]} \land \textit{carrier_ratios}_\text{node,tech,carrier_tier,carrier}\mathord{>}\text{0}) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_2)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_2,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[in_2]})\land{}(\text{carrier_tier} \in \text{[in_2,in_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_2)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_2,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[in_2,in_3]})\land{}(\text{carrier_tier} \in \text{[in_2]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_2)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_2,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[in_2]})\land{}(\text{carrier_tier} \in \text{[out_2,out_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_3)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_3,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[in_2,in_3]})\land{}(\text{carrier_tier} \in \text{[in_3]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_3)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_3,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[in_3]})\land{}(\text{carrier_tier} \in \text{[in_2,in_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_2)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_2,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[in_2,in_3]})\land{}(\text{carrier_tier} \in \text{[out_2]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_3)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_3,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[in_3]})\land{}(\text{carrier_tier} \in \text{[out_2,out_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_3)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_3,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[in_2,in_3]})\land{}(\text{carrier_tier} \in \text{[out_3]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_2)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_2,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[out_2]})\land{}(\text{carrier_tier} \in \text{[in_2,in_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_2)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_2,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[out_2,out_3]})\land{}(\text{carrier_tier} \in \text{[in_2]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_2)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_2,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[out_2]})\land{}(\text{carrier_tier} \in \text{[out_2,out_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in_3)}} (\frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in_3,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[out_2,out_3]})\land{}(\text{carrier_tier} \in \text{[in_3]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=in,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_3)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_3,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[out_3]})\land{}(\text{carrier_tier} \in \text{[in_2,in_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_2)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_2,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[out_2,out_3]})\land{}(\text{carrier_tier} \in \text{[out_2]}) \\ - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier,timestep} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_3)}} (\frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_3,carrier,timestep} })&\quad - \text{if } (\text{carrier_tier} \in \text{[out_3]})\land{}(\text{carrier_tier} \in \text{[out_2,out_3]}) + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out,carrier} }) = \sum\limits_{\text{carrier} \in \text{carrier_tier(out_3)}} (\frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{carrier_ratios}_\text{node,tech,carrier_tier=out_3,carrier} })&\quad + \text{if } (\text{carrier_tier} \in \text{[out_2,out_3]})\land{}(\text{carrier_tier} \in \text{[out_3]}) \\ \end{cases} -conversion_plus_prod_con_to_zero -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +conversion_plus_flow_to_zero +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set a `conversion_plus` technology's carrier flow to zero if its `carrier_ratio` is zero. @@ -309,13 +310,13 @@ Set a `conversion_plus` technology's carrier flow to zero if its `carrier_ratio` \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\textit{carrier_ratios}_\text{node,tech,carrier_tier,carrier,timestep}\mathord{=}\text{0} \land \text{tech_group=conversion_plus}) + \text{if } (\textit{carrier_ratios}_\text{node,tech,carrier_tier,carrier}\mathord{=}\text{0} \land \text{tech_group=conversion_plus}) \end{array} \begin{cases} - \textbf{carrier_con}_\text{node,tech,carrier,timestep} = 0&\quad + \textbf{flow_in}_\text{node,tech,carrier,timestep} = 0&\quad \text{if } (\text{carrier_tier} \in \text{[in,in_2,in_3]}) \\ - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} = 0&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} = 0&\quad \text{if } (\text{carrier_tier} \in \text{[out,out_2,out_3]}) \\ \end{cases} @@ -323,7 +324,7 @@ Set a `conversion_plus` technology's carrier flow to zero if its `carrier_ratio` balance_conversion ^^^^^^^^^^^^^^^^^^ -Fix the relationship between a `conversion` technology's carrier production and consumption. +Fix the relationship between a `conversion` technology's outflow and consumption. .. container:: scrolling-wrapper @@ -337,14 +338,14 @@ Fix the relationship between a `conversion` technology's carrier production and \text{if } (\text{tech_group=conversion}) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) = -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}) \times \textit{energy_eff}_\text{node,tech,timestep}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) = \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}) \times \textit{flow_eff}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_max -^^^^^^^^^^^^^^^^^^^^^^ +flow_out_max +^^^^^^^^^^^^ -Set the upper bound of a non-`conversion_plus` technology's carrier production. +Set the upper bound of a non-`conversion_plus` technology's outflow. .. container:: scrolling-wrapper @@ -356,17 +357,17 @@ Set the upper bound of a non-`conversion_plus` technology's carrier production. \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \neg (\text{tech_group=conversion_plus}) \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[out]}) + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \neg (\text{tech_group=conversion_plus}) \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[out]}) \end{array} \begin{cases} - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} \leq \textbf{energy_cap}_\text{node,tech} \times \textit{timestep_resolution}_\text{timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} \leq \textbf{flow_cap}_\text{node,tech} \times \textit{timestep_resolution}_\text{timestep} \times \textit{parasitic_eff}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_min -^^^^^^^^^^^^^^^^^^^^^^ +flow_out_min +^^^^^^^^^^^^ -Set the lower bound of a non-`conversion_plus` technology's carrier production. +Set the lower bound of a non-`conversion_plus` technology's outflow. .. container:: scrolling-wrapper @@ -378,17 +379,17 @@ Set the lower bound of a non-`conversion_plus` technology's carrier production. \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \exists (\textit{energy_cap_min_use}_\text{node,tech}) \land \neg (\text{tech_group=conversion_plus}) \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[out]}) + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \exists (\textit{flow_out_min_relative}_\text{node,tech}) \land \neg (\text{tech_group=conversion_plus}) \land \neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[out]}) \end{array} \begin{cases} - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} \geq \textbf{energy_cap}_\text{node,tech} \times \textit{timestep_resolution}_\text{timestep} \times \textit{energy_cap_min_use}_\text{node,tech}&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} \geq \textbf{flow_cap}_\text{node,tech} \times \textit{timestep_resolution}_\text{timestep} \times \textit{flow_out_min_relative}_\text{node,tech}&\quad \\ \end{cases} -carrier_consumption_max -^^^^^^^^^^^^^^^^^^^^^^^ +flow_in_max +^^^^^^^^^^^ -Set the upper bound of a non-`conversion_plus` technology's carrier consumption. +Set the upper bound of a non-`conversion_plus` technology's inflow. .. container:: scrolling-wrapper @@ -400,17 +401,17 @@ Set the upper bound of a non-`conversion_plus` technology's carrier consumption. \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land (\text{tech_group=transmission} \lor \text{tech_group=demand} \lor \text{tech_group=storage}) \land (\neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \lor \text{tech_group=demand}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[in]}) + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land (\text{tech_group=transmission} \lor \text{tech_group=demand} \lor \text{tech_group=storage}) \land (\neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \lor \text{tech_group=demand}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[in]}) \end{array} \begin{cases} - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \geq -1 \times \textbf{energy_cap}_\text{node,tech} \times \textit{timestep_resolution}_\text{timestep}&\quad + \textbf{flow_in}_\text{node,tech,carrier,timestep} \leq \textbf{flow_cap}_\text{node,tech} \times \textit{timestep_resolution}_\text{timestep}&\quad \\ \end{cases} -resource_max -^^^^^^^^^^^^ +source_use_max +^^^^^^^^^^^^^^ -Set the upper bound of a `supply_plus` technology's resource consumption. +Set the upper bound of a `supply_plus` technology's source consumption. .. container:: scrolling-wrapper @@ -424,14 +425,14 @@ Set the upper bound of a `supply_plus` technology's resource consumption. \text{if } (\text{tech_group=supply_plus}) \end{array} \begin{cases} - \textbf{resource_con}_\text{node,tech,timestep} \leq \textit{timestep_resolution}_\text{timestep} \times \textbf{resource_cap}_\text{node,tech}&\quad + \textbf{source_use}_\text{node,tech,timestep} \leq \textit{timestep_resolution}_\text{timestep} \times \textbf{source_cap}_\text{node,tech}&\quad \\ \end{cases} storage_max ^^^^^^^^^^^ -Set the upper bound of the amount of energy a `storage`/`supply_plus` technology can store. +Set the upper bound of the amount of carrier a `storage`/`supply_plus` technology can store. .. container:: scrolling-wrapper @@ -452,7 +453,7 @@ Set the upper bound of the amount of energy a `storage`/`supply_plus` technology storage_discharge_depth_limit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the lower bound of the stored energy a `storage`/`supply_plus` technology must keep in reserve at all times. +Set the lower bound of the stored carrier a `storage`/`supply_plus` technology must keep in reserve at all times. .. container:: scrolling-wrapper @@ -473,7 +474,7 @@ Set the lower bound of the stored energy a `storage`/`supply_plus` technology mu system_balance ^^^^^^^^^^^^^^ -Set the global energy balance of the optimisation problem by fixing the total production of a given energy carrier to equal the total consumption of that carrier at every node in every timestep. +Set the global carrier balance of the optimisation problem by fixing the total production of a given carrier to equal the total consumption of that carrier at every node in every timestep. .. container:: scrolling-wrapper @@ -486,24 +487,24 @@ Set the global energy balance of the optimisation problem by fixing the total pr \\ \end{array} \begin{cases} - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textbf{unmet_demand}_\text{node,carrier,timestep} + \textbf{unused_supply}_\text{node,carrier,timestep} = 0&\quad - \text{if } (\text{run_config.ensure_feasibility}\mathord{=}\text{true})\land{}(\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier)) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textbf{unmet_demand}_\text{node,carrier,timestep} + \textbf{unused_supply}_\text{node,carrier,timestep} = 0&\quad + \text{if } (\text{config.ensure_feasibility}\mathord{=}\text{true})\land{}(\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier)) \\ - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}) + \textbf{unmet_demand}_\text{node,carrier,timestep} + \textbf{unused_supply}_\text{node,carrier,timestep} = 0&\quad - \text{if } (\text{run_config.ensure_feasibility}\mathord{=}\text{true})\land{}(\neg (\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier))) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}) + \textbf{unmet_demand}_\text{node,carrier,timestep} + \textbf{unused_supply}_\text{node,carrier,timestep} = 0&\quad + \text{if } (\text{config.ensure_feasibility}\mathord{=}\text{true})\land{}(\neg (\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier))) \\ - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) = 0&\quad - \text{if } (\neg (\text{run_config.ensure_feasibility}\mathord{=}\text{true}))\land{}(\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier)) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) = 0&\quad + \text{if } (\neg (\text{config.ensure_feasibility}\mathord{=}\text{true}))\land{}(\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier)) \\ - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}) = 0&\quad - \text{if } (\neg (\text{run_config.ensure_feasibility}\mathord{=}\text{true}))\land{}(\neg (\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier))) + \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) - \sum\limits_{\text{tech} \in \text{techs}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}) = 0&\quad + \text{if } (\neg (\text{config.ensure_feasibility}\mathord{=}\text{true}))\land{}(\neg (\bigvee\limits_{\text{tech} \in \text{techs}} (export_carrier))) \\ \end{cases} balance_supply ^^^^^^^^^^^^^^ -Set the upper bound on, or a fixed total of, a `supply` technology's ability to produce energy based on the quantity of available resource. +Set the upper bound on, or a fixed total of, a `supply` technology's ability to produce a carrier based on the quantity of available source. .. container:: scrolling-wrapper @@ -515,36 +516,36 @@ Set the upper bound on, or a fixed total of, a `supply` technology's ability to \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{resource}_\text{node,tech,timestep}) \land \text{tech_group=supply}) + \text{if } ((\exists (\textit{source_equals}_\text{node,tech}) \lor \exists (\textit{source_max}_\text{node,tech})) \land \text{tech_group=supply}) \end{array} \begin{cases} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{resource_area}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } = \textit{source_equals}_\text{node,tech} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\exists (\textit{source_equals}_\text{node,tech}) \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_area}) \\ - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_cap}) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } = \textit{source_equals}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\exists (\textit{source_equals}_\text{node,tech}) \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_cap}) \\ - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy}) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } = \textit{source_equals}_\text{node,tech} \times 1&\quad + \text{if } (\exists (\textit{source_equals}_\text{node,tech}) \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } \leq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{resource_area}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}) \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } \leq \textit{source_max}_\text{node,tech} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\neg (\exists (\textit{source_equals}_\text{node,tech})) \land \exists (\textit{sink_max}) \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_area}) \\ - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } \leq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}) \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_cap}) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } \leq \textit{source_max}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\neg (\exists (\textit{source_equals}_\text{node,tech})) \land \exists (\textit{sink_max}) \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_cap}) \\ - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } \leq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}) \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy}) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } \leq \textit{source_max}_\text{node,tech} \times 1&\quad + \text{if } (\neg (\exists (\textit{source_equals}_\text{node,tech})) \land \exists (\textit{sink_max}) \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} = 0&\quad - \text{if } (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{flow_out}_\text{node,tech,carrier,timestep} = 0&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0}) \\ \end{cases} balance_supply_min_use ^^^^^^^^^^^^^^^^^^^^^^ -Set the lower bound on, or a fixed amount of, the energy a `supply` technology must consume in each timestep. +Set the lower bound on the quantity of its source a `supply` technology must use in each timestep. .. container:: scrolling-wrapper @@ -556,10 +557,17 @@ Set the lower bound on, or a fixed amount of, the energy a `supply` technology m \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{resource}_\text{node,tech,timestep}) \land \text{tech_group=supply} \land \exists (\textit{resource_min_use}_\text{node,tech}) \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})) + \text{if } (\exists (\textit{source_min}_\text{node,tech}) \land \neg (\exists (\textit{source_equals}_\text{node,tech})) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0}) \end{array} \begin{cases} - \textit{resource_min_use}_\text{node,tech} \leq \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} }&\quad + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } \geq \textit{source_min}_\text{node,tech} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_area}) + \\ + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } \geq \textit{source_min}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_cap}) + \\ + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } \geq \textit{source_min}_\text{node,tech} \times 1&\quad + \text{if } (\textit{source_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ \end{cases} @@ -580,30 +588,59 @@ balance_demand \text{if } (\text{tech_group=demand}) \end{array} \begin{cases} - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep} = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{resource_area}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech} = \textit{sink_equals}_\text{node,tech,timestep} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\exists (\textit{sink_equals}_\text{node,tech,timestep}))\land{}(\textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_area}) + \\ + \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech} = \textit{sink_equals}_\text{node,tech,timestep} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\exists (\textit{sink_equals}_\text{node,tech,timestep}))\land{}(\textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_cap}) + \\ + \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech} = \textit{sink_equals}_\text{node,tech,timestep} \times 1&\quad + \text{if } (\exists (\textit{sink_equals}_\text{node,tech,timestep}))\land{}(\textit{sink_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep} = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_cap}) + \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech} \leq \textit{sink_max} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\neg (\exists (\textit{sink_equals}_\text{node,tech,timestep})) \land \exists (\textit{sink_max}))\land{}(\textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_area}) \\ - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep} = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy}) + \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech} \leq \textit{sink_max} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\neg (\exists (\textit{sink_equals}_\text{node,tech,timestep})) \land \exists (\textit{sink_max}))\land{}(\textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_cap}) + \\ + \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech} \leq \textit{sink_max} \times 1&\quad + \text{if } (\neg (\exists (\textit{sink_equals}_\text{node,tech,timestep})) \land \exists (\textit{sink_max}))\land{}(\textit{sink_unit}_\text{node,tech}\mathord{=}\text{absolute}) + \\ + \end{cases} + +balance_demand_min_use +^^^^^^^^^^^^^^^^^^^^^^ + +Set the lower bound on the quantity of flow a `demand` technology must dump to its sink in each timestep. + +.. container:: scrolling-wrapper + + .. math:: + \begin{array}{r} + \forall{} + \text{ node }\negthickspace \in \negthickspace\text{ nodes, } + \text{ tech }\negthickspace \in \negthickspace\text{ techs, } + \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } + \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep} \geq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{resource_area}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}))\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \text{if } (\exists (\textit{sink_min}) \land \neg (\exists (\textit{source_equals}_\text{node,tech})) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0}) + \end{array} + \begin{cases} + \textit{sink_min} \times \textbf{area_use}_\text{node,tech} \leq \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech}&\quad + \text{if } (\textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_area}) \\ - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep} \geq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}))\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_cap}) + \textit{sink_min} \times \textbf{flow_cap}_\text{node,tech} \leq \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech}&\quad + \text{if } (\textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_cap}) \\ - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep} \geq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}))\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy}) + \textit{sink_min} \times 1 \leq \textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech}&\quad + \text{if } (\textit{sink_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ \end{cases} balance_supply_plus_no_storage ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound on, or a fixed total of, a `supply_plus` (without storage) technology's ability to produce energy based on only the quantity of consumed resource. +Set the upper bound on, or a fixed total of, a `supply_plus` (without storage) technology's ability to produce flow based on only the quantity of consumed resource. .. container:: scrolling-wrapper @@ -618,18 +655,18 @@ Set the upper bound on, or a fixed total of, a `supply_plus` (without storage) t \text{if } (\text{tech_group=supply_plus} \land \neg (\textit{include_storage}_\text{node,tech}\mathord{=}\text{true})) \end{array} \begin{cases} - \textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep} = 0&\quad - \text{if } (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech} = 0&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}) \\ - \textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep} = \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech} = \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})) \\ \end{cases} balance_supply_plus_with_storage ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound on, or a fixed total of, a `supply_plus` (with storage) technology's ability to produce energy based on the quantity of consumed resource and available stored energy. +Set the upper bound on, or a fixed total of, a `supply_plus` (with storage) technology's ability to produce flow based on the quantity of consumed resource and available stored carrier. .. container:: scrolling-wrapper @@ -644,30 +681,30 @@ Set the upper bound on, or a fixed total of, a `supply_plus` (with storage) tech \text{if } (\exists (\textbf{storage}_\text{node,tech,timestep}) \land \text{tech_group=supply_plus}) \end{array} \begin{cases} - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep}) - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep})&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep}) - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true}))\land{}(\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech}) - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}))\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech}) - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}))\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep}) - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech}) - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}))\land{}(\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ \end{cases} -resource_availability_supply_plus -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +source_availability_supply_plus +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound on, or a fixed total of, a `supply_plus` technology's ability to consume its available energy resource. +Set the upper bound on, or a fixed total of, a `supply_plus` technology's ability to consume its available resource. .. container:: scrolling-wrapper @@ -678,33 +715,33 @@ Set the upper bound on, or a fixed total of, a `supply_plus` technology's abilit \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{resource_con}_\text{node,tech,timestep}) \land \exists (\textit{resource}_\text{node,tech,timestep})) + \text{if } (\exists (\textbf{source_use}_\text{node,tech,timestep}) \land (\exists (\textit{source_equals}_\text{node,tech}) \lor \exists (\textit{source_max}_\text{node,tech}))) \end{array} \begin{cases} - \textbf{resource_con}_\text{node,tech,timestep} = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{resource_area}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \textbf{source_use}_\text{node,tech,timestep} = \textit{source_equals}_\text{node,tech} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\exists (\textit{source_equals}_\text{node,tech}))\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_area}) \\ - \textbf{resource_con}_\text{node,tech,timestep} = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_cap}) + \textbf{source_use}_\text{node,tech,timestep} = \textit{source_equals}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\exists (\textit{source_equals}_\text{node,tech}))\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_cap}) \\ - \textbf{resource_con}_\text{node,tech,timestep} = \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech}&\quad - \text{if } (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true})\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy}) + \textbf{source_use}_\text{node,tech,timestep} = \textit{source_equals}_\text{node,tech} \times 1&\quad + \text{if } (\exists (\textit{source_equals}_\text{node,tech}))\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ - \textbf{resource_con}_\text{node,tech,timestep} \leq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{resource_area}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}))\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \textbf{source_use}_\text{node,tech,timestep} \leq \textit{source_max}_\text{node,tech} \times \textbf{area_use}_\text{node,tech}&\quad + \text{if } (\neg (\exists (\textit{source_equals}_\text{node,tech})) \land \exists (\textit{source_max}_\text{node,tech}))\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_area}) \\ - \textbf{resource_con}_\text{node,tech,timestep} \leq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}))\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_cap}) + \textbf{source_use}_\text{node,tech,timestep} \leq \textit{source_max}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\neg (\exists (\textit{source_equals}_\text{node,tech})) \land \exists (\textit{source_max}_\text{node,tech}))\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{per_cap}) \\ - \textbf{resource_con}_\text{node,tech,timestep} \leq \textit{resource}_\text{node,tech,timestep} \times \textit{resource_scale}_\text{node,tech}&\quad - \text{if } (\neg (\textit{force_resource}_\text{node,tech}\mathord{=}\text{true}))\land{}(\textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy}) + \textbf{source_use}_\text{node,tech,timestep} \leq \textit{source_max}_\text{node,tech} \times 1&\quad + \text{if } (\neg (\exists (\textit{source_equals}_\text{node,tech})) \land \exists (\textit{source_max}_\text{node,tech}))\land{}(\textit{source_unit}_\text{node,tech}\mathord{=}\text{absolute}) \\ \end{cases} balance_storage ^^^^^^^^^^^^^^^ -Fix the quantity of energy stored in a `storage` technology at the end of each timestep based on the net flow of energy charged and discharged and the quantity of energy stored at the start of the timestep. +Fix the quantity of carrier stored in a `storage` technology at the end of each timestep based on the net flow of carrier charged and discharged and the quantity of carrier stored at the start of the timestep. .. container:: scrolling-wrapper @@ -719,30 +756,30 @@ Fix the quantity of energy stored in a `storage` technology at the end of each t \text{if } (\text{tech_group=storage}) \end{array} \begin{cases} - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep=lookup_cluster_last_timestep[timestep]}}) \times \textbf{storage}_\text{node,tech,timestep=lookup_cluster_last_timestep[timestep]} + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\textit{lookup_cluster_first_timestep}\mathord{=}\text{true} \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ \end{cases} set_storage_initial ^^^^^^^^^^^^^^^^^^^ -Fix the relationship between energy stored in a `storage` technology at the start and end of the whole model period. +Fix the relationship between carrier stored in a `storage` technology at the start and end of the whole model period. .. container:: scrolling-wrapper @@ -752,17 +789,17 @@ Fix the relationship between energy stored in a `storage` technology at the star \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{storage}_\text{node,tech,timestep}) \land \exists (\textit{storage_initial}_\text{node,tech}) \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{storage}_\text{node,tech,timestep}) \land \exists (\textit{storage_initial}_\text{node,tech}) \land \text{config.cyclic_storage}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{storage}_\text{node,tech,timestep=timesteps[-1]} \times ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep=timesteps[-1]}}) = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech}&\quad + \textbf{storage}_\text{node,tech,timestep=timesteps[-1]} \times ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep=timesteps[-1]}}) = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech}&\quad \\ \end{cases} balance_transmission ^^^^^^^^^^^^^^^^^^^^ -Fix the relationship between between energy flowing into and out of a `transmission` link in each timestep. +Fix the relationship between between carrier flowing into and out of a `transmission` link in each timestep. .. container:: scrolling-wrapper @@ -774,17 +811,17 @@ Fix the relationship between between energy flowing into and out of a `transmiss \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\text{tech_group=transmission} \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\text{tech_group=transmission} \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} = -1 \times \textbf{carrier_con}_\text{node=link_remote_nodes[node],tech=link_remote_techs[tech],carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep}&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} = \textbf{flow_in}_\text{node=link_remote_nodes[node],tech=link_remote_techs[tech],carrier,timestep} \times \textit{flow_eff}_\text{node,tech}&\quad \\ \end{cases} symmetric_transmission ^^^^^^^^^^^^^^^^^^^^^^ -Fix the energy capacity of two `transmission` technologies representing the same link in the system. +Fix the flow capacity of two `transmission` technologies representing the same link in the system. .. container:: scrolling-wrapper @@ -797,14 +834,14 @@ Fix the energy capacity of two `transmission` technologies representing the same \text{if } (\text{tech_group=transmission}) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} = \textbf{energy_cap}_\text{node=link_remote_nodes[node],tech=link_remote_techs[tech]}&\quad + \textbf{flow_cap}_\text{node,tech} = \textbf{flow_cap}_\text{node=link_remote_nodes[node],tech=link_remote_techs[tech]}&\quad \\ \end{cases} export_balance ^^^^^^^^^^^^^^ -Set the lower bound of a technology's carrier production to a technology's carrier export, for any technologies that can export energy out of the system. +Set the lower bound of a technology's outflow to a technology's carrier export, for any technologies that can export carriers out of the system. .. container:: scrolling-wrapper @@ -819,14 +856,14 @@ Set the lower bound of a technology's carrier production to a technology's carri \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \textit{export}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} \geq \textbf{carrier_export}_\text{node,tech,carrier,timestep}&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} \geq \textbf{flow_export}_\text{node,tech,carrier,timestep}&\quad \\ \end{cases} -carrier_export_max -^^^^^^^^^^^^^^^^^^ +flow_export_max +^^^^^^^^^^^^^^^ -Set the upper bound of a technology's carrier export, for any technologies that can export energy out of the system. +Set the upper bound of a technology's carrier export, for any technologies that can export carriers out of the system. .. container:: scrolling-wrapper @@ -838,13 +875,13 @@ Set the upper bound of a technology's carrier export, for any technologies that \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) \land \exists (\textit{export_max}_\text{node,tech})) + \text{if } (\exists (\textbf{flow_export}_\text{node,tech,carrier,timestep}) \land \exists (\textit{export_max}_\text{node,tech})) \end{array} \begin{cases} - \textbf{carrier_export}_\text{node,tech,carrier,timestep} \leq \textit{export_max}_\text{node,tech} \times \textbf{operating_units}_\text{node,tech,timestep}&\quad + \textbf{flow_export}_\text{node,tech,carrier,timestep} \leq \textit{export_max}_\text{node,tech} \times \textbf{operating_units}_\text{node,tech,timestep}&\quad \text{if } (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer}) \\ - \textbf{carrier_export}_\text{node,tech,carrier,timestep} \leq \textit{export_max}_\text{node,tech}&\quad + \textbf{flow_export}_\text{node,tech,carrier,timestep} \leq \textit{export_max}_\text{node,tech}&\quad \text{if } (\neg (\textit{cap_method}_\text{node,tech}\mathord{=}\text{integer})) \\ \end{cases} @@ -870,10 +907,10 @@ Set the upper bound of the number of integer units of technology that can exist, \\ \end{cases} -carrier_production_max_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_out_max_milp +^^^^^^^^^^^^^^^^^ -Set the upper bound of a non-`conversion_plus` technology's ability to produce energy, for any technology using integer units to define its capacity. +Set the upper bound of a non-`conversion_plus` technology's ability to produce carriers, for any technology using integer units to define its capacity. .. container:: scrolling-wrapper @@ -885,17 +922,17 @@ Set the upper bound of a non-`conversion_plus` technology's ability to produce e \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \neg (\text{tech_group=conversion_plus}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \neg (\text{tech_group=conversion_plus}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} \leq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{energy_cap_per_unit}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech,timestep}&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} \leq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{flow_cap_per_unit}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_max_conversion_plus_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_out_max_conversion_plus_milp +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound of a `conversion_plus` technology's ability to produce energy across all of its `out` energy carriers, if it uses integer units to define its capacity. +Set the upper bound of a `conversion_plus` technology's ability to outflow across all of its `out` carriers, if it uses integer units to define its capacity. .. container:: scrolling-wrapper @@ -906,17 +943,17 @@ Set the upper bound of a `conversion_plus` technology's ability to produce energ \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \text{tech_group=conversion_plus} \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \text{tech_group=conversion_plus} \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) \leq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{energy_cap_per_unit}_\text{node,tech}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) \leq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{flow_cap_per_unit}_\text{node,tech}&\quad \\ \end{cases} -carrier_consumption_max_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_in_max_milp +^^^^^^^^^^^^^^^^ -Set the upper bound of a non-`conversion_plus` technology's ability to consume energy, for any technology using integer units to define its capacity. +Set the upper bound of a non-`conversion_plus` technology's ability to consume carriers, for any technology using integer units to define its capacity. .. container:: scrolling-wrapper @@ -928,17 +965,17 @@ Set the upper bound of a non-`conversion_plus` technology's ability to consume e \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \neg (\text{tech_group=conversion_plus}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \neg (\text{tech_group=conversion_plus}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \geq -1 \times \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{energy_cap_per_unit}_\text{node,tech}&\quad + \textbf{flow_in}_\text{node,tech,carrier,timestep} \leq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{flow_cap_per_unit}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_min_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_out_min_milp +^^^^^^^^^^^^^^^^^ -Set the lower bound of a non-`conversion_plus` technology's ability to produce energy, for any technology using integer units to define its capacity. +Set the lower bound of a non-`conversion_plus` technology's ability to produce carriers, for any technology using integer units to define its capacity. .. container:: scrolling-wrapper @@ -950,17 +987,17 @@ Set the lower bound of a non-`conversion_plus` technology's ability to produce e \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \exists (\textit{energy_cap_min_use}_\text{node,tech}) \land \neg (\text{tech_group=conversion_plus}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \exists (\textit{flow_out_min_relative}_\text{node,tech}) \land \neg (\text{tech_group=conversion_plus}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} \geq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{energy_cap_per_unit}_\text{node,tech} \times \textit{energy_cap_min_use}_\text{node,tech}&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} \geq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{flow_cap_per_unit}_\text{node,tech} \times \textit{flow_out_min_relative}_\text{node,tech}&\quad \\ \end{cases} -carrier_production_min_conversion_plus_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_out_min_conversion_plus_milp +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the lower bound of a `conversion_plus` technology's ability to produce energy across all of its `out` energy carriers, if it uses integer units to define its capacity. +Set the lower bound of a `conversion_plus` technology's ability to outflow across all of its `out` carriers, if it uses integer units to define its capacity. .. container:: scrolling-wrapper @@ -971,10 +1008,10 @@ Set the lower bound of a `conversion_plus` technology's ability to produce energ \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{energy_cap_min_use}_\text{node,tech}) \land \text{tech_group=conversion_plus} \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{flow_out_min_relative}_\text{node,tech}) \land \text{tech_group=conversion_plus} \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) \geq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{energy_cap_per_unit}_\text{node,tech} \times \textit{energy_cap_min_use}_\text{node,tech}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) \geq \textbf{operating_units}_\text{node,tech,timestep} \times \textit{timestep_resolution}_\text{timestep} \times \textit{flow_cap_per_unit}_\text{node,tech} \times \textit{flow_out_min_relative}_\text{node,tech}&\quad \\ \end{cases} @@ -998,10 +1035,10 @@ Fix the storage capacity of any technology using integer units to define its cap \\ \end{cases} -energy_capacity_units_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_units_milp +^^^^^^^^^^^^^^^^^^^^^^^^ -Fix the energy capacity of any technology using integer units to define its capacity. +Fix the flow capacity of any technology using integer units to define its capacity. .. container:: scrolling-wrapper @@ -1011,17 +1048,17 @@ Fix the energy capacity of any technology using integer units to define its capa \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{energy_cap_per_unit}_\text{node,tech})) + \text{if } (\exists (\textbf{operating_units}_\text{node,tech,timestep}) \land \exists (\textit{flow_cap_per_unit}_\text{node,tech})) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} = \textbf{units}_\text{node,tech} \times \textit{energy_cap_per_unit}_\text{node,tech}&\quad + \textbf{flow_cap}_\text{node,tech} = \textbf{units}_\text{node,tech} \times \textit{flow_cap_per_unit}_\text{node,tech}&\quad \\ \end{cases} -energy_capacity_max_purchase_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_max_purchase_milp +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound on, or a fixed total of, a technology's energy capacity, for any technology with binary capacity purchasing. +Set the upper bound on, or a fixed total of, a technology's flow capacity, for any technology with binary capacity purchasing. .. container:: scrolling-wrapper @@ -1031,21 +1068,17 @@ Set the upper bound on, or a fixed total of, a technology's energy capacity, for \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land (\exists (\textit{energy_cap_max}_\text{node,tech}) \lor \exists (\textit{energy_cap_equals}_\text{node,tech}))) + \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land \exists (\textit{flow_cap_max}_\text{node,tech})) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} = \textit{energy_cap_equals}_\text{node,tech} \times \textit{energy_cap_scale}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad - \text{if } (\exists (\textit{energy_cap_equals}_\text{node,tech})) - \\ - \textbf{energy_cap}_\text{node,tech} \leq \textit{energy_cap_max}_\text{node,tech} \times \textit{energy_cap_scale}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad - \text{if } (\neg (\exists (\textit{energy_cap_equals}_\text{node,tech}))) + \textbf{flow_cap}_\text{node,tech} \leq \textit{flow_cap_max}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad \\ \end{cases} -energy_capacity_min_purchase_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +flow_capacity_min_purchase_milp +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the lower bound on a technology's energy capacity, for any technology with binary capacity purchasing. +Set the lower bound on a technology's flow capacity, for any technology with binary capacity purchasing. .. container:: scrolling-wrapper @@ -1055,10 +1088,10 @@ Set the lower bound on a technology's energy capacity, for any technology with b \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land \exists (\textit{energy_cap_min}_\text{node,tech}) \land \neg (\exists (\textit{energy_cap_equals}_\text{node,tech}))) + \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land \exists (\textit{flow_cap_min}_\text{node,tech}) \land \neg (\exists (\textit{flow_cap_equals}))) \end{array} \begin{cases} - \textbf{energy_cap}_\text{node,tech} \geq \textit{energy_cap_min}_\text{node,tech} \times \textit{energy_cap_scale}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad + \textbf{flow_cap}_\text{node,tech} \geq \textit{flow_cap_min}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad \\ \end{cases} @@ -1075,14 +1108,10 @@ Set the upper bound on, or a fixed total of, a technology's storage capacity, fo \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land (\exists (\textit{storage_cap_max}_\text{node,tech}) \lor \exists (\textit{storage_cap_equals}_\text{node,tech}))) + \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land \exists (\textit{storage_cap_max}_\text{node,tech})) \end{array} \begin{cases} - \textbf{storage_cap}_\text{node,tech} = \textit{storage_cap_equals}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad - \text{if } (\exists (\textit{storage_cap_equals}_\text{node,tech})) - \\ \textbf{storage_cap}_\text{node,tech} \leq \textit{storage_cap_max}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad - \text{if } (\neg (\exists (\textit{storage_cap_equals}_\text{node,tech}))) \\ \end{cases} @@ -1099,17 +1128,17 @@ Set the lower bound on a technology's storage capacity, for any technology with \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land \exists (\textit{storage_cap_min}_\text{node,tech}) \land \neg (\exists (\textit{storage_cap_equals}_\text{node,tech}))) + \text{if } (\exists (\textbf{purchased}_\text{node,tech}) \land \exists (\textit{storage_cap_min}_\text{node,tech}) \land \neg (\exists (\textit{storage_cap_equals}))) \end{array} \begin{cases} \textbf{storage_cap}_\text{node,tech} \geq \textit{storage_cap_min}_\text{node,tech} \times \textbf{purchased}_\text{node,tech}&\quad \\ \end{cases} -unit_capacity_systemwide_milp -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +unit_capacity_max_systemwide_milp +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the upper bound on, or a fixed total of, the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity. +Set the upper bound on the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity. .. container:: scrolling-wrapper @@ -1118,27 +1147,44 @@ Set the upper bound on, or a fixed total of, the total number of units of a tech \forall{} \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } ((\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech})) \land (\exists (\textit{units_max_systemwide}_\text{tech}) \lor \exists (\textit{units_equals_systemwide}_\text{tech}))) + \text{if } ((\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech})) \land \exists (\textit{units_max_systemwide}_\text{tech})) \end{array} \begin{cases} - \sum\limits_{\text{node} \in \text{nodes}} (\textbf{purchased}_\text{node,tech}) = \textit{units_equals_systemwide}_\text{tech}&\quad - \text{if } (\exists (\textit{units_equals_systemwide}_\text{tech}))\land{}(\exists (\textbf{purchased}_\text{node,tech})) - \\ - \sum\limits_{\text{node} \in \text{nodes}} (\textbf{units}_\text{node,tech}) = \textit{units_equals_systemwide}_\text{tech}&\quad - \text{if } (\exists (\textit{units_equals_systemwide}_\text{tech}))\land{}(\exists (\textbf{units}_\text{node,tech})) - \\ \sum\limits_{\text{node} \in \text{nodes}} (\textbf{purchased}_\text{node,tech}) \leq \textit{units_max_systemwide}_\text{tech}&\quad - \text{if } (\neg (\exists (\textit{units_equals_systemwide}_\text{tech})))\land{}(\exists (\textbf{purchased}_\text{node,tech})) + \text{if } (\exists (\textbf{purchased}_\text{node,tech})) \\ \sum\limits_{\text{node} \in \text{nodes}} (\textbf{units}_\text{node,tech}) \leq \textit{units_max_systemwide}_\text{tech}&\quad - \text{if } (\neg (\exists (\textit{units_equals_systemwide}_\text{tech})))\land{}(\exists (\textbf{units}_\text{node,tech})) + \text{if } (\exists (\textbf{units}_\text{node,tech})) + \\ + \end{cases} + +unit_capacity_min_systemwide_milp +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Set the lower bound on the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity. + +.. container:: scrolling-wrapper + + .. math:: + \begin{array}{r} + \forall{} + \text{ tech }\negthickspace \in \negthickspace\text{ techs } + \\ + \text{if } ((\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech})) \land \exists (\textit{units_min_systemwide}_\text{tech})) + \end{array} + \begin{cases} + \sum\limits_{\text{node} \in \text{nodes}} (\textbf{purchased}_\text{node,tech}) \geq \textit{units_min_systemwide}_\text{tech}&\quad + \text{if } (\exists (\textbf{purchased}_\text{node,tech})) + \\ + \sum\limits_{\text{node} \in \text{nodes}} (\textbf{units}_\text{node,tech}) \geq \textit{units_min_systemwide}_\text{tech}&\quad + \text{if } (\exists (\textbf{units}_\text{node,tech})) \\ \end{cases} -asynchronous_con_milp -^^^^^^^^^^^^^^^^^^^^^ +async_flow_in_milp +^^^^^^^^^^^^^^^^^^ -Set a technology's ability to consume energy in the same timestep that it is producing energy, for any technology using the asynchronous production/consumption binary switch. +Set a technology's ability to have inflow in the same timestep that it has outflow, for any technology using the asynchronous flow binary switch. .. container:: scrolling-wrapper @@ -1149,17 +1195,17 @@ Set a technology's ability to consume energy in the same timestep that it is pro \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{prod_con_switch}_\text{node,tech,timestep})) + \text{if } (\exists (\textbf{async_flow_switch}_\text{node,tech,timestep})) \end{array} \begin{cases} - -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}) \leq (1 - \textbf{prod_con_switch}_\text{node,tech,timestep}) \times \textit{bigM}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}) \leq (1 - \textbf{async_flow_switch}_\text{node,tech,timestep}) \times \textit{bigM}&\quad \\ \end{cases} -asynchronous_prod_milp -^^^^^^^^^^^^^^^^^^^^^^ +async_flow_out_milp +^^^^^^^^^^^^^^^^^^^ -Set a technology's ability to produce energy in the same timestep that it is consuming energy, for any technology using the asynchronous production/consumption binary switch. +Set a technology's ability to have outflow in the same timestep that it has inflow, for any technology using the asynchronous flow binary switch. .. container:: scrolling-wrapper @@ -1170,17 +1216,17 @@ Set a technology's ability to produce energy in the same timestep that it is con \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textbf{prod_con_switch}_\text{node,tech,timestep})) + \text{if } (\exists (\textbf{async_flow_switch}_\text{node,tech,timestep})) \end{array} \begin{cases} - \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) \leq \textbf{prod_con_switch}_\text{node,tech,timestep} \times \textit{bigM}&\quad + \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) \leq \textbf{async_flow_switch}_\text{node,tech,timestep} \times \textit{bigM}&\quad \\ \end{cases} ramping_up ^^^^^^^^^^ -Set the upper bound on a technology's ability to ramp energy production up beyond a certain percentage compared to the previous timestep. +Set the upper bound on a technology's ability to ramp outflow up beyond a certain percentage compared to the previous timestep. .. container:: scrolling-wrapper @@ -1192,24 +1238,24 @@ Set the upper bound on a technology's ability to ramp energy production up beyon \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{energy_ramping}_\text{node,tech,timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) + \text{if } (\exists (\textit{flow_ramping}_\text{node,tech}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \end{array} \begin{cases} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} } \leq \textit{energy_ramping}_\text{node,tech,timestep} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true})) + \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} } \leq \textit{flow_ramping}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true})) \\ - \frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} } \leq \textit{energy_ramping}_\text{node,tech,timestep} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true})) + \frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} } \leq \textit{flow_ramping}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true})) \\ - \frac{ (\textbf{carrier_con}_\text{node,tech,carrier,timestep} + \textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ (\textbf{carrier_con}_\text{node,tech,carrier,timestep-1} + \textbf{carrier_prod}_\text{node,tech,carrier,timestep-1}) }{ \textit{timestep_resolution}_\text{timestep-1} } \leq \textit{energy_ramping}_\text{node,tech,timestep} \times \textbf{energy_cap}_\text{node,tech}&\quad - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true} \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + \frac{ (\textbf{flow_out}_\text{node,tech,carrier,timestep} - \textbf{flow_in}_\text{node,tech,carrier,timestep}) }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ (\textbf{flow_out}_\text{node,tech,carrier,timestep-1} - \textbf{flow_in}_\text{node,tech,carrier,timestep-1}) }{ \textit{timestep_resolution}_\text{timestep-1} } \leq \textit{flow_ramping}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech}&\quad + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true} \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \\ \end{cases} ramping_down ^^^^^^^^^^^^ -Set the upper bound on a technology's ability to ramp energy production down beyond a certain percentage compared to the previous timestep. +Set the upper bound on a technology's ability to ramp outflow down beyond a certain percentage compared to the previous timestep. .. container:: scrolling-wrapper @@ -1221,17 +1267,17 @@ Set the upper bound on a technology's ability to ramp energy production down bey \text{ carrier }\negthickspace \in \negthickspace\text{ carriers, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{energy_ramping}_\text{node,tech,timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) + \text{if } (\exists (\textit{flow_ramping}_\text{node,tech}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \end{array} \begin{cases} - -1 \times \textit{energy_ramping}_\text{node,tech,timestep} \times \textbf{energy_cap}_\text{node,tech} \leq \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} }&\quad - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true})) + -1 \times \textit{flow_ramping}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech} \leq \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} }&\quad + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true})) \\ - -1 \times \textit{energy_ramping}_\text{node,tech,timestep} \times \textbf{energy_cap}_\text{node,tech} \leq \frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{carrier_con}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} }&\quad - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true})) + -1 \times \textit{flow_ramping}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech} \leq \frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep} }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ \textbf{flow_in}_\text{node,tech,carrier,timestep-1} }{ \textit{timestep_resolution}_\text{timestep-1} }&\quad + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true} \land \neg (\textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true})) \\ - -1 \times \textit{energy_ramping}_\text{node,tech,timestep} \times \textbf{energy_cap}_\text{node,tech} \leq \frac{ (\textbf{carrier_con}_\text{node,tech,carrier,timestep} + \textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ (\textbf{carrier_con}_\text{node,tech,carrier,timestep-1} + \textbf{carrier_prod}_\text{node,tech,carrier,timestep-1}) }{ \textit{timestep_resolution}_\text{timestep-1} }&\quad - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true} \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true}) + -1 \times \textit{flow_ramping}_\text{node,tech} \times \textbf{flow_cap}_\text{node,tech} \leq \frac{ (\textbf{flow_out}_\text{node,tech,carrier,timestep} - \textbf{flow_in}_\text{node,tech,carrier,timestep}) }{ \textit{timestep_resolution}_\text{timestep} } - \frac{ (\textbf{flow_out}_\text{node,tech,carrier,timestep-1} - \textbf{flow_in}_\text{node,tech,carrier,timestep-1}) }{ \textit{timestep_resolution}_\text{timestep-1} }&\quad + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true} \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true}) \\ \end{cases} @@ -1253,98 +1299,98 @@ The operating costs per timestep of a technology \text{ cost }\negthickspace \in \negthickspace\text{ costs, } \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ - \text{if } (\exists (\textit{cost_export}_\text{node,tech,cost,timestep}) \lor \exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \lor \exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep})) + \text{if } (\exists (\textit{cost_export}_\text{node,tech,cost}) \lor \exists (\textit{cost_om_con}_\text{node,tech,cost}) \lor \exists (\textit{cost_om_prod}_\text{node,tech,cost})) \end{array} \begin{cases} - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \textbf{resource_con}_\text{node,tech,timestep})&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \textbf{source_use}_\text{node,tech,timestep})&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \textbf{resource_con}_\text{node,tech,timestep})&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \textbf{source_use}_\text{node,tech,timestep})&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply_plus})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \textbf{resource_con}_\text{node,tech,timestep})&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply_plus})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) }{ \textit{flow_eff}_\text{node,tech} })&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{energy_eff}_\text{node,tech,timestep} })&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) }{ \textit{flow_eff}_\text{node,tech} })&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{energy_eff}_\text{node,tech,timestep} })&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{energy_eff}_\text{node,tech,timestep} })&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost})))\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \textbf{source_use}_\text{node,tech,timestep})&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \textbf{source_use}_\text{node,tech,timestep})&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply_plus})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) }{ \textit{flow_eff}_\text{node,tech} })&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) }{ \textit{flow_eff}_\text{node,tech} })&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{carrier_export}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost,timestep}))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep})))\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \textbf{resource_con}_\text{node,tech,timestep})&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \textbf{resource_con}_\text{node,tech,timestep})&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_con}_\text{node,tech,cost,timestep} \times \textbf{resource_con}_\text{node,tech,timestep})&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply_plus})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{energy_eff}_\text{node,tech,timestep} })&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost})))\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{energy_eff}_\text{node,tech,timestep} })&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\exists (\textit{cost_om_prod}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus}))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\frac{ \textit{cost_om_con}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) }{ \textit{energy_eff}_\text{node,tech,timestep} })&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=supply} \land \textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \textbf{source_use}_\text{node,tech,timestep})&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply_plus})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_con}_\text{node,tech,cost} \times \textbf{source_use}_\text{node,tech,timestep})&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply_plus})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \frac{ \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) }{ \textit{flow_eff}_\text{node,tech} })&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\frac{ \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{flow_out}_\text{node,tech,carrier,timestep}) }{ \textit{flow_eff}_\text{node,tech} })&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=supply} \land \textit{flow_eff}_\text{node,tech}\mathord{>}\text{0} \land \text{carrier_tier} \in \text{[out]})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier=primary_carrier_in}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \text{tech_group=conversion_plus})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_con}_\text{node,tech,cost,timestep} \times -1 \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{carrier_con}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}) + \textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier=primary_carrier_out}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \text{tech_group=conversion_plus}) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_con}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(in)}} (\textbf{flow_in}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_om_con}_\text{node,tech,cost}) \land \neg (\text{tech_group=conversion_plus} \lor \text{tech_group=supply_plus} \lor \text{tech_group=supply}) \land \text{carrier_tier} \in \text{[in]})\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ - \textit{timestep_weights}_\text{timestep} \times (\textit{cost_om_prod}_\text{node,tech,cost,timestep} \times \sum\limits_{\text{carrier} \in \text{carrier_tier(out)}} (\textbf{carrier_prod}_\text{node,tech,carrier,timestep}))&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep})))\land{}(\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}) \land \neg (\text{tech_group=conversion_plus})) + \textit{timestep_weights}_\text{timestep} \times (\textit{cost_export}_\text{node,tech,cost} \times \sum\limits_{\text{carrier} \in \text{carriers}} (\textbf{flow_export}_\text{node,tech,carrier,timestep}))&\quad + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost})))\land{}(\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \exists (\textit{cost_export}_\text{node,tech,cost})) \\ \textit{timestep_weights}_\text{timestep} \times (0)&\quad - \text{if } (\neg (\exists (\textit{cost_export}_\text{node,tech,cost,timestep})))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost,timestep})))\land{}(\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost,timestep}))) + \text{if } (\neg (\exists (\textit{cost_om_prod}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_om_con}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_export}_\text{node,tech,cost}))) \\ \end{cases} @@ -1362,296 +1408,296 @@ The installation costs of a technology, including annualised investment costs an \text{ tech }\negthickspace \in \negthickspace\text{ techs, } \text{ cost }\negthickspace \in \negthickspace\text{ costs } \\ - \text{if } (\exists (\textit{cost_energy_cap}_\text{node,tech,cost}) \lor \exists (\textit{cost_om_annual}_\text{node,tech,cost}) \lor \exists (\textit{cost_om_annual_investment_fraction}_\text{node,tech,cost}) \lor \exists (\textit{cost_purchase}_\text{node,tech,cost}) \lor \exists (\textit{cost_resource_area}_\text{node,tech,cost}) \lor \exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \lor \exists (\textit{cost_storage_cap}_\text{node,tech,cost})) + \text{if } (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}) \lor \exists (\textit{cost_om_annual}_\text{node,tech,cost}) \lor \exists (\textit{cost_om_annual_investment_fraction}_\text{node,tech,cost}) \lor \exists (\textit{cost_purchase}_\text{node,tech,cost}) \lor \exists (\textit{cost_area_use}_\text{node,tech,cost}) \lor \exists (\textit{cost_source_cap}_\text{node,tech,cost}) \lor \exists (\textit{cost_storage_cap}_\text{node,tech,cost})) \end{array} \begin{cases} - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (0) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{purchased}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{purchased}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_storage_cap}_\text{node,tech,cost} \times \textbf{storage_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech} + \textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_purchase}_\text{node,tech,cost} \times \textbf{units}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land \exists (\textbf{units}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_source_cap}_\text{node,tech,cost} \times \textbf{source_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech}))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_energy_cap}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\exists (\textit{cost_energy_cap}_\text{node,tech,cost}))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (0) \times (0.5 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\text{tech_group=transmission})\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech} + \textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech} + \textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_cap}_\text{node,tech,cost} \times \textbf{resource_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_area_use}_\text{node,tech,cost} \times \textbf{area_use}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech}))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_resource_area}_\text{node,tech,cost} \times \textbf{resource_area}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech})) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (\textit{cost_flow_cap}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\exists (\textit{cost_flow_cap}_\text{node,tech,cost})) \\ - \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (0) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{energy_cap}_\text{node,tech}))&\quad - \text{if } (\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_energy_cap}_\text{node,tech,cost})))\land{}(\neg (\exists (\textit{cost_resource_cap}_\text{node,tech,cost}) \land \exists (\textbf{resource_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_resource_area}_\text{node,tech,cost}) \land \exists (\textbf{resource_area}_\text{node,tech}))) + \textit{annualisation_weight} \times ((\textit{cost_depreciation_rate}_\text{node,tech,cost} \times (0) \times (1 + \textit{cost_om_annual_investment_fraction}_\text{node,tech,cost})) + (\textit{cost_om_annual}_\text{node,tech,cost} \times \textbf{flow_cap}_\text{node,tech}))&\quad + \text{if } (\neg (\exists (\textit{cost_purchase}_\text{node,tech,cost}) \land (\exists (\textbf{purchased}_\text{node,tech}) \lor \exists (\textbf{units}_\text{node,tech}))))\land{}(\neg (\exists (\textit{cost_storage_cap}_\text{node,tech,cost}) \land \exists (\textbf{storage_cap}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_source_cap}_\text{node,tech,cost}) \land \exists (\textbf{source_cap}_\text{node,tech})))\land{}(\neg (\text{tech_group=transmission}))\land{}(\neg (\exists (\textit{cost_area_use}_\text{node,tech,cost}) \land \exists (\textbf{area_use}_\text{node,tech})))\land{}(\neg (\exists (\textit{cost_flow_cap}_\text{node,tech,cost}))) \\ \end{cases} @@ -1673,26 +1719,26 @@ The total annualised costs of a technology, including installation and operation \end{array} \begin{cases} \textbf{cost_investment}_\text{node,tech,cost} + \sum\limits_{\text{timestep} \in \text{timesteps}} (\textbf{cost_var}_\text{node,tech,cost,timestep})&\quad - \text{if } (\exists (\textbf{cost_investment}_\text{node,tech,cost}))\land{}(\exists (\textbf{cost_var}_\text{node,tech,cost,timestep})) - \\ - \textbf{cost_investment}_\text{node,tech,cost}&\quad - \text{if } (\exists (\textbf{cost_investment}_\text{node,tech,cost}))\land{}(\neg (\exists (\textbf{cost_var}_\text{node,tech,cost,timestep}))) + \text{if } (\exists (\textbf{cost_var}_\text{node,tech,cost,timestep}))\land{}(\exists (\textbf{cost_investment}_\text{node,tech,cost})) \\ \sum\limits_{\text{timestep} \in \text{timesteps}} (\textbf{cost_var}_\text{node,tech,cost,timestep})&\quad - \text{if } (\neg (\exists (\textbf{cost_investment}_\text{node,tech,cost})))\land{}(\exists (\textbf{cost_var}_\text{node,tech,cost,timestep})) + \text{if } (\exists (\textbf{cost_var}_\text{node,tech,cost,timestep}))\land{}(\neg (\exists (\textbf{cost_investment}_\text{node,tech,cost}))) + \\ + \textbf{cost_investment}_\text{node,tech,cost}&\quad + \text{if } (\neg (\exists (\textbf{cost_var}_\text{node,tech,cost,timestep})))\land{}(\exists (\textbf{cost_investment}_\text{node,tech,cost})) \\ 0&\quad - \text{if } (\neg (\exists (\textbf{cost_investment}_\text{node,tech,cost})))\land{}(\neg (\exists (\textbf{cost_var}_\text{node,tech,cost,timestep}))) + \text{if } (\neg (\exists (\textbf{cost_var}_\text{node,tech,cost,timestep})))\land{}(\neg (\exists (\textbf{cost_investment}_\text{node,tech,cost}))) \\ \end{cases} Decision Variables ------------------ -energy_cap -^^^^^^^^^^ +flow_cap +^^^^^^^^ -A technology's energy capacity, also known as its nominal or nameplate capacity. +A technology's flow capacity, also known as its nominal or nameplate capacity. .. container:: scrolling-wrapper @@ -1705,16 +1751,16 @@ A technology's energy capacity, also known as its nominal or nameplate capacity. \forall\mathbb{R}\; \end{array} \begin{cases} - \textit{energy_cap_min}_\text{node,tech} \leq \textbf{energy_cap}_\text{node,tech}&\quad + \textit{flow_cap_min}_\text{node,tech} \leq \textbf{flow_cap}_\text{node,tech}&\quad \\ - \textbf{energy_cap}_\text{node,tech} \leq \textit{energy_cap_max}_\text{node,tech}&\quad + \textbf{flow_cap}_\text{node,tech} \leq \textit{flow_cap_max}_\text{node,tech}&\quad \\ \end{cases} -carrier_prod -^^^^^^^^^^^^ +flow_out +^^^^^^^^ -The energy produced by a technology per timestep, also known as the energy discharged (from `storage` technologies) or the energy received (by `transmission` technologies) on a link. +The outflow of a technology per timestep, also known as the flow discharged (from `storage` technologies) or the flow received (by `transmission` technologies) on a link. .. container:: scrolling-wrapper @@ -1727,19 +1773,19 @@ The energy produced by a technology per timestep, also known as the energy disch \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ \forall\mathbb{R}\; - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_prod}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[out,out_2,out_3]}) + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_out}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[out,out_2,out_3]}) \end{array} \begin{cases} - 0 \leq \textbf{carrier_prod}_\text{node,tech,carrier,timestep}&\quad + 0 \leq \textbf{flow_out}_\text{node,tech,carrier,timestep}&\quad \\ - \textbf{carrier_prod}_\text{node,tech,carrier,timestep} \leq inf&\quad + \textbf{flow_out}_\text{node,tech,carrier,timestep} \leq inf&\quad \\ \end{cases} -carrier_con -^^^^^^^^^^^ +flow_in +^^^^^^^ -The energy consumed by a technology per timestep, also known as the energy consumed (by `storage` technologies) or the energy sent (by `transmission` technologies) on a link. +The inflow to a technology per timestep, also known as the flow consumed (by `storage` technologies) or the flow sent (by `transmission` technologies) on a link. .. container:: scrolling-wrapper @@ -1752,19 +1798,19 @@ The energy consumed by a technology per timestep, also known as the energy consu \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ \forall\mathbb{R}\; - \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_carrier_con}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[in,in_2,in_3]}) + \text{if } (\exists (\textit{carrier}_\text{tech,carrier_tier,carrier}) \land \textit{allowed_flow_in}_\text{node,tech}\mathord{=}\text{true} \land \text{carrier_tier} \in \text{[in,in_2,in_3]}) \end{array} \begin{cases} - -inf \leq \textbf{carrier_con}_\text{node,tech,carrier,timestep}&\quad + 0 \leq \textbf{flow_in}_\text{node,tech,carrier,timestep}&\quad \\ - \textbf{carrier_con}_\text{node,tech,carrier,timestep} \leq 0&\quad + \textbf{flow_in}_\text{node,tech,carrier,timestep} \leq inf&\quad \\ \end{cases} -carrier_export -^^^^^^^^^^^^^^ +flow_export +^^^^^^^^^^^ -The energy exported outside the system boundaries by a technology per timestep. +The flow of a carrier exported outside the system boundaries by a technology per timestep. .. container:: scrolling-wrapper @@ -1780,14 +1826,14 @@ The energy exported outside the system boundaries by a technology per timestep. \text{if } (\exists (\textit{export_carrier}_\text{node,tech,carrier}) \land \textit{export}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - 0 \leq \textbf{carrier_export}_\text{node,tech,carrier,timestep}&\quad + 0 \leq \textbf{flow_export}_\text{node,tech,carrier,timestep}&\quad \\ - \textbf{carrier_export}_\text{node,tech,carrier,timestep} \leq inf&\quad + \textbf{flow_export}_\text{node,tech,carrier,timestep} \leq inf&\quad \\ \end{cases} -resource_area -^^^^^^^^^^^^^ +area_use +^^^^^^^^ The area in space utilised directly (e.g., solar PV panels) or indirectly (e.g., biofuel crops) by a technology. @@ -1800,19 +1846,19 @@ The area in space utilised directly (e.g., solar PV panels) or indirectly (e.g., \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ \forall\mathbb{R}\; - \text{if } (\exists (\textit{resource_area_min}_\text{node,tech}) \lor \exists (\textit{resource_area_max}_\text{node,tech}) \lor \exists (\textit{resource_area_equals}_\text{node,tech}) \lor \exists (\textit{resource_area_per_energy_cap}_\text{node,tech}) \lor \textit{resource_unit}_\text{node,tech}\mathord{=}\text{energy_per_area}) + \text{if } (\exists (\textit{area_use_min}_\text{node,tech}) \lor \exists (\textit{area_use_max}_\text{node,tech}) \lor \exists (\textit{area_use_per_flow_cap}_\text{node,tech}) \lor \textit{sink_unit}_\text{node,tech}\mathord{=}\text{per_area} \lor \textit{source_unit}_\text{node,tech}\mathord{=}\text{per_area}) \end{array} \begin{cases} - \textit{resource_area_min}_\text{node,tech} \leq \textbf{resource_area}_\text{node,tech}&\quad + \textit{area_use_min}_\text{node,tech} \leq \textbf{area_use}_\text{node,tech}&\quad \\ - \textbf{resource_area}_\text{node,tech} \leq \textit{resource_area_max}_\text{node,tech}&\quad + \textbf{area_use}_\text{node,tech} \leq \textit{area_use_max}_\text{node,tech}&\quad \\ \end{cases} -resource_con -^^^^^^^^^^^^ +source_use +^^^^^^^^^^ -The energy consumed from outside the system boundaries by a `supply_plus` technology. +The carrier flow consumed from outside the system boundaries by a `supply_plus` technology. .. container:: scrolling-wrapper @@ -1827,16 +1873,16 @@ The energy consumed from outside the system boundaries by a `supply_plus` techno \text{if } (\text{tech_group=supply_plus}) \end{array} \begin{cases} - 0 \leq \textbf{resource_con}_\text{node,tech,timestep}&\quad + 0 \leq \textbf{source_use}_\text{node,tech,timestep}&\quad \\ - \textbf{resource_con}_\text{node,tech,timestep} \leq inf&\quad + \textbf{source_use}_\text{node,tech,timestep} \leq inf&\quad \\ \end{cases} -resource_cap -^^^^^^^^^^^^ +source_cap +^^^^^^^^^^ -The upper limit on energy that can be consumed from outside the system boundaries by a `supply_plus` technology in each timestep. +The upper limit on a flow that can be consumed from outside the system boundaries by a `supply_plus` technology in each timestep. .. container:: scrolling-wrapper @@ -1850,16 +1896,16 @@ The upper limit on energy that can be consumed from outside the system boundarie \text{if } (\text{tech_group=supply_plus}) \end{array} \begin{cases} - \textit{resource_cap_min}_\text{node,tech} \leq \textbf{resource_cap}_\text{node,tech}&\quad + \textit{source_cap_min}_\text{node,tech} \leq \textbf{source_cap}_\text{node,tech}&\quad \\ - \textbf{resource_cap}_\text{node,tech} \leq \textit{resource_cap_max}_\text{node,tech}&\quad + \textbf{source_cap}_\text{node,tech} \leq \textit{source_cap_max}_\text{node,tech}&\quad \\ \end{cases} storage_cap ^^^^^^^^^^^ -The upper limit on energy that can be stored by a `supply_plus` or `storage` technology in any timestep. +The upper limit on a carrier that can be stored by a `supply_plus` or `storage` technology in any timestep. .. container:: scrolling-wrapper @@ -1882,7 +1928,7 @@ The upper limit on energy that can be stored by a `supply_plus` or `storage` tec storage ^^^^^^^ -The energy stored by a `supply_plus` or `storage` technology in each timestep. +The carrier stored by a `supply_plus` or `storage` technology in each timestep. .. container:: scrolling-wrapper @@ -1929,7 +1975,7 @@ Binary switch defining whether a technology has been purchased or not, for any t units ^^^^^ -Integer number of a technology that has been purchased, for any technology set to require inteter capacity purchasing. This is used to allow installation of fixed capacity units of technologies. Since technology capacity is no longer a continuous decision variable, it is possible for these technologies to have a lower bound set on carrier production/consumption which will only be enforced in those timesteps that the technology is operating (otherwise, the same lower bound forces the technology to produce/consume that minimum amount of energy in *every* timestep). +Integer number of a technology that has been purchased, for any technology set to require inteter capacity purchasing. This is used to allow installation of fixed capacity units of technologies. Since technology capacity is no longer a continuous decision variable, it is possible for these technologies to have a lower bound set on outflow/consumption which will only be enforced in those timesteps that the technology is operating (otherwise, the same lower bound forces the technology to produce/consume that minimum amount of carrier in *every* timestep). .. container:: scrolling-wrapper @@ -1973,10 +2019,10 @@ Integer number of a technology that is operating in each timestep, for any techn \\ \end{cases} -prod_con_switch -^^^^^^^^^^^^^^^ +async_flow_switch +^^^^^^^^^^^^^^^^^ -Binary switch to force asynchronous carrier production/consumption of a `storage`/`supply_plus`/`transmission` technology. This ensures that a technology with carrier flow efficiencies < 100% cannot produce and consume energy simultaneously to remove unwanted energy from the system. +Binary switch to force asynchronous outflow/consumption of a `storage`/`supply_plus`/`transmission` technology. This ensures that a technology with carrier flow efficiencies < 100% cannot produce and consume a flow simultaneously to remove unwanted carrier from the system. .. container:: scrolling-wrapper @@ -1988,19 +2034,19 @@ Binary switch to force asynchronous carrier production/consumption of a `storage \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ \forall\mathbb{Z}\; - \text{if } (\textit{force_asynchronous_prod_con}_\text{node,tech}\mathord{=}\text{true}) + \text{if } (\textit{force_async_flow}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - 0 \leq \textbf{prod_con_switch}_\text{node,tech,timestep}&\quad + 0 \leq \textbf{async_flow_switch}_\text{node,tech,timestep}&\quad \\ - \textbf{prod_con_switch}_\text{node,tech,timestep} \leq 1&\quad + \textbf{async_flow_switch}_\text{node,tech,timestep} \leq 1&\quad \\ \end{cases} unmet_demand ^^^^^^^^^^^^ -Virtual source of energy to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined supply capacity to meet demand. +Virtual source of carrier flow to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined supply capacity to meet demand. .. container:: scrolling-wrapper @@ -2012,7 +2058,7 @@ Virtual source of energy to ensure model feasibility. This should only be consid \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ \forall\mathbb{R}\; - \text{if } (\text{run_config.ensure_feasibility}\mathord{=}\text{true}) + \text{if } (\text{config.ensure_feasibility}\mathord{=}\text{true}) \end{array} \begin{cases} 0 \leq \textbf{unmet_demand}_\text{node,carrier,timestep}&\quad @@ -2024,7 +2070,7 @@ Virtual source of energy to ensure model feasibility. This should only be consid unused_supply ^^^^^^^^^^^^^ -Virtual sink of energy to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. In model results, the negation of this variable is combined with `unmet_demand` and presented as only one variable: `unmet_demand`. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined consumption capacity to meet required energy production (e.g. from renewables without the possibility of curtailment). +Virtual sink of carrier flow to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. In model results, the negation of this variable is combined with `unmet_demand` and presented as only one variable: `unmet_demand`. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined consumption capacity to meet required outflow (e.g. from renewables without the possibility of curtailment). .. container:: scrolling-wrapper @@ -2036,7 +2082,7 @@ Virtual sink of energy to ensure model feasibility. This should only be consider \text{ timestep }\negthickspace \in \negthickspace\text{ timesteps } \\ \forall\mathbb{R}\; - \text{if } (\text{run_config.ensure_feasibility}\mathord{=}\text{true}) + \text{if } (\text{config.ensure_feasibility}\mathord{=}\text{true}) \end{array} \begin{cases} -inf \leq \textbf{unused_supply}_\text{node,carrier,timestep}&\quad diff --git a/doc/_static/math_storage_inter_cluster.rst b/doc/_static/math_storage_inter_cluster.rst index d9de0e215..108f4d4ff 100644 --- a/doc/_static/math_storage_inter_cluster.rst +++ b/doc/_static/math_storage_inter_cluster.rst @@ -13,7 +13,7 @@ balance_supply_plus_with_storage ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :yellow:`UPDATED` -Set the upper bound on, or a fixed total of, a `supply_plus` (with storage) technology's ability to produce energy based on the quantity of consumed resource and available stored energy. +Set the upper bound on, or a fixed total of, a `supply_plus` (with storage) technology's ability to produce flow based on the quantity of consumed resource and available stored carrier. .. container:: scrolling-wrapper @@ -28,23 +28,23 @@ Set the upper bound on, or a fixed total of, a `supply_plus` (with storage) tech \text{if } (\exists (\textbf{storage}_\text{node,tech,timestep}) \land \text{tech_group=supply_plus}) \end{array} \begin{cases} - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep}) - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}))) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep})&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep}) - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep})))\land{}(\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech}) - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}))\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep})&\quad - \text{if } (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech}) - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}))\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}))) \\ - \textbf{storage}_\text{node,tech,timestep} = (\textbf{resource_con}_\text{node,tech,timestep} \times \textit{resource_eff}_\text{node,tech,timestep}) - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ (\textit{energy_eff}_\text{node,tech,timestep} \times \textit{parasitic_eff}_\text{node,tech,timestep}) }&\quad - \text{if } (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\neg (\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech,timestep}\mathord{=}\text{0})) + \textbf{storage}_\text{node,tech,timestep} = (\textbf{source_use}_\text{node,tech,timestep} \times \textit{source_eff}_\text{node,tech}) - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ (\textit{flow_eff}_\text{node,tech} \times \textit{parasitic_eff}_\text{node,tech}) }&\quad + \text{if } (\neg (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0} \lor \textit{parasitic_eff}_\text{node,tech}\mathord{=}\text{0}))\land{}(\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ \end{cases} @@ -52,7 +52,7 @@ balance_storage ^^^^^^^^^^^^^^^ :yellow:`UPDATED` -Fix the quantity of energy stored in a `storage` technology at the end of each timestep based on the net flow of energy charged and discharged and the quantity of energy stored at the start of the timestep. +Fix the quantity of carrier stored in a `storage` technology at the end of each timestep based on the net flow of carrier charged and discharged and the quantity of carrier stored at the start of the timestep. .. container:: scrolling-wrapper @@ -67,23 +67,23 @@ Fix the quantity of energy stored in a `storage` technology at the end of each t \text{if } (\text{tech_group=storage}) \end{array} \begin{cases} - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} - \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}))) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} - \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \frac{ \textbf{flow_out}_\text{node,tech,carrier,timestep} }{ \textit{flow_eff}_\text{node,tech} } + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{>}\text{0})\land{}(\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ - \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech} + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage}_\text{node,tech,timestep} = \frac{ \textbf{carrier_prod}_\text{node,tech,carrier,timestep} }{ \textit{energy_eff}_\text{node,tech,timestep} } - (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{>}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{\textit{timestep_resolution}_\text{timestep-1}}) \times \textbf{storage}_\text{node,tech,timestep-1} + (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(((\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]})) \land \neg (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}))) \\ - \textbf{storage}_\text{node,tech,timestep} = (\textbf{carrier_con}_\text{node,tech,carrier,timestep} \times \textit{energy_eff}_\text{node,tech,timestep})&\quad - \text{if } (\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{energy_eff}_\text{node,tech,timestep}\mathord{=}\text{0}) + \textbf{storage}_\text{node,tech,timestep} = (\textbf{flow_in}_\text{node,tech,carrier,timestep} \times \textit{flow_eff}_\text{node,tech})&\quad + \text{if } (\textit{flow_eff}_\text{node,tech}\mathord{=}\text{0})\land{}(\exists (\textit{lookup_cluster_last_timestep}_\text{timestep}) \land \neg (\textit{timesteps}_\text{timestep}\mathord{=}\text{timesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))) \\ \end{cases} @@ -91,7 +91,7 @@ set_storage_initial ^^^^^^^^^^^^^^^^^^^ :yellow:`UPDATED` -Fix the relationship between energy stored in a `storage` technology at the start and end of the whole model period. +Fix the relationship between carrier stored in a `storage` technology at the start and end of the whole model period. .. container:: scrolling-wrapper @@ -101,10 +101,10 @@ Fix the relationship between energy stored in a `storage` technology at the star \text{ node }\negthickspace \in \negthickspace\text{ nodes, } \text{ tech }\negthickspace \in \negthickspace\text{ techs } \\ - \text{if } (\exists (\textbf{storage}_\text{node,tech,timestep}) \land \exists (\textit{storage_initial}_\text{node,tech}) \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) + \text{if } (\exists (\textbf{storage}_\text{node,tech,timestep}) \land \exists (\textit{storage_initial}_\text{node,tech}) \land \text{config.cyclic_storage}\mathord{=}\text{true}) \end{array} \begin{cases} - \textbf{storage_inter_cluster}_\text{node,tech,datestep=datesteps[-1]} \times ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{24}) = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech}&\quad + \textbf{storage_inter_cluster}_\text{node,tech,datestep=datesteps[-1]} \times ((1 - \textit{storage_loss}_\text{node,tech})^{24}) = \textit{storage_initial}_\text{node,tech} \times \textbf{storage_cap}_\text{node,tech}&\quad \\ \end{cases} @@ -112,7 +112,7 @@ balance_storage_inter ^^^^^^^^^^^^^^^^^^^^^ :green:`NEW` -Fix the relationship between one day and the next of a `storage` technology's available stored energy, according to the previous day's representative storage fluctuations and the excess stored energy available from all days up to this day. +Fix the relationship between one day and the next of a `storage` technology's available stored carrier, according to the previous day's representative storage fluctuations and the excess stored carrier available from all days up to this day. .. container:: scrolling-wrapper @@ -127,16 +127,16 @@ Fix the relationship between one day and the next of a `storage` technology's av \end{array} \begin{cases} \textbf{storage_inter_cluster}_\text{node,tech,datestep} = \textit{storage_initial}_\text{node,tech}&\quad - \text{if } (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})) + \text{if } (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))\land{}(\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage_inter_cluster}_\text{node,tech,datestep} = \textit{storage_initial}_\text{node,tech} + \textbf{storage}_\text{node,tech,timestep=\textit{lookup_datestep_last_cluster_timestep}_\text{datestep-1}}&\quad - \text{if } (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))\land{}(\neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))) + \textbf{storage_inter_cluster}_\text{node,tech,datestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{24}) \times \textbf{storage_inter_cluster}_\text{node,tech,datestep-1}&\quad + \text{if } (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true}))\land{}((\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]})) \\ - \textbf{storage_inter_cluster}_\text{node,tech,datestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{24}) \times \textbf{storage_inter_cluster}_\text{node,tech,datestep-1}&\quad - \text{if } ((\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]}))\land{}(\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true})) + \textbf{storage_inter_cluster}_\text{node,tech,datestep} = \textit{storage_initial}_\text{node,tech} + \textbf{storage}_\text{node,tech,timestep=\textit{lookup_datestep_last_cluster_timestep}_\text{datestep-1}}&\quad + \text{if } (\neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})))\land{}(\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})) \\ - \textbf{storage_inter_cluster}_\text{node,tech,datestep} = ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{24}) \times \textbf{storage_inter_cluster}_\text{node,tech,datestep-1} + \textbf{storage}_\text{node,tech,timestep=\textit{lookup_datestep_last_cluster_timestep}_\text{datestep-1}}&\quad - \text{if } ((\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \text{run_config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]}))\land{}(\neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{run_config.cyclic_storage}\mathord{=}\text{true}))) + \textbf{storage_inter_cluster}_\text{node,tech,datestep} = ((1 - \textit{storage_loss}_\text{node,tech})^{24}) \times \textbf{storage_inter_cluster}_\text{node,tech,datestep-1} + \textbf{storage}_\text{node,tech,timestep=\textit{lookup_datestep_last_cluster_timestep}_\text{datestep-1}}&\quad + \text{if } (\neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \neg (\text{config.cyclic_storage}\mathord{=}\text{true})))\land{}((\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]} \land \text{config.cyclic_storage}\mathord{=}\text{true}) \lor \neg (\textit{datesteps}_\text{datestep}\mathord{=}\text{datesteps[0]})) \\ \end{cases} @@ -144,7 +144,7 @@ storage_inter_max ^^^^^^^^^^^^^^^^^ :green:`NEW` -Set the upper bound of a `storage` technology's stored energy across all days in the timeseries +Set the upper bound of a `storage` technology's stored carrier across all days in the timeseries .. container:: scrolling-wrapper @@ -166,7 +166,7 @@ storage_inter_min ^^^^^^^^^^^^^^^^^ :green:`NEW` -Set the lower bound of a `storage` technology's stored energy across all days in the timeseries +Set the lower bound of a `storage` technology's stored carrier across all days in the timeseries .. container:: scrolling-wrapper @@ -180,7 +180,7 @@ Set the lower bound of a `storage` technology's stored energy across all days in \text{if } (\textit{include_storage}_\text{node,tech}\mathord{=}\text{true}) \end{array} \begin{cases} - (\textbf{storage_inter_cluster}_\text{node,tech,datestep} \times ((1 - \textit{storage_loss}_\text{node,tech,timestep})^{24})) + \textbf{storage_intra_cluster_min}_\text{node,tech,cluster=\textit{lookup_datestep_cluster}_\text{datestep}} \geq 0&\quad + (\textbf{storage_inter_cluster}_\text{node,tech,datestep} \times ((1 - \textit{storage_loss}_\text{node,tech})^{24})) + \textbf{storage_intra_cluster_min}_\text{node,tech,cluster=\textit{lookup_datestep_cluster}_\text{datestep}} \geq 0&\quad \\ \end{cases} @@ -188,7 +188,7 @@ storage_intra_max ^^^^^^^^^^^^^^^^^ :green:`NEW` -Set the upper bound of a `storage` technology's stored energy within a clustered day +Set the upper bound of a `storage` technology's stored carrier within a clustered day .. container:: scrolling-wrapper @@ -210,7 +210,7 @@ storage_intra_min ^^^^^^^^^^^^^^^^^ :green:`NEW` -Set the lower bound of a `storage` technology's stored energy within a clustered day +Set the lower bound of a `storage` technology's stored carrier within a clustered day .. container:: scrolling-wrapper @@ -235,7 +235,7 @@ storage ^^^^^^^ :yellow:`UPDATED` -The virtual energy stored by a `supply_plus` or `storage` technology in each timestep of a clustered day. Stored energy can be negative so long as it does not go below the energy stored in `storage_inter_cluster`. Only together with `storage_inter_cluster` does this variable's values gain physical significance. +The virtual carrier stored by a `supply_plus` or `storage` technology in each timestep of a clustered day. Stored carrier can be negative so long as it does not go below the carrier stored in `storage_inter_cluster`. Only together with `storage_inter_cluster` does this variable's values gain physical significance. .. container:: scrolling-wrapper @@ -260,7 +260,7 @@ storage_inter_cluster ^^^^^^^^^^^^^^^^^^^^^ :green:`NEW` -The virtual energy stored by a `supply_plus` or `storage` technology between days of the entire timeseries. Only together with `storage` does this variable's values gain physical significance. +The virtual carrier stored by a `supply_plus` or `storage` technology between days of the entire timeseries. Only together with `storage` does this variable's values gain physical significance. .. container:: scrolling-wrapper diff --git a/doc/helpers/generate_math.py b/doc/helpers/generate_math.py index 7f77a2d20..39ac5e643 100644 --- a/doc/helpers/generate_math.py +++ b/doc/helpers/generate_math.py @@ -54,7 +54,9 @@ def generate_base_math_model(model_config: dict) -> calliope.Model: Returns: calliope.Model: Base math model to use in generating custom math docs. """ - model = calliope.Model(config=model_config, timeseries_dataframes=_ts_dfs()) + model = calliope.Model( + model_definition=model_config, timeseries_dataframes=_ts_dfs() + ) model.math_documentation.build() model.math_documentation.write(STATICPATH / "math.rst") return model @@ -78,7 +80,9 @@ def generate_custom_math_model( model_config = calliope.AttrDict(model_config) model_config_updates = calliope.AttrDict(model_config_updates) model_config.union(model_config_updates) - model = calliope.Model(config=model_config, timeseries_dataframes=_ts_dfs()) + model = calliope.Model( + model_definition=model_config, timeseries_dataframes=_ts_dfs() + ) _keep_only_changes(base_model, model) model.math_documentation.write(STATICPATH / f"math_{name}.rst") @@ -142,8 +146,6 @@ def generate_model_config() -> dict[str, dict]: } return { - "model": {}, - "run": {"objective_options": {"cost_class": {"monetary": 1}}}, "nodes": { "A": {"techs": {k: None for k in dummy_techs.keys()}, "available_area": 1} }, @@ -152,12 +154,9 @@ def generate_model_config() -> dict[str, dict]: def _add_data(name, default_val): - "If timeseries is allowed, we reference timeseries data. Some parameters need hardcoded values to be returned" - if name in POSSIBLE_TIMESERIES_DATA: - if name == "carrier_ratios": - return {"carrier_in.electricity": "df=ts"} - else: - return "df=ts" + "Some parameters need hardcoded values to be returned" + if name == "carrier_ratios": + return {"carrier_in.electricity": 1} elif name == "export_carrier": return "electricity" elif default_val is None or name == "interest_rate": @@ -208,7 +207,7 @@ def _ts_dfs() -> dict[str, pd.DataFrame]: index=pd.date_range("2005-01-01 00:00", "2005-01-01 02:00", freq="H"), columns=["A"], ) - return {"ts": ts, "ts_neg": -1 * ts} + return {"ts": ts} if __name__ == "__main__": @@ -219,16 +218,18 @@ def _ts_dfs() -> dict[str, pd.DataFrame]: base_model, base_model_config, { - "model": { - "custom_math": ["storage_inter_cluster"], - "time": { - "function": "apply_clustering", - "function_options": { - "clustering_func": "kmeans", - "how": "mean", - "k": 1, + "config": { + "init": { + "custom_math": ["storage_inter_cluster"], + "time": { + "function": "apply_clustering", + "function_options": { + "clustering_func": "kmeans", + "how": "mean", + "k": 1, + }, }, - }, + } }, }, "storage_inter_cluster", diff --git a/doc/user/advanced_features.rst b/doc/user/advanced_features.rst index 4bf6b8e2a..1846d1c43 100644 --- a/doc/user/advanced_features.rst +++ b/doc/user/advanced_features.rst @@ -136,15 +136,15 @@ None of the ``tech_groups`` appear in model results, they are only used to group Removing techs, locations and links ----------------------------------- -By specifying :yaml:`exists: false` in the model configuration, which can be done for example through overrides, model components can be removed for debugging or scenario analysis. +By specifying :yaml:`active: false` in the model configuration, which can be done for example through overrides, model components can be removed for debugging or scenario analysis. This works for: -* Techs: :yaml:`techs.tech_name.exists: false` -* Locations: :yaml:`locations.location_name.exists: false` -* Links: :yaml:`links.location1,location2.exists: false` -* Techs at a specific location: :yaml:`locations.location_name.techs.tech_name.exists: false` -* Transmission techs at a specific location: :yaml:`links.location1,location2.techs.transmission_tech.exists: false` +* Techs: :yaml:`techs.tech_name.active: false` +* Locations: :yaml:`locations.location_name.active: false` +* Links: :yaml:`links.location1,location2.active: false` +* Techs at a specific location: :yaml:`locations.location_name.techs.tech_name.active: false` +* Transmission techs at a specific location: :yaml:`links.location1,location2.techs.transmission_tech.active: false` .. _operational_mode: diff --git a/doc/user/building.rst b/doc/user/building.rst index afdeebefd..19a6261c6 100644 --- a/doc/user/building.rst +++ b/doc/user/building.rst @@ -89,7 +89,7 @@ The ``init`` configuration items are accessed when you initialise your model (`c The ``build`` configuration items are accessed when you build your optimisation problem (`calliope.Model.build(...)`). The ``solve`` configuration items are accessed when you solve your optimisation problem (`calliope.Model.solve(...)`). -At each of these stages you can override what you have put in your YAML file, or the default calliope will use when you have defined nothing, by providing additional keyword arguments on calling `calliope.Model` or its methods. E.g.,: +At each of these stages you can override what you have put in your YAML file (or if not in your YAML file, the default that Calliope uses), by providing additional keyword arguments on calling `calliope.Model` or its methods. E.g.,: .. code-block:: python @@ -129,8 +129,6 @@ In the case of Gurobi, for example, it is usually fastest to use the direct Pyth .. note:: The opposite is currently true for CPLEX, which runs faster with the default ``solver_io``. -Further optional settings, including debug settings, can be specified in the run configuration. - .. seealso:: :ref:`config_reference_config`, :doc:`troubleshooting`, :ref:`solver_options`, :ref:`documentation on operate mode `, :ref:`documentation on SPORES mode `, :doc:`built-in examples ` @@ -146,7 +144,15 @@ This could be a single value: .. code-block:: yaml parameters: - my_param: { data: 10 } + my_param: 10 + +or (equivalent): + +.. code-block:: yaml + + parameters: + my_param: + data: 10 which can then be accessed in the model inputs `model.inputs.my_param` and used in custom math as `my_param`. diff --git a/doc/user/config_defaults.rst b/doc/user/config_defaults.rst index 97a223269..119eb9044 100644 --- a/doc/user/config_defaults.rst +++ b/doc/user/config_defaults.rst @@ -7,8 +7,8 @@ Defaults are automatically applied in constraints whenever there is no user inpu .. _config_reference_config: -Model initialisation configuration ----------------------------------- +Model initialisation (``config.init``) +-------------------------------------- .. csv-table:: :file: includes/config_init.csv @@ -16,8 +16,8 @@ Model initialisation configuration :widths: 10, 5, 15 :stub-columns: 0 -Optimisation problem build configuration ----------------------------------------- +Optimisation problem build (``config.build``) +--------------------------------------------- .. csv-table:: :file: includes/config_build.csv @@ -25,8 +25,8 @@ Optimisation problem build configuration :widths: 10, 5, 15 :stub-columns: 0 -Optimisation problem solve configuration ----------------------------------------- +Optimisation problem solve (``config.solve``) +--------------------------------------------- .. csv-table:: :file: includes/config_solve.csv diff --git a/doc/user/ref_formulation.rst b/doc/user/ref_formulation.rst index 0c767f6ca..c5380401f 100644 --- a/doc/user/ref_formulation.rst +++ b/doc/user/ref_formulation.rst @@ -10,7 +10,7 @@ All built-in Calliope math can be found in the calliope `math directory ` is loaded from file. If you want to overwrite the base math with other built-in math, you can do so by referring to the file by its name (without the file extension) in :yaml:`model.custom_math`, e.g. :yaml:`model.custom_math: [storage_inter_cluster]`. -When solving the model in a :ref:`run mode ` other than `plan`, some built-in custom math will be applied automatically from a file of the same name (`spores` mode custom math is stored in `math/spores.yaml `_). +When solving the model in a :ref:`run mode ` other than `plan`, some built-in custom math will be applied automatically from a file of the same name (e.g., `spores` mode custom math is stored in `math/spores.yaml `_). The changes made by the built-in custom math are detailed in this page. .. note:: Custom math is applied in the order it appears in the :yaml:`model.custom_math` list. By default, any run mode custom math will be applied as the final step. If you want to apply your own custom math *after* the run mode custom math, you should add it explicitly to the :yaml:`model.custom_math` list, e.g., :yaml:`model.custom_math: [operate, my_custom_math.yaml]`. @@ -64,4 +64,4 @@ SPORES mode custom math Below are the changes from the base math introduced by the built-in custom math file ``spores``. These changes are applied automatically if selecting the run mode ``spores`` -TODO: Add spores math \ No newline at end of file +TODO: Add spores math diff --git a/doc/user/troubleshooting.rst b/doc/user/troubleshooting.rst index 62a7a44d3..f63986470 100644 --- a/doc/user/troubleshooting.rst +++ b/doc/user/troubleshooting.rst @@ -12,9 +12,9 @@ General strategies * **Analysing the optimisation problem without running the model**: If you are comfortable with navigating Pyomo objects, then you can inspect the Pyomo model backend after building it using :python:`model.build()`. Pyomo objects are then accessible within :python:`model.backend`. - For instance, the constraints limiting outflows can be viewed by calling :python:`model.get_constraint("flow_out_max")`. - A single Pyomo object can be then accessed by slicing the resulting array: :python:`model.get_constraint("flow_out_max").sel(techs=...)`. - You can also view the data in a more readable format by using setting the `as_backend_objs` option to false: :python:`constr = model.get_constraint("flow_out_max", as_backend_objs=False)`. + For instance, the constraints limiting outflows can be viewed by calling :python:`model.backend.get_constraint("flow_out_max")`. + A single Pyomo object can be then accessed by slicing the resulting array: :python:`model.backend.get_constraint("flow_out_max").sel(techs=...)`. + You can also view the data in a more readable format by using setting the `as_backend_objs` option to false: :python:`constr = model.backend.get_constraint("flow_out_max", as_backend_objs=False)`. This will allow you to inspect constraint upper bounds (`constr.ub`), lower bounds (`constr.lb`), and bodies as math strings (`constr.body`). Alternatively, if you are working from the command line or have little experience with Pyomo, you can generate an LP file. diff --git a/pyproject.toml b/pyproject.toml index f59cef5ab..15cfd9b4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,8 +5,8 @@ minversion = "6.0" # `--strict-markers` - Raise error on unexpected pytest markers being used (add new markers to `markers` config) # `-nauto` - parallelise over as many threads as possible (uses pytest-xdist). If debugging (`--pdb`), this will default to one thread. # `--nbmake --nbmake-kernel=calliope` - test example notebooks using the "calliope" notebook kernel (uses nbmake) -# `--cov --cov-report=xml --cov-config=pyproject.toml` - generate coverage report for tests (uses pytest-cov; call `--no-cov` in CLI to switch off; `--cov-config` include to avoid bug) -addopts = "-rav --dist=loadscope --strict-markers -nauto --nbmake --nbmake-kernel=calliope --cov --cov-report=xml --cov-config=pyproject.toml" +# `--cov-report=xml --cov-config=pyproject.toml` - coverage report config for when running in tests (uses pytest-cov; call `--cov` in CLI to switch coverage on; `--cov-config` include to avoid bug) +addopts = "-rav --dist=loadscope --strict-markers -nauto --nbmake --nbmake-kernel=calliope --cov-report=xml --cov-config=pyproject.toml" # TODO: add testpath once notebooks are fixed: "doc/_static/notebooks" testpaths = ["tests"] diff --git a/requirements/base.txt b/requirements/base.txt index 639f9448e..b047524aa 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,7 +6,7 @@ jsonschema >= 4.17, < 4.19 natsort >= 8, < 9 netcdf4 >= 1.2, < 1.7 numpy >= 1, < 2 -pandas >= 2, < 3 +pandas >= 2, < 2.1 pyomo >= 6.5, < 7 pyparsing >= 3.0, < 3.1 ruamel.yaml >= 0.17, < 0.18 diff --git a/src/calliope/cli.py b/src/calliope/cli.py index c614e0a90..e5678c3f5 100644 --- a/src/calliope/cli.py +++ b/src/calliope/cli.py @@ -182,7 +182,7 @@ def new(path, template, debug): with format_exceptions(debug): if template is None: template = "national_scale" - source_path = examples._PATHS[template] + source_path = examples.EXAMPLE_MODEL_DIR / template click.echo("Copying {} template to target directory: {}".format(template, path)) shutil.copytree(source_path, path) diff --git a/src/calliope/config/defaults.yaml b/src/calliope/config/defaults.yaml index d7f098443..4ca530c2e 100644 --- a/src/calliope/config/defaults.yaml +++ b/src/calliope/config/defaults.yaml @@ -16,7 +16,7 @@ config: subset_time: null # Subset of timesteps as a two-element list giving the range, e.g. ['2005-01-01', '2005-01-05'], or a single string, e.g. '2005-01' time: null # Optional settings to adjust time resolution, see :ref:`time_clustering` for the available options timeseries_data_path: null # Path to time series data - timeseries_dateformat: "ISO8601" # Timestamp format of all time series data when read from file + timeseries_dateformat: "ISO8601" # Timestamp format of all time series data when read from file. "ISO8601" means "YYYY-mm-dd HH:MM:SS". custom_math: [] # List of references to files which contain custom mathematical formulations. If referring to an in-built Calliope custom math file (see documentation for available files), do not append the reference with ".yaml". If referring to your own custom math file, ensure the file type is given as a suffix (".yaml" or ".yml"). Relative paths will be assumed to be relative to the `config` file given when creating a calliope Model (`calliope.Model(config)`) build: backend: pyomo # Module with which to build the optimisation problem @@ -41,8 +41,12 @@ config: zero_threshold: 1e-10 # On postprocessing the optimisation results, values smaller than this threshold will be considered as optimisation artefacts and will be set to zero. parameters: - bigM: # Large value used to define certain optimisation problems. See https://en.wikipedia.org/wiki/Big_M_method for more information. This value should be larger than the largest values that any decision variables can take, but should not be **too** large (i.e., do not set it greater than 3 orders of magnitude above the numeric range of the model). If too large, numerical problems may arise in the optimisation. - data: 1e9 + # BigM is a large value used to define certain optimisation problems. + # See https://en.wikipedia.org/wiki/Big_M_method for more information. + # This value should be larger than the largest values that any decision variables can take, + # but should not be **too** large (i.e., do not set it greater than 3 orders of magnitude above the numeric range of the model). + # if too large, numerical problems may arise in the optimisation. + bigM: 1e9 objective_cost_class: # Weightings for cost classes to apply in the objective function. data: 1 index: [monetary] @@ -438,7 +442,8 @@ techs: area_use: 0 # name: Cost of area use ¦ unit: m\ :sup:`-2` ¦ source_cap: 0 # name: Cost of source flow capacity ¦ unit: kW :sup:`-1` ¦ storage_cap: 0 # name: Cost of storage capacity ¦ unit: kWh :sup:`-1` ¦ - exists: true + depreciation_rate: 1 # name: Depreciation rate for annualisation of investment costs ¦ unit: fraction ¦ + active: true nodes: default_node: @@ -446,7 +451,7 @@ nodes: coordinates: {} # The node's x-y coordinates for distance calculations and plotting: {lat: ..., lon: ...} or {x: ..., y: ...} available_area: .inf # This node's available land area (required if constraining technology deployment by area). techs: null # A list of technologies, optionally with node-specific settings overriding the technology's global settings. - exists: true + active: true links: default_node_from,default_node_to: @@ -454,4 +459,4 @@ links: default_tech: distance: null # Used for per_distance constraints, but automatically inferred from coordinates of nodes in a link if not given directly - exists: true + active: true diff --git a/src/calliope/core/attrdict.py b/src/calliope/core/attrdict.py index f6d07f0e8..653ced493 100644 --- a/src/calliope/core/attrdict.py +++ b/src/calliope/core/attrdict.py @@ -177,7 +177,7 @@ def from_yaml(cls, f, resolve_imports=True): overrides definitions in the imported file. """ - if isinstance(f, str) or isinstance(f, Path): + if isinstance(f, (str, Path)): with open( f, "r", diff --git a/src/calliope/core/model.py b/src/calliope/core/model.py index 25a401bea..4a900b371 100644 --- a/src/calliope/core/model.py +++ b/src/calliope/core/model.py @@ -58,7 +58,7 @@ class Model(object): def __init__( self, - model_definition: Optional[Union[str, dict]] = None, + model_definition: Optional[Union[str, Path, dict]] = None, model_data: Optional[xarray.Dataset] = None, debug: bool = False, scenario: Optional[str] = None, @@ -71,7 +71,7 @@ def __init__( configuration file or a dict fully specifying the model. Args: - config (Optional[Union[str, dict]]): + config (Optional[Union[str, Path, dict]]): If str, must be the path to a model configuration file. If dict or AttrDict, must fully specify the model. model_data (Optional[xarray.Dataset], optional): @@ -104,8 +104,8 @@ def __init__( # try to set logging output format assuming python interactive. Will # use CLI logging format if model called from CLI log_time(LOGGER, self._timings, "model_creation", comment="Model: initialising") - if isinstance(model_definition, str): - self._model_def_path = model_definition + if isinstance(model_definition, (str, Path)): + self._model_def_path = Path(model_definition).as_posix() model_run, debug_data = model_run_from_yaml( model_definition, scenario, diff --git a/src/calliope/core/util/tools.py b/src/calliope/core/util/tools.py index ef4223a99..f5d5bbf41 100644 --- a/src/calliope/core/util/tools.py +++ b/src/calliope/core/util/tools.py @@ -6,6 +6,7 @@ import importlib import os import sys +from pathlib import Path from typing import TypeVar import jsonschema @@ -67,7 +68,7 @@ def relative_path(base_path_file, path): """ # Check if base_path_file is a string because it might be an AttrDict - if not os.path.isabs(path) and isinstance(base_path_file, str): + if not os.path.isabs(path) and isinstance(base_path_file, (str, Path)): path = os.path.join(os.path.dirname(base_path_file), path) return path diff --git a/src/calliope/example_models/national_scale/model.yaml b/src/calliope/example_models/national_scale/model.yaml index 546c904e1..1f40e98dc 100644 --- a/src/calliope/example_models/national_scale/model.yaml +++ b/src/calliope/example_models/national_scale/model.yaml @@ -27,5 +27,4 @@ parameters: index: [monetary] dims: costs - bigM: - data: 1e6 # Sets the scale of unmet demand, which cannot be too high, otherwise the optimisation will not converge + bigM: 1e6 # Sets the scale of unmet demand, which cannot be too high, otherwise the optimisation will not converge diff --git a/src/calliope/example_models/urban_scale/model.yaml b/src/calliope/example_models/urban_scale/model.yaml index f67322d74..58fe595e7 100644 --- a/src/calliope/example_models/urban_scale/model.yaml +++ b/src/calliope/example_models/urban_scale/model.yaml @@ -24,5 +24,4 @@ parameters: data: 1 index: [monetary] dims: costs - bigM: - data: 1e6 # setting the scale of unmet demand, which cannot be too high, otherwise the optimisation will not converge + bigM: 1e6 # setting the scale of unmet demand, which cannot be too high, otherwise the optimisation will not converge diff --git a/src/calliope/examples.py b/src/calliope/examples.py index 19734be18..ada4a4d4e 100644 --- a/src/calliope/examples.py +++ b/src/calliope/examples.py @@ -9,75 +9,51 @@ """ -import os +import importlib from calliope.core.model import Model -_PATHS = { - "national_scale": os.path.join( - os.path.dirname(__file__), "example_models", "national_scale" - ), - "urban_scale": os.path.join( - os.path.dirname(__file__), "example_models", "urban_scale" - ), -} +EXAMPLE_MODEL_DIR = importlib.resources.files("calliope") / "example_models" def national_scale(*args, **kwargs): """Returns the built-in national-scale example model.""" - return Model(os.path.join(_PATHS["national_scale"], "model.yaml"), *args, **kwargs) - - -def time_clustering(*args, **kwargs): - """Returns the built-in national-scale example model with time clustering.""" return Model( - os.path.join(_PATHS["national_scale"], "model.yaml"), - scenario="time_clustering", + model_definition=EXAMPLE_MODEL_DIR / "national_scale" / "model.yaml", *args, **kwargs, ) +def time_clustering(*args, **kwargs): + """Returns the built-in national-scale example model with time clustering.""" + return national_scale(scenario="time_clustering", *args, **kwargs) + + def time_resampling(*args, **kwargs): """Returns the built-in national-scale example model with time resampling.""" - return Model( - os.path.join(_PATHS["national_scale"], "model.yaml"), - scenario="time_resampling", - *args, - **kwargs, - ) + return national_scale(scenario="time_resampling", *args, **kwargs) def urban_scale(*args, **kwargs): """Returns the built-in urban-scale example model.""" - return Model(os.path.join(_PATHS["urban_scale"], "model.yaml"), *args, **kwargs) - - -def milp(*args, **kwargs): - """Returns the built-in urban-scale example model with MILP constraints enabled.""" return Model( - os.path.join(_PATHS["urban_scale"], "model.yaml"), - scenario="milp", + model_definition=EXAMPLE_MODEL_DIR / "urban_scale" / "model.yaml", *args, **kwargs, ) +def milp(*args, **kwargs): + """Returns the built-in urban-scale example model with MILP constraints enabled.""" + return urban_scale(scenario="milp", *args, **kwargs) + + def operate(*args, **kwargs): """Returns the built-in urban-scale example model in operate mode.""" - return Model( - os.path.join(_PATHS["urban_scale"], "model.yaml"), - scenario="operate", - *args, - **kwargs, - ) + return urban_scale(scenario="operate", *args, **kwargs) def time_masking(*args, **kwargs): """Returns the built-in urban-scale example model with time masking.""" - return Model( - os.path.join(_PATHS["urban_scale"], "model.yaml"), - scenario="time_masking", - *args, - **kwargs, - ) + return urban_scale(scenario="time_masking", *args, **kwargs) diff --git a/src/calliope/math/base.yaml b/src/calliope/math/base.yaml index f5b24e9bd..c23569a10 100644 --- a/src/calliope/math/base.yaml +++ b/src/calliope/math/base.yaml @@ -614,7 +614,7 @@ variables: objectives: minmax_cost_optimisation: - description: "Minimise the total cost of installing and operation all technologies in the system. If multiple cost classes are present (e.g., monetary and co2 emissions), the weighted sum of total costs is minimised. Cost class weights can be defined in `config.objective_options.cost_class`." + description: "Minimise the total cost of installing and operation all technologies in the system. If multiple cost classes are present (e.g., monetary and co2 emissions), the weighted sum of total costs is minimised. Cost class weights can be defined in the top-level parameter `objective_cost_class`." equations: - where: "any(cost, over=[nodes, techs, costs])" expression: sum(sum(cost, over=[nodes, techs]) * objective_cost_class, over=costs) + $unmet_demand diff --git a/src/calliope/preprocess/checks.py b/src/calliope/preprocess/checks.py index dc03d83a4..359a22b56 100644 --- a/src/calliope/preprocess/checks.py +++ b/src/calliope/preprocess/checks.py @@ -323,7 +323,7 @@ def _check_tech_final( """ if tech_id not in model_run.techs: model_warnings.append( - "Tech {} was removed by setting ``exists: False`` - not checking " + "Tech {} was removed by setting ``active: False`` - not checking " "the consistency of its constraints at node {}.".format(tech_id, loc_id) ) return model_warnings, errors @@ -597,7 +597,10 @@ def check_model_data(model_data): model_data.timestep_resolution.loc[i].values for i in np.unique(model_data.timesteps.to_index().strftime("%Y-%m-%d")) ] - if not np.all(daily_timesteps == daily_timesteps[0]): + daily_timestep_shapes = set(day.shape for day in daily_timesteps) + if len(daily_timestep_shapes) > 1 or not np.all( + daily_timesteps == daily_timesteps[0] + ): model_data.attrs["allow_operate_mode"] = 0 model_warnings.append( "Operational mode requires the same timestep resolution profile " diff --git a/src/calliope/preprocess/model_data.py b/src/calliope/preprocess/model_data.py index 719e58450..b75e4e051 100644 --- a/src/calliope/preprocess/model_data.py +++ b/src/calliope/preprocess/model_data.py @@ -103,52 +103,84 @@ def _add_top_level_params(self): raise KeyError( f"Trying to add top-level parameter with same name as a node/tech level parameter: {param_name}" ) + + if not isinstance(param_data, dict): + param_data = {"data": param_data} + if "dims" in param_data: + index = param_data.get("index", None) + if index is None or not isinstance(index, list): + raise ValueError( + f"(parameters, {param_name}) | Expected list for `index`, received: {index}" + ) + _index = [ + tuple(idx) if isinstance(idx, list) else tuple([idx]) + for idx in param_data["index"] + ] + _dims = ( + param_data["dims"] + if isinstance(param_data["dims"], list) + else [param_data["dims"]] + ) param_series = pd.Series( data=param_data["data"], - index=param_data["index"], + index=pd.MultiIndex.from_tuples(_index, names=_dims), name=param_name, ) - if isinstance(param_data["dims"], list) and len(param_data["dims"]) > 1: - param_series.index = pd.MultiIndex.from_tuples( - param_series.index, names=param_data["dims"] - ) - else: - param_series = param_series.rename_axis(param_data["dims"]) param_da = param_series.to_xarray() else: param_da = xr.DataArray(param_data["data"], name=param_name) - coords_to_update = {} - for coord_name, coord_data in param_da.coords.items(): - if ( - self.model_data.coords.get(coord_name, xr.DataArray()).dtype.kind - == "M" - ): - LOGGER.debug( - f"Updating `{param_name}` {coord_name} dimension index values to datetime format" - ) - coords_to_update[coord_name] = pd.to_datetime( - coord_data, format="ISO8601" - ) - for coord_name, coord_data in coords_to_update.items(): - param_da.coords[coord_name] = coord_data + self._update_param_coords(param_name, param_da) + self._log_param_updates(param_name, param_da) + + self.model_data = self.model_data.merge(param_da.to_dataset()) + + def _update_param_coords(self, param_name: str, param_da: xr.DataArray) -> None: + """ + Check array coordinates to see if any should be in datetime format, + if the base model coordinate is in datetime format. - for coord_name, coord_data in param_da.coords.items(): - if coord_name not in self.model_data.coords: + Args: + param_name (str): name of parameter being added to the model. + param_da (xr.DataArray): array of parameter data. + """ + coords_to_update = {} + for coord_name, coord_data in param_da.coords.items(): + if self.model_data.coords.get(coord_name, xr.DataArray()).dtype.kind == "M": + LOGGER.debug( + f"(parameters, {param_name}) | Updating {coord_name} dimension index values to datetime format" + ) + coords_to_update[coord_name] = pd.to_datetime( + coord_data, format="ISO8601" + ) + for coord_name, coord_data in coords_to_update.items(): + param_da.coords[coord_name] = coord_data + + def _log_param_updates(self, param_name: str, param_da: xr.DataArray) -> None: + """ + Check array coordinates to see if: + 1. any are new compared to the base model dimensions. + 2. any are adding new elements to an existing base model dimension. + + Args: + param_name (str): name of parameter being added to the model. + param_da (xr.DataArray): array of parameter data. + """ + for coord_name, coord_data in param_da.coords.items(): + if coord_name not in self.model_data.coords: + LOGGER.debug( + f"(parameters, {param_name}) | Adding a new dimension to the model: {coord_name}" + ) + else: + new_coord_data = coord_data[ + ~coord_data.isin(self.model_data.coords[coord_name]) + ] + if new_coord_data.size > 0: LOGGER.debug( - f"top-level parameter `{param_name}` is adding a new dimension to the model: {coord_name}" + f"(parameters, {param_name}) | Adding a new value to the " + f"`{coord_name}` model coordinate: {new_coord_data.values}" ) - else: - new_coord_data = coord_data[ - ~coord_data.isin(self.model_data.coords[coord_name]) - ] - if new_coord_data.size > 0: - LOGGER.debug( - f"top-level parameter `{param_name}` is adding a new value to the " - f"`{coord_name}` model coordinate: {new_coord_data.values}" - ) - self.model_data = self.model_data.merge(param_da.to_dataset()) def _add_time_dimension(self): self.data_pre_time = self.model_data.copy(deep=True) diff --git a/src/calliope/preprocess/model_run.py b/src/calliope/preprocess/model_run.py index 8d24a0711..09a125e23 100644 --- a/src/calliope/preprocess/model_run.py +++ b/src/calliope/preprocess/model_run.py @@ -13,6 +13,7 @@ import itertools import logging import os +from pathlib import Path from typing import Optional import pandas as pd @@ -64,7 +65,7 @@ def model_run_from_yaml( """ config = AttrDict.from_yaml(model_file) - config._model_def_path = model_file + config._model_def_path = Path(model_file).as_posix() config_with_overrides, debug_comments, overrides, scenario = apply_overrides( config, scenario=scenario, override_dict=override_dict @@ -162,7 +163,7 @@ def apply_overrides(model_dict, scenario=None, override_dict=None): ) # Interpret timeseries_data_path as relative - if "timeseries_data_path" in model_dict.config.init: + if "timeseries_data_path" in model_dict.get_key("config.init", default={}): model_dict.config.init.timeseries_data_path = relative_path( model_dict._model_def_path, model_dict.config.init.timeseries_data_path ) @@ -260,8 +261,8 @@ def process_techs(config_model): debug_comments = AttrDict() for tech_id, tech_config in config_model.techs.items(): - # If a tech specifies ``exists: false``, we skip it entirely - if not tech_config.get("exists", True): + # If a tech specifies ``active: false``, we skip it entirely + if not tech_config.get("active", True): continue tech_result = AttrDict() diff --git a/src/calliope/preprocess/nodes.py b/src/calliope/preprocess/nodes.py index b2f8f0d2f..9e43a1791 100644 --- a/src/calliope/preprocess/nodes.py +++ b/src/calliope/preprocess/nodes.py @@ -66,7 +66,7 @@ def process_nodes(model_config, modelrun_techs): # Kill any nodes that the modeller does not want to exist ## for loc in list(nodes.keys()): - if not nodes[loc].get("exists", True): + if not nodes[loc].get("active", True): nodes.del_key(loc) ## @@ -74,7 +74,7 @@ def process_nodes(model_config, modelrun_techs): ## techs_to_delete = [] for tech_name in techs_in: - if not techs_in[tech_name].get("exists", True): + if not techs_in[tech_name].get("active", True): techs_to_delete.append(tech_name) continue # Get inheritance chain generated in process_techs() @@ -165,9 +165,9 @@ def process_nodes(model_config, modelrun_techs): ) # Now merge the tech settings into the node-specific - # tech dict -- but if a tech specifies ``exists: false``, + # tech dict -- but if a tech specifies ``active: false``, # we kill it at this node - if not tech_settings.get("exists", True): + if not tech_settings.get("active", True): node_techs_to_delete.append("{}.techs.{}".format(loc_name, tech_name)) else: nodes[loc_name].techs[tech_name].union( @@ -182,7 +182,7 @@ def process_nodes(model_config, modelrun_techs): for link in links_in: loc_from, loc_to = [i.strip() for i in link.split(",")] # Skip this link entirely if it has been told not to exist - if not links_in[link].get("exists", True): + if not links_in[link].get("active", True): continue # Also skip this link - and warn about it - if it links to a # now-inexistant (because removed) node @@ -190,14 +190,14 @@ def process_nodes(model_config, modelrun_techs): warnings.append( "Not building the link {},{} because one or both of its " "nodes have been removed from the model by setting " - "``exists: false``".format(loc_from, loc_to) + "``active: false``".format(loc_from, loc_to) ) continue processed_transmission_techs = AttrDict() for tech_name in links_in[link].techs: # Skip techs that have been told not to exist # for this particular link - if not links_in[link].get_key("techs.{}.exists".format(tech_name), True): + if not links_in[link].get_key("techs.{}.active".format(tech_name), True): continue if tech_name not in processed_transmission_techs: tech_settings = AttrDict() diff --git a/tests/common/test_model/scenarios.yaml b/tests/common/test_model/scenarios.yaml index 589c2c5db..a274cc684 100644 --- a/tests/common/test_model/scenarios.yaml +++ b/tests/common/test_model/scenarios.yaml @@ -72,7 +72,7 @@ overrides: costs.monetary: { purchase: 1, flow_cap: 0 } test_demand_elec: - links.a,b.exists: false + links.a,b.active: false supply_purchase: nodes: @@ -84,7 +84,7 @@ overrides: costs.monetary.flow_cap: 0 test_demand_elec: - links.a,b.exists: false + links.a,b.active: false supply_milp: nodes: @@ -96,8 +96,8 @@ overrides: units_max: 1 flow_cap_per_unit: 15 test_demand_elec: - b.exists: false - links.a,b.exists: false + b.active: false + links.a,b.active: false supply_export: techs: @@ -146,7 +146,7 @@ overrides: test_demand_elec: test_demand_heat: - links.a,b.exists: false + links.a,b.active: false conversion_plus_milp: nodes: @@ -162,7 +162,7 @@ overrides: test_demand_elec: test_demand_heat: - links.a,b.exists: false + links.a,b.active: false conversion_plus_purchase: nodes: @@ -178,7 +178,7 @@ overrides: test_demand_elec: test_demand_heat: - links.a,b.exists: false + links.a,b.active: false simple_conversion_plus: nodes: @@ -191,7 +191,7 @@ overrides: test_demand_elec: test_demand_heat: - links.a,b.exists: false + links.a,b.active: false simple_storage: nodes: @@ -226,7 +226,7 @@ overrides: storage_cap_per_unit: 15 test_demand_elec: - links.a,b.exists: false + links.a,b.active: false storage_purchase: nodes: @@ -238,7 +238,7 @@ overrides: costs.monetary: { purchase: 1 } test_demand_elec: - links.a,b.exists: false + links.a,b.active: false clustering: config.init.time: diff --git a/tests/test_constraint_results.py b/tests/test_constraint_results.py index e92aa9c7a..b96213087 100644 --- a/tests/test_constraint_results.py +++ b/tests/test_constraint_results.py @@ -109,13 +109,13 @@ def run_model(self): def _run_model(feasibility, cap_val): override_dict = { "nodes.a.techs": {"test_supply_elec": {}, "test_demand_elec": {}}, - "links.a,b.exists": False, + "links.a,b.active": False, # pick a time subset where demand is uniformally -10 throughout "config.init.subset_time": [ "2005-01-01 06:00:00", "2005-01-01 08:00:00", ], - "parameters.bigM.data": 1e3, + "parameters.bigM": 1e3, # Allow setting resource and flow_cap_max/equals to force infeasibility "techs.test_supply_elec.constraints": { "source_equals": cap_val, diff --git a/tests/test_core_preprocess.py b/tests/test_core_preprocess.py index f5e64d593..a8b1a2454 100644 --- a/tests/test_core_preprocess.py +++ b/tests/test_core_preprocess.py @@ -742,7 +742,7 @@ def test_inexistent_group_constraint_empty_loc_tech(self): excinfo, "Constraint group `mygroup` will be completely ignored" ) - assert m._model_run.group_constraints.mygroup.get("exists", True) is False + assert m._model_run.group_constraints.mygroup.get("active", True) is False @pytest.mark.filterwarnings( "ignore:(?s).*Not building the link a,b:calliope.exceptions.ModelWarning" @@ -1115,9 +1115,10 @@ def test_one_way(self): "links.X1,N1.techs.heat_pipes.switches.one_way": True, "links.N1,X2.techs.heat_pipes.switches.one_way": True, "links.N1,X3.techs.heat_pipes.switches.one_way": True, - "config.init.subset_time": ["2005-01-01", "2005-01-01"], } - m = calliope.examples.urban_scale(override_dict=override) + m = calliope.examples.urban_scale( + override_dict=override, subset_time=["2005-01-01", "2005-01-01"] + ) m.build() removed_prod_links = [ {"nodes": "X1", "techs": "heat_pipes:N1"}, @@ -1478,18 +1479,20 @@ def model_national(self, load_timeseries_from_dataframes): """ if load_timeseries_from_dataframes: # Create dictionary with dataframes - timeseries_data_path = os.path.join( - calliope.examples._PATHS["national_scale"], "timeseries_data/" + timeseries_data_path = ( + calliope.examples.EXAMPLE_MODEL_DIR + / "national_scale" + / "timeseries_data" ) timeseries_dataframes = {} timeseries_dataframes["csp_resource"] = pd.read_csv( - os.path.join(timeseries_data_path, "csp_resource.csv"), index_col=0 + timeseries_data_path / "csp_resource.csv", index_col=0 ) timeseries_dataframes["demand_1"] = pd.read_csv( - os.path.join(timeseries_data_path, "demand-1.csv"), index_col=0 + timeseries_data_path / "demand-1.csv", index_col=0 ) timeseries_dataframes["demand_2"] = pd.read_csv( - os.path.join(timeseries_data_path, "demand-2.csv"), index_col=0 + timeseries_data_path / "demand-2.csv", index_col=0 ) # Create override dict telling calliope to load timeseries from df override_dict = { diff --git a/tests/test_core_time.py b/tests/test_core_time.py index 2fcf0cddc..d8085d86f 100644 --- a/tests/test_core_time.py +++ b/tests/test_core_time.py @@ -1057,7 +1057,7 @@ def test_invalid_csv_columns(self): "d.techs": {"test_supply_elec": None, "test_demand_elec": None}, }, "links": { - "a,b": {"exists": False}, + "a,b": {"active": False}, "c,d.techs": {"test_transmission_elec": None}, }, } diff --git a/tests/test_example_models.py b/tests/test_example_models.py index 24b72cc10..8fabed9cb 100755 --- a/tests/test_example_models.py +++ b/tests/test_example_models.py @@ -419,7 +419,7 @@ def model_runner( }, } if storage is False: - override.update({"techs.battery.exists": False, "techs.csp.exists": False}) + override.update({"techs.battery.active": False, "techs.csp.active": False}) if storage_inter_cluster and backend_runner == "solve": override["config.init.custom_math"] = ["storage_inter_cluster"] @@ -516,12 +516,14 @@ def example_tester(self, source_unit, solver="cbc", solver_io=None): ), "techs.pv.switches.source_unit": source_unit, } - override = { - "config.init.subset_time": ["2005-07-01", "2005-07-01"], - **unit_override, - } - model = calliope.examples.urban_scale(override_dict=override) + model = calliope.examples.urban_scale( + override_dict=unit_override, subset_time=["2005-07-01", "2005-07-01"] + ) + + solve_kwargs = {"solver": solver} + if solver_io: + solve_kwargs["solver_io"] = solver_io solve_kwargs = {"solver": solver} if solver_io: diff --git a/tests/test_model_data.py b/tests/test_model_data.py index a1b2389a3..9de154f22 100644 --- a/tests/test_model_data.py +++ b/tests/test_model_data.py @@ -5,11 +5,13 @@ import numpy as np import pandas as pd import pytest +import xarray as xr from calliope._version import __version__ from calliope.core.attrdict import AttrDict from calliope.preprocess import model_run_from_yaml from calliope.preprocess.model_data import ModelDataFactory +from .common.util import build_test_model as build_model from .common.util import check_error_or_warning @@ -19,11 +21,12 @@ def model_run(): return model_run_from_yaml(filepath.as_posix(), scenario="simple_supply")[0] -class TestModelData: - @pytest.fixture(scope="function") - def model_data(self, model_run): - return ModelDataFactory(model_run) +@pytest.fixture(scope="function") +def model_data(model_run): + return ModelDataFactory(model_run) + +class TestModelData: @pytest.fixture(scope="class") def model_data_w_params(self, model_run): model_data = ModelDataFactory(model_run) @@ -418,3 +421,206 @@ def test_add_attributes(self, model_data_w_params): attr_dict["calliope_version"] == __version__ assert attr_dict["applied_overrides"] == "foo" assert attr_dict["scenario"] == "bar" + + +class TestTopLevelParams: + @pytest.fixture(scope="function") + def run_and_test(self, model_data): + def _run_and_test(in_dict, out_dict, dims): + model_data._extract_node_tech_data() + model_data._add_time_dimension() + model_data.params = {"my_val": in_dict} + model_data._add_top_level_params() + + _data = pd.Series(out_dict).rename_axis(index=dims) + pd.testing.assert_series_equal( + model_data.model_data.my_val.to_series().dropna().reindex(_data.index), + _data, + check_dtype=False, + check_names=False, + check_exact=False, + ) + + return _run_and_test + + def test_protected_parameter_names(self): + with pytest.raises(KeyError) as excinfo: + build_model( + {"parameters.flow_eff.data": 1}, + "simple_supply,two_hours", + ) + assert check_error_or_warning( + excinfo, + "Trying to add top-level parameter with same name as a node/tech level parameter: flow_eff", + ) + + @pytest.mark.parametrize("val", [1, 1.0, np.inf, "foo"]) + @pytest.mark.parametrize("dict_nesting", ["", ".data"]) + def test_top_level_param_single_val(self, val, dict_nesting): + model = build_model( + {f"parameters.my_val{dict_nesting}": val}, + "simple_supply,two_hours", + ) + assert model.inputs.my_val == xr.DataArray(val) + + @pytest.mark.parametrize("val", [None, np.nan]) + @pytest.mark.parametrize("dict_nesting", ["", ".data"]) + def test_top_level_param_single_val_cleaned_out_in_preprocessing( + self, val, dict_nesting + ): + model = build_model( + {f"parameters.my_val{dict_nesting}": val}, + "simple_supply,two_hours", + ) + assert "my_val" not in model.inputs + + def test_top_level_param_dims_no_index(self): + with pytest.raises(ValueError) as excinfo: + build_model( + {"parameters.my_val": {"data": 1, "dims": "techs"}}, + "simple_supply,two_hours", + ) + assert check_error_or_warning( + excinfo, + "(parameters, my_val) | Expected list for `index`, received: None", + ) + + def test_top_level_param_dims_not_list_index(self): + with pytest.raises(ValueError) as excinfo: + build_model( + {"parameters.my_val": {"data": 1, "dims": "techs", "index": "foo"}}, + "simple_supply,two_hours", + ) + assert check_error_or_warning( + excinfo, + "(parameters, my_val) | Expected list for `index`, received: foo", + ) + + @pytest.mark.parametrize("val", [1, 1.0, np.inf, "foo"]) + def test_top_level_param_single_data_single_known_dim(self, val, run_and_test): + run_and_test( + { + "data": val, + "index": ["test_supply_elec"], + "dims": "techs", + }, + {"test_supply_elec": val}, + "techs", + ) + + def test_top_level_param_multi_data_single_known_dim(self, run_and_test): + run_and_test( + { + "data": [1, "foo"], + "index": ["test_supply_elec", "test_demand_elec"], + "dims": "techs", + }, + {"test_supply_elec": 1, "test_demand_elec": "foo"}, + "techs", + ) + + def test_top_level_param_single_data_multi_known_dim(self, run_and_test): + run_and_test( + { + "data": 10, + "index": [["a", "test_supply_elec"], ["b", "test_demand_elec"]], + "dims": ["nodes", "techs"], + }, + {("a", "test_supply_elec"): 10, ("b", "test_demand_elec"): 10}, + ["nodes", "techs"], + ) + + def test_top_level_param_multi_data_multi_known_dim(self, run_and_test): + run_and_test( + { + "data": [10, 20], + "index": [["a", "test_supply_elec"], ["b", "test_demand_elec"]], + "dims": ["nodes", "techs"], + }, + {("a", "test_supply_elec"): 10, ("b", "test_demand_elec"): 20}, + ["nodes", "techs"], + ) + + def test_top_level_param_unknown_dim_only(self, caplog, run_and_test): + caplog.set_level(logging.DEBUG, logger="calliope.preprocess.model_data") + run_and_test( + {"data": 10, "index": ["foo"], "dims": "bar"}, + {"foo": 10}, + "bar", + ) + assert ( + "(parameters, my_val) | Adding a new dimension to the model: bar" + in caplog.text + ) + + def test_top_level_param_multi_unknown_dim(self, caplog, run_and_test): + caplog.set_level(logging.DEBUG, logger="calliope.preprocess.model_data") + run_and_test( + { + "data": 10, + "index": [["foo", "foobar"]], + "dims": ["bar", "baz"], + }, + {("foo", "foobar"): 10}, + ["bar", "baz"], + ) + assert ( + "(parameters, my_val) | Adding a new dimension to the model: bar" + in caplog.text + ) + assert ( + "(parameters, my_val) | Adding a new dimension to the model: baz" + in caplog.text + ) + + def test_top_level_param_unknown_dim_mixed(self, caplog, run_and_test): + caplog.set_level(logging.DEBUG, logger="calliope.preprocess.model_data") + run_and_test( + { + "data": 10, + "index": [["test_supply_elec", "foobar"]], + "dims": ["techs", "baz"], + }, + {("test_supply_elec", "foobar"): 10}, + ["techs", "baz"], + ) + assert ( + "(parameters, my_val) | Adding a new dimension to the model: baz" + in caplog.text + ) + + def test_top_level_param_timeseries(self, caplog, run_and_test): + caplog.set_level(logging.DEBUG, logger="calliope.preprocess.model_data") + run_and_test( + { + "data": 10, + "index": ["2005-01-01"], + "dims": ["timesteps"], + }, + {pd.to_datetime("2005-01-01"): 10}, + "timesteps", + ) + assert ( + "(parameters, my_val) | Updating timesteps dimension index values to datetime format" + in caplog.text + ) + + @pytest.mark.filterwarnings( + "ignore:(?s).*Operational mode requires the same timestep resolution:calliope.exceptions.ModelWarning" + ) + def test_top_level_param_extend_dim_vals(self, caplog, run_and_test): + # We do this test with timesteps as all other dimension elements are filtered out if there is no matching True element in `definition_matrix` + caplog.set_level(logging.DEBUG, logger="calliope.preprocess.model_data") + run_and_test( + { + "data": 10, + "index": ["2006-01-01"], + "dims": ["timesteps"], + }, + {pd.to_datetime("2006-01-01"): 10}, + "timesteps", + ) + assert ( + "(parameters, my_val) | Adding a new value to the `timesteps` model coordinate: ['2006-01-01T00:00:00.000000000']" + in caplog.text + ) diff --git a/tests/test_model_manipulation.py b/tests/test_model_manipulation.py index b51cf83ba..de332f2ce 100644 --- a/tests/test_model_manipulation.py +++ b/tests/test_model_manipulation.py @@ -5,15 +5,15 @@ from .common.util import check_error_or_warning -class TestExistsFalse: +class TestActiveFalse: """ Test removal of techs, nodes, links, and transmission techs - with the ``exists: False`` configuration option. + with the ``active: False`` configuration option. """ - def test_tech_exists_false(self): - overrides = {"techs.test_storage.exists": False} + def test_tech_active_false(self): + overrides = {"techs.test_storage.active": False} with pytest.warns(exceptions.ModelWarning) as excinfo: model = build_model(overrides, "simple_storage,two_hours,investment_costs") @@ -23,11 +23,11 @@ def test_tech_exists_false(self): # Ensure warnings were raised assert check_error_or_warning( excinfo, - "Tech test_storage was removed by setting ``exists: False`` - not checking the consistency of its constraints at node a.", + "Tech test_storage was removed by setting ``active: False`` - not checking the consistency of its constraints at node a.", ) - def test_node_exists_false(self): - overrides = {"nodes.b.exists": False} + def test_node_active_false(self): + overrides = {"nodes.b.active": False} with pytest.warns(exceptions.ModelWarning) as excinfo: model = build_model(overrides, "simple_storage,two_hours,investment_costs") @@ -37,11 +37,11 @@ def test_node_exists_false(self): # Ensure warnings were raised assert check_error_or_warning( excinfo, - "Not building the link a,b because one or both of its nodes have been removed from the model by setting ``exists: false``", + "Not building the link a,b because one or both of its nodes have been removed from the model by setting ``active: false``", ) - def test_definition_matrix_exists_false(self): - overrides = {"nodes.b.techs.test_storage.exists": False} + def test_node_tech_active_false(self): + overrides = {"nodes.b.techs.test_storage.active": False} model = build_model(overrides, "simple_storage,two_hours,investment_costs") # Ensure what should be gone is gone @@ -51,15 +51,15 @@ def test_definition_matrix_exists_false(self): ).any(["carriers", "carrier_tiers"]) ) - def test_link_exists_false(self): - overrides = {"links.a,b.exists": False} + def test_link_active_false(self): + overrides = {"links.a,b.active": False} model = build_model(overrides, "simple_storage,two_hours,investment_costs") # Ensure what should be gone is gone assert not model._model_data.inheritance.str.endswith("transmission").any() - def test_link_tech_exists_false(self): - overrides = {"links.a,b.techs.test_transmission_elec.exists": False} + def test_link_tech_active_false(self): + overrides = {"links.a,b.techs.test_transmission_elec.active": False} model = build_model(overrides, "simple_storage,two_hours,investment_costs") # Ensure what should be gone is gone