Mariem Dellaly,Sondes Skander-Mustapha,2,Ilhem Slama-Belkhodja
1. Université de Tunis El Manar,Ecole Nationale d’Ingénieurs de Tunis,LR11ES15 Laboratoire de Systèmes Electriques,1002,Tunis,Tunisie
2. Université de Carthage,Ecole Nationale d’Architecture et d’Urbanisme,Laboratoire de Systèmes Electriques,1002,Tunis,Tunisie
Abstract: This paper presents a peer-to-peer community cost optimization approach based on a single-prosumer energy management system.Its objective is to optimize energy costs for prosumers in the community by enhancing the consumption efficiency.This study was conducted along two main axes.The first axis focuses on designing a digital twin for a residential community microgrid platform.This phase involves data collection,cleaning,exploration,and interpretation.Moreover,it includes replicating the functionality of the real platform and validating the results.The second axis involves the development of a novel approach that incorporates two distinct prosumer behaviors within the same community microgrid,while maintaining the concept of peer-to-peer energy trading.Prosumers without storage utilize their individual PV systems to fulfill their energy requirements and inject excess energy into a local microgrid.Meanwhile,a single prosumer with a storage system actively engages in energy exchange to maximize the community’s profit.This is achieved by optimizing battery usage using a cost optimization solution.The proposed solution is validated using the developed digital twin.
Keywords: Energy management system (EMS);Cost optimization;Digital twin;Photovoltaic systems;Microgrid
The development of renewable energy technologies has led to new concepts,such as residential microgrids [1,2].These microgrids play a crucial role in the integration of decentralized energy sources [3,4].Another emerging concept in this decentralized environment is peer-topeer (P2P) energy trading [5,6].Several P2P market architectures have been proposed.Some approaches involve interconnecting all the prosumers to facilitate energy trading [7,8],whereas others manage prosumers through a centralized decision-making process that communicates with the utility grid.Centralized decision making is based on predefined rules [9,10].The hybrid P2P model combines elements from both approaches [11-13].Within these topologies,several configuration variants are presented.For example,in [14],shared PV generation was proposed for a community of several prosumers,with each prosumer having their own dedicated energy storage devices.In[9],the authors proposed a two-stage P2P energy-sharing topology for community microgrids in which one-way communication was implemented.The first stage aimed to minimize the energy costs of the community,while the second stage involved updating the control set-points based on real-time measurements.
Nevertheless,it is worth mentioning that the implementation of microgrids that adopt the concept of P2P energy trading presents various control challenges associated with maintaining a critical balance between supply and demand [15].In the literature,energy management systems (EMS) have been developed as the primary choice for ensuring an optimal energy exchange in a community [16,17],with a wide variety of algorithms and approaches available [18-20].For instance,in [5],optimization algorithms were classified into six groups∶ operation cost,emission and fuel cost,sizing,loss and interruption,load shedding,and revenue.In [21],the authors specifically focused on artificial intelligence(AI)-based optimization techniques.In [22],an EMS was designed for a smart building to optimize the cost of energy consumption from the utility grid power.It is used to charge batteries during off-peak hours and inject maximum power into the distribution network during peak hours.In [23],a control strategy was proposed for an isolated hybrid AC-DC microgrid to optimize the dispatch of distributed generators with the aim of minimizing the operational costs.
This study considers the concept of a digital twin to validate the proposed approach.The microgrid research landscape has undergone a rapid transformation,embracing the notion of intelligent energy management driven by digitalization.Real-world microgrid operations frequently encounter challenges that impede decision making and create system irregularities.The utilization of digital twin technology,a prominent constituent of the fourth industrial revolution,presents a promising avenue for addressing existing problems.Digital twin technology enables real-time testing and assessment through dynamic adjustments to the configuration of the microgrid and operational algorithms within a virtual environment,thereby offering an effective means to overcome operational hurdles [24].Digital twin technologies have the potential to create precise virtual replicas of power system entities [25].The digital twin approach has been adopted in various domains for purposes such as design,operation,monitoring,management,assessing the state of health,predictive maintenance,fault diagnosis,and enhancing security and resiliency [26].
The goal of this study is to develop an improved EMS for a community comprising four prosumers through P2P centralized decision making.Two objectives are to be achieved∶ first,aligning with the physical microgrid platform and second,applying cost optimization for the entire community by acting on a single prosumer.
Furthermore,the reliability of the proposed approach is validated using a digital twin framework generated within a commercial platform that is extensively developed in this study.
The remainder of this paper is organized into two parts.The first section provides a detailed explanation of the design of the digital twin framework used to implement the proposed P2P approach.The second part delves into the details of the proposed approach.The paper follows this subdivision∶ In Section 2,the microgrid platform used as a case study is described.Subsequently,a data-driven framework is developed.The P2P community EMS is then described in detail.The results and discussions are presented in the last section before the conclusions are drawn.
This study is based on a single-phase residential microgrid located at the National School of Engineering,Tunis (Fig.1).It contains four prosumers connected to each other via an AC single-phase bus and to the utility grid via the central unit.The center acts as an intermediary between the grid and prosumers,which includes photovoltaic (PV)generation,local loads,and battery-based storage.The experimental platform,known as SMARTNESS,was used to manage the energy flows in real time.The platform incorporates two types of EMS∶ a local EMS dedicated to each prosumer and a central EMS dedicated to the entire platform.Which enables the interaction and coordination between different components of the microgrid.
Fig.1 Studied microgrid platform structure
In the platform,the sign conventions for active power exchange are as follows∶ absorbed energy is represented by negative values for the grid,while positive values indicate energy consumption by the loads and charging batteries.
Table 1 summarizes the features of the microgrid platform.
Table 1 Microgrid platform features
The aim of this section is to replicate the operation of a commercial platform,as illustrated in Fig.2.
Fig.2 Microgrid platform digital twin
The digital twin model of the proposed micro-grids is a computational representation that simulates the behavior,operation,and performance of physical micro-grids in a virtual environment.It incorporates real-time data and control strategies to mimic the behavior of physical microgrids,including hardware,such as inverters,batteries,and loads.This approach serves as a tool for predictive analysis,optimization,and decision making,enabling experimentation under different critical scenarios.
In this study,the data are analyzed,and then an EMS that accurately reflects the real operation of the platform is developed.The details of this process are as follows.
The design of the proposed digital twin follows these steps (Fig.3).
Fig.3 Comprehensive study overview
• Define objectives∶ The proposed digital twin aims to replicate the real function of an existing commercial microgrid platform by incorporating predictive analysis,but excluding real-time monitoring in its initial stage.
• Data collection∶ Real-world and historical data are collected from the platform interface and grid meters,provided at 15-min intervals.
• Modeling and simulation∶ A mathematical model of the microgrid system is created using MATLAB/Simulink.The microgrid behavior is simulated under various conditions,considering PV production variations,load demand,battery state of charge,and grid fluctuations,managed by a basic energy flow algorithm.
• Data integration∶ Data integration does not occur in real time because of communication problems between the platform and MATLAB model.Instead,historical data integration is implemented.
• Calibration and validation∶ The digital twin is calibrated by comparing its predictions with those of real-world data.PV production predictions are based on historical data.The load demand (Pload) was not predicted at this stage because the tests were conducted using internally designed load profiles.The same load profile was tested on a commercial platform and incorporated into the proposed model for consistent evaluation.(The prediction of load power will be significant when the system is implemented in a real house,and a question arises regarding residential data collection.)
• Model Accuracy Validation∶ Various scenarios,including different load profiles and meteorological conditions,are used to validate the accuracy of the model.Adjustments are made to maintain a predefined error between the twin’s response and that of the real system.
• Optimization and Control Algorithms∶ An optimization algorithm is implemented to minimize costs and replace the initial EMS,mimicking the functioning of the real platform.This process aims to propose a product that can be installed in actual residential PV systems and conforms to national standards.
Tests were conducted to analyze the operation of the local EMS of SMARTNESS,with an emphasis on the exchange of active powers considering consumption,PV production,and battery state of charge (SOC).The test procedure,performed using a commercial platform for two different days,is outlined in Fig.4.
Fig.4 Tests protocol description
The objective of the first test is to observe the load variation throughout the day and analyze the impact of PV production changes on each prosumer.The test was conducted on a sunny winter day (November 22nd,2021),considering only the resistive loads.Additionally,the secondary load of each prosumer was powered by 60 W lamps.
During the test,the charges applied to all prosumers were varied over three trial periods,from 9 a.m.to 4 p.m.,with a 15-minute gap between each trial.The applied charges were as follows∶ resistive loads of 840 W and 1091 W for the first three prosumers and 1713 W for the fourth prosumer,from 9∶35 a.m.to 11∶35 a.m.From 11∶45 a.m.to 1∶45 p.m.,the first three prosumers supplied 1681 W,while the fourth prosumer had a load of 1713 W.For the final time slot,from 2 p.m.to 4 p.m.,three prosumers had loads of 1176 W,while the fourth prosumer had a load of 1213 W.
The objective of the second test is to set different power load values for each prosumer,except for the fourth.No tests were conducted on the fourth prosumer.The tests were conducted between 9 a.m.and 4 p.m.
For prosumer 1,the connected loads were varied over seven time slots throughout the test period,with a 1-h dip between 12 a.m.and 1 p.m.Prosumer 2 testing started at 10∶20 a.m.and included six variations in load power values during the test period,including a 1-h dip between 12 a.m.and 1 p.m.Prosumer 3 had a similar testing pattern,but with two dips∶ one from 11 a.m.to 12 a.m.and another from 2 p.m.to 3 p.m.
The platform data were retrieved from the manufacturer’s website (Fig.5).For the analysis,the data for one year generated by the SMARTNESS platform are considered.The selection of data for analysis prioritized days without data loss or communication problems.The results and conclusions are drawn over multiple days,encompassing diverse situations.Examples of the meter prosumer data for two weeks are shown in Fig.6.
Fig.5 Commercial platform interface
Fig.6 Meter prosumers’ data for two different weeks(Week of December 1,2021,and July 1,2022)
The highest-level rules governing the operation of the digital twin were provided by the manufacturer of the physical platform installed in our laboratory.These rules serve as foundational guidelines for the behavior of the system.Subsequently,a data-driven methodology is employed to further refine and optimize the performance of the digital twin.Real-world data collected from a physical platform connected to a microgrid are used to achieve this goal.The dataset encompasses the PV power production for the four-house installations,load power,active power delivered by each meter in every house,and battery characteristics of House 1.By applying this dataset,predictive modeling was conducted to simulate these variables within the digital twin by analyzing both historical and real-time data.This process enables the accurate prediction of future system behaviors.
The objective of this phase is to replicate the exact operation of an EMS platform,which is considered a black box.Fig.7 presents an example focusing on the storage system of “prosumer 1” and illustrates the data analysis for various operating modes.A flowchart depicting the EMS of prosumer 1 and the functioning of the central EMS derived from the data analysis is presented in Fig.8.Where PV represents prosumer 1PPV,Load indicates the energy usage,Pbatindicates the battery power,Pchmaxindicates the battery peak charging rate,Pdischmaxindicates the battery peak discharge rate,Pchfloatdenotes the battery power during float charging mode,Xrefers to the maximum discharge threshold of the battery,Ydenotes the nighttime discharge capacity of the battery,PVjindicates the central PV,Pconsumersindicates the prosumer’s power,Plimitindicates the power limit,KoRis the Key of Repartition,LoadPdenotes the consumption power,Loadbasedenotes the power consumption,PVdispindicates the available PV production,andPVsatindicates the saturated power.
Fig.7 Data analysis for different scenarios
Fig.8 Flowchart illustrating the energy management system of prosumer 1 and central EMS operations
The EMS of Prosumer 1 is summarized in two scenarios∶daytime with PV power generation and nighttime without PV power generation.In the first scenario,the procedure involves comparing PV generation with load consumption.Subsequently,the battery’s SOC is calculated and compared with the predefined limit values.
Several tests are then conducted,as depicted in the EMS.
The functioning of the central EMS is summarized as follows∶
• Limits the injection of energy from the prosumers to the central by enforcing a specific threshold.
• Restriction of energy injection from the central station to the grid.
• Generate reference power for PV systems based on the PV generation curtailment protocol adopted by country builders.
To validate the digital twin framework,simulation results are presented for two specific cases∶ a sunny day and cloudy day.Simulations were conducted using MATLAB and the analysis focused on the time interval between 7 a.m.and 5 p.m.
The response of the proposed digital twin compared to the registered data from a real platform is presented in Fig.9 and 10.In the figures,the indices 1 and 2 represent the experimental platform data and simulation results,respectively.
Fig.9 Results of a sunny day∶ From top to bottom∶Exchanged power,battery energy,and SOC (State of Charge)for Prosumer 1,Meter Energy for Prosumers 2,and 3.Indices 1 and 2 represent the experimental platform data and the simulation results,respectively
Fig.10 Results of a cloudy day∶ From top to bottom∶Exchanged power,battery energy,and SOC (State of Charge)for Prosumer 1,Meter Energy for Prosumers 2 and 3.Indices 1 and 2 represent the experimental platform data and the simulation results,respectively
In the top figures in Fig.9 and 10,the power response of Prosumer 1 is depicted,which includes the power exchange with the grid,PV generation,load,and battery.These figures demonstrate a notable difference between the two cases∶ on a sunny day,the PV production exceeds the load most of the time,whereas on a cloudy day,the load is higher.
The battery power curves reveal a minor disparity between the platform data and simulation results for both cases.This discrepancy can be attributed to potential problems with the data stored in the platform’s cloud,such as data loss or inconsistencies.A comparison of the battery SOC between the platform data and simulation results reveals an error of 2%.
The power exchanged with the grid by Prosumers 2 and 3,as shown for Cases 1 and 2,aligns closely with the experimental results.
These results confirm the reliability of the designed digital twin framework and its ability to validate the results of any investigation on this microgrid.
The idea behind the proposed EMS (Fig.11) is that two approaches are employed within the same community.Three prosumers with PV systems but no storage are expected to fulfill their energy requirements using individually generated PV power.The surplus energy from each house is injected into the local microgrid,establishing a coordinated relationship that compensates for any individual energy deficit within the community.However,a prosumer with a storage system intends to exchange energy to enhance the community’s profit.This is achieved by adopting a solution that optimizes costs by regulating battery usage.The proposed topology aims to ensure efficient consumption by optimizing the energy costs for community prosumers.
Fig.11 Energy management system applied to P2P community
The coordinator was equipped with a PV production and storage system to facilitate the objectives of the proposed solution.It is also equipped with an energy management system that manages a predefined consensus and prioritizes users with energy shortages.In the case of multiple affected prosumers,the prosumer who injected a higher amount of power into the local microgrid during the last period (for example,one day in this study;however,the duration can be adjusted based on the prosumer’s agreement) is entitled to a larger share of available power.
An EMS coordinator that corresponds to the central EMS is not within the scope of this investigation.
Billing is provided based on the sale and purchase of energy for each customer based on their individual meters.The price applied to the billing of the general microgrid meter ensures that everyone benefits from the optimization of the price initiated by Prosumer 1.
For example,in the context of national energy billing,which often employs pricing brackets (Tiered Rate Plan),effective optimization by any prosumer prevents the entire group from moving into a higher,less favorable pricing bracket.This ensures that the total energy bill for all microgrid prosumers is reduced,contributing to cost savings and the financial well-being of the entire microgrid community.
The problem is formulated as a linear programming (LP)model with the objective of minimizing the total cost of variable-priced electricity for the community over a one-day period by considering the actions of a single prosumer.
The objective of the optimization problem is to minimize the cost associated with the energy consumption while considering various constraints.LP is a mathematical technique used to optimize a linear objective function subject to linear inequality constraints.It works by iteratively exploring the feasible region (defined by the constraints) to determine a combination of variables that minimizes the objective function.This approach ensures that the solution is not only mathematically optimal but also satisfies all relevant constraints.
To formulate the community microgrid problem,the cost function associated with LP is defined in (1) and (2).
wheref(x) represents the objective function related to the total cost;xis the decision variable of the optimization problem;Mindicates the total number of discrete steps;CmeterandEmeterdenote the cost and energy of the grid,respectively;Tindicates the total number of time slots (value 24-h),Pmeter(1∶M),Pstorage(1∶M) andEstorage(1∶M) represent the power from the grid used from time steps 1 to M and power from the battery and energy stored in the battery,respectively.Nindicates the number of sources.
The power-balance constraint can be expressed at each time step in the microgrid using (3).It ensures that the energy demand requirements of the connected loads are satisfied.Nmindicates the number of meters,NPVindicates the number of PV systems,andNlindicates the number of loads.
wherePmeter(i,t),PPV(i,t),Pload(i,t),andPstorage(i,t) represent the meter power,PV production,power consumption,and battery power,respectively.
The battery capacity constraint is considered,and (4)describes the energy stored in the battery.
where ΔTsignifies the time between optimization iterations.
The battery SOC is also considered as a constraint and must be maintained within predefined bounds [SOCmin,SOCmax] to prevent overcharging or deep discharging,which can result in a reduced battery lifespan.
Grid connection constraints are considered in this solution.Specifically,the limitations of the PV system introduced by the platform manufacturer are considered in the proposed solution.
This section compares the results obtained from a real platform (Fig.12) replicated through a digital twin,with the outcomes of the proposed P2P approach adopting a costoptimized solution (Fig.13).The EMS implemented on the platform prioritizes battery usage when PV generation is insufficient to compensate for the power deficit,considering the current load.This is illustrated in Fig.12,which displays the power exchange (PV,battery,load,and grid power) of prosumer 1 over the course of a day.The battery intervenes and continues to discharge between 12∶00 a.m.and 4∶45 p.m.to ensure the load power,resulting in a continuous decrease in the state of charge,reaching 23% by the end of the day.At this point,the algorithm also results in an energy consumption cost for Prosumer 1,amounting to 4900 millimes for the day.The computation is conducted using the price profile of the Tunisian operator,as shown in the top figure.
Fig.12 Results based on digital twin of the commercial platform
Fig.13 Results of P2P approach adopting cost-optimized solution
The results of the scenario applying the proposed P2P approach using a cost-optimized solution are presented in Fig.13.In this case,the priorities were changed.
Consequently,battery discharging and charging are now conducted with the aim of increasing the benefits to the community of prosumers from an energy-billing perspective.Noticeable peaks in battery discharge coincide with price peaks in the middle and end of the day (09∶00 a.m.– 1∶15 p.m.) and (7∶00 p.m.– 11∶45 p.m.),respectively,considering SOC limits of 20% and 100%.
The disparity between the behavior of the commercial platform and the proposed solution becomes evident when comparing the figures positioned second from the top of Fig.12 and 13.The battery behavior is altered by providing the power difference (PL-PV) to align with the cost profile while ensuring that the power balance is maintained.
The proposed solution successfully achieves price optimization,resulting in a gain of approximately 3040 millimes by the end of the day,as shown in the comparison of cost billing results for both the cost-optimized solution and the commercial platform response,as shown in Fig.14.
Fig.14 Comparison of cost billing results∶ cost-optimized solution (case 2) vs.commercial platform response (case 1)
The proposed EMS was tested over four consecutive days to evaluate the evolution of the SOC of the battery and assess the effective reduction in the energy bill over an extended period.The results are shown in Fig.15.
Fig.15 Results of the system adopting the cost-optimized solution for four consecutive days
The battery was charged to full capacity once per day,corresponding to a period of low electricity prices,typically between 00∶00 a.m.– 02∶00 a.m.The initial battery charging value was set to 100% SOC,which is the reason it appears different on the first day.After four days,the energy billing statement of the subscriber reflects a net gain of approximately 5654 millimes.
The adoption of renewable energy sources driven by the P2P trading solution can enhance energy independence and reduce reliance on external energy sources.This in turn leads to economic benefits by lowering energy import costs.This study proposed an EMS based on cost optimization,specifically designed for residential communities implementing P2P energy trading.
This study was conducted using a commercial microgrid laboratory platform installed at ENIT.This study addressed two main challenges.First,the real behavior of the platform was reproduced using a digital twin framework with an error rate of less than 2%.Second,the electricity cost of the community was optimized by focusing on the EMS of a single prosumer.
The simulation results of the proposed community P2P EMS demonstrate an overall gain for the community.Electricity purchase billing decreased from 4900 millimes per day to a profit of 3040 millimes per day through the sale of excess electricity while incorporating PV curtailment.
As part of future work,an enhanced EMS will be developed for community coordinators,which will involve establishing communication with both EMS systems.Furthermore,we plan to extend our research by conducting a comprehensive comparative analysis of our optimization algorithm with genetic algorithms to provide a comprehensive understanding of its performance under various scenarios.
The presented work highlights the limitation that data are not transferred in real time between the real system and digital twin.This problem can be resolved in the future by accommodating an adequate communication protocol between both entities to enable data exchange between the sensors and digital twin.
Acknowledgments
This work was supported by the Tunisian Ministry of Higher Education and Scientific Research under Grant LSE-ENIT-LR 11ES15,and funded in part by the PAQCollabora (PAR &I-Tk) program.
Declaration of Competing Interest
The authors have no conflicts of interest to declare.
Global Energy Interconnection2024年1期