Yuanliang-Li / PEMT-CoSim

A Co-Simulation Platform for Packetized Energy Management and Trading
7 stars 4 forks source link

PEMT-CoSim

A Co-Simulation Platform For Packetized Energy Management and Trading

1. Description

PEMT-CoSim is a co-simulation platform for packetized energy management (PEM) and trading (PET) in smart grids. It is developed based on the open-source Transactive Energy Simulation Platform (TESP, v1.0.0).

Packetized Energy (PE) is a gird management technology which breaks the power into fixed-duration/fixed power "energy packet" with a "request-reply" scheme. Prosumers (both suppler and consumer) can request a packet for their load/generator to consume/provide. A central coordinator will accept/reject the request based on grid condition. There are two types of PE, Packetized Energy Management (PEM) and Packetized Energy Trading (PET). Packetized Energy Management (PEM) is a load dispatch program which uses a PEM controller to have houses' flexible load to request a packet with a probability, and the central coordinator will accept/reject the request by comparing the the request load with a balancing signal. PET allows prosumers to bid for a packet in a double-auction market. The cleared price and quantity determine whether bids are accepted or rejected for prosumers.

PEMT-CoSim utilizes the TESP's HELICS co-simulation framework to enable coordination between a number of dedicated simulators/programs (named "federate" under the HECLIS framework): GridLAB-D federate (distribution system simulator), PyPower federate (transmission system simulator), EnergyPlus federate(building simulator), Wether federate (weather data generator), Substation federate (Implemented the processes for PET and PEM).

image

PEMT-CoSim Architecture

Substation is main federate which implements the PEM and PET using developed API, including PEM-related modules (PEM Controllers, PEM Coordinator), PET-related modules (PET Prosumer, PEM Market). Moreover, the AI modules implemented the reinforcement learning algorithm that can be used to optimize the biding strategies for prosumers.

2. Installation

PEMT-CoSim runs natively on Linux. However, for better deployment of this project, it is suggested to run this project in a docker container. Therefore, PEMT-CoSim can also run in Windows and MacOS via docker.

2.1 Installation via Docker

Before the installation, the Docker or Docker Desktop, and Git should be installed.

The following steps show how you start and connect to your running container

3. File Directory

Denote "(c)" as configuration file, "(o)" as output file.

4. Run Cases

4.1 Run PEM example via prompt

In the docker container, type:

cd /PEMT-CoSim/demo-PEM
python3 generate_case.py 
cd ./fed_substation/
python3 launch_substation.py

To visualize the experimental results after the simulation

cd /PEMT-CoSim/
python3 plotFig.py

image

PEM results

4.2 Run PET example (without RL) via prompt

In the docker container, type:

cd /PEMT-CoSim/demo-PET
python3 generate_case.py 
cd ./fed_substation/
python3 launch_substation.py

To visualize the experimental results after the simulation

cd /PEMT-CoSim/
python3 plotFig.py

image image

PET results

4.3 Run PET-RL example (with RL) via prompt

In this case, we apply RL to optimize the biding price for prosumers including the biding prices for seller and buyer, respectively. The first 48 hours are used to train the RL agents. After 48 hours, prsoumers use the trained policy to generate biding prices.

In the docker container, type:

cd /PEMT-CoSim/demo-PET-RL
python3 generate_case.py 
cd ./fed_substation/
python3 launch_substation.py

To visualize the experimental results after the simulation

cd /PEMT-CoSim/
python3 plotFig.py

image image

PET-RL results

Related Publications

  1. Li, Yuanliang, et al. "PEMT-CoSim: A Co-Simulation Platform for Packetized Energy Management and Trading in Distributed Energy Systems." 2022 IEEE International Conference on Communications, Control, and Computing Technologies for Smart Grids (SmartGridComm). IEEE, 2022.