Internal Colloquium - Comparative Simulation of Energy Market Designs

Florian Maurer

May 6, 2024

Outline

Motivation

  • Easy way to compare market designs

Motivation

  • Easy way to compare market designs
  • Comparative evaluation with simulation

Motivation

  • Easy way to compare market designs
  • Comparative evaluation with simulation
  • Like PyPSA but for energy markets

Research question

How can different energy market designs be evaluated in a simulative comparative manner?

Objective: Framework for the comparison of market designs


Which abstract description is able to characterize different market designs?

In what way can different market mechanisms be represented in the simulation software?

How can key performance indicators of market mechanisms be used to evaluate specific market designs?

Market comparability

Market Comparability Simulation Framework

Comparison agent-based market simulation

Model Year Market Design OSS Power Flow Modularity Interoperability Scaled Market Comparison
GSY-e [1] 2016-now LEM
lemlab [2] 2021-now LEM
SIMONA [3] 2021-now
ASAM [4] 2021-now DA, ID, RE
AMIRIS [5] 2016-now DA
USEF [6] 2016-2017 USEF
FNCS/AMES [7] 2008-now SCUC/SCED
Powermatcher 2014-2017
PowerACE [8] 2013-2016 DA
Maon [9] 2012-2021 DA
ÖkoFlex [10] 2014-2017 DA

table from [11]

○ - not applicable, ◐ - partial applicable, ✓ - fully applicable

Missing features of current market simulations

Features
various configurable market designs
OTC & conditional contracts
concurrent auctions
grid optimization
foundation for reinforcement learning
comparative evaluation

Summary of requirements

Functional

  • Generic market design abstraction
  • Modelling of different market mechanisms
  • Possible grid optimization through power flow calculation
  • Customizable output metrics
  • Evaluation using key performance indicators

Non-Functional

  • Availability/Open Source
  • Modularity
  • Interoperability with existing tools
  • Scalability

Functional requirements

  • Generic market design abstraction
  • Modelling of different market mechanisms
  • Possible grid optimization through power flow calculation
  • Customizable output metrics
  • Evaluation using key performance indicators

First research question

Which abstract description is able to characterize different market designs?

Market abstraction

market config item description
name string name
product type energy or capacity or heat
market products list of available products to be traded
opening hours recurrence rule of openings (RFC 5545)
opening duration time delta
market mechanism name of method used for clearing
maximum bid max allowed bidding price
minimum bid min allowed bidding price
maximum volume the largest valid volume for a single bid
additional fields list of additional fields to base bid
volume tick size step increments of volume
price tick size step increments of price
volume unit string for visualization
price unit string for visualization
supports get unmatched boolean
maximum gradient max allowed change between bids
eligible obligations lambda function checking if agent is allowed to trade here

concept presented in [11]

Market product

Market product Example
delivery duration 1 hour
count 24
offset to opening 24 hours

Base bid

  • Contains fields which are mandatory
  • Common abstraction layer
  • Can be extended by market
  • Additional fields receive meaning through market mechanism
field value
start-delivery 2023-06-30 00:00
end-delivery 2023-06-30 01:00
volume 100
price 32
sender id 118

Example for Germany - Day-Ahead Auction[12]

Market1

Example for Germany - Intraday Auction

Market2

Example for Germany - Intraday Trading

Market3

Example for Germany - Futures

Market4

First research question

Which abstract description is able to characterize different market designs?

  • Abstract description created
  • Presented in OS2 and EI.A paper [11]
  • Fits to various market designs

First research question

Which abstract description is able to characterize different market designs?

  • Abstract description created
  • Presented in OS2 and EI.A paper [11]
  • Fits to various market designs

Second research question

In what way can different market mechanisms be represented in the simulation software?

Agent-based simulation approach

  • All agents have
    • Obligations
    • Message handlers
  • Event-based approach
  • mango agents
    • TCP
    • MQTT
mindmap root)MarketAgent( Message Handler Receive Orderbook ::icon(fa fa-book) Receive Registration ::icon(fa fa-paper-plane) Event Obligation Inform Market opening ::icon(fa fa-door-open) Inform Market closing/result ::icon(fa fa-door-closed)

Market mechanisms

  • Different market mechanisms are modelled
    • Pay-as-bid
    • Pay-as-clear
    • Pay-as-clear-complex
    • Nodal-market (pyPSA)
    • Redispatch (pyPSA)
    • Pay-as-bid-with-contracts
    • Two-step-clearing
  • Modular design allows extensions

Concurrent markets and Continuous Auctions

  • Continuous auctions have an open orderbook
  • Continuity does not exist with computers
    • Approximate through short clearing intervals
    • Allows modeling by common bidding design
sequenceDiagram participant Market Market->>+Demand: Market opens for 1h Market->>+Generation: Market opens for 1h Generation-->>-Market: Bids [(vol: 20, cost: 300),(vol: 20, cost: 30)] Demand-->>+Market: Which bids available? Market->>-Demand: [(vol: 20, cost: 300),(vol: 20, cost: 30)] Demand-->>-Market: Bid (vol: 40, cost: 150) loop in discrete interval steps Market->>Demand: Market cleared Market->>Generation: Market cleared end Note right of Market: [(vol: 20, cost: 300), (vol: 20, cost: 150)] stay open positions

Eligible Lambda function

  • Some markets have additional constraints
    • On bids
    • On market participants
  • Configurable in market design through eligible_lambda function
    • inplace function evaluated at registration
    • only renewable actors can bid
    • lambda unit: unit["technology"] in ["solar", "wind", ...] and unit["max_power"] >= 10

How to support OTC and custom contracts?

  • OTC is traded between parties
  • Virtual market containing bilateral trades
  • Contract execution is defined in market_mechanism
    • Contract specifies executed code
    • Trade gets accepted
    • e.g. PPA - volume is calculated at the end
Long Term Market

Second research question

In what way can different market mechanisms be represented in the simulation software?

Second research question

In what way can different market mechanisms be represented in the simulation software?

Third research question

How can key performance indicators of market mechanisms be used to evaluate specific market designs?

Key Performance Indicators

Dashboard with KPIs

Grid optimization

  • Different scenarios
    • Redispatch
    • Nodal pricing
  • Works using pyPSA
Grid calculation

Reinforcement Learning

  • Agents sample actions from dedicated learning role
  • Learning Role writes results into output database
Learning Progress

Showcase

  • Market result analysis
  • Grid consideration
  • Key performance indicators
  • Dispatch of individual agent
Grid calculation
Single Agent metrics
Market results

Implementation

  • list of KPIs executed at end of simulation
  • configurable query building
  • Total Cost
    • Name: total Cost
    • Value: sum(price*demand_volume_energy)
    • Table: market_meta
    • Group bys: simulation

Third research question

How can key performance indicators of market mechanisms be used to evaluate specific market designs?

Third research question

How can key performance indicators of market mechanisms be used to evaluate specific market designs?

Summary of requirements

Functional

  • First research question
    • Generic market design abstraction
  • Second research question
    • Modelling of different market mechanisms
    • Possible grid optimization through power flow calculation
  • Third research question
    • Customizable output metrics
    • Evaluation using key performance indicators

Summary of requirements

Functional

  • Generic market design abstraction
  • Modelling of different market mechanisms
  • Possible grid optimization through power flow calculation
  • Customizable output metrics
  • Evaluation using key performance indicators

Non-Functional

  • Availability/Open Source
  • Modularity
  • Interoperability with existing tools
  • Scalability

Non-functional requirements

  • Availability/Open Source
  • Modularity
  • Interoperability with existing tools
  • Scalability

Open-Source Software

Base for reproducibility and expandability

Open-Source Software

Concepts fully integrated into ASSUME. Two versions available:

  1. independent PhD version

SPARKLE (Simulation Platform for Agent-based Research on energy marKet dynamics for Lower Emissions)

https://github.com/maurerle/sparkle

  1. a maintained community version with other researchers and focus on RL
Github Repository

Modularity

Software should be modular so that it can be maintained easily and adapt to future features and requirements.

Modularity

  • Integration in ASSUME project
  • Customizable output metrics
  • Software patterns
    • High cohesion
    • Low coupling
mindmap root((modular simulation)) Market Clearing Pay as bid ::icon(fa fa-marker) Pay as clear ::icon(fa fa-clock) ... Bidding Strategies Naive MC strategy ::icon(fa fa-lightbulb) Learning strategy ::icon(fa fa-graduation-cap) Agent Units Powerplant ::icon(fa fa-sun) Storage ::icon(fa fa-battery-half) Demand ::icon(fa fa-plug) DSM ::icon(fa fa-building) Output metrics Total dispatch volume ::icon(fa fa-chart-line) Average price ::icon(fa fa-dollar-sign)

Component based structure


Strategy pattern for behavior

Builder pattern for scenario

State pattern for RL Buffer

Proxy for CSV/DB output

Interoperability

  • No standardized simulation input and output exists
  • Scenario in hierarchical data format (YAML, XML, JSON)
  • Time series data in tabular format (CSV, XLSX, DataFrame)

Interoperability

  • PyPSA based loader​
    • netCDF
    • PyPOWER
    • Pandapower
    • PyPSA HDF5
  • AMIRIS [13]
    • scenario/timeseries
    • contracts
  • OEDS [14]
    • ECMWF weather
    • power plants from MASTR
Scigrid network loaded from PyPSA

Comparison study with AMIRIS at EEM2024

AMIRIS ASSUME Comparison Study

Know Your Tools - comparison study

Scalability

  • Runtime should profit from more cores
  • Distributed simulation
    • Container-based
    • Orchestration with docker swarm
Scale-out approach

Scalability / distributed clock

  • Process Intercommunication uses TCP
  • Main Clock orchestrates simulation
Distributed clock

Scalability / performance evaluation

Scalability showcase
Cores Speedup
1 1.00
2 1.82
4 3.18
8 5.21
16 7.32

Speedup = \frac{T_1}{T_n}

Scalability / non parallelizable market

  • Amdahl’s Law
    • parallellizable part
    • non-parallellizable part
  • Which amount limits scalability?
Scalability detailed walltime usage

New design

  • Market abstraction found
  • Simulation approach
  • Iterative development
Model Year Market Design OSS Power Flow Modularity Interoperability Scaled Market Comparison
New Design 2023+ various ✓ (pypsa) ✓ (loaders) ✓ (mango)

Limitations - what is not the focus

  • markets not covered by abstraction
  • optimized bidding behavior
  • most realistic parameterization for real simulation
  • investment planning/grid planning

Remaining TODOs

  • Better scalability interface
  • Improve output metrics
  • Usage scenarios
  • Finish thesis

Publication list

Thank you for your attention!

Questions?

References

[1]
GridSingularity, “Grid Singularity Mission - Grid Singularity Wiki,” 2021. [Online]. Available: https://gridsingularity.github.io/gsy-e/documentation/. [Accessed: 15-Apr-2022].
[2]
M. Zade, S. D. Lumpp, P. Tzscheutschler, and U. Wagner, Satisfying user preferences in community-based local energy markets — Auction-based clearing approaches,” Applied Energy, vol. 306, p. 118004, Jan. 2022.
[3]
J. Hiry, C. Kittl, F. Erlemeyer, and D. Schmid, SIMONAAgentenbasierte Netzsimulation für das intelligente Verteilnetz der Zukunft,” vol. Jahresbericht, pp. 40–41, Jan. 2018.
[4]
S. Glismann, Ancillary Services Acquisition Model: Considering market interactions in policy design,” Renewable and Sustainable Energy Reviews, Apr. 2021.
[5]
J. Kochems and C. Schimeczek, Agentenbasierte Modellierung von Lastmanagement im deutschen Stromsektor,” in Internationale Energiewirtschaftstagung (IEWT) 2021: Das Energiesystem nach Corona: Irreversible Strukturänderungen - Wie?, 2021.
[6]
USEF Design Team, USEF - The Framework Explained,” p. 58, May 2021.
[7]
S. Battula, L. Tesfatsion, and T. E. McDermott, An ERCOT test system for market design studies,” Applied Energy, vol. 275, p. 115182, Oct. 2020.
[8]
“Model PowerACE – REflex.” [Online]. Available: https://reflex-project.eu/model-coupling/powerace/. [Accessed: 10-Dec-2021].
[9]
M. Ketov, “MARKTSIMULATIONEN UNTER BERÜCKSICHTIGUNG DER STROM-WÄRME-SEKTORENKOPPLUNG,” p. 5, 2019.
[10]
T. Künzel and A. Weidlich, “Flexibility as an economic commodity in the intelligent energy system for the efficient integration of renewable energies,” 2015.
[11]
F. Maurer, K. K. Miskiw, R. R. Acosta, N. Harder, V. Sander, and S. Lehnhoff, Market Abstraction of Energy Markets and Policies - Application in an Agent-Based Modeling Toolbox,” in Energy Informatics, vol. 14468, B. N. Jørgensen, L. C. P. Da Silva, and Z. Ma, Eds. Cham: Springer Nature Switzerland, 2023, pp. 139–157.
[12]
EPEX SPOT, “Trading Products | EPEX SPOT,” 2022. [Online]. Available: https://www.epexspot.com/en/tradingproducts. [Accessed: 09-May-2023].
[13]
F. Maurer, F. Nitsch, J. Kochems, C. Schimeczek, V. Sander, and S. Lehnhoff, Know Your Tools - A Comparison of Two Open Agent-Based Energy Market Models,” in 2024 20th International Conference on the European Energy Market (EEM), 2024, pp. 1–8.
[14]
F. Maurer, J. Sejdija, and V. Sander, Decentralized energy data storages through an Open Energy Database Server,” NFDI4Energy, Feb. 2024.
[15]
S. Loizidis, A. Kyprianou, and G. E. Georghiou, Electricity market price forecasting using ELM and Bootstrap analysis: A case study of the German and Finnish Day-Ahead markets,” Applied Energy, vol. 363, p. 123058, Jun. 2024.