annular.coupling

coupling.py: core model coupling functionality using MUSCLE3.

This file contains the creation of the coupling structure, and the MUSCLE3 instance definitions for both the central market model and the (arbitrary) number of satellite models.

The standard coupling structure is one central market model linked to many individual satellite models. The market model receives bid tables from the satellite models, and after market clearing sends back the amount of satisfied power and cleared market price.

Attributes

logger

Functions

satellite_model(→ None)

A simple satellite model to determine bids.

central_market_model(→ None)

The central market model.

summarize_scheduled_bids(→ dict[str, numpy.ndarray])

Summarize explicitly scheduled quantity per bid to amounts per timestamp.

prepare_results_folder(→ dict)

Prepare the results folder to contain copies of the settings files to be used.

run() → None)

Run the coupled simulation.

Module Contents

annular.coupling.logger[source]
annular.coupling.satellite_model() None[source]

A simple satellite model to determine bids.

annular.coupling.central_market_model() None[source]

The central market model.

annular.coupling.summarize_scheduled_bids(bids: pandas.DataFrame, window: Iterable[pandas.Timestamp]) dict[str, numpy.ndarray][source]

Summarize explicitly scheduled quantity per bid to amounts per timestamp.

Bids do not have to be submitted for the entire bidding window, but scheduled bids do have to be reported per satellite model per timestamp.

Parameters:
  • bids – Bids table with a scheduled column to be summarized.

  • window – Bidding window over which to summarize.

Returns:

A dictionary with satellite names as keys, and an array of scheduled quantity as values. This array is the same length as the given window, with 0 value if no bid is scheduled.

annular.coupling.prepare_results_folder(config_file: pathlib.Path, results_path: pathlib.Path) dict[source]

Prepare the results folder to contain copies of the settings files to be used.

Set up a unique folder for the model coupling run being executed. This folder will be the default location for any generated output by central or satellite models.

Parameters:
  • config_file – Initial configuration file from which settings for the model coupling run will be loaded.

  • results_path – Path where a new folder for the results can be created.

Returns:

Finalized settings dictionary for the model coupling run.

Raises:

RuntimeError – if the given results_path already contains a results folder for this configuration file.

annular.coupling.run(config_file: pathlib.Path, results_path: pathlib.Path = Path('results/')) None[source]

Run the coupled simulation.

Parameters:
  • config_file – configuration file for the simulation to run.

  • results_path – location where a folder can be created for output files. Defaults to “results/”.