# PROCSIM: An Open-Source Simulator to Generate Energy Community Power Demand and Generation Scenarios

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

#### 1.1. Current Status of Energy Communities Datasets and Simulators

#### 1.2. Main Contributions

- The PROCSIM simulation platform, which allows the generation of realistic EC datasets at the appliance level completely customized by the user for multiple purposes considering different periods. It allows the creation of ECs with different sizes by choosing the number of houses, members, and appliances of each house; the peak power contract; and the schedule of every activity done by the house members. Additionally, it supports integration with multiple sources for weather forecasts (for instance, using Solcast Application Programming Interface (API) to provide solar irradiance data with a minimum granularity of 30 min, using PVLib to provide solar data from the weather models, or using Tomorrow.io to provide wind data). Finally, based on the weather forecast, it supports PV and wind generation using PVLib and windpowerlib libraries. This open-source platform is fully available at https://pypi.org/project/procsimulator/ (accessed on 4 February 2023), and its documentation is also available at https://procsim.readthedocs.io/en/latest/procsimulator.html (accessed on 4 February 2023).
- A walkthrough demonstration of the use of the platform. The code and the generated EC dataset are open-source and available on a public repository https://github.com/feelab-info/PROCSIM_ECs_Simulation_Scenarios/blob/main/paper_experiments/Experiment1_EC_Generator.ipynb (accessed on 4 February 2023).
- Application of an optimization model on top of an EC dataset generated using PROCSIM to demonstrate the tool’s potential. The optimization model and software are also open-source (https://github.com/feelab-info/PROCSIM_ECs_Simulation_Scenarios/blob/main/paper_experiments/Experiment2_EC_Optimization.ipynb, accessed on 4 February 2023).

## 2. Background and Related Works

#### 2.1. Energy Communities’ Datasets

#### 2.2. Tools for Energy Communities’ Research

#### 2.2.1. Electricity Consumption Datasets

#### 2.2.2. Household Consumption Simulators

#### 2.2.3. Energy Generation from PV and Wind

#### 2.3. Summary

## 3. PROCSIM: Energy Community Simulation Platform

- Released as open-source software (with documentation) to encourage researchers to contribute with new EC datasets, with the aim of fostering increased collaboration within the community. These datasets offer benefits for data scientists, researchers, and decision makers in the energy field, making them a valuable source for model and algorithm applications. In addition, they can be convenient for real-life simulating and planning of an EC. They can also be used to evaluate different communities with diverse sizes and characteristics. Ultimately, it provides a stronger contribution due to the individual appliance consumption profiles, which are hard to find in the existing literature.
- Designed with a modular structure, enabling researchers to reuse, replace, or append individual components as needed (for instance, a researcher can append an electric vehicles module to understand how it affects the community in terms of the management of the renewable resources).
- Designed to allow the use of just one module or a set of modules instead of the whole simulator (for instance, generate only one house with a PV panel) for teaching purposes.
- Written in Python, ensuring simplicity (allowing even beginners to use it) and compatibility with many existent platforms.

#### 3.1. PROCSIM Implementation

#### 3.1.1. Community Specificator

#### 3.1.2. Consumption Generator

#### 3.1.3. Weather Data Acquisition

#### 3.1.4. Renewable Energy Generation

#### 3.1.5. Community Generation

#### 3.2. Dataset Structure

## 4. Case Study

#### 4.1. Experiment One: Dataset Generation

#### 4.1.1. Step 1: Generation of the Consumption Profiles

`ConsumptionGenerator`class, three arguments are required: the location of the JSON configuration file, the location where the consumption profiles generated by ANTGen will be created, and the location of the profiles after the resampling. Then, when calling the execute function of this class, the two following arguments must be provided: the number of days to simulate and the folder of the configuration files in the ANTGen format. In our case, consumption profiles for a week were generated (the first day is shown in Figure 5).

#### 4.1.2. Step 2: Generation of PV and Wind Production

`RenewableEnergyGenerator`class, four arguments must be provided: the CommunityGenerator instance in order to use some of its functions, the PV and wind subclasses, and the location of the consumption profiles generated in the previous module. Then, the execute function is called without any argument to calculate the PV and wind production based on the weather data acquired. The total production is then calculated by summing the individual components.

#### 4.1.3. Step 3: Calculation of Net-Load and Generation of the EC Dataset

#### 4.1.4. Step 4: Calculate Metrics in the EC Dataset

#### 4.2. Experiment Two: Community Battery Energy Storage Optimization

#### 4.2.1. Constraints

- The power exchange between the EC and the main grid ($pIm{p}_{t}$ and $pEx{p}_{t}$) is limited by the thermal limits of the cables or by contracts.
- The power of generators (${gAct}_{g,t}$) is limited by their nominal power and by the generation forecast of PV and wind.
- For the loads (${load}_{l,t}$), we assume continuous flexibility of 10% (${lRed}_{l,t}$) of their power consumption at each instant and 5% flexibility with discrete activation (${lCut}_{l,t}$). A relaxation variable (${lENS}_{l,t}$) is also considered in the problem. This variable is important when the generation resources are insufficient to supply all the demand.
- The batteries are limited by the maximum values of power charge (${sCh}_{s,t}$) and discharge (${sDch}_{s,t}$) and by their maximum capacity. Afterward, a constraint to model the BESS balance is required to update the $SOC$ of the BESS in each instant t.
- Finally, the balance between power consumed and injected in the EC is required. This equation is represented in Equation (3).$$\begin{array}{cc}\hfill 0=& \sum _{g}^{G}{gAct}_{g,t}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& +{pImp}_{t}-{pExp}_{t}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& -\sum _{l}^{L}{load}_{l,t}-{lRed}_{l,t}-{lCut}_{l,t}-{lENS}_{l,t}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& -\sum _{s}^{S}{sCh}_{s,t}-{sDch}_{s,t},\forall t\in T\hfill \end{array}$$

#### 4.2.2. Objective Function

#### 4.2.3. Results

## 5. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Nomenclature

${\varphi}_{g,t}^{gen}$ | Cost of using energy from generators |

${\varphi}_{l,t}^{cut}$ | Active power curtailment (on/off control) in load l in instant t [kW] |

${\varphi}_{l,t}^{ENS}$ | Active power not supplied (relaxation variable) in load l in instant t [kW] |

${\varphi}_{l,t}^{red}$ | Active power reduction (continuous control) in load l in instant t [kW] |

${\varphi}_{s,t}^{ch}$ | Cost of charging the storage |

${\varphi}_{s,t}^{dch}$ | Cost of discharging the storage |

${\varphi}_{t}^{buy}$ | Cost of buying energy from the grid |

${\varphi}_{t}^{sell}$ | Cost of selling energy to the grid |

$pEx{p}_{t}$ | Active Power exported to the grid at instant t [kW] |

$pIm{p}_{t}$ | Active Power imported from the grid at instant t [kW] |

${gAct}_{g,t}$ | Active Power of generated g at instant t [kW] |

${lCut}_{l,t}$ | Flexibility with discrete activation of load l at instant t [%] |

${lENS}_{l,t}$ | Relaxation variable of load l at instant t |

${load}_{l,t}$ | Active Power of load l at instant t [kW] |

${lRed}_{l,t}$ | Flexibility of active power consumption of load l at instant t [%] |

${sCh}_{s,t}$ | Active Power charge of storage s at instant t [kW] |

${sDch}_{s,t}$ | Active Power discharge of storage s at instant t [kW] |

## Abbreviations

API | Application Programming Interface |

BESS | Battery Energy Storage System |

CPLEX | Constraint Programming Language EXecutor |

CSV | Comma Separated Values |

DHI | Direct Horizontal Irradiance |

DNI | Direct Normal Irradiance |

DR | Demand Response |

EC | Energy Community |

EV | Electric Vehicle |

GFS | Global Forecast System |

GHI | Global Horizontal Irradiance |

GUI | Graphical User Interface |

HEMS | Home Energy Management System |

HRRR | High Resolution Rapid Refresh |

JSON | JavaScript Object Notation |

MILP | Mixed Integer Linear Programming |

NAM | North American Mesoscale |

NFDF | National Digital Forecast Database |

NILM | Non-Intrusive Load Monitoring |

OF | Objective Function |

PPC | Peak Power Contract |

PV | Solar Photovoltaic |

RAP | Rapid Refresh |

REC | Renewable Energy Community |

RES | Renewable Energy Sources |

SC | Self-Consumption |

SOC | State of Charge |

SS | Self-Sufficiency |

UML | Unified Modeling Language |

WPL | Wind Power Library |

## References

- Akpan, U.F.; Akpan, G.E. The Contribution of Energy Consumption to Climate Change: A Feasible Policy Direction. Int. J. Energy Econ. Policy
**2011**, 2, 21–33. [Google Scholar] - Eltamaly, A.M.; Alotaibi, M.A.; Alolah, A.I.; Ahmed, M.A. A Novel Demand Response Strategy for Sizing of Hybrid Energy System With Smart Grid Concepts. IEEE Access
**2021**, 9, 20277–20294. [Google Scholar] [CrossRef] - Brooks, N.A.; Powers, S.T.; Borg, J.M. A mechanism to promote social behaviour in household load balancing. arXiv
**2020**, arXiv:2006.14526. [Google Scholar] - Bhamidi, L.; Sadhukhan, A.; Sivasubramani, S. Multi-objective optimization for demand side management in a smart grid environment. In Proceedings of the 2017 7th International Conference on Power Systems (ICPS), Shivajinagar, India, 21–23 December 2017; p. 205. [Google Scholar] [CrossRef]
- Alfaverh, F.; Denaï, M.; Sun, Y. Demand Response Strategy Based on Reinforcement Learning and Fuzzy Reasoning for Home Energy Management. IEEE Access
**2020**, 8, 39310–39321. [Google Scholar] [CrossRef] - Chavali, P.; Yang, P.; Nehorai, A. A Distributed Algorithm of Appliance Scheduling for Home Energy Management System. IEEE Trans. Smart Grid
**2014**, 5, 282–290. [Google Scholar] [CrossRef] - Kazmi, H.; Munne-Collado, I.; Mehmood, F.; Syed, T.A.; Driesen, J. Towards data-driven energy communities: A review of open-source datasets, models and tools. Renew. Sustain. Energy Rev.
**2021**, 148, 111290. [Google Scholar] [CrossRef] - Berg, K.; Löschenbrand, M. A data set of a Norwegian energy community. Data Brief
**2022**, 40, 107683. [Google Scholar] [CrossRef] - Goncalves, C.; Barreto, R.; Faria, P.; Gomes, L.; Vale, Z. Energy Community Consumption and Generation Dataset with Appliance Allocation. IFAC-PapersOnLine
**2022**, 55, 285–290. [Google Scholar] [CrossRef] - Cosic, A.; Stadler, M.; Mansoor, M.; Zellinger, M. Mixed-integer linear programming based optimization strategies for renewable energy communities. Energy
**2021**, 237, 121559. [Google Scholar] [CrossRef] - Giordano, A.; Mastroianni, C.; Scarcello, L.; Spezzano, G. An Optimization Model for Efficient Energy Exchange in Energy Communities. In Proceedings of the 2020 Fifth International Conference on Fog and Mobile Edge Computing (FMEC), Paris, France, 20–23 April 2020; pp. 319–324. [Google Scholar] [CrossRef]
- Buneeva, N.; Reinhardt, A. AMBAL: Realistic load signature generation for load disaggregation performance evaluation. In Proceedings of the 2017 IEEE International Conference on Smart Grid Communications (SmartGridComm), Dresden, Germany, 23–26 October 2017; pp. 443–448. [Google Scholar] [CrossRef]
- Albouys, J.; Sabouret, N.; Haradji, Y.; Schumann, M.; Inard, C. SMACH: Multi-agent Simulation of Human Activity in the Household. In Advances in Practical Applications of Survivable Agents and Multi-Agent Systems: The PAAMS Collection, 17th International Conference, PAAMS 2019, Ávila, Spain, 26–28 June 2019; Lecture Notes in Computer Science; Demazeau, Y., Matson, E., Corchado, J.M., De la Prieta, F., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 227–231. [Google Scholar] [CrossRef]
- Pflugradt, N. LoadProfileGenerator. 2015. Available online: https://www.loadprofilegenerator.de/ (accessed on 18 October 2022).
- Pereira, L.; Nunes, N. Performance evaluation in non-intrusive load monitoring: Datasets, metrics, and tools—A review. WIREs Data Min. Knowl. Discov.
**2018**, 8, e1265. [Google Scholar] [CrossRef] - Kelly, J.; Knottenbelt, W. The UK-DALE dataset, domestic appliance-level electricity demand and whole-house demand from five UK homes. Sci. Data
**2015**, 2, 150007. [Google Scholar] [CrossRef] - Murray, D.; Stankovic, L.; Stankovic, V. An electrical load measurements dataset of United Kingdom households from a two-year longitudinal study. Sci. Data
**2017**, 4, 160122. [Google Scholar] [CrossRef] - Pereira, L.; Quintal, F.; Gonçalves, R.; Nunes, N.J. SustData: A Public Dataset for ICT4S Electric Energy Research. In Proceedings of the 2014 conference ICT for Sustainability, Stockholm, Sweden, 24–27 August 2014; Advances in Computer Science Research. Atlantis Press: Amsterdam, The Netherlands, 2014. [Google Scholar] [CrossRef]
- Pereira, L.; Costa, D.; Ribeiro, M. A residential labeled dataset for smart meter data analytics. Sci. Data
**2022**, 9, 1–11. [Google Scholar] - Kriechbaumer, T.; Jacobsen, H.A. BLOND, a Building-Level Office Environment Dataset of Typical Electrical Appliances. Sci. Data
**2018**, 5, 180048. [Google Scholar] [CrossRef] - Batra, N.; Parson, O.; Berges, M.; Singh, A.; Rogers, A. A Comparison of Non-Intrusive Load Monitoring Methods for Commercial and Residential Buildings. arXiv
**2014**, arXiv:1408.6595. [Google Scholar] - Pereira, L. FIKElectricity: A Electricity Consumption Dataset from Three Restaurant Kitchens in Portugal. Data
**2021**, 6, 26. [Google Scholar] [CrossRef] - Klemenjak, C.; Kovatsch, C.; Herold, M.; Elmenreich, W. A synthetic energy dataset for non-intrusive load monitoring in households. Sci. Data
**2020**, 7, 108. [Google Scholar] [CrossRef] - Harell, A.; Jones, R.; Makonin, S.; Bajic, I.V. PowerGAN: Synthesizing Appliance Power Signatures Using Generative Adversarial Networks. arXiv
**2020**, arXiv:2007.13645. [Google Scholar] - Reinhardt, A. Areinhardt/Antgen. 2020. Original-Date: 2020-05-14T08:42:49Z. Available online: https://github.com/areinhardt/antgen (accessed on 18 May 2022).
- Amouroux, E.; Huraux, T.; Sempe, F.; Sabouret, N.; Haradji, Y. SMACH: Agent-Based Simulation Investigation on Human Activities and Household Electrical Consumption. In Proceedings of the Agents and Artificial Intelligence, Lisbon, Portugal, 10–12 January 2014; Communications in Computer and Information Science. Filipe, J., Fred, A., Eds.; Springer: Berlin/Heidelberg, Germany, 2014; pp. 194–210. [Google Scholar] [CrossRef]
- Holmgren, W.F.; Hansen, C.W.; Stein, J.S.; Mikofski, M.A. Review of Open Source Tools for PV Modeling. In Proceedings of the 2018 IEEE 7th World Conference on Photovoltaic Energy Conversion (WCPEC) (A Joint Conference of 45th IEEE PVSC, 28th PVSEC & 34th EU PVSEC), Waikoloa Village, HI, USA, 10–15 June 2018; pp. 2557–2560, ISSN 0160-8371. [Google Scholar] [CrossRef]
- Andrews, R.W.; Stein, J.S.; Hansen, C.; Riley, D. Introduction to the open source PV LIB for python Photovoltaic system modelling package. In Proceedings of the 2014 IEEE 40th Photovoltaic Specialist Conference (PVSC), Denver, CO, USA, 8–13 June 2014; pp. 0170–0174, ISSN 0160-8371. [Google Scholar] [CrossRef]
- Klise, K.A.; Stein, J.S. Automated performance monitoring for PV systems using pecos. In Proceedings of the 2016 IEEE 43rd Photovoltaic Specialists Conference (PVSC), Portland, OR, USA, 5–10 June 2016; pp. 3431–3435. [Google Scholar] [CrossRef]
- Donatelli, M.; Bellocchi, G.; Habyarimana, E.; Confalonieri, R.; Micale, F. An extensible model library for generating wind speed data. Comput. Electron. Agric.
**2013**, 69, 165–170. [Google Scholar] [CrossRef] - Fernandes, F.; Morais, H.; Vale, Z. Near real-time management of appliances, distributed generation and electric vehicles for demand response participation. Integr.-Comput.-Aided Eng.
**2022**, 29, 313–332. [Google Scholar] [CrossRef] - Morais, H.; Kádár, P.; Faria, P.; Vale, Z.A.; Khodr, H. Optimal scheduling of a renewable micro-grid in an isolated load area using mixed-integer linear programming. Renew. Energy
**2010**, 35, 151–156. [Google Scholar] [CrossRef] - Hart, W.E.; Watson, J.P.; Woodruff, D.L. Pyomo: Modeling and Solving Mathematical Programs in Python. Math. Program. Comput.
**2011**, 3, 219. [Google Scholar] [CrossRef]

House | People | Appliances | PPC |
---|---|---|---|

H1 | Sarah | F, TV, WM, VC, PC, CM, K, BC, CS, M, T, CP, A | 3.45 kVA |

H2 | Ann | F, TV, WM, VC, PC, CM, K, BC, CS, M, T | 3.45 kVA |

H3 | Mark, Bill | F, TV, WM, VC, PC, CM, K, BC, CS, M, T, CP, A | 5.75 kVA |

H4 | Elon, Tom, John, Toby | F, TV, WM, DM, VC, WH, PC, CM, K, BC, CS, M, T, CP, A | 10.35 kVA |

H5 | Ruth, Jeff, Steve | F, TV, WM, DM, VC, WH, DW, PC, CM, K, BC, CS, M, T, CP, A | 6.9 kVA |

Metric | Value |
---|---|

Average Power Used from Grid | 1.72 kW |

Average Power Used from PV | 1.48 kW |

Average Power Not Used from PV | 4.09 kW |

Energy Used from Grid | 41.29 kWh |

Energy Used from PV | 35.47 kWh |

Energy Not Used from PV | 98.28 kWh |

Number of Peaks | 5046 |

Self-Sufficiency (SS) | 46.21% |

Self-Consumption (SC) | 26.52% |

Day 1 | Day 2 | Day 3 | Day 4 | Day 5 | Day 6 | Day 7 | |
---|---|---|---|---|---|---|---|

House 1 (kWh) | 6.98 | 6.96 | 6.31 | 4.65 | 6.36 | 6.29 | 6.32 |

House 2 (kWh) | 6.76 | 4.49 | 5.79 | 6.51 | 6.26 | 6.84 | 6.67 |

House 3 (kWh) | 10.06 | 11.85 | 12.21 | 11.97 | 11.82 | 11.58 | 11.71 |

House 4 (kWh) | 19.82 | 20.00 | 20.65 | 17.97 | 16.67 | 20.47 | 22.26 |

House 5 (kWh) | 12.39 | 12.50 | 12.53 | 13.20 | 11.82 | 12.38 | 8.77 |

Battery Charging (kWh) | 13.85 | 5.69 | 8.42 | 9.30 | 8.94 | 4.99 | 8.42 |

Day 1 | Day 2 | Day 3 | Day 4 | Day 5 | Day 6 | Day 7 | |
---|---|---|---|---|---|---|---|

PV (kWh) | 14.71 | 11.20 | 26.60 | 17.52 | 21.16 | 5.89 | 2.33 |

Wind (kWh) | 38.31 | 29.76 | 8.13 | 14.21 | 16.31 | 39.63 | 112.39 |

Battery Discharging (kWh) | −4.93 | −4.77 | −9.19 | −9.43 | −8.5 | −5.28 | −2.19 |

Grid (kWh) | 11.90 | 14.33 | 16.50 | 14.63 | 14.00 | 11.76 | 4.45 |

**Table 5.**Battery charging, battery discharging, and state of charge for every day of the week after applying the model.

Day 1 | Day 2 | Day 3 | Day 4 | Day 5 | Day 6 | Day 7 | |
---|---|---|---|---|---|---|---|

Battery charging (kWh) | 13.85 | 5.69 | 8.42 | 9.30 | 8.94 | 4.99 | 8.42 |

Battery discharging (kWh) | −4.93 | −4.77 | −9.19 | −9.43 | −8.5 | −5.28 | −2.19 |

Average State of Charge (%) | 58.82 | 88.70 | 60.36 | 57.88 | 53.64 | 37.18 | 50.89 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Velosa, N.; Gomes, E.; Morais, H.; Pereira, L. PROCSIM: An Open-Source Simulator to Generate Energy Community Power Demand and Generation Scenarios. *Energies* **2023**, *16*, 1611.
https://doi.org/10.3390/en16041611

**AMA Style**

Velosa N, Gomes E, Morais H, Pereira L. PROCSIM: An Open-Source Simulator to Generate Energy Community Power Demand and Generation Scenarios. *Energies*. 2023; 16(4):1611.
https://doi.org/10.3390/en16041611

**Chicago/Turabian Style**

Velosa, Nuno, Eduardo Gomes, Hugo Morais, and Lucas Pereira. 2023. "PROCSIM: An Open-Source Simulator to Generate Energy Community Power Demand and Generation Scenarios" *Energies* 16, no. 4: 1611.
https://doi.org/10.3390/en16041611