Skip to content

Commit 33a51b4

Browse files
authored
Merge branch 'develop' into update/pre-commit-hooks
2 parents 0625e8b + d1e961a commit 33a51b4

50 files changed

Lines changed: 1091 additions & 472 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.2.0rc4
2+
current_version = 1.2.1rc1
33
commit = True
44
tag = True
55

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ authors:
99
given-names: Adam
1010

1111
title: MUSE_OS
12-
version: v1.2.0rc4
12+
version: v1.2.1rc1
1313
date-released: 2024-08-13

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
project = "MUSE"
99
copyright = "2024, Imperial College London"
1010
author = "Imperial College London"
11-
release = "1.2.0rc4"
11+
release = "1.2.1rc1"
1212
version = ".".join(release.split(".")[:2])
1313

1414
# -- General configuration ---------------------------------------------------

docs/inputs/toml.rst

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ a whole.
9090
Carbon market
9191
-------------
9292

93-
This section contains the settings related to the modelling of the carbon market. If omitted, it defaults to not
94-
including the carbon market in the simulation.
93+
This section contains the settings related to the modelling of the carbon market.
94+
If omitted, it defaults to not including the carbon market in the simulation.
9595

9696
Example
9797

@@ -106,46 +106,49 @@ Example
106106
`time_framework` from the main section. If not given or an empty list, then the
107107
carbon market feature is disabled. Defaults to an empty list.
108108

109-
*method*
110-
Method used to equilibrate the carbon market. Available options are `fitting` and `bisection`, however this can be expanded with the `@register_carbon_budget_method` hook in `muse.carbon_budget`.
111-
112-
The market-clearing algorithm iterates over the sectors until the market reaches an equilibrium in the foresight period (the period next to the one analysed).
113-
This is represented by a stable variation of a commodity demand (or price) between iterations below a defined tolerance.
114-
The market-clearing algorithm samples a user-defined set of carbon prices.
115-
116-
When the `fitting` method is selected, this command builds a regression model of the emissions as a function of the carbon price.
117-
It applies to a pool of emissions for all the modelled regions. Therefore, the estimated carbon price applies to all the modelled regions.
118-
The regression model, the method calculates iteratively the emissions at pre-defined carbon price sample values.
119-
The emissions-carbon price couples are used to used to fit the emission-carbon price relation, is uer-defined (ie. linear or exponential fitter).
120-
The new carbon price is estimated as a root of the regression model estimated at the value of the emission equal to the user-defined emission cap in the foresight period.
121-
Alongside the selection of the method, the user can define a `sample_size`, representing the magnitude of the sample for the fitter.
122-
123-
When the `bisection` method is selected, this command applies a bisection method to solve the carbon market.
124-
Similarly to the `fitting` method, the carbon market includes a pool of all the modelled regions. The obtained carbon price
125-
applies to all the regions, as above. This method solves as a typical bisection algorithm.
126-
It is coded independently to use the internal signature of the `register_carbon_budget_method`. The algorithm aims to find a root of
127-
the function emissions-carbon price, as for the carbon price at which the carbon budget is met.
128-
The algorithm iteratively modifies the carbon price and estimates the corresponding emissions.
129-
It stops when the convergence or stop criteria are met.
130-
This happens for example either when the carbon budget or the maximum number of iterations are met.
131-
Alongside the selection of the method, the user can define a `sample_size`, representing the number of iterations of the bisection method.
132-
133109
*commodities*
134110
Commodities that make up the carbon market. Defaults to an empty list.
135111

136112
*control_undershoot*
137-
Whether to control carbon budget undershoots. This parameter allows for carbon tax credit from one year to be passed to the next in the case of less carbon being emitted than the budget. Defaults to True.
113+
Whether to control carbon budget undershoots. This parameter allows for carbon tax credit from one year to be passed to the next in the case of less carbon being emitted than the budget. Defaults to False.
138114

139115
*control_overshoot*
140-
Whether to control carbon budget overshoots. If the amount of carbon emitted is above the carbon budget, this parameter specifies whether this deficit is carried over to the next year. Defaults to True.
116+
Whether to control carbon budget overshoots. If the amount of carbon emitted is above the carbon budget, this parameter specifies whether this deficit is carried over to the next year. Defaults to False.
117+
118+
*method*
119+
Method used to equilibrate the carbon market. Available options are `fitting` and `bisection`, however this can be expanded with the `@register_carbon_budget_method` hook in `muse.carbon_budget`.
120+
121+
These methods solve the market with a number of different carbon prices, aiming to find the carbon price at which emissions (pooled across all regions) are equal to the carbon budget.
122+
The obtained carbon price applies to all regions.
123+
124+
The `fitting` method samples a number of different carbon prices to build a regression model (linear or exponential) of emissions as a function of carbon price.
125+
This regression model is then used to estimate the carbon price at which the carbon budget is met.
126+
127+
The `bisection` method uses an iterative approach to settle on a carbon price.
128+
Starting with a lower and upper-bound carbon price, it iteratively halves this price interval until the carbon budget is met to within a user-defined tolerance, or until the maximum number of iterations is reached.
129+
Generally, this method is more robust for markets with a complex, nonlinear relationship between emissions and carbon price, but may be slower to converge than the `fitting` method.
130+
131+
Defaults to `bisection`.
141132

142133
*method_options*
143-
Additional options for the specific carbon method. In particular, the `refine_price` activate a sanity check on the adjusted carbon price.
144-
The sanity check applies an upper limit on the carbon price obtained from the algorithm (either `fitting` or `bisection`), called
145-
`price_too_high_threshold`, a user-defined threshold based on heuristics on the values of the carbon price, reflecting typical historical trends.
134+
Additional options for the specified carbon method.
135+
136+
Parameters for the `bisection` method:
137+
138+
- `max_iterations`: maximum number of iterations. Defaults to 5.
139+
- `tolerance`: tolerance for convergence. E.g. 0.1 means that the algorithm will terminate when emissions are within 10% of the carbon budget. Defaults to 0.1.
140+
- `early_termination_count`: number of iterations with no change in the carbon price before the algorithm will terminate. Defaults to 5.
141+
142+
Parameters for the `fitting` method:
143+
144+
- `fitter`: the regression model used to approximate model emissions. Predefined options are `linear` (default) and `exponential`. Further options can be defined using the `@register_carbon_budget_fitter` hook in `muse.carbon_budget`.
145+
- `sample_size`: number of price samples used. Defaults to 5.
146+
147+
Shared parameters:
148+
149+
- `refine_price`: If True, applies an upper limit on the carbon price. Defaults to False.
150+
- `price_too_high_threshold`: upper limit on the carbon price. Defaults to 10.
146151

147-
*fitter*
148-
`fitter` specifies the regression model fit. The regression approximates the model emissions. Predefined options are `linear` and `exponential`. Further options can be defined using the `@register_carbon_budget_fitter` hook in `muse.carbon_budget`.
149152

150153
------------------
151154
Global input files

docs/tutorial-code/0-new-decision-metric/settings.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ quantity = "timeslice_supply"
3333
sink = "aggregate"
3434
filename = "{cwd}/{default_output_dir}/MCA{Quantity}.csv"
3535

36-
# Carbon budget control
3736
[carbon_budget_control]
38-
# budget = []
39-
method = "fitting"
37+
budget = []
4038

4139
[global_input_files]
4240
projections = '{path}/input/Projections.csv'

docs/tutorial-code/1-add-new-technology/1-introduction/settings.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ quantity = "prices"
2323
sink = "aggregate"
2424
filename = "{cwd}/{default_output_dir}/MCA{Quantity}.csv"
2525

26-
# Carbon budget control
2726
[carbon_budget_control]
2827
budget = []
2928

docs/tutorial-code/1-add-new-technology/2-scenario/settings.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ quantity = "prices"
2323
sink = "aggregate"
2424
filename = "{cwd}/{default_output_dir}/MCA{Quantity}.csv"
2525

26-
# Carbon budget control
2726
[carbon_budget_control]
2827
budget = []
2928

docs/tutorial-code/2-add-agent/1-single-objective/settings.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ quantity = "prices"
2323
sink = "aggregate"
2424
filename = "{cwd}/{default_output_dir}/MCA{Quantity}.csv"
2525

26-
# Carbon budget control
2726
[carbon_budget_control]
2827
budget = []
2928

docs/tutorial-code/2-add-agent/2-multiple-objective/settings.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ quantity = "prices"
2323
sink = "aggregate"
2424
filename = "{cwd}/{default_output_dir}/MCA{Quantity}.csv"
2525

26-
# Carbon budget control
2726
[carbon_budget_control]
2827
budget = []
2928

docs/tutorial-code/3-add-region/1-new-region/settings.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ quantity = "prices"
2323
sink = "aggregate"
2424
filename = "{cwd}/{default_output_dir}/MCA{Quantity}.csv"
2525

26-
# Carbon budget control
2726
[carbon_budget_control]
2827
budget = []
2928

0 commit comments

Comments
 (0)