Energy Management and Optimization of Renewable Energy Communities with Flexible Load Coordination and Shared Energy Utilization
Abstract:
Renewable Energy Communities (RECs) play an increasingly important role in decentralized energy systems by improving local renewable energy utilization, enhancing energy flexibility, and supporting low-carbon energy transitions. However, the integration of distributed energy resources (DERs), flexible electrical loads, and energy sharing mechanisms continues to create operational and management challenges for REC-based systems. This study investigates the energy management and optimization of a residential REC in Italy composed of photovoltaic (PV) generation, battery storage systems, and flexible air-conditioning loads. A detailed optimization framework was developed to coordinate DERs and flexible demand with the objective of maximizing shared energy utilization and related economic incentives while maintaining user comfort and avoiding additional electricity costs. The regulatory framework and operational structure of RECs in Europe and Italy were also examined to support the development of the proposed management strategy. The optimization process was conducted under different operating conditions to evaluate the influence of coordinated load management on REC performance. The results showed that the coordinated control of battery storage systems and air-conditioning units improved shared renewable energy utilization and increased the economic return associated with energy sharing. The optimized operation strategy also reduced electricity costs for users while improving the operational efficiency of the community energy system. The findings indicate that advanced energy management and load coordination strategies provide an effective approach for enhancing the performance of distributed renewable energy systems and supporting the practical implementation of REC-based energy infrastructures.1. Introduction: Background and Regulatory Framework for Energy Communities
Mitigating climate change through the reduction of greenhouse gas (GHG) emissions represents a primary objective of both national policies and the European Union strategic agenda [1]. Recent geopolitical developments and the evolving energy market have further emphasized the urgency of accelerating the clean energy transition, while strengthening Europe’s energy independence from unreliable suppliers and volatile fossil fuel sources. In 2021, a significant share of EU energy imports originated from Russia, highlighting the vulnerability of the current system. Consequently, the need for a rapid and decisive transition toward clean energy has become more critical than ever. In response, the European Commission (EC) introduced the REPowerEU plan [2], aimed at enhancing the resilience of the European energy system. This initiative focuses on reducing fossil fuel consumption across residential, industrial, and power sectors by promoting energy efficiency, increasing the share of renewable energy, accelerating electrification, and addressing infrastructure constraints. Within this framework, two key strategies emerge: (i) improving energy self-sufficiency through the exploitation of local resources, and (ii) achieving energy independence through a high penetration of renewables across all sectors [3].
In this context, three major trends are widely recognized as essential for achieving the EU’s 2030 climate and energy targets and carbon neutrality by 2050 [4]. First, the electrification of final energy uses is considered a crucial pathway toward net-zero emissions, supported by the increasing competitiveness of renewable technologies such as photovoltaic (PV) systems and wind turbines [5]. According to the International Renewable Energy Agency (IRENA), the share of electricity in final energy consumption is expected to grow significantly in the coming decades [1].
Second, the widespread deployment of distributed energy resources (DERs) is driving the transition from centralized to decentralized energy systems. Compared to traditional configurations, DERs offer several advantages, including enhanced integration of renewable energy sources (RES), reduced transmission losses, and improved local energy management, thereby promoting energy self-sufficiency for users and communities [6], [7].
Third, the role of energy consumers is evolving from passive users to active participants in the energy system. This transformation is strongly supported by the “Clean Energy for all Europeans” Package [8], which places citizens at the center of the energy transition and promotes concepts such as energy democratization and user empowerment. Within this framework, innovative models such as collective self-consumption and energy communities have been introduced.
In particular, the revised Renewable Energy Directive (RED II) 2018/2001/EU [9] defines jointly acting renewable self-consumers as groups of users located within the same building or multi-apartment structure [10], while the Electricity Market Directive (EMD II) 2019/944/EU [11] extends the concept to include groups of active consumers. These directives established the foundations for Renewable Energy Communities (RECs) and Citizen Energy Communities (CECs), fostering greater participation of citizens, small and medium-sized enterprises, and local authorities in the energy system. According to the EMD II and RED II Directives, an array of possible activities appears to be open for accordingly RECs and CECs as described in Table 1.
REC | CEC |
Roles and Responsibilities: | |
Article 2 (16) in RED II | Article 2 (11) in EMD II |
‘REC’ means a legal entity: a) which, in accordance with the applicable national law, is based on open and voluntary participation, is autonomous, and is effectively controlled by shareholders or members that are located in the proximity of the renewable energy projects that are owned and developed by that legal entity; b) the shareholders or members of which are natural persons, SMEs or local authorities, including municipalities; c) the primary purpose of which is to provide environmental, economic or social community benefits for its shareholders or members or for the local areas where it operates, rather than financial profits; | ‘CEC’ means a legal entity that: a) is based on voluntary and open participation and is effectively controlled by members or shareholders that are natural persons, local authorities, including municipalities, or small enterprises; b) has for its primary purpose to provide environmental, economic or social community benefits to its members or shareholders or to the local areas where it operates rather than to generate financial profits; and c) may engage in generation, including from renewable sources, distribution, supply, consumption, aggregation, energy storage, energy efficiency services or charging services for electric vehicles or provide other energy services to its members or shareholders; |
Article 22 | Article 16 |
Member States shall ensure that RECs are entitled to: · produce, consume, store and sell renewable energy, including through renewable power purchase agreements; · share, within the REC, renewable energy that is produced by the production units owned by that REC, subject to the other requirements laid down in this Article and to maintaining the rights and obligations of the REC members as customers; · access all suitable energy markets both directly or through aggregation in a non-discriminatory manner. | Member States may provide in the enabling regulatory framework that citizen energy communities: · are open to cross-border participation; · are entitled to own, establish, purchase or lease distribution networks and to autonomously manage them subject to conditions set (see the row below); · are subject to the exemptions, applied to the closed distribution systems related to procurement of energy for cover losses and non-frequency ancillary services, ownership of EV charging points, storage facilities etc. (see Art. 38). Member States may decide to grant citizen energy communities the right to manage distribution networks in their area of operation and establish the relevant procedures. If such a right is granted, Member States shall ensure that citizen energy communities: · are entitled to conclude an agreement on the operation of their network with the relevant distribution system operator or transmission system operator to which their network is connected; · are subject to appropriate network charges at the connection points between their network and the distribution network outside the citizen energy community and that such network charges account separately for the electricity fed into the distribution network and the electricity consumed from the distribution network outside the citizen energy community. |
The main differences between CECs and RECs are represented in Figure 1 below.

Beyond the differences, both RECs and CECs aim to promote the adoption of renewable energy at the local level, enhance energy efficiency, facilitate market participation, ensure affordable energy access, and address energy poverty [12], [13], [14], [15]. However, this work focuses specifically on RECs, which are defined as legal entities based on open and voluntary participation, controlled by local stakeholders, and primarily aimed at generating environmental, economic, and social benefits rather than maximizing profits [15].
With specific reference to the Italian context, the regulatory framework for RECs has developed progressively through a combination of experimental, transpositional, and operational measures. Their initial recognition occurred with Legislative Decree 162/2019, art. 42-bis (L. 8/2020), which introduced the concept on a pilot basis, permitting citizens, businesses, and local entities to collectively produce and share energy from renewable sources. This preliminary step was subsequently formalized and structured by Legislative Decree 199/2021, which implemented the RED II Directive, providing a comprehensive legislative framework encompassing renewable energy generation, collective self-consumption, and the legal definition and operational criteria for energy communities. The practical and technical aspects of energy sharing were clarified by ARERA Resolution 727/2022/R/eel (TIAD), which established rules on energy measurement, allocation, and tariff structures for self-consumption and collective energy schemes. Finally, Ministerial Decree 414/2023 (CER/CACER) codified incentives and procedural mechanisms for RECs, defining both financial support schemes and the modalities for energy distribution among participants. Collectively, these legislative instruments create an integrated and operationally viable framework, facilitating the development, governance, and economic sustainability of RECs in Italy.
The increasing relevance of this consumer-centered energy paradigm has stimulated significant research activity. Numerous studies and reviews [16], [17], [18], [19], [20], [21], [22], [23] have investigated the enabling conditions, technological solutions, stakeholder involvement, benefits, challenges, and business models associated with energy communities, highlighting both their potential and the barriers to their large-scale deployment.
This paper aims to provide a comprehensive analysis of evolution, regulatory frameworks, and contemporary development of RECs at both European and global levels. Furthermore, the study addresses the challenges inherent in the planning, management, and governance of RECs, underscoring the complexity of decision-making processes resulting from the integration of diverse DERs and flexible assets.
The structure of this paper is as follows. Section 2 provides a comprehensive review of the current status of RECs in Europe. Section 3 extends the analysis to their evolution and implementation at the global level. Section 4 examines the key technical considerations and barrier underlying REC deployment, while Section 5 presents a case study in Italy. Finally, Section 6 synthesizes the main findings and derives lessons for future research.
2. Status of Renewable Energy Communities in Europe
This section discusses an overview of energy communities in Europe, based on the results from the H2020 project eNeuron [24] and a screening study performed in 2021, where 76 local energy communities located in 11 different countries were analyzed as shown in Figure 2.

The following classification criteria were considered in the analysis:
• Stakeholders involved;
• Motivations for implementation;
• Energy carriers involved;
• Technologies involved;
• Implementation stage.
For the criterion of involved stakeholders, results are presented in Figure 3 that shows that “Citizens” is the largest part (25%), followed by “Municipality” (17%).

As for the motivation for establishment, the energy communities included in the review are evaluated according to nine alternative motivations, and several motivations can be indicated for each community. The results are presented in Figure 4. The main motivations for the total group are “Renewable energy” (23%) and “Economical” (22%), followed by “Environmental” (16%).

The energy carriers identified in the reviewed energy communities are presented in Figure 5 that shows that the most common energy carrier is “Electricity” (69%), followed by “Bio” (16%) and “Thermal” (12%). Figure 6 shows the energy technologies installed in the reviewed energy communities. Seven different technologies are included in the review, and the most common is solar panel–PV, identified in 47% of the reviewed case studies. Finally, Figure 7 illustrates the implementation phase of the energy communities, with most projects (64% total) already implemented or in the process of further development after implementation. A smaller portion (27%) is still in earlier stages such as research or concept development, while very few are in the initial concept stage.



3. Main Projects of Energy Communities Around the World
Energy communities are emerging also worldwide as a key model for accelerating the transition to sustainable and decentralized energy systems. Across different regions, energy community projects vary in scale, structure, and stage of development—from early research and concept phases to fully implemented systems that continue to evolve. Many of these projects focus on renewable sources such as solar, wind, and biomass, while also integrating smart technologies, energy storage, and innovative governance models. Understanding the main types and stages of these projects is essential for identifying best practices, challenges, and opportunities for wider adoption.
The overview presented in this section aims to define and categorize the main energy community projects around the world, highlighting their development stages and contributions to the global energy transition.
It must be noted that energy communities have become a central pillar in the global transition toward sustainable, decentralized, and citizen-driven energy systems. Their rapid growth is largely motivated by the urgent need to address climate change, improve energy security, and create more inclusive and resilient energy infrastructures.
One of the primary drivers behind energy communities is the commitment to achieving climate goals, particularly through the reduction of GHG emissions and the increased deployment of RES. In many regions, especially across the European Union, energy communities play a critical role in accelerating the adoption of solar, wind, and other clean technologies, often achieving significant emission reductions at the local level.
Beyond environmental benefits, energy communities contribute to energy independence and security by reducing reliance on centralized power plants and imported fossil fuels. This is particularly relevant in remote or underserved regions in Southeast Asia and Africa, where decentralized solutions can also help alleviate energy poverty. At the same time, these initiatives improve grid efficiency by minimizing transmission losses and optimizing local energy use, while also supporting flexibility through demand response programs and energy storage integration.
Technological innovation further enhances the impact of energy communities. Emerging models such as peer-to-peer (P2P) energy trading enable local energy markets, allowing prosumers to directly exchange electricity. Additionally, digitalization and smart control systems are enabling the development of smart energy systems, which are essential for the functioning of smart cities and advanced urban infrastructures. These systems rely on data-driven optimization, real-time monitoring, and automated control to balance supply and demand efficiently.
From an economic perspective, energy communities can reduce the need for large-scale infrastructure investments by promoting distributed generation and localized solutions. They also play a role in congestion management within densely populated areas by alleviating pressure on distribution networks. This is particularly important in regions with high energy demand and limited grid capacity.
Overall, energy communities represent a multifaceted approach to modern energy challenges, combining environmental, economic, technological, and social objectives. Table 2 provides a structured overview of the key motivations, their descriptions, areas of application, and representative examples from around the world, illustrating the diversity and global relevance of these initiatives.
Motivation | Description | Area of Application | Example |
|---|---|---|---|
Climate goals | Reduced GHG emissions (up to 35% ); Increasing the penetration of renewable energy sources (RES) | European Union | Germany's energy cooperatives Denmark's Samsø Island (100% renewable) |
Energy independence | Less reliance on large power plants and reduction of energy poverty | European Union, Southeast Asia, Africa | Feldheim, Germany |
Grid efficiency | Reduced transmission losses (up to 12%) | European Union | Portugal community photovoltaic (PV) |
Flexibility | Demand response and storage | European Union, Australia | Perth battery initiative |
Peer-to-peer (P2P) trading | Local energy markets | European Union, USA, India | Brooklyn Microgrid (NY) Lucknow Solar Trading pilot (India) |
Investments | Reduction of large infrastructure investments | East Africa | Off-grid communities |
Congestion management | Reducing congestion in energy distribution networks in densely populated areas | European Union | UK's Piclo Flex platform |
Smart energy system | Advanced and data-driven control models to meet the requirements of smart cities | European Union, Japan | Japan's Kashiwanoha Smart City |
Figure 8 below shows a comprehensive overview of energy communities across major global regions in 2025, highlighting their scale, capacity, energy contribution, and financial support.

First, in terms of the number of energy communities, the EU clearly dominates, with a significantly higher count than any other region. This reflects strong policy support and long-standing community energy traditions. India follows as a distant second, with several thousand initiatives, indicating rapid growth in decentralized energy systems. Canada and China show moderate numbers, each with a few hundred projects, while the United States has a relatively smaller but still notable presence. Australia, South Africa, and especially Brazil have comparatively few energy communities, suggesting that the concept is still emerging in these regions.
Looking at energy communities’ capacity (MW), the EU again leads by a wide margin, demonstrating not only a high number of projects but also substantial installed capacity. China and India also show strong capacity figures, reflecting their large-scale renewable deployments and growing interest in community-based systems. The USA and Canada maintain moderate capacity levels, while Brazil, South Africa, and Australia remain at lower levels, consistent with their smaller number of projects.
In terms of energy output (TWh), the EU and China are the top contributors, each generating large amounts of electricity through energy communities. India also contributes significantly, though at a lower level. Canada and the USA produce moderate outputs, while Brazil, South Africa, and Australia generate relatively small amounts of energy, reflecting their limited deployment.
When considering total renewable capacity (GW) at the national level (not just energy communities), China stands out as the global leader, with a massive capacity far exceeding all other regions. The EU ranks second, followed by the USA and India. Other countries, including Brazil, Canada, Australia, and South Africa, have smaller but still meaningful renewable capacity bases. This comparison shows that while some countries have large renewable sectors, this does not always translate into a high number of community-based projects.
The grid stability contribution (%) from energy communities further emphasizes the EU’s leadership, with around 20% contribution, indicating a significant role in balancing and supporting the grid. China and India also show notable contributions, while the USA and Canada have moderate impacts. In contrast, Brazil, South Africa, and Australia contribute only marginally, suggesting that energy communities are not yet a major component of grid management in these regions.
Finally, the annual funding (USD million) data reveals strong financial backing in the USA, China, and India, each receiving substantial investments in the billions of dollars range. The EU, despite its leadership in implementation, shows comparatively moderate funding levels, possibly due to more mature and self-sustaining systems. Canada and Australia receive modest funding, while Brazil and South Africa have minimal financial support, which may partly explain their slower development of energy communities.
A clear global imbalance is evident in the development of energy communities. The EU stands out as the global leader, not only in terms of the number of initiatives but also in their maturity, technological integration, and contribution to grid stability. This leadership is largely driven by strong regulatory frameworks, long-term policy support, and active citizen participation. In contrast, China and India are experiencing rapid growth, particularly in installed capacity and financial investment. While their energy communities may not yet match the EU in terms of maturity or integration, their scale and pace of expansion indicate a significant shift toward decentralized energy systems in the near future.
Meanwhile, other regions—including the United States, Canada, Brazil, South Africa, and Australia—continue to lag behind. This disparity can be attributed to a combination of factors such as limited funding, less supportive or fragmented policy environments, and the early-stage development of local energy markets. As a result, despite their potential, these regions have yet to fully harness the benefits of energy communities at scale.
4. Key Technical Aspects and Barriers for the Implementation of Renewable Energy Communities
Planning RECs entails a comprehensive evaluation of interconnected technical dimensions spanning resource assessment, system design, integration, operation, and digitalization. A fundamental step is the high-resolution characterization of local renewable energy resources (e.g., solar irradiance, wind speed distributions, hydro and biomass potential), including temporal variability and climate sensitivity, to inform optimal technology selection and sizing. This is followed by the design and optimal allocation of DERs—such as PV systems, wind turbines, combined heat and power (CHP), and heat pumps—based on multi-objective optimization that considers cost, reliability, and emissions. Energy storage systems (electrical, thermal, and hybrid) are critical for addressing intermittency, enabling peak shaving, and increasing self-consumption; their sizing and control require detailed techno-economic analysis. Advanced energy management systems (EMS), often leveraging artificial intelligence and predictive control, are essential to coordinate generation, storage, and flexible demand through demand response and load shifting strategies.
From an infrastructure perspective, RECs depend on smart grid architectures with bidirectional power flows, robust communication networks, and interoperability standards (e.g., IoT-enabled devices, smart meters, and SCADA systems), ensuring real-time monitoring and control. Power system stability and power quality (voltage regulation, frequency control, harmonic distortion) must be carefully managed, particularly in low-voltage distribution networks with high DER penetration. Grid integration studies, including load flow analysis, fault analysis, and hosting capacity assessment, are therefore indispensable. Protection coordination and islanding capability (intentional or unintentional) also represent key technical challenges, especially for enhancing resilience.
Moreover, accurate forecasting of both generation (via weather-based models) and demand (using data-driven approaches) is required to support optimal scheduling and market participation. Sector coupling—integrating electricity with heating, cooling, and mobility (e.g., electric vehicles and vehicle-to-grid systems)—adds further complexity but enhances overall system flexibility and efficiency. Digitalization tools such as digital twins, blockchain for P2P energy trading, and advanced optimization algorithms (e.g., mixed-integer linear programming, stochastic and robust optimization) are increasingly employed to improve planning and operational decision-making under uncertainty. Cybersecurity and data privacy are also emerging technical concerns due to the high level of system connectivity.
Figure 9 presents a hierarchical triangular framework that illustrates the different levels of REC planning and management, organized by time horizon and function. At the top of the triangle, the planning phase represents long-term decision-making, typically covering years or months ahead. This level focuses on strategic activities such as system design and expansion planning, which define the structure and future development of the energy system. In the middle section, the focus shifts to medium-term and short-term planning, particularly at the day-ahead level. This layer includes tasks such as day-ahead operational planning, validation of system design, and forecasting. It acts as a bridge between long-term planning and real-time operations, ensuring that strategies are effectively translated into actionable plans. At the bottom of the triangle, the assets control level deals with real-time operations. This includes activities like monitoring and data mining, which are essential for the immediate management, control, and optimization of system performance.
The figure also emphasizes the interconnected nature of these layers, indicating continuous feedback and interaction between planning, analysis, and control.

The design, the operation planning of RECs can be thus framed as a complex decision-making process, aimed at identifying the optimal system configuration in terms of technology mix, as well as the number and sizing of assets, and the DERs scheduling, while accounting for one or multiple objective functions [25], The complexity of this process stems from several interconnected factors: (1) the presence of heterogeneous DERs, including renewable generation (e.g., PV systems, wind turbines), conversion technologies (e.g., heat pumps, power-to-heat), and storage systems (electrical and thermal), which enable flexible energy production and storage; (2) the integration of multiple energy carriers—primarily electricity and heat, but increasingly also gas and hydrogen—with strong interdependencies and bidirectional energy flows; and (3) the variability and uncertainty of aggregated demand profiles from prosumers and consumers within the community, evolving under dynamic and stochastic conditions.
Additional complexity arises from the participatory and the decentralized nature of RECs, where multiple stakeholders—such as citizens, local authorities, small and medium enterprises, and distribution system operators—are actively involved in system planning and operation, often with diverging objectives [24]. In this context, optimization approaches based solely on economic criteria, such as cost minimization, are insufficient to guarantee the long-term success and sustainability of RECs. Instead, multi-criteria decision-making frameworks are required, incorporating not only economic performance but also environmental benefits (e.g., emission reductions), energy autonomy, grid support, and social acceptance. This holistic perspective is increasingly emphasized in European energy policy and regulatory frameworks, which recognize RECs as key enablers of the energy transition and local decarbonization strategies.
The implementation of RECs faces a wide range of barriers that span regulatory, technical, economic, and social dimensions, often hindering their large-scale deployment despite strong policy support. Regulatory and legal barriers are among the most significant, as the transposition of European directives into national frameworks is often incomplete or inconsistent, leading to uncertainty in governance structures, unclear definitions of community ownership, and limitations on energy sharing mechanisms [26]. In many cases, grid access rules, licensing procedures, and tariff schemes are not yet fully adapted to decentralized and collective energy models, thereby constraining REC development.
Technical barriers also play a critical role, particularly related to the integration of DERs into existing distribution networks. High penetration of renewables can lead to voltage fluctuations, congestion, and power quality issues, requiring grid reinforcement, advanced control systems, and smart metering infrastructure [27]. Additionally, the lack of standardized platforms for data exchange, interoperability issues among devices, and limited deployment of EMS can hinder efficient coordination within RECs.
Economic and financial barriers remain substantial, especially due to high upfront investment costs, limited access to financing, and uncertainty in revenue streams and payback periods [28]. The absence of well-established business models and market mechanisms for P2P trading or collective self-consumption further complicates investment decisions. Moreover, existing tariff structures and taxation policies in some countries may reduce the economic attractiveness of local energy sharing.
Social and organizational barriers are equally important, as RECs rely heavily on active participation, trust, and collaboration among members. Low public awareness, lack of technical expertise, and challenges in stakeholder coordination can slow down project development [29]. Issues related to governance, decision-making processes, and equitable distribution of benefits may also create internal conflicts within communities.
Finally, informational and digital barriers—such as limited access to high-quality data, cybersecurity concerns, and insufficient digital literacy—can restrict the effective use of advanced tools like smart platforms, blockchain, and digital twins, which are increasingly important for REC operation.
5. Optimization of Energy Management of Renewable Energy Communities to Maximize Shared Energy and Incentives for End Users: An Italian Case Study
The optimization of energy management in RECs represents a crucial step to maximize both shared energy and the economic benefits derived from incentive schemes for end users. In the Italian context—characterized by regulatory frameworks based on collective self-consumption and virtual energy sharing—the optimal operation of RECs relies on advanced EMS capable of coordinating generation, consumption, and storage over fine time resolutions.
The primary objective is to maximize the amount of shared energy within the community, defined as the minimum between local renewable generation and aggregated demand within the same time interval, since incentives are allocated based on this shared quota. To achieve this, optimization strategies often incorporate demand response and load shifting techniques, encouraging users to align their consumption with periods of high PV generation. Additionally, the integration of battery energy storage systems enables further improvements by storing excess renewable generation and releasing it during periods of low production, thereby increasing self-consumption and shared energy levels.
In the following, a case study applied to the Italian context highlights how optimized scheduling of distributed resources and flexible loads can significantly increase the virtual shared energy and, consequently, the financial returns for community members [30]. A REC under a Collective Self-Consumption (CSC) scheme was analyzed, consisting of 10 apartments in Naples, Italy, with real consumption data [30]. The community is connected to the public electricity grid and presents a rooftop PV system to supply local energy needs. The main objectives are to maximize revenues from energy sharing through incentive schemes while ensuring user comfort.
Flexible and controllable resources include Heating, Ventilation and Air Conditioning (HVAC) systems, which can be regulated within comfort constraints, and electrical battery storage, capable of storing excess PV generation and releasing energy when economically advantageous. A 15-minute resolution is adopted, suitable for monitoring consumption and PV production, calculating incentives, and optimizing battery operation. Under the CSC scheme, the incentive tariff of 0.10 €/kWh is applied to the shared energy, which is calculated by the Italian Energy Services Operator (Gestore dei Servizi Energetici, GSE) using measurements from the Distribution System Operator. Specifically, the GSE compares the hourly energy injected by the PV system with the hourly energy withdrawn by all users, generating 24 pairs of values per day. The hourly shared energy corresponds to the minimum of each pair, and the daily shared energy is obtained by summing the hourly values. Both the community members and the PV system must be located within the same portion of the distribution network under a single Primary Substation.
To coordinate these resources, a Linear Programming (LP) optimization model is formulated with the detailed model presented in the study [30]. The model determines the optimal control strategies for HVAC regulation and battery charging/discharging with a time-step of 15 minutes, with the goal of maximizing revenues from energy sharing while maintaining occupant comfort and minimizing electricity costs.
The optimization horizon is discretized into quarter-hour intervals over one day. The following index sets are adopted throughout the formulation:
• $i \in \mathcal{N}=\{1, \ldots, N\}$: set of apartments/users;
• $k \in \mathcal{K}=\{1, \ldots, 96\}$: set of 15-minute time intervals in the optimization horizon;
• $y \in \mathcal{Y}=\{0, \ldots, 23\}$: set of hourly intervals;
• $p \in \mathcal{P}$: set of PV generation scenarios;
• $l \in \mathcal{L}$: set of electrical load demand scenarios.
To model uncertainties related to PV power generation and users’ electric loads, a stochastic formulation is established through a set of scenarios [30]. Let $\pi_p$ and $\pi_l$ denote the probabilities associated with PV scenario $p$ and load scenario $l$, respectively.
The optimization determines the operating schedules of HVAC systems and BESSs for all apartments, scenarios, and time intervals to maximize expected shared-energy revenues while satisfying thermal comfort, battery operational, and economic constraints.
The decision variables of the optimization problem are:
$$ \left\{ P_{\text{ac}}^{p,l,k,i}, P_{\text{batt}}^{p,l,k,i}, P_{\text{ch}}^{p,l,k,i}, P_{\text{dch}}^{p,l,k,i}, \text{SoC}^{p,l,k,i}, T_{\text{air}}^{p,l,k,i}, \alpha_y \right\} $$
where:
• $P_{\text{ac}}^{p,l,k,i}$ is the HVAC electrical power of apartment $i$;
• $P_{\text{batt}}^{p,l,k,i}$ is the net battery power;
• $P_{\text{ch}}^{p,l,k,i}$ and $P_{\text{dch}}^{p,l,k,i}$ are battery charging and discharging powers;
• $\text{SoC}^{p,l,k,i}$ is the battery state of charge;
• $T_{\text{air}}^{p,l,k,i}$ is the indoor air temperature;
• $\alpha_y$ is the auxiliary variable used for linearization of the shared-energy revenue term.
The complete stochastic LP problem is then formulated below.
• HVAC Thermal Model
The HVAC system of each apartment is modeled through a proportional temperature controller. The thermal power delivered by the air-conditioning system is expressed as:
where, $K_p$ is the proportional gain and $T_{\text{ref}}$ is the indoor temperature setpoint.
The corresponding electrical power absorbed by the HVAC unit is:
where, $\eta_{\text{ac}}$ denotes the HVAC efficiency, assumed constant for linearity preservation.
The indoor air temperature evolution is described through a first-order Resistance-Capacitance (RC) thermal model:
where, $R_{\text{air}}$ and $C_{\text{air}}$ are the equivalent thermal resistance and capacitance of the building.
To ensure occupant comfort, indoor temperature is constrained by:
• Battery Energy Storage Model
The BESS dynamics for apartment $i$ are modeled as:
where, $\text{SoC}^{p,l,k,i}$ is the battery state of charge.
Battery net power is defined as:
subject to:
In addition, the battery end-of-day SoC is constrained to equal its initial value to avoid net daily depletion.
• Apartment Power Balance and Billing Constraint
For each apartment, the total absorbed power must not exceed the contracted meter power:
The expected daily electricity bill of apartment $i$ is:
To guarantee user participation, the optimized bill must satisfy:
• Shared Energy Revenue Model
According to the Italian shared-energy incentive mechanism, the hourly remunerated shared energy is the minimum between hourly PV generation and aggregated hourly community demand.
Thus, for each hour $y$, the shared-energy revenue is:
where, $I$ is the shared-energy incentive.
• Objective Function and Linearization
The objective function is to maximize the expected shared-energy revenues while penalizing simultaneous battery charging and discharging:
Because the $\min(\cdot)$ operator in (13) is nonlinear, an auxiliary variable $\alpha_y$ is introduced to linearize the objective:
subject to:
The resulting optimization problem is a stochastic LP, summarized in the scheme in Figure 10, and can be efficiently solved using standard LP solvers based on the dual-simplex algorithm.

Four scenarios were analyzed in the case study as shown in Figure 11, and they are listed below:
(a) Scenario 0 (baseline case): No optimal control of air conditioning and batteries.
(b) Scenario 1: Optimal control for air conditioning and no optimal control for batteries.
(c) Scenario 2: No optimal control for air conditioning and optimal control for batteries.
(d) Scenario 3: Optimal control for both air conditioning and batteries.

The main optimization results are presented in Figure 12 and Table 3.
The results indicate that the combined management of HVAC systems and batteries in Scenario 3 is the most effective strategy for maximizing the virtual shared energy. Total revenues from shared energy increase by 59.7% in Scenario 3 relative to Scenario 0 (without control strategies).
Moreover, the proposed optimal control strategies yield a substantial reduction in end user energy costs compared to the uncontrolled scenario (Scenario 0), with a reduction of up to 16.9% when HVAC systems and batteries are operated in a coordinated manner.

| Scenario | Air Conditioning Regulation | Battery Regulation | Total Revenues for Energy Sharing (€) | Total Final Energy Cost (€) |
|---|---|---|---|---|
| Scenario 0 | NO | NO | 8.88 | 31.36 |
| Scenario 1 | YES | NO | 10.22 | 30.02 |
| Scenario 2 | NO | YES | 12.59 | 27.65 |
| Scenario 3 | YES | YES | 14.18 | 26.06 |
This approach enables an EMS to efficiently manage flexible loads and storage, improving both technical and economic performance of the REC under real-world Italian incentive mechanisms. To strengthen the broader applicability of the proposed stochastic optimization framework, it is important to discuss its scalability with respect to community size, user heterogeneity, and climatic variability. The formulation is inherently modular and scenario-based, which allows straightforward extension to different REC configurations without structural modifications to the optimization model. Specifically, the index set $i \in N$ can be expanded to accommodate larger numbers of residential or prosumer units, while preserving the same linear structure of the constraints. As a result, the computational complexity increases primarily in proportion to the number of users and scenarios, but remains tractable due to the problem’s linear formulation.
Regarding REC size, larger communities generally enhance the effectiveness of shared-energy mechanisms because aggregation reduces demand variability and increases internal PV self-consumption. Consequently, the expected shared-energy revenue term in the objective function tends to increase with community size, although diminishing marginal gains may appear due to grid constraints and saturation of local demand.
In terms of user profiles, the framework is sensitive to behavioral and technical heterogeneity, particularly variations in HVAC usage patterns, thermal comfort preferences, and battery capacities. More flexible users (e.g., wider comfort bands or higher battery flexibility) enable greater load shifting and energy arbitrage opportunities, thereby improving both economic performance and renewables utilization. Conversely, highly constrained users reduce optimization flexibility and may shift the solution toward grid-dependent operation.
Finally, climatic conditions significantly influence system performance through both PV generation profiles and HVAC demand. In warmer climates with higher cooling loads, HVAC consumption becomes the dominant load, increasing the value of thermal flexibility and battery coordination. In contrast, colder climates or regions with lower solar irradiance reduce PV availability, thereby decreasing shared-energy revenues but increasing the importance of cost optimization under electricity price variability. The scenario-based stochastic structure of the model ensures adaptability to these variations by explicitly capturing uncertainty in both generation and demand.
6. Conclusions and Key Findings
RECs represent a key enabler of the ongoing energy transition by fostering decentralized, participatory, and sustainable energy systems. They promote local renewable energy generation, collective self-consumption, and active citizen involvement, contributing to decarbonization while delivering environmental, economic, and social benefits. The European legislative framework, together with national implementations such as the Italian incentive schemes and operational rules for energy sharing, provides the necessary regulatory support to facilitate the deployment and operation of RECs.
Despite this regulatory support, the planning, management, and control of RECs remain complex due to the integration of multiple DERs, flexible assets, and heterogeneous user behaviors. This complexity necessitates advanced tools and methodologies for planning and for identifying operational strategies to maximize benefits while ensuring user comfort and avoiding increased energy costs. In this context, the proposed case study based on optimized energy management approach, formulated through linear programming, demonstrates that coordinated control of flexible resources—specifically air conditioning units and battery storage systems—substantially improves REC performance. Scenario analyses indicate that this coordinated management not only maximizes shared energy but also increases revenues from energy sharing by up to 59.7% compared to uncontrolled scenarios, while reducing end user energy costs by up to 16.9%.
These findings highlight the strategic importance of integrating advanced optimization tools into REC management, both to enhance operational efficiency and to fully exploit economic incentives. By enabling more effective energy sharing and resource coordination, such strategies support the broader goals of European climate neutrality and global sustainability. Ultimately, the study demonstrates that the combination of supportive policy frameworks, innovative control strategies, and participatory community engagement is essential for unlocking the full potential of RECs in the energy transition.
Conceptualization, N.B. and M.D.S.; methodology, M.D.S.; software, M.D.S.; validation, N.B. and M.D.S.; formal analysis, M.D.S.; investigation, M.D.S.; data curation, M.D.S; writing—original draft preparation, M.D.S.; writing—review and editing, N.B. All authors have read and agreed to the published version of the manuscript.
Not applicable.
The authors declare no conflicts of interest.
