From 6c25079975f6a56dca6bafda207c4dca1c18d85c Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Mon, 2 Feb 2026 09:57:38 +0000 Subject: [PATCH 01/10] Add section on flexible assets from LaTeX and renumber sections --- docs/model/dispatch_optimisation.md | 167 ++++++++++++++++++++- src/simulation/optimisation/constraints.rs | 2 +- 2 files changed, 164 insertions(+), 5 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index cedc064dc..6263c89a8 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -149,7 +149,166 @@ time-varying availability limits. For all \\( a \in \mathbf{A}^{std}, r, t \\): \\[ act[a,r,t] = capacity[a,r]\\,cap2act[a]\\,avail_{EQ}[a,t]\\,duration[t] \\] -## B. Full Model Construction +## B. Flexible Assets (\\( a \in \mathbf{A}^{flex} \\)) + +**Purpose:** This section defines the operational characteristics of flexible assets, which can +adjust their input consumption mix and/or output product shares, governed by an overall process +efficiency. The generic activity variable \\( act[a,r,t] \\) (linked to the asset's physical \\( +capacity[a,r] \\)) is connected to the scale of this flexible conversion process via a reference +output parameter. It is assumed that SVD commodities cannot be efficiency-constrained or auxiliary +inputs to these assets. + +### B.1. Asset-Specific Sets (Defined for each flexible asset \\( a \in \mathbf{A}^{flex} \\)) + +These sets categorize the commodities involved in the flexible asset's operation. + +- \\( \mathbf{C}^{eff\\_ in}_a \subseteq (\mathbf{C}^{\mathrm{SED}} \cup \mathbf{C}^{\mathrm{OTH}}) + \\): Set of input commodities for asset \\( a \\) whose combined energy or mass content is subject + to the main process efficiency \\( \eta[a] \\). + +- \\( \mathbf{C}^{eff\\_ out}_a \subseteq \mathbf{C} \\): Set of main output commodities from asset + \\( a \\) whose combined energy or mass content is determined by \\( \eta[a] \\) and the processed + inputs. + +- \\( \mathbf{C}^{aux\\_ in}_a \subseteq (\mathbf{C}^{\mathrm{SED}} \cup \mathbf{C}^{\mathrm{OTH}}) + \\): Set of auxiliary input commodities for asset \\( a \\) (e.g., water, catalysts) whose + consumption is typically proportional to the main activity \\( act[a,r,t] \\) but which are not + part of the primary energy/mass balance for the efficiency calculation. + +- \\( \mathbf{C}^{aux\\_ out}_a \subseteq \mathbf{C} \\): Set of auxiliary output commodities for + asset \\( a \\) (e.g., specific emissions, waste streams) whose production is typically + proportional to \\( act[a,r,t] \\) but which are not counted in the efficiency calculation for the + primary products. + +### B.2. Parameters (for \\( a \in \mathbf{A}^{flex} \\)) + +These parameters define the technical and economic behavior of flexible assets. + +- \\( \eta[a] \\): The overall process efficiency (\\( \in (0,1] \\)) of flexible asset \\( a \\), + relating total common units of outputs in \\( \mathbf{C}^{eff\_out}_a \\) to inputs in \\( + \mathbf{C}^{eff\_in}_a \\). + +- \\( factor_{CU}[c] \\): A commodity-specific factor to convert its native physical units (e.g., + tonnes, m³) to a common unit (e.g., MWh of energy content, or tonnes of mass if it's a mass + balance) used for consistent efficiency and input/output share calculations. + +- \\( RefEffOutPerAct[a] \\): Reference Total Efficiency-constrained Output per unit of Activity. + This crucial parameter defines the total quantity of efficiency-constrained outputs (summed in + common units using \\( factor_{CU}[c] \\)) that are produced when asset \\( a \\) operates at one + unit of its generic activity level \\( act[a,r,t] \\). + +- \\( minInputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ in}_a \\)): Minimum fractional share of + input commodity \\( c \\) (in common units) relative to the total efficiency-constrained input (in + common units). + +- \\( maxInputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ in}_a \\)): Maximum fractional share + for input \\( c \\). + +- \\( minOutputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ out}_a \\)): Minimum fractional share + of output commodity \\( c \\) (in common units) relative to the total efficiency-constrained + output. + +- \\( maxOutputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ out}_a \\)): Maximum fractional share + for output \\( c \\). + +- \\( coeff_{aux\\_ in}[a,c] \\) (for \\( c \in \mathbf{C}^{aux\\_ in}_a \\)): Quantity of auxiliary + input \\( c \\) consumed per unit of \\( act[a,r,t] \\). + +- \\( coeff_{aux\\_ out}[a,c] \\) (for \\( c \in \mathbf{C}^{aux\\_ out}_a \\)): Quantity of auxiliary + output \\( c \\) produced per unit of \\( act[a,r,t] \\). + +### B.3. Decision Variables (for \\( a \in \mathbf{A}^{flex} \\)) + +These variables represent the operational choices for flexible assets. + +- \\( act[a,r,t]\ge0 \\): Generic activity level of flexible asset \\( a \\) (linked to its \\( + capacity[a,r] \\)). + +- \\( InputSpec[a,c,r,t]\ge0 \quad \forall c \in \mathbf{C}^{eff\\_ in}\_a \\): Actual amount of + efficiency-constrained input commodity \\( c \\) consumed by asset \\( a \\) in region \\( r \\), + time \\( t \\) (in its native physical units). + +- \\( OutputSpec[a,c,r,t]\ge0 \quad \forall c \in \mathbf{C}^{eff\\_ out}\_a \\): Actual amount of + efficiency-constrained output commodity \\( c \\) produced by asset \\( a \\) in region \\( r \\), + time \\( t \\) (in its native physical units). + +### B.4. Objective Contribution (for \\( a \in \mathbf{A}^{flex} \\)) + +The cost contribution from flexible assets includes costs related to +their generic activity, specific costs for efficiency-constrained inputs +and outputs (if defined separately from system commodity values), and +costs/revenues for auxiliary inputs and outputs. +\\[ + \begin{aligned} + &act[a,r,t] \cdot cost\_{var}[a,r,t] \\\\ + &+ \sum\_{c \in \mathbf{C}^{eff\\_ in}\_a} InputSpec[a,c,r,t] \cdot cost\_{input}[a,c] \\\\ + &+ \sum\_{c \in \mathbf{C}^{eff\\_ out}\_a} OutputSpec[a,c,r,t] \cdot cost\_{output}[a,c] \\\\ + &+ \sum\_{c \in \mathbf{C}^{aux\\_ in}\_a} (act[a,r,t] \cdot coeff\_{aux\\_ in}[a,c]) + \cdot cost\_{input}[a,c] \\\\ + &+ \sum\_{c \in \mathbf{C}^{aux\\_ out}\_a} (act[a,r,t] \cdot coeff\_{aux\\_ out}[a,c]) + \end{aligned} +\\] + +### B.5. Constraints (for \\( a \in \mathbf{A}^{flex}, r \in \mathbf{R}, t \in \mathbf{T} \\)) + +These rules govern the internal operation and conversion process of +flexible assets. Let +\\( ActualTotalEffOutputCU[a,r,t] = RefEffOutPerAct[a] \cdot act[a,r,t] \\) +(This is the total efficiency-constrained output in common units). Let +\\( ActualTotalEffInputCU[a,r,t] = (RefEffOutPerAct[a] / \eta[a]) \cdot act[a,r,t] \\) +(This is the total efficiency-constrained input in common units, derived +from the output and efficiency). + +- **Capacity & Availability:** Standard capacity and availability constraints (as in A.4) apply to + the generic activity variable \\( act[a,r,t] \\) of the flexible asset. + +- **Total Efficiency-Constrained Input Definition:** The sum of all specific efficiency-constrained + inputs, when converted to common units by \\( factor_{CU}[c] \\), must equal the total + efficiency-constrained input derived from \\( act[a,r,t] \\) and the asset's efficiency: + + \\[ + \sum\_{c \in \mathbf{C}^{eff\\_ in}\_a} InputSpec[a,c,r,t] \cdot factor\_{CU}[c] + = ActualTotalEffInputCU[a,r,t] + \\] + +- **Total Efficiency-Constrained Output Definition:** Similarly, the sum of all specific main + outputs (in common units) must equal the total defined by \\( act[a,r,t] \\) and the reference + output parameter: + + \\[ + \sum_{c \in \mathbf{C}^{eff\_out}\_a} OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] + = ActualTotalEffOutputCU[a,r,t] + \\] + +- **Input Share Constraints** (for each \\( c \in \mathbf{C}^{eff\_in}_a \\)): Ensure that each + individual efficiency-constrained input (in common units) stays within its defined minimum (\\( + minInputShare[a,c] \\)) and maximum (\\( maxInputShare[a,c] \\)) fractional share of the \\( + ActualTotalEffInputCU[a,r,t] \\). + + \\[ + \begin{aligned} + InputSpec[a,c,r,t] \cdot factor\_{CU}[c] + &\ge minInputShare[a,c] \cdot ActualTotalEffInputCU[a,r,t] \\\\ + InputSpec[a,c,r,t] \cdot factor\_{CU}[c] + &\le maxInputShare[a,c] \cdot ActualTotalEffInputCU[a,r,t] + \end{aligned} + \\] + +- **Output Share Constraints** (for each \\( c \in \mathbf{C}^{eff\_out}_a \\)): Ensure that each + individual efficiency-constrained output (in common units) stays within its defined minimum (\\( + minOutputShare[a,c] \\)) and maximum (\\( maxOutputShare[a,c] \\)) fractional share of the \\( + ActualTotalEffOutputCU[a,r,t] \\). + + \\[ + \begin{aligned} + OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] + &\ge minOutputShare[a,c] \cdot ActualTotalEffOutputCU[a,r,t] \\\\ + OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] + &\le maxOutputShare[a,c] \cdot ActualTotalEffOutputCU[a,r,t] + \end{aligned} + \\] + +## C. Full Model Construction > Note: This section includes references to many features that are not described elsewhere in this > document or implemented yet (e.g. region-to-region trade), but these are included for @@ -176,7 +335,7 @@ commodities: Note that the unmet demand variables (\\( UnmetD[c,r,t] \\)) are normally not included in the optimisation and are currently only used to diagnose the source of errors when running the model. -### Constraints +### C.1. Constraints The complete set of constraints that the optimisation must satisfy includes: @@ -191,7 +350,7 @@ The complete set of constraints that the optimisation must satisfy includes: - Flexible Asset operational constraints (E.5). -### Demand Satisfaction for \\( c\in \mathbf{C}^{\mathrm{SVD}} \\) +### C.2. Demand Satisfaction for \\( c\in \mathbf{C}^{\mathrm{SVD}} \\) These constraints ensure that exogenously defined final demands for SVDs are met in each region \\( r \\) and time slice \\( t \\), or any shortfall is explicitly accounted for. @@ -218,7 +377,7 @@ Else (if SVD \\( c \\) must be strictly met and is not included in \\( \mathbf{C \ge demand[r,c] \times timeslice\\_ share[c,t] \\] -### Commodity Balance for \\( c\in \mathbf{C}^{\mathrm{SED}} \\) +### C.4. Commodity Balance for \\( c\in \mathbf{C}^{\mathrm{SED}} \\) These constraints ensure that for all intermediate SED commodities, total supply equals total demand within each region \\( r \\) and for each balancing period defined by \\( balance\\_ level[c,r] \\) diff --git a/src/simulation/optimisation/constraints.rs b/src/simulation/optimisation/constraints.rs index ac7d710ff..26873a6d3 100644 --- a/src/simulation/optimisation/constraints.rs +++ b/src/simulation/optimisation/constraints.rs @@ -113,7 +113,7 @@ where /// commodity-balance constraint added to `problem` and `keys` lists the /// `(commodity, region, time_selection)` entries in the same order as the rows. /// -/// [1]: https://energysystemsmodellinglab.github.io/MUSE2/model/dispatch_optimisation.html#commodity-balance-for--cin-mathbfcmathrmsed- +/// [1]: https://energysystemsmodellinglab.github.io/MUSE2/model/dispatch_optimisation.html#c4-commodity-balance-for--cin-mathbfcmathrmsed- fn add_commodity_balance_constraints<'a, I>( problem: &mut Problem, variables: &VariableMap, From d9832f2579cc520cbd4a98ce8c032de819c8c793 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Mon, 2 Feb 2026 11:32:29 +0000 Subject: [PATCH 02/10] Remove some references to non-existent sections --- docs/model/dispatch_optimisation.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index 6263c89a8..b6fee2526 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -325,8 +325,6 @@ commodities: \\[ \begin{aligned} \text{Minimise: } &(\text{Core Asset Operational Costs from A.3 and E.4}) \\\\ - &+ (\text{Scope Policy Costs/Credits from B.4}) \\\\ - &+ (\text{Region-to-Region Trade Costs from C.4}) + (\text{Pool-Based Trade Costs from D.4}) \\\\ &+ \sum_{c \in \mathbf{C}^{VoLL},r,t} UnmetD[c,r,t] \cdot VoLL[c,r] \quad \text{(Penalty for Unserved Demand)} \end{aligned} @@ -342,12 +340,6 @@ The complete set of constraints that the optimisation must satisfy includes: - Capacity & Availability constraints for all assets \\( a \in \mathbf{A} \\) (as per A.4 and E.5). -- Scope policy constraints (B.5). - -- Region-to-Region Trade Limits (C.5.A). - -- Pool-Based Trade Limits (D.5.A). - - Flexible Asset operational constraints (E.5). ### C.2. Demand Satisfaction for \\( c\in \mathbf{C}^{\mathrm{SVD}} \\) From 6e8e4d7f5dfb56f7f76c1c19a1bc74a0bb565980 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Mon, 2 Feb 2026 11:38:50 +0000 Subject: [PATCH 03/10] Fix refs to remaining sections and add some hyperlinks --- docs/model/dispatch_optimisation.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index b6fee2526..3a06e5c16 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -324,7 +324,7 @@ commodities: \\[ \begin{aligned} - \text{Minimise: } &(\text{Core Asset Operational Costs from A.3 and E.4}) \\\\ + \text{Minimise: } &(\text{Core Asset Operational Costs from A.3 and B.4}) \\\\ &+ \sum_{c \in \mathbf{C}^{VoLL},r,t} UnmetD[c,r,t] \cdot VoLL[c,r] \quad \text{(Penalty for Unserved Demand)} \end{aligned} @@ -338,9 +338,12 @@ optimisation and are currently only used to diagnose the source of errors when r The complete set of constraints that the optimisation must satisfy includes: - Capacity & Availability constraints for all assets \\( a \in \mathbf{A} \\) - (as per A.4 and E.5). + (as per [A.4] and [B.5]) -- Flexible Asset operational constraints (E.5). +- [Flexible Asset operational constraints][B.5] + +[A.4]: #a4-constraints-capacity--availability-for-standard-assets--a-in-mathbfastd- +[B.5]: #b5-constraints-for--a-in-mathbfaflex-r-in-mathbfr-t-in-mathbft- ### C.2. Demand Satisfaction for \\( c\in \mathbf{C}^{\mathrm{SVD}} \\) From 80396dc11f94dcf22fbe48fcfbdf8794b47cd5be Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 13:39:48 +0000 Subject: [PATCH 04/10] Fix section numbering --- docs/model/dispatch_optimisation.md | 2 +- src/simulation/optimisation/constraints.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index 3a06e5c16..cfabcdae5 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -372,7 +372,7 @@ Else (if SVD \\( c \\) must be strictly met and is not included in \\( \mathbf{C \ge demand[r,c] \times timeslice\\_ share[c,t] \\] -### C.4. Commodity Balance for \\( c\in \mathbf{C}^{\mathrm{SED}} \\) +### C.3. Commodity Balance for \\( c\in \mathbf{C}^{\mathrm{SED}} \\) These constraints ensure that for all intermediate SED commodities, total supply equals total demand within each region \\( r \\) and for each balancing period defined by \\( balance\\_ level[c,r] \\) diff --git a/src/simulation/optimisation/constraints.rs b/src/simulation/optimisation/constraints.rs index 26873a6d3..6a1ac48e5 100644 --- a/src/simulation/optimisation/constraints.rs +++ b/src/simulation/optimisation/constraints.rs @@ -113,7 +113,7 @@ where /// commodity-balance constraint added to `problem` and `keys` lists the /// `(commodity, region, time_selection)` entries in the same order as the rows. /// -/// [1]: https://energysystemsmodellinglab.github.io/MUSE2/model/dispatch_optimisation.html#c4-commodity-balance-for--cin-mathbfcmathrmsed- +/// [1]: https://energysystemsmodellinglab.github.io/MUSE2/model/dispatch_optimisation.html#c3-commodity-balance-for--cin-mathbfcmathrmsed- fn add_commodity_balance_constraints<'a, I>( problem: &mut Problem, variables: &VariableMap, From 2b672da3835e8858f2d226e711fea0bd91ae050b Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 13:45:18 +0000 Subject: [PATCH 05/10] Fix: Double-escape some more underscores --- docs/model/dispatch_optimisation.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index cfabcdae5..fbae25630 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -185,8 +185,8 @@ These sets categorize the commodities involved in the flexible asset's operation These parameters define the technical and economic behavior of flexible assets. - \\( \eta[a] \\): The overall process efficiency (\\( \in (0,1] \\)) of flexible asset \\( a \\), - relating total common units of outputs in \\( \mathbf{C}^{eff\_out}_a \\) to inputs in \\( - \mathbf{C}^{eff\_in}_a \\). + relating total common units of outputs in \\( \mathbf{C}^{eff\\_out}_a \\) to inputs in \\( + \mathbf{C}^{eff\\_in}_a \\). - \\( factor_{CU}[c] \\): A commodity-specific factor to convert its native physical units (e.g., tonnes, m³) to a common unit (e.g., MWh of energy content, or tonnes of mass if it's a mass @@ -276,11 +276,11 @@ from the output and efficiency). output parameter: \\[ - \sum_{c \in \mathbf{C}^{eff\_out}\_a} OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] + \sum_{c \in \mathbf{C}^{eff\\_out}\_a} OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] = ActualTotalEffOutputCU[a,r,t] \\] -- **Input Share Constraints** (for each \\( c \in \mathbf{C}^{eff\_in}_a \\)): Ensure that each +- **Input Share Constraints** (for each \\( c \in \mathbf{C}^{eff\\_in}_a \\)): Ensure that each individual efficiency-constrained input (in common units) stays within its defined minimum (\\( minInputShare[a,c] \\)) and maximum (\\( maxInputShare[a,c] \\)) fractional share of the \\( ActualTotalEffInputCU[a,r,t] \\). @@ -294,7 +294,7 @@ from the output and efficiency). \end{aligned} \\] -- **Output Share Constraints** (for each \\( c \in \mathbf{C}^{eff\_out}_a \\)): Ensure that each +- **Output Share Constraints** (for each \\( c \in \mathbf{C}^{eff\\_out}_a \\)): Ensure that each individual efficiency-constrained output (in common units) stays within its defined minimum (\\( minOutputShare[a,c] \\)) and maximum (\\( maxOutputShare[a,c] \\)) fractional share of the \\( ActualTotalEffOutputCU[a,r,t] \\). @@ -392,7 +392,7 @@ other regions). \left( \begin{cases} OutputSpec[a,c,r,t] & \text{if } c \in \mathbf{C}^{eff\\_out}\_a \\\\ - act[a,r,t] \cdot coeff\_{aux\\_out}[a,c] & \text{if } c \in \mathbf{C}^{aux\_out}\_a \\ 0 + act[a,r,t] \cdot coeff\_{aux\\_out}[a,c] & \text{if } c \in \mathbf{C}^{aux\\_out}\_a \\ 0 & \text{otherwise} \end{cases} \right) From 9d436ba4986d095ba4dcb2ee89b3d17c96cd3d7a Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 13:49:08 +0000 Subject: [PATCH 06/10] Whitespace --- docs/model/dispatch_optimisation.md | 38 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index fbae25630..c503a9c82 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -197,25 +197,25 @@ These parameters define the technical and economic behavior of flexible assets. common units using \\( factor_{CU}[c] \\)) that are produced when asset \\( a \\) operates at one unit of its generic activity level \\( act[a,r,t] \\). -- \\( minInputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ in}_a \\)): Minimum fractional share of - input commodity \\( c \\) (in common units) relative to the total efficiency-constrained input (in - common units). +- \\( minInputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ in}_a \\)): Minimum fractional share + of input commodity \\( c \\) (in common units) relative to the total efficiency-constrained input + (in common units). - \\( maxInputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ in}_a \\)): Maximum fractional share for input \\( c \\). -- \\( minOutputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ out}_a \\)): Minimum fractional share - of output commodity \\( c \\) (in common units) relative to the total efficiency-constrained +- \\( minOutputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ out}_a \\)): Minimum fractional + share of output commodity \\( c \\) (in common units) relative to the total efficiency-constrained output. -- \\( maxOutputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ out}_a \\)): Maximum fractional share - for output \\( c \\). +- \\( maxOutputShare[a,c] \\) (for \\( c \in \mathbf{C}^{eff\\_ out}_a \\)): Maximum fractional + share for output \\( c \\). - \\( coeff_{aux\\_ in}[a,c] \\) (for \\( c \in \mathbf{C}^{aux\\_ in}_a \\)): Quantity of auxiliary input \\( c \\) consumed per unit of \\( act[a,r,t] \\). -- \\( coeff_{aux\\_ out}[a,c] \\) (for \\( c \in \mathbf{C}^{aux\\_ out}_a \\)): Quantity of auxiliary - output \\( c \\) produced per unit of \\( act[a,r,t] \\). +- \\( coeff_{aux\\_ out}[a,c] \\) (for \\( c \in \mathbf{C}^{aux\\_ out}_a \\)): Quantity of + auxiliary output \\( c \\) produced per unit of \\( act[a,r,t] \\). ### B.3. Decision Variables (for \\( a \in \mathbf{A}^{flex} \\)) @@ -234,10 +234,10 @@ These variables represent the operational choices for flexible assets. ### B.4. Objective Contribution (for \\( a \in \mathbf{A}^{flex} \\)) -The cost contribution from flexible assets includes costs related to -their generic activity, specific costs for efficiency-constrained inputs -and outputs (if defined separately from system commodity values), and -costs/revenues for auxiliary inputs and outputs. +The cost contribution from flexible assets includes costs related to their generic activity, +specific costs for efficiency-constrained inputs and outputs (if defined separately from system +commodity values), and costs/revenues for auxiliary inputs and outputs. + \\[ \begin{aligned} &act[a,r,t] \cdot cost\_{var}[a,r,t] \\\\ @@ -251,13 +251,11 @@ costs/revenues for auxiliary inputs and outputs. ### B.5. Constraints (for \\( a \in \mathbf{A}^{flex}, r \in \mathbf{R}, t \in \mathbf{T} \\)) -These rules govern the internal operation and conversion process of -flexible assets. Let -\\( ActualTotalEffOutputCU[a,r,t] = RefEffOutPerAct[a] \cdot act[a,r,t] \\) -(This is the total efficiency-constrained output in common units). Let -\\( ActualTotalEffInputCU[a,r,t] = (RefEffOutPerAct[a] / \eta[a]) \cdot act[a,r,t] \\) -(This is the total efficiency-constrained input in common units, derived -from the output and efficiency). +These rules govern the internal operation and conversion process of flexible assets. Let \\( +ActualTotalEffOutputCU[a,r,t] = RefEffOutPerAct[a] \cdot act[a,r,t] \\) (This is the total +efficiency-constrained output in common units). Let \\( ActualTotalEffInputCU[a,r,t] = +(RefEffOutPerAct[a] / \eta[a]) \cdot act[a,r,t] \\) (This is the total efficiency-constrained input +in common units, derived from the output and efficiency). - **Capacity & Availability:** Standard capacity and availability constraints (as in A.4) apply to the generic activity variable \\( act[a,r,t] \\) of the flexible asset. From 038089c87d469e7381ef8e0b09e4776270dd762a Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 13:52:06 +0000 Subject: [PATCH 07/10] Fix: Add missing `cost_output` term Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/model/dispatch_optimisation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index c503a9c82..31c8ed7c7 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -246,6 +246,7 @@ commodity values), and costs/revenues for auxiliary inputs and outputs. &+ \sum\_{c \in \mathbf{C}^{aux\\_ in}\_a} (act[a,r,t] \cdot coeff\_{aux\\_ in}[a,c]) \cdot cost\_{input}[a,c] \\\\ &+ \sum\_{c \in \mathbf{C}^{aux\\_ out}\_a} (act[a,r,t] \cdot coeff\_{aux\\_ out}[a,c]) + \cdot cost\_{output}[a,c] \\\\ \end{aligned} \\] From 2360539550e0841fcc948996e0b5f99ddb35cc7a Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 14:04:32 +0000 Subject: [PATCH 08/10] Make sections for 'Full Model Construction' more logical --- docs/model/dispatch_optimisation.md | 20 +++++++++++--------- src/simulation/optimisation/constraints.rs | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index 31c8ed7c7..842ffe7fc 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -314,12 +314,14 @@ in common units, derived from the output and efficiency). > completeness. This represents the roadmap for future MUSE2 development. This section describes how all preceding components are integrated to form the complete dispatch -optimisation problem. 1. **Sets, Parameters, Decision Variables:** The union of all previously -defined elements. 2. **Objective Function:** The overall objective is to minimise the total system -cost, which is the sum of all operational costs from assets (standard and flexible), financial -impacts from policy scopes (taxes minus credits), costs of inter-regional trade, costs of pool-based -trade, and importantly, the high economic penalties associated with any unserved demand for critical -commodities: +optimisation problem. + +### C.1. Objective Function + +The overall objective is to minimise the total system cost, which is the sum of all operational +costs from assets (standard and flexible), financial impacts from policy scopes (taxes minus +credits), costs of inter-regional trade, costs of pool-based trade, and importantly, the high +economic penalties associated with any unserved demand for critical commodities: \\[ \begin{aligned} @@ -332,7 +334,7 @@ commodities: Note that the unmet demand variables (\\( UnmetD[c,r,t] \\)) are normally not included in the optimisation and are currently only used to diagnose the source of errors when running the model. -### C.1. Constraints +### C.2. Constraints The complete set of constraints that the optimisation must satisfy includes: @@ -344,7 +346,7 @@ The complete set of constraints that the optimisation must satisfy includes: [A.4]: #a4-constraints-capacity--availability-for-standard-assets--a-in-mathbfastd- [B.5]: #b5-constraints-for--a-in-mathbfaflex-r-in-mathbfr-t-in-mathbft- -### C.2. Demand Satisfaction for \\( c\in \mathbf{C}^{\mathrm{SVD}} \\) +#### Demand Satisfaction for \\( c\in \mathbf{C}^{\mathrm{SVD}} \\) These constraints ensure that exogenously defined final demands for SVDs are met in each region \\( r \\) and time slice \\( t \\), or any shortfall is explicitly accounted for. @@ -371,7 +373,7 @@ Else (if SVD \\( c \\) must be strictly met and is not included in \\( \mathbf{C \ge demand[r,c] \times timeslice\\_ share[c,t] \\] -### C.3. Commodity Balance for \\( c\in \mathbf{C}^{\mathrm{SED}} \\) +#### Commodity Balance for \\( c\in \mathbf{C}^{\mathrm{SED}} \\) These constraints ensure that for all intermediate SED commodities, total supply equals total demand within each region \\( r \\) and for each balancing period defined by \\( balance\\_ level[c,r] \\) diff --git a/src/simulation/optimisation/constraints.rs b/src/simulation/optimisation/constraints.rs index 6a1ac48e5..ac7d710ff 100644 --- a/src/simulation/optimisation/constraints.rs +++ b/src/simulation/optimisation/constraints.rs @@ -113,7 +113,7 @@ where /// commodity-balance constraint added to `problem` and `keys` lists the /// `(commodity, region, time_selection)` entries in the same order as the rows. /// -/// [1]: https://energysystemsmodellinglab.github.io/MUSE2/model/dispatch_optimisation.html#c3-commodity-balance-for--cin-mathbfcmathrmsed- +/// [1]: https://energysystemsmodellinglab.github.io/MUSE2/model/dispatch_optimisation.html#commodity-balance-for--cin-mathbfcmathrmsed- fn add_commodity_balance_constraints<'a, I>( problem: &mut Problem, variables: &VariableMap, From 171a38700ceaefebc7cb42d18b8f9c4f27101d39 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 14:11:16 +0000 Subject: [PATCH 09/10] Fix line break formatting Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/model/dispatch_optimisation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index 842ffe7fc..c90923adc 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -393,8 +393,8 @@ other regions). \left( \begin{cases} OutputSpec[a,c,r,t] & \text{if } c \in \mathbf{C}^{eff\\_out}\_a \\\\ - act[a,r,t] \cdot coeff\_{aux\\_out}[a,c] & \text{if } c \in \mathbf{C}^{aux\\_out}\_a \\ 0 - & \text{otherwise} + act[a,r,t] \cdot coeff\_{aux\\_out}[a,c] & \text{if } c \in \mathbf{C}^{aux\\_out}\_a \\\\ + 0 & \text{otherwise} \end{cases} \right) && \text{(Flex Asset Production)} \\\\ From d99e6743406053e3cb71812404d517caba841786 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 11 Feb 2026 14:11:31 +0000 Subject: [PATCH 10/10] Fix: Escape another underscore Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/model/dispatch_optimisation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/model/dispatch_optimisation.md b/docs/model/dispatch_optimisation.md index c90923adc..abb6bcdf2 100644 --- a/docs/model/dispatch_optimisation.md +++ b/docs/model/dispatch_optimisation.md @@ -275,7 +275,7 @@ in common units, derived from the output and efficiency). output parameter: \\[ - \sum_{c \in \mathbf{C}^{eff\\_out}\_a} OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] + \sum\_{c \in \mathbf{C}^{eff\\_out}\_a} OutputSpec[a,c,r,t] \cdot factor\_{CU}[c] = ActualTotalEffOutputCU[a,r,t] \\]