Skip to content

documentation changes March 2025 #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

ahawkes
Copy link
Contributor

@ahawkes ahawkes commented Mar 26, 2025

Description

Changes to documentation - the model description changed to address some issues and improve clarity

Fixes # (issue)

Type of change

  • [ x] Documentation (improve or add documentation)

Key checklist

  • [x ] All tests pass: $ cargo test
  • [x ] The documentation builds and looks OK: $ cargo doc

Further checks

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.03%. Comparing base (043e63e) to head (12efa24).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #466   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files          36       36           
  Lines        4893     4893           
  Branches     4893     4893           
=======================================
  Hits         4650     4650           
  Misses        123      123           
  Partials      120      120           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@tsmbland tsmbland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Clearly still lots of unknowns, but this has a lot to get us started


The result is a time sliced price for each commodity in each region.

#### B. Price discovery for commodities not produced
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an example would be helpful here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean an example in a simple model that we can try out? Or an example in written text here? The latter would be something like: e.g. there are two technologies that can produce heat, a gas boiler and a biomass-fuelled boiler. In the base year the gas boiler serves all demand. There is no other technology consuming biomass, so there is no price for biomass in the base year dispatch solution. Therefore, for the next milestone year, when trying to calculate objectives we do not have a price for biomass, and cannot proceed. So, we need to consider the range of processes that can produce biomass, and figure out the marginal cost of the best one (and this is the cost of biomass for the desired objective calculation).

This is complicated by the fact that there might be multiple processes needed to produce a specific commodity (ie.. the full commodity supply chain might be missing).

Copy link
Collaborator

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ahawkes,

I've taken the liberty of reviewing this because I thought I should give it a read before the next engagement. Besides @tsmbland's suggestions I've spotted a few typos etc. You should just be able to commit most of them directly. Otherwise all good!

Thanks for keeping this updated. It'll be a handy resource for the next stages of development.


For each asset/process that produces the commodity, we calculate the potential dispatch
in each time slice. This is done by observing the amount of demand that is above the
marginal cost of this process in the solution for the previous milestone year (i.e. demand
Copy link
Collaborator

@tsmbland tsmbland Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahawkes Could you please provide an equation for marginal cost?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marginal cost is operational costs only (i.e. no contribution from capex and fixed opex). So it's cost of inputs, cost (if any) of outputs, and variable operating cost.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double-check: the costs of inputs/outputs are commodity costs (as in, the things in commodity_costs.csv) rather than commodity prices... right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double-check: the costs of inputs/outputs are commodity costs (as in, the things in commodity_costs.csv) rather than commodity prices... right?

I assume we'd have to include both? i.e. for each input commodity (commodity_x), the contribution to the marginal cost (of commodity_y) is:

input_flow_of_commodity_x * (price_of_commodity_x + cost_of_commodity_x) / output_flow_of_commodity_y

Where cost can be positive (tax) or negative (subsidy), but price is always positive

@ahawkes Is that correct?

Comment on lines +130 to +135
We also calculate the prices of commodities that are not present in the dispatch
solution, but could exist in the solution for the next milestone year. These are calculated
directly from input data. This is done by calculating the marginal price of the process producing
the commodity in question with the best decision value, where decision values are calculated
using the utilisation of the next most expensive (marginal cost) asset in the dispatch stack,
adjusted for availability differences, and commodity prices from the price discovery at step 2(A).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be useful to have a formula for decision values. It's not clear how utilisation, availability and commodity price should be combined here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just spoke to @tsmbland and he said decision values should be the same as objective values for the single-objective case? If so, we don't have to worry about it until we add support for additional decision rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think this description is wrong, because if the commodity is present in the solution then we already have a price for it. Instead I think we should use an assumption of max utilisation for now, and create an issue for this (because it would be better to use the utilisation corresponding to the availability profile of the potential downstream demand - but this is a very complicated thing to do!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it may be possible to get prices for commodities not present in the solution by adding the processes to the problem with capacity constrained to zero. Then Highs might generate related prices - we would need to try this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it may be possible to get prices for commodities not present in the solution by adding the processes to the problem with capacity constrained to zero. Then Highs might generate related prices - we would need to try this.

We can certainly give this a go!

Does the below make sense (for now)? I can open an issue about getting a better value for utilisation here.

Suggested change
We also calculate the prices of commodities that are not present in the dispatch
solution, but could exist in the solution for the next milestone year. These are calculated
directly from input data. This is done by calculating the marginal price of the process producing
the commodity in question with the best decision value, where decision values are calculated
using the utilisation of the next most expensive (marginal cost) asset in the dispatch stack,
adjusted for availability differences, and commodity prices from the price discovery at step 2(A).
We also calculate the prices of commodities that are not present in the dispatch
solution, but could exist in the solution for the next milestone year. These are calculated
directly from input data. This is done by calculating the marginal price of the process producing
the commodity in question with the best decision value, assuming maximum utilisation.

@alexdewar alexdewar self-assigned this May 6, 2025
@alexdewar alexdewar added this to MUSE May 6, 2025
@alexdewar alexdewar moved this to 👀 In review in MUSE May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants