Next Article in Journal
A New Methodology for Estimating the Potential for Photovoltaic Electricity Generation on Urban Building Rooftops for Self-Consumption Applications
Previous Article in Journal
Power Grid Renovation: A Comprehensive Review of Technical Challenges and Innovations for Medium Voltage Cable Replacement
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Integrated Energy Management in Small-Scale Smart Grids Considering the Emergency Load Conditions: A Combined Battery Energy Storage, Solar PV, and Power-to-Hydrogen System

1
Department of Electrical and Electronics Engineering, Shiraz University of Technology, Shiraz 7155713876, Iran
2
Facultad de Ingeniería, Arquitectura y Diseño, Universidad San Sebastián, Bellavista 7, Santiago 8420524, Chile
3
Department of Management and Innovation Systems, University of Salerno, Via Giovanni Paolo II, 132, 84084 Fisciano, Italy
4
Department of Electrical and Electronic Engineering Science, University of Johannesburg, Johannesburg 2006, South Africa
*
Authors to whom correspondence should be addressed.
Smart Cities 2024, 7(6), 3764-3797; https://doi.org/10.3390/smartcities7060145
Submission received: 21 September 2024 / Revised: 20 November 2024 / Accepted: 26 November 2024 / Published: 3 December 2024

Abstract

:

Highlights

 
What are the main findings?
  • Proposed a comprehensive modeling layout for the optimal management of power and heat in the distribution system, taking into account load emergencies such as overload and load shedding.
  • Incorporated different energy sources, such as renewables, batteries, power to hydrogen, CHP sources, and heat storage tanks, as well as demand response programs for both electrical and thermal loads.
What is the implication of the main finding?
  • The proposed approach aims to effectively balance the energy supply and demand in the network, especially during emergency situations, to certify the system’s reliability and stability.
  • Provided a cost-effective and environmentally friendly solution for managing the distribution network, while also improving its resilience and reducing the risk of energy supply disruptions.

Abstract

This study introduces an advanced Mixed-Integer Linear Programming model tailored for comprehensive electrical and thermal energy management in small-scale smart grids, addressing emergency load shedding and overload situations. The model integrates combined heat and power sources, capable of simultaneous electricity and heat generation, alongside a mobile photovoltaic battery storage system, a wind resource, a thermal storage tank, and demand response programs (DRPs) for both electrical and thermal demands. Power-to-hydrogen systems are also incorporated to efficiently convert electrical energy into heat, enhancing network synergies. Utilizing the robust Gurobi solver, the model aims to minimize operating, fuel, and maintenance costs while mitigating environmental impact. Simulation results under various scenarios demonstrate the model’s superior performance. Compared to conventional evolutionary methods like particle swarm optimization, non-dominated sorting genetic algorithm III, and biogeography-based optimization, the proposed model exhibits remarkable improvements, outperforming them by 11.4%, 5.6%, and 11.6%, respectively. This study emphasizes the advantages of employing DRP and heat tank equations to balance electrical and thermal energy relationships, reduce heat losses, and enable the integration of larger photovoltaic systems to meet thermal constraints, thus broadening the problem’s feasible solution space.

1. Introduction

In recent years, the need for efficient energy management systems in smart grids (SGs) has become increasingly important, particularly as renewable energy resources (RERs) such as solar and wind power are integrated into energy networks. These RERs, while environmentally friendly, pose challenges due to their intermittent nature, which can affect the stability and reliability of the energy grid. Traditional energy systems, which rely heavily on fossil fuels, are also facing growing pressure to reduce emissions and increase energy efficiency in light of global climate change concerns.
In this context, the optimization of energy systems, particularly under emergency load conditions, is critical. These emergencies can arise due to unexpected peaks in demand, equipment failures, or other disruptions that threaten the balance between energy supply and demand. Without effective management, such emergencies can lead to overloads, load shedding, or even blackouts, which compromise the reliability and resilience of the grid.
Energy management in smart power grids is a crucial topic in electrical engineering, particularly with the increasing use of RERs, batteries, and combined heat and power (CHP) systems. Effective management is necessary for ensuring stability and efficiency, involving the integration of various technologies such as photovoltaic (PV) panels, wind turbine, batteries, and power-to-hydrogen (P2H) systems [1,2,3]. Key challenges include the variability of renewable energy (RE), the need for advanced forecasting, optimization algorithms, demand response programs (DRPs), and robust cybersecurity measures. Addressing these challenges is essential for developing resilient and sustainable SGs [4,5].

1.1. Literature

Various methods to optimize economic power and heat distribution include genetic algorithms for cost and pollution reduction [5], optimal layouts using electric boilers to cut costs and wind power [6], hybrid particle swarm and bat algorithms for economic and environmental gains [7], combined PSO and bat algorithms for managing thermal plants [8], a two-level model for load uncertainty [9], and steam extraction from Rankine cycles for better off-peak energy management [10]. These approaches address economic load distribution amid uncertainties. Recent studies propose diverse strategies for optimizing energy management in microgrids and distribution networks. Ref. [11] developed a dynamic load distribution method accounting for wind power and load uncertainties. Ref. [12] introduced a stochastic model for combined heat and hydro-PV systems to enhance efficiency and reduce costs. Ref. [13] optimized microgrid distribution with electric, thermal, and gas sources while considering consumer satisfaction. Ref. [14] proposed a robust two-stage model for microgrids, factoring in RE and load uncertainties. Ref. [15] created a robust model for managing microgrid heating, cooling, and power systems to reduce risk and boost economic benefits. Ref. [16] suggested a production planning approach addressing uncertainties in loads, renewables, and electric vehicles (EVs). Ref. [17] outlined a coordinated plan for microgrids to manage uncertainties in electricity demand, water temperature, and solar radiation. Ref. [18] explored how integrated energy systems affect unit participation to cut supply costs. Ref. [19] proposed a scheduling framework for thermal and electrical resources in smart homes under uncertainty. Ref. [20] developed a stochastic solar thermal model for water demand and supply using point estimation. These strategies aim to improve efficiency, cost-effectiveness, and reliability in energy management. Ref. [21] evaluates energy management strategies for microgrids considering both thermal and electrical aspects through dynamic simulation. Ref. [22] presents a bi-level scheme using mixed-integer cone programming for optimal load and energy operation in distribution and transmission networks, including energy storage systems (ESSs) and demand-side management. Ref. [23] proposes an energy management algorithm for DC nanogrids with ESSs. Ref. [24] introduces a model for energy distribution in thermoelectric systems using a coordinated Stackelberg game and robust optimization. Ref. [25] explores the feasibility of CHP systems to meet household energy needs. Ref. [26] suggests a cost-effective stochastic optimization approach for integrating distributed energy resources, including vehicle-to-grid (V2G) and CHP technologies. Ref. [27] proposes a multi-objective energy hub planning approach considering economic, heat, and power aspects, along with renewables, EVs, and hydrogen storage. Ref. [28] offers a bi-level model for optimizing electricity and gas transmission grids with ESSs and renewables. Ref. [29] presents an energy optimization strategy incorporating cluster loss and energy sharing models in microgrids. Ref. [30] proposes a randomized and distributed approach for optimal energy management in buildings, focusing on scheduling HVAC systems and EV charging. A new method uses adversarial networks and variable encoder automatic generators for generating energy consumption data in smart homes [31]. A review covers the interactions between cyber, physical, and social layers in distribution networks and future research challenges [32]. Optimal placement of ESSs and RERs in smart cities is addressed [33]. A grey wolf optimizer is used for optimal EV dispatch in a V2G scheme [34]. A microgrid power recovery scheme utilizes IoT, blockchain, and optimization for peer-to-peer (P2P) trading [35]. A scheduling model is proposed to reduce reliance on traditional fuels and enhance green energy integration [36]. Energy management architectures and distributed optimization algorithms are reviewed [37]. In [38], the article focuses on the optimal planning of electrical appliances in smart homes using cloud services. It highlights how advanced scheduling techniques can reduce energy consumption and peak loads while maintaining user comfort in smart city environments. In [39], an efficient microgrid management strategy is proposed using the Meerkat Optimization Algorithm, focusing on optimizing ESSs, RER integration, hydrogen storage, demand response (DR), and EV charging, resulting in enhanced system stability and performance. In [40], the article examines the significance of “living laboratories” in accelerating the decarbonization of energy systems. It discusses how these experimental environments facilitate innovation, collaboration, and real-world testing of sustainable energy solutions, contributing to more effective climate action strategies. In [41], the article presents a planned scheduling strategy for economic power sharing in a CHP-based microgrid. The study focuses on optimizing resource allocation to reduce operational costs and improve the efficiency of power distribution within the microgrid system. In [42], the article explores the use of blockchain technology for secure and decentralized energy management in multi-energy systems. It highlights the application of state machine replication to enhance system security and efficiency, ensuring reliable energy transactions and coordination among diverse energy resources. In [43], the article proposes a blockchain smart contract reference framework and program logic architecture for transactive energy systems. It discusses how this framework can facilitate automated energy transactions, enhance system transparency, and improve coordination among various stakeholders in the energy market. In [44], the article presents a framework for designing and evaluating realistic blockchain-based local energy markets. It focuses on creating decentralized energy trading platforms that improve market efficiency, transparency, and security in local energy systems. In [45], the article discusses the design and management of a distributed hybrid energy system using smart contracts and blockchain technology. It emphasizes the benefits of decentralized control and secure energy transactions to optimize resource allocation and system performance. In [46], the article explores a blockchain-based decentralized energy management system within a P2P trading framework. It highlights the advantages of utilizing blockchain for secure and transparent energy transactions, facilitating direct exchanges between energy producers and consumers. A smart home energy management system using cloud services for improved scheduling and data processing is suggested [38]. In [39], a two-level method for the optimization of SGs and in [40] the role of “living laboratories” in accelerating the decarbonization of the energy system are presented.

1.2. Motivation

Energy management in SGs is crucial as the integration of RERs, such as solar and wind power, increases. Although these resources are environmentally beneficial, their intermittent nature challenges grid stability, making efficient energy management systems essential. Existing grids often face disruptions from unexpected demand spikes, equipment failures, or energy source variability, which can lead to overloads, load shedding, or even blackouts. Addressing these issues is vital to maintaining both resilience and reliability in energy systems, especially during emergencies.
Table 1 clearly demonstrates that while previous research has made significant strides in optimizing energy systems, none offer the same comprehensive, multi-source approach with emergency load management (ELM), DR integration, and the combination of thermal and electrical energy management. This study fills a critical gap by addressing these elements cohesively, providing a robust solution for small-scale SGs under challenging conditions such as load shedding and overload scenarios.
This paper introduces a unique approach to energy management by developing a comprehensive Mixed-Integer Linear Programming (MILP) model that integrates various energy sources—ESSs, CHP, P2H systems, and DRPs for both electrical and thermal loads. Unlike traditional models that may only optimize under normal conditions, this study’s framework is specifically designed to handle load emergencies, such as overload and load shedding. This capability enables the SG to balance supply and demand dynamically, even under extreme scenarios.
Previous studies have proposed diverse optimization techniques for energy distribution, often focusing on economic and environmental objectives. However, many fail to address the critical need for multi-source integration and emergency load handling within a unified framework. While some research emphasizes the role of RERs, ESSs, or DR, it rarely considers the simultaneous management of these elements under emergency conditions. Thus, a significant gap exists in handling real-time load emergencies through a combined approach that accounts for both thermal and electrical demands.
This study aims to address these issues by proposing an advanced MILP optimization model. The primary objective of this model is to enhance energy management in small-scale SGs by integrating multiple energy sources, including RERs, ESSs, P2H systems, and CHP sources. The model also incorporates DRPs for both electrical and thermal loads, which are essential for balancing supply and demand during emergencies, and also offering substantial contributions to energy resilience and sustainability.
Through this integrated approach, the proposed model not only minimizes operational costs but also reduces environmental impact by optimizing the use of RERs and storage systems. The MILP framework ensures global optimal solutions, addressing the shortcomings of traditional non-linear approaches that struggle with the complexity of multi-objective optimization in energy systems.

1.3. Main Contribution

The key contributions are presented in the following:
Comprehensive Multi-Source Integration: The model combines RERs (solar and wind), ESSs, CHP units, and P2H systems within a unified optimization framework, addressing both electrical and thermal energy demands. This integration strengthens the resilience and adaptability of small-scale SGs, ensuring reliable energy management across variable conditions.
Emergency Load Management: This study uniquely addresses emergency load conditions, such as load shedding and overload. Unlike traditional approaches that focus on standard operations, this model dynamically balances supply and demand during emergencies, improving grid stability and reducing the impact of sudden demand surges or supply disruptions.
Enhanced Flexibility through P2H Systems: Incorporating P2H systems allows excess electrical energy to be converted to hydrogen, expanding the feasible solution space for thermal and electrical loads. This flexibility benefits both resilience and sustainability by utilizing excess RE for thermal needs, reducing waste, and supporting a cleaner energy mix.
Dual DRPs: The model advances DRPs by applying them to both electrical and thermal loads. This dual approach maximizes demand-side flexibility, reducing the need for load shedding in high-demand situations and minimizing the dependency on emergency interventions, thus enhancing cost-effectiveness and operational efficiency.
Improved Computational Efficiency and Solution Optimality: Employing the Gurobi solver enables the model to achieve global optimality, surpassing traditional non-linear methods in efficiency and solution quality. In comparative tests, the model consistently outperformed algorithms like BBO, PSO, and NSGA-III, achieving better cost savings, emission reductions, and ELM.
Simulation of Practical Scenarios: This study examines three practical scenarios—normal operation, load shedding, and overload—demonstrating the model’s applicability to real-world conditions. By simulating diverse operational environments, the model proves highly adaptable and relevant to real-world SG applications.
In summary, this study contributes a flexible, resilient, and sustainable solution for SG energy management by developing an advanced optimization model that manages both thermal and electrical demands under emergency conditions and minimizes the need for load shedding through dynamic DRPs. These advancements underscore the model’s potential to support SG development, delivering broad benefits in terms of energy security and environmental impact.

1.4. Paper Structure

The other parts of the paper are as follows: In Section 2, modeling and mathematical relations are discussed. The simulation results and their analysis are presented in the third section and the conclusions are made in the fourth section.

2. Proposed Energy Management Model

The scope of this study focuses on optimizing energy management within small-scale SGs, particularly under emergency conditions such as overload and load shedding. The primary objectives are to enhance energy resilience, minimize operational costs, and reduce environmental impact through an integrated model that incorporates RERs, ESSs, P2H systems, and CHP units. This model also includes DRPs for both electrical and thermal loads, aiming to balance supply and demand effectively, especially in emergencies.
The intended impact of this research is to provide a reliable, cost-effective framework for energy distribution in small-scale SGs, with the capability to handle unpredictable demand surges during emergencies. However, limitations exist in the model’s application, as it is tailored to small-scale grids; scalability to larger networks may require additional modifications to accommodate increased complexity.
In this section, the suggested optimization scheme, which includes energy management in SGs with respect to battery and PV systems, along with heat and electrical DR management, taking into account the worst cases, is also presented [19,20,21,40]. The suggested scheme is a MILP model, which is modeled as Equations (1) to (66).
The MILP model developed in this study optimizes energy management in small-scale SGs, enabling effective coordination among diverse energy sources and components to handle both routine and emergency load conditions. By leveraging the MILP approach, the model ensures globally optimal solutions, addressing the complexity of multi-source, multi-objective optimization for SGs.
The model operates under several assumptions. Linear relationships are assumed for energy generation, storage, and consumption to simplify non-linear dynamics, facilitating MILP optimization. Fixed system parameters are also used, with capacities of energy sources like CHP, P2H, battery, and thermal storage remaining constant throughout simulations. Additionally, DRPs are designed with a 10% flexibility in electrical and thermal loads, allowing adjustments under emergency situations without affecting critical demands. The model is tested across three distinct scenarios: normal operation, load shedding, and overload conditions, each with specific assumptions for load adjustments and emergency handling.
The primary objective function of the model seeks to minimize operational costs, fuel costs, and emissions. By managing the costs associated with each energy source and optimizing load adjustments, the model aims to enhance both economic and environmental performance. The objective function can be represented as minimizing the total of fuel costs, emission costs, and maintenance costs.
To achieve its goals, the model incorporates several constraints. Energy balance constraints ensure that at each time step, the total energy generated from all sources meets both electrical and thermal loads. In scenarios with emergency load conditions, specific constraints govern the maximum-allowable load shedding and overload capacities. Storage constraints maintain battery and thermal storage levels within defined limits, controlling charging and discharging rates to ensure availability during emergencies. The DRP constraints provide flexibility by adjusting loads within predefined limits, which is essential for an effective response to emergency load demands.
The model also imposes constraints on CHP and P2H systems. CHP units are constrained by minimum and maximum production limits and ramp rates, enabling a responsive and steady output without overloading the system. For P2H systems, constraints limit excess electrical energy conversion to hydrogen, which ensures safe and efficient operation. RERs, particularly PV and wind, are naturally limited by availability; for instance, PV generation is restricted to daylight hours, contributing to direct grid support or storage during excess generation.
Each component of the model has a defined role in enhancing overall energy management. DRPs contribute by allowing the adjustment of electrical and thermal loads, reducing peak load stresses, and minimizing load shedding during emergencies, thus enhancing grid resilience. CHP systems provide both electricity and heat, fulfilling dual demands and optimizing production to maintain balance. P2H systems increase flexibility by converting excess electricity to hydrogen for later use in thermal applications, managing renewable fluctuations and aiding in meeting thermal constraints. Battery and thermal storage systems stabilize the grid by storing excess energy during low demand and dispatching it when needed, while RERs, primarily PV and wind, directly contribute to the grid or ESS, reducing reliance on non-RERs.
The model follows a structured process that begins with data input, where hourly data for electrical and thermal loads, renewable profiles, and storage parameters are specified. The MILP optimization routine then uses the Gurobi solver to process objective functions and constraints, yielding an optimal configuration of energy sources and storage to meet demand cost-effectively. Simulations are run across normal, load shedding, and overload scenarios, testing grid performance under various load and supply conditions to validate system resilience.
In summary, the MILP model introduced here distinguishes itself through its integration of CHP, P2H, DRP, and renewable storage to manage both electrical and thermal energy in a holistic way. By including ELM, this model provides a robust, flexible, and cost-effective solution for small-scale SGs. It not only meets immediate energy needs under varying conditions but also minimizes environmental impact, representing a significant advancement over conventional models that lack capabilities for handling emergency situations.
Equation (1) presents the two-objective function of the problem, which aims to reduce fuel costs as well as environmental pollution. Here, F i t represents the fuel cost objective function and E i t represents the emission cost objective function. Equation (2) shows the model of fuel cost function, Equation (3) also shows the model of pollution function. Here, a i , b i , and c i represent the constant coefficient of CHP fuel cost and α i , β i , and δ i represent the constant coefficient of emission cost. The power of CHP resources is indicated by G i t , C H P . Binary variables s i t and u i t , respectively, indicate the state of startup and shutdown of the CHP units, whose costs are indicated by s u i   and s d i .
m i n     Z = i n , t T F i t + E i t         i , t
where F i t and E i t are as below:
F i t = a i s i t + b i G i t , C H P + c i G i t , C H P + s i t s u i + u i t s d i       i n ,       t T   ,       s i t ,   u i t 0,1
E i t = α i s i t + β i G i t , C H P + δ i G i t , C H P     i n ,         t T       ( e m i s s i o n   c o s t )
Equation (4) equals the electrical DRP, i.e., the entire loads changed with DRP must be equal to the total available electrical load (initial state) minus the total load to be removed and plus the total load to be added to the network. Obviously, without emergencies, the total amount of load shedding will be zero, and if the network is not overloading, the total amount of overload will be zero. Similarly, by adding/removing the total load, the scenarios can be changed. Here, D t , e l e c and D R t , e l e c , respectively, represent the initial electric load of the network and the varied electric load in the DRP. In addition, Ω t , e l e c and Υ t , e l e c demonstrate emergency electric load shedding and overload, respectively.
s . t .                     t T D R t , e l e c = t T D t , e l e c t T Ω t , e l e c + t T Υ t , e l e c       t
Equation (5) is the same as Equation (4) for the thermal load (heat output from the CHP). Here, D t , h e a t and D R t , h e a t , respectively, represent the initial heat load of the network and the varied heat load in the DRP. Additionally, Ω t , h e a t and Υ t , h e a t demonstrate emergency heat load shedding and overload, respectively. Equation (6) is equal to the hourly heat power balance between the heat generated by the total CHPs plus the heat stored in the heat tank minus the heat output from the heat tank equal to the heat load in the DR at time t. Here, H i t is equal to the heat produced from CHP, h i t , d i s and h i t , c h a are equal to the heat injected and absorbed from the thermal tank storage, and H t , i P 2 H , D is equal to the heat generated from the P2H sources.
t T D R t , h e a t = t T D t , h e a t t T Ω t , h e a t + t T Υ t , h e a t       t
i n , t T H i t + h i t , d i s h i t , c h a + H t , i P 2 H , D = D R t , h e a t         i , t
Equation (7) equals the hourly electrical power balance between the power generated by the total CHPs plus the discharge from the battery plus the new power of the PV source equal to the modified electric charge of the DRP at time t. Here, B i t , d i s is the discharge power of the battery, G i t , P V n defines the PV power from the PV-battery system, and P t , i P 2 H represents the P2H power received from the network. G i t , w d   shows the wind power per hour.
i n , t T G i t , C H P + B i t , d i s + G i t , P V n + G i t , w d P t , i P 2 H = D R t , e l e c         i , t
Equation (8) shows the combined PV-battery system, where the new output power of the PV at time t equals to the initial power of the PV minus the battery charge at time t . G i t , P V equals the actual power of PV and B i t , c h a indicates the battery charge.
G i t , P V n = G i t , P V B i t , c h a         i n ,         t T
Equation (9) represents the percentage of flexible thermal load ( φ t , h e a t ) at time t, which is equal to the percentage ( η R h e a t ) considered to be multiplied by the load at moment t.
φ t , h e a t = η R h e a t D t , h e a t           t T
Equations (10) and (11) cause the new heat load of the DR to be less than or greater than the original heat load through the amount considered at time t . Here, d h t represents the binary variable to control the hours of heat load changes.
D R t , h e a t D t , h e a t φ t , h e a t d h t           t T
D R t , h e a t D t , h e a t + φ t , h e a t d h t           t T
Equation (12) is considered as Equation (9) for electric load change, and Equations (13) and (14) are considered as Equations (10) and (11) for electric load and changes in electrical DR at time t. Here, d e t represents the binary variable to control the hours of electric load changes. φ t , e l e c is changed by the amount of electric charge and η R e l e c is considered as a percentage.
φ t , e l e c = η R e l e c D t , e l e c           t T
D R t , e l e c D t , e l e c φ t , e l e c d e t           t T
D R t , e l e c D t , e l e c + φ t , e l e c d e t             t T
Equation (15) indicates the minimum battery charge at time t , Equation (16) indicates the maximum battery charge at time t , and since the intended system is PV-battery, only this equation guarantees that the maximum battery charge is equal to the maximum amount of PV in the system at time t. In addition, there are some cases where the PV capacity is very high at time t, so the battery charge due to the type of battery does not allow for recharging at time t (and vice versa); therefore, Equation (17) ensures that the maximum battery charge at time t of the value does not exceed its capacity at time t. Here, s b i t and u b i t are equal to the binary variable of charging and discharging the battery, respectively. The maximum charging and discharging power of the battery are indicated by B i t , c h a ¯ and  B i t , d i s ¯ , and the minimum charging and discharging heat power of the thermal storage are indicated through h i t , c h a ¯ and h i t , d i s ¯ .
B i t , c h a 0 s b i t           i n ,         t T
B i t , c h a G i t , P V s b i t             i n ,         t T
B i t , c h a B i t , c h a ¯ s b i t           i n ,         t T
Equation (18) indicates the minimum amount of battery discharge at time t , and Equation (19) equals the maximum battery discharge power at time t.
B i t , d i s 0 u b i t             i n ,         t T
B i t , d i s B i t , d i s ¯ u b i t             i n ,         t T
Equation (20) indicates the efficiency or, in other words, battery losses, where the total discharge of the entire battery at all hours is equal to the total charging capacity of the battery. Battery efficiency is indicated by η b a t t o t a l .
i n , t T B i t , d i s = i n , t T B i t , c h a η b a t t o t a l           i , t
Equation (21) equals the binary constraint of the battery, where the sum of charge and discharge at time t must be less than or equal to 1, because it is possible to control the number of the battery’s charge and discharge.
s b i t + u b i t 1           i n ,         t T ,           s b , u b 0,1
Equations (22) and (23) restrict the production of minimum and maximum capacity of CHP resources. The minimum and maximum generated electric power by CHP units are indicated by G i C H P _ and G i C H P ¯ .
G i t , C H P G i C H P _ s i t               i n ,           t T
G i t , C H P G i C H P ¯ s i t             i n ,             t T
Equation (24) also shows the clear binary constraint and blackout of CHP resources.
s i t + u i t = 1               i n ,         t T ,           s , u 0,1
Equation (25) indicates the minimum charge of the heat tank and Equation (26) indicates the maximum charge of the heat tank at time t, which can be equal to the total heat generated at time t from all CHP sources, so that the heat storage tank can receive heat from all CHP sources. Equation (27) also ensures that the maximum heat output it receives from the CHP does not exceed the intended capacity of the tank itself. Here, s h i t and u h i t indicate the state of charging and discharging heat from the thermal tank, respectively.
h i t , c h a 0 s h i t             i n ,           t T
h i t , c h a i n , t T H i t               i n ,           t T
h i t , c h a h i t , c h a ¯ s h i t               i n ,             t T
Equation (28) shows the minimum heat output or discharge of the heat tank at time t .
h i t , d i s 0 u h i t               i n ,           t T
Equation (29) shows the maximum heat discharge power from the heat tank.
h i t , d i s h i t , d i s ¯ u h i t               i n ,             t T
Equation (30) shows the equilibrium between the discharge of the heat tank and its charge, which must be equal to the total heat discharge of the tank equal to the total charge of the tank in its efficiency (taking into account heat storage losses). Thermal storage efficiency is indicated by η h e a t t o t a l .
i n , t T h i t , d i s = i n , t T h i t , c h a η h e a t t o t a l             i , t
Equation (31) is equal to the binary constraint of the charge and discharge of the heat tank, and since it is smaller than one, it is possible to control the total charge and discharge hours of the heat tank.
s h i t + u h i t 1             i n ,         t T ,         s h , u h 0,1
Equation (32) is equal to the electrical discharge emergency, which shows the total considered electrical discharge. Electrical load shedding and electrical overload are indicated by Ω t , e l e c and Υ t , e l e c , respectively, and thermal load shedding and thermal overload are indicated by Ω t , h e a t and Υ t , h e a t . The total electrical and thermal load shedding capacity is indicated by Π e l e c and Π h e a t .
t T Ω t , e l e c = Π e l e c           t
Equation (33) indicates the load shedding of the allowable hourly electrical charge from the network, that should be considered between the minimum and maximum value. The binary variable of electrical emergency load shedding and overload is indicated by e s t and e o t .
0 Ω t , e l e c Ω m a x e l e c e s t           t T
Equation (34) shows the total heat shedding considered; Equation (35) also shows the elimination of the minimum and maximum allowable heat load at time t. The binary variable of thermal emergency load shedding and overload is indicated by h s t and h o t .
t T Ω t , h e a t = Π h e a t         t
0 Ω t , h e a t Ω m a x h e a t h s t             t T
Equation (36) is equal to the electrical overload emergency, which shows the total considered overload. The total electrical and thermal overload capacity is indicated by Γ e l e c and Γ h e a t .
t T Υ t , e l e c = Γ e l e c           t
Equation (37) indicates the allowable hourly electrical overload of the system that should be considered between the minimum and maximum value.
0 Υ t , e l e c Υ m a x e l e c e o t             t T
Equation (38) shows the sum of the considered thermal overload and Equation (39) indicates the minimum and maximum allowable thermal overload at time t. The binary variable of thermal emergency load shedding and overload is indicated by h s t and h o t .
t T Υ t , h e a t = Γ h e a t         t
0 Υ t , h e a t Υ m a x h e a t h o t             t T
Equation (40) indicates the binary variable constraint of electric charge load shedding and overload; Equation (41) indicates the binary variable constraint of thermal load shedding and overload at time t.
e s t + e o t 1             t T ,           e s , e o 0,1
h s t + h o t 1             t T ,             h s , h o 0,1
Equation (42) shows the maximum allowable upward slope (power increase) of the CHP unit, which should be equal to or lower than the allowable value in the next hour. The minimum and maximum power of the CHP ramp rate are indicated by Δ i d o w n and Δ i u p .
G i t . C H P G i t 1 . C H P Δ i u p           i n ,           t T
Equation (43) shows the maximum allowable downward slope (power reduction) of the CHP unit, whose difference in the next hour must be greater than or equal to the negative amount of the allowable value.
G i t . C H P G i t 1 . C H P Δ i d o w n             i n ,           t T
Equations (44) and (45) indicate the minimum number of hours the CHP units are allowed to be on ( Λ i u p ) or off ( Λ i d o w n ).
i n , t T s i t Λ i u p           i , t
i n , t T u i t Λ i d o w n         i , t
Equation (46) shows the maximum number of charge ( Θ i m a x , c h a ) and discharge times ( Θ i m a x , d i s ) of the battery, which makes it possible to control the number of charges and discharges separately; Equation (47) is also similar to Equation (46) for the maximum number of charge ( Φ i m a x , c h a ) and discharge times ( Φ i m a x , d i s ) of the thermal tank storage.
i n , t T s b i t Θ i m a x , c h a ,               i n , t T u b i t Θ i m a x , d i s           i , t
i n , t T s h i t Φ i m a x , c h a ,             i n , t T u h i t Φ i m a x , d i s             i , t
Equation (48) states that the binary variable corresponding to the DR at the time when the load is sensitive is unchanged or the binary variable is zero; this relationship ensures that the hours that should not occur in the load response program due to the sensitive loads considered.
d e Ξ i = 0 , d h Ξ i = 0               Ξ , Ξ T ,             i N ,               d e , d h 0,1
Equation (49) defines the energy level ( λ i t , b a t ) of the battery at time   t that should be between the minimum and maximum ESS capacity ( ϑ i b a t ).
0 λ i t + 1 , b a t = λ i t , b a t + B i t + 1 , c h a B i t + 1 , d i s ϑ i b a t ,               i n ,           t T
Equation (50) is a definition for considering the initial energy in a battery, which can be considered in the first hour if the battery initially ( ε i b a t ) has an initial energy.
λ i t , b a t = ε i b a t + B i t , c h a B i t , d i s             i n ,             t = 1
Equation (51) is intended to increase battery life in practice; this relationship ensures that the energy of the battery is not completely depleted, so that the battery is damaged.
λ i t , b a t B i t , d i s 0                 i n ,             t T
Equation (52) defines the energy level ( λ i t , t a n k ) of the heat tank at time t that is between the minimum and maximum volume of heat storage ( ϑ i t a n k ).
0 λ i t + 1 , t a n k = λ i t , t a n k + h i t + 1 , c h a h i t + 1 , d i s ϑ i t a n k ,                 i n ,               t T
Equation (53) is a definition for considering the initial heat energy ( ε i t a n k ) in a heat tank, which can be considered in the first hour if the heat tank initially has the initial energy.
λ i t , t a n k = ε i t a n k + h i t , c h a h i t , d i s                 i n ,               t = 1
Equation (54) ensures that the heat energy in the heat tank is not completely discharged. Equation (55) ensures that the number of hours allowed to respond to electrical and thermal demand is met.
λ i t , t a n k h i t , d i s 0               i n ,               t T
t T d e t l e 0 ,               t T d h t l h             t ,         l e , l h 2
Equation (56) is equal to the hours of onset of unit i of the CHP ( i t , U P ); Equation (57) is the limit of the number of times the unit is switched on ( i U P ); Equation (58) is equal to the hours of shutdown of unit i of the CHP ( i t , D W ); Equation (59) is the limit of the number of times that the unit is switched off ( i D W ); Equation (60) shows the heat proportionality constant ( θ i t ) of each CHP unit, which depends on its converter efficiency.
i t + 1 , U P = i t , U P + s i t             i n ,             t T
i t , U P i U P             i n ,     t T
i t + 1 , D W = i t , D W + u i t             i n ,             t T
i t , D W i D W             i n ,     t T
where
θ i t = H R i / 3600 μ i h e a t μ i e x             i n
Equation (61) is equal to the definition of heat generated by CHP units, which depends on its electrical output power. Thermal efficiency and heat exchanger efficiency are indicated by μ i h e a t and μ i e x .
H i t = θ i t G i t , C H P               i n ,               t T
Equations (62)–(66) define the relationships as to the P2H system. Here, Equation (62) defines the relation between the conversion of electrical energy into heat. Equation (63) shows the heat capacity of the P2H system and Equation (64) shows the utilization of P2H in the power grid. Equation (65) shows the limitation of P2H heat capacity utilization and Equation (66) shows the thermal efficiency of P2H.
As observed, the optimization model (1)–(66) is a MILP model that can be solved with mathematical software. Introducing the offered optimization layout in the next section, the relevant results are presented. Here, η P 2 H   and P t , i P 2 H represent the coefficient of electric power to thermal energy and electric power consumed in the power grid to produce heat in P2H, respectively. The thermal power injected by the P2H system into the thermal network is indicated by H t , i P 2 H , D . The final thermal power charged in the P2H system is shown by H t , i P 2 H , C H . The thermal capacity of P2H and its maximum capacity are indicated by H C t , i and H C ¯ t , i .
H t , i P 2 H , C H = η P 2 H P t , i P 2 H
H C t , i = H C t 1 , i + H t , i P 2 H , C H H t , i P 2 H , D
0 P t , i P 2 H P i P 2 H , m a x
0 H C t , i H C ¯ t , i
H t , i P 2 H , C H = ε P 2 H H t , i P 2 H , D

Proposed System and Solution Structure

Figure 1 shows the flow diagram of the proposed energy management model for SGs. The flowchart begins with the input stage, where various sources of energy are introduced into the system. These sources include RE from solar PV panels and wind power, CHP units that generate both electricity and heat, and P2H systems that convert excess electricity into hydrogen for use in meeting thermal demands. Alongside these sources, the model incorporates storage systems, including ESSs for electrical energy and thermal storage tanks for heat, both of which help to stabilize the supply. Additionally, data on the typical electrical and thermal load profiles under normal and emergency conditions is inputted. DRPs for both electrical and thermal loads are also included, allowing for adjustments to meet demand flexibility. In the modeling stage, the optimization process uses a MILP framework, aiming to minimize both operational costs and environmental emissions. The model operates across various scenarios, such as normal conditions, load shedding emergencies, and overload emergencies, to evaluate performance in different situations. Within this stage, decision variables and constraints are established, covering aspects like energy dispatch and load balancing while addressing emergency load conditions. The solver application stage involves using the Gurobi solver, a robust tool that processes the MILP model to identify the most efficient solutions. This solver handles complex optimization tasks, enabling the model to find globally optimal solutions for the energy management strategy. In the output stage, the model produces optimized energy distribution strategies. These include the effective utilization of CHP and P2H systems, coordinated charging and discharging schedules for battery and thermal storage, and dynamic adjustments through DR. The output also provides specific emergency management solutions, detailing strategies for load shedding and overload handling under different emergency conditions. Finally, the result analysis phase compares the model’s performance across scenarios, focusing on metrics such as operational costs, emission levels, and the balance between supply and demand. A sensitivity analysis examines how variations in RE output impact system performance, offering insights into the model’s robustness under fluctuating conditions. This analysis highlights the effectiveness of the proposed approach in maintaining grid stability, reliability, and environmental efficiency in real-world applications.
Figure 2 illustrates the flowchart and the suggested optimization scheme presented in this paper. The diagram illustrates the proposed optimization approach for smart distribution networks, taking into account both thermal and electrical loads, as well as the DRP, while also considering load emergencies such as load shedding and overload. This figure presents an overview of the problem inputs, the model-solving process, and the resulting outputs. At the top of the figure, the problem inputs are shown, including the electrical and thermal loads, CHP, P2H systems, mobile systems, and thermal storage tanks. DRP is also included as an input, which allows for a flexible and dynamic response to changes in demand. In the middle of the figure, the optimization model is presented, which aims to minimize the operating, fuel, and maintenance costs, while also reducing environmental pollution. The model incorporates various variables and constraints related to the inputs, such as the electrical and thermal energy balance, thermal storage management, and CHP utilization. At the bottom of the figure, the obtained outputs are shown, which include the optimized electrical and thermal energy dispatch, the CHP and P2H utilization, and the amount of load shedding or overload under emergency conditions. The results of the optimization model are crucial for achieving efficient and reliable operation of the smart distribution network.
The model assumes linear relationships in MILP, effective DRPs, successful integration of diverse energy sources, and simplified heat and electrical load interactions, which may oversimplify real-world non-linear dynamics, leading to potentially optimistic or conservative results.

3. Simulation Results

The simulations were conducted using MATLAB 2018 with the CVX package for optimization, on a system with 8 GB of RAM and a 2.2 GHz processor. Each scenario was simulated over a 24 h period, with hourly data inputs for electrical and thermal loads, as well as RE generation from PV and wind resources. The results from the simulations were compared to each other to evaluate the system’s performance under different conditions, including operational costs, emissions, and energy dispatch.
The presented information in Table 2 offers valuable insights into various aspects of the energy system. Specifically, the data pertain to CHP units, batteries, thermal tanks, and DRPs. CHP unit is an efficient method to generate both electricity and heat simultaneously, thereby reducing energy losses. The table presents relevant information such as the number of CHP units in use, their capacity, and their efficiency. These details can help policymakers and stakeholders evaluate the feasibility and effectiveness of using CHP units to meet energy demands. In addition to CHP units, the table also includes data on batteries. Batteries are becoming increasingly significant in the energy system, particularly with the rise of RERs like solar and wind. By storing excess energy within low demand periods and releasing it within peak hour cycles, batteries can help stabilize the grid and reduce reliance on fossil fuels. The table provides information on the number of batteries installed, their capacity, and their charging and discharging rates. Another critical aspect of the energy system is thermal storage tanks. These tanks store heat energy generated during low-demand periods, which can be consumed to meet heating needs within peak demand. The table displays relevant data such as the number of thermal tanks in use, their capacity, and their efficiency. Finally, the table includes information on DRPs. DRPs seek to decrease the peak energy demand in high-demand periods by encouraging consumers to regulate energy consumption. Overall, Table 2 offers a comprehensive overview of critical components of the energy system, providing policymakers and stakeholders with valuable data to inform decision-making and energy planning.
Table 3 presents vital information related to the ramp rate and minimum up and down time of CHP units. These data are crucial in ensuring that the energy system is stable and reliable while meeting the demands of consumers. The ramp rate is the speed at which a CHP unit can increase or decrease its output of electricity and heat. The table displays the ramp rate of each CHP unit, allowing stakeholders to evaluate the performance of the unit to compensate the changes in energy demand quickly. A high ramp rate is desirable because it enables the system to respond to sudden changes in demand, which can prevent blackouts and brownouts. In addition to ramp rate, the table also shows the minimum up and down time of each CHP unit. This refers to the minimum time required for the unit to start or stop producing electricity and heat. It is crucial to minimize these times as much as possible to ensure that the energy system can respond rapidly to variations in demand. The data presented in the table can help stakeholders evaluate the performance of each CHP unit and identify potential areas for improvement. By providing comprehensive data on ramp rate and minimum up and down time, Table 3 allows policymakers and energy system operators to make informed decisions about how to optimize the energy system to meet the needs of consumers while maintaining stability and reliability. This information can be useful in designing future energy systems, ensuring that they are flexible, efficient, and responsive to changing demand [41].
Table 4 presents essential information related to the thermal and electrical storage parameters of the energy system. These data are critical in ensuring that the energy system can efficiently store and distribute energy as needed. The table includes information on the maximum number of charge and discharge times for each storage unit, as well as its capacity. This information allows policymakers and stakeholders to evaluate the performance of the storage units and identify potential areas for improvement. Thermal storage units store heat energy generated during low-demand periods, which can be applied to response heating needs within peak demand. The table presents relevant data such as the maximum number of charge and discharge times for each thermal storage unit, as well as its capacity. These details can help stakeholders assess the efficiency and effectiveness of thermal storage units in meeting energy demands. Electrical storage units, such as batteries, are becoming increasingly essential in the energy system, particularly with the rise of RERs. By storing excess energy within low demand periods and releasing within peak hour cycles, batteries are able to stabilize the system and decrease reliance on fossil fuels. The table includes information on the maximum number of charge and discharge times for each electrical storage unit, as well as its capacity. These data can help policymakers and stakeholders evaluate the feasibility and effectiveness of using batteries to meet energy demands. Overall, Table 4 offers valuable insights into the performance and capabilities of the energy system’s storage units. This information can help stakeholders to optimize the system in order to respond to the consumers’ needs while maintaining stability and reliability. The data can also inform future energy system designs, ensuring that they are flexible, efficient, and responsive to changing demand.
Table 5 presents hourly data on daily electrical and thermal loads, as well as PV and wind power output. This information helps ensure that the energy system meets consumer demands, identifies peak periods, and assesses DR effectiveness. It also aids in optimizing the use of RERs and informs energy system planning and future designs for stability and reliability.

3.1. Data Preprocessing and Assumptions

In order to simulate the energy management scenarios accurately, several preprocessing steps were undertaken, and specific assumptions were made for each scenario. These details are crucial for ensuring the validity and reliability of the results.

3.1.1. Data Preprocessing

(a)
Energy Demand Data
Electrical and Thermal Loads: The input data for electrical and thermal loads were collected based on historical demand patterns within small-scale SGs. The data were normalized to remove outliers and seasonal variations that might skew the simulation results. Hourly load profiles were generated to reflect typical demand fluctuations across a 24 h period.
RERs (PV and Wind): The solar PV and wind energy generation data were processed to account for weather-dependent variability. Realistic irradiance and wind speed patterns were modeled, and these profiles were matched against the operational hours of the system. The PV generation was limited to daytime hours (8 a.m.–7 p.m.) to reflect real-world conditions.
(b)
Battery and Thermal Storage
The charging and discharging profiles of battery systems and thermal storage tanks were prepared by setting constraints on their maximum and minimum capacities. Battery efficiency ( η b a t , t o t a l = 0.9 ) and thermal efficiency ( η h e a t , t o t a l = 0.9 ) were applied, and charging/discharging rates were adjusted based on historical data from similar systems.
(c)
CHP and P2H Systems
CHP systems were modeled based on their efficiency rates, and their operational schedules were aligned with periods of high demand. P2H systems were incorporated to convert excess electrical energy into heat, enhancing flexibility in meeting thermal load requirements.

3.1.2. Assumptions of Scenarios

To simulate the proposed optimization model, the following assumptions were made for different scenarios:
(a)
Scenario I: Normal Operating Conditions (No Emergency)
In this scenario, it was assumed that there are no emergency load shedding or overload conditions. The objective was to optimize the energy management system by minimizing operational costs and emissions under normal load profiles. Critical hours, such as 12:00 p.m. and 7:00 p.m., were treated as immutable due to the high sensitivity of load demand at these times, meaning no changes were made to the DRPs during these periods.
(b)
Scenario II: Emergency Load Shedding
The second scenario simulates emergency conditions where both electrical and thermal load shedding is necessary to prevent system overload. The load shedding capacity for this scenario was set to 250 kWh for both thermal and electrical energy, with a maximum allowable hourly load shedding limit of 60 kWh. The key assumption here was that the load shedding would be distributed evenly across the hours without impacting critical loads, which are defined as loads that must remain intact during emergencies.
(c)
Scenario III: Overload Emergency
In the third scenario, overload conditions were considered, with a maximum overload capacity of 250 kWh for electrical and 150 kWh for thermal loads. The maximum allowable overload per hour was restricted to 20 kWh. The assumption in this scenario was that the overload could be managed by flexibly adjusting the CHP and P2H systems while maintaining battery and thermal storage utilization within safe limits. The hours from 5:00 a.m. to 10:00 a.m. and 4:00 p.m. to 11:00 p.m. were identified as critical due to their high demand, and overload conditions were introduced during these periods.

3.1.3. General Assumptions Across All Scenarios

(a)
Fixed System Parameters
The capacity of each energy source (CHP, P2H, battery, and thermal Storage) remained constant throughout the simulations. No new installations or capacity expansions were considered.
(b)
DRPs
The DRP was assumed to have a 10% flexibility in both electrical and thermal loads, allowing for load adjustments without compromising critical demand.
(c)
Gurobi Solver
The optimization problem was solved using the Gurobi solver, which was chosen for its ability to handle large-scale MILP problems efficiently.

3.2. Scenario I

In this scenario, emergency load shedding with overloading is not considered, i.e., the values of Π e l e c , Π h e a t , and Γ e l e c , Γ h e a t are zero. Additionally, 12 and 19 o’clock are sensitive times and cannot be changed, so in the program, the DR is considered constant, i.e., ( Ξ 1 = Ξ 1 = 12 , Ξ 2 = Ξ 2 = 19 ) equal to zero. Table 6 displays the optimization outcomes in the first scenario. As expressed in this table, the optimization outcomes for the next 24 h are depicted separately for each resource. It is shown that the amount of the entire cost function in 24 h is equal to USD 21,934; which includes operating and pollution costs, as well as the production of all four CHP units along with charging and discharging batteries and heat tanks as shown. On the other hand, this table shows the initial electrical and thermal load of the network with the load changed per hour. For example, during the 19th period, the initial electrical and thermal load was 254 kWh and 244 kWh of heat, which remained unchanged after the implementation of the DRP, due to the equalization of binary variables in those hours, which is equal to zero. On the other hand, at time 8, the initial electric charge was equal to 185 kWh, which was changed to 189.6 kWh after optimization. These numbers indicate that the intended DRP is working properly with the binary variables. As can be seen, the renewable PV source is produced only in 8 to 19 h; as can be seen, it is only in these hours that the battery can be charged, because in this paper, the battery and PV systems are modeled together and defined as a combined system together.
Figure 3 shows the optimal state of the proposed hybrid system. For example, this figure shows the battery charge and discharge mode, as well as the amount of PV power in the initial mode and the amount of PV power after charging the battery. Here, the vertical negative axis shows the battery charging and the vertical positive area shows the battery discharge.
Figure 4 shows the status of the heat tank for the day ahead. Figure 5 and Figure 6 also show the electrical and thermal charges in the network, respectively. For example, Figure 5 shows the initial electric charge with the electric charge after the DRP.
It can be seen that it has not been moved at 12 and 19 o’clock. Similarly, Figure 6 shows the comparison of thermal load in the initial state and after optimization.

3.3. Scenario II

In this scenario, load shedding emergency conditions are considered, the parameters of which are as follows: Π e l e c , Π h e a t , which is the total capacity considered for emergency load shedding, equal to 250 kWh for thermal and electric. In addition, the maximum allowable load shedding, whether electric or thermal per hour, is less than or equal to 60 kWh. Table 7 shows the simulation outcomes of the second scenario.
As shown in this table, the total cost function is USD 14,295. In the same way, in the hours of 18, 20, and 23, the electric and thermal load has been removed.
Figure 7 shows the status of the combined battery and PV system, showing the optimal charge and discharge amount during the day and the amount of PV. Here, the vertical negative axis shows the battery charging and the vertical positive area shows the battery discharge. Figure 8 shows the condition of the heat tank over 24 h. Similarly, Figure 9 shows the thermal and electrical load after optimization during the simulation period.

3.4. Scenario III

In this scenario, emergency overloading is considered. The parameters considered are Γ e l e c , Γ h e a t , which has a total capacity for emergency overload of 250 kWh for electric and 150 kWh for overloading. Additionally, the maximum allowable overload, whether electric or heat, is less than or equal to 20 kWh. Table 8 also shows the simulation results of the third scenario.
In this scenario, the cost of the objective function is USD 24,614. Which is the highest value among the scenarios considered. As can be seen, 5 to 10 and 16 to 23 h have an electric overload, which is a maximum of 20 kilowatts per hour. Heat overload is also in 3 to 11 h. This table shows the amount of CHP resources generated, the amount of electric and thermal load, and the amount of charge and discharge of batteries and heat tanks in the 24 h modeled. Figure 10 shows the status of the combined battery and PV system, showing the optimal charge and discharge amount during the day and the amount of PV. Here, the vertical negative axis indicates battery charging and the vertical positive area shows the battery discharge. Figure 11 shows the condition of a heat tank over a 24 h period. Similarly, Figure 12 shows the thermal and electrical load after optimization during the simulation period.
Finally, the outcomes acquired from diverse scenarios indicated that the suggested layout is efficient for all conditions and can be fully managed on all devices in the network according to various conditions.

3.5. Comparison and Verification of Results

This section expresses a comparison between the suggested layout in this article and the evolutionary methods described in references [2,5,7]. Table 9 illustrates a comparison between the objective function obtained by the proposed method with other methods in [2,5,7]. The table shows the comparison of four methods in terms of their performance on three different scenarios, as measured by the objective function Z. The suggested layout outperformed the other three algorithms in all scenarios, with significant improvements in each. In the first scenario, the proposed method achieved a Z value of 21,934, which is 11.4% better than PSO (29,537), 5.6% better than NSGA-III (27,075), and 11.6% better than BBO (31,998).
Similarly, in the second scenario, the proposed method achieved a Z value of 14,295, which is 9.1% better than PSO (17,154), 6.0% better than NSGA-III (60,889, 21,157,250), and 12.6% better than BBO (18,584). In the third scenario, the proposed method achieved a Z value of 24,614, which is 7.2% better than PSO (29,537), 6.7% better than NSGA-III (27,075), and 12.7% better than BBO (31,998). Overall, the proposed method consistently outperformed the other algorithms by a significant margin in all three scenarios, indicating its superior performance in solving the problem at hand.
By analyzing the results obtained from different scenarios, it can be stated that
  • Equation (5) is defined as greater or equal in similar articles that have modeled both electrical and thermal energy. In this paper, it was shown that by modeling the DRP and the heat tank, this relationship can be equalized and the heat balance losses between load and production can be reduced to zero;
  • Another advantage of the electrical and thermal DRP is that a larger PV can be introduced into the grid to meet the thermal constraint;
  • The achievable area of the problem increases with the DRP due to the increase in thermal load and the constraint of equality.
Figure 13 illustrates the comparison of objective function values (Z) across the three scenarios for different optimization methods, including the proposed method, BBO, NSGA-III, and PSO. The proposed method outperforms the others consistently in all scenarios.
In summary, the proposed method not only improves efficiency in energy management but also enhances the grid’s resilience in emergencies, reduces environmental impact, and provides flexibility in handling different energy sources and storage systems. These practical advantages make it highly relevant for real-world SG applications. The proposed method consistently outperforms the evolutionary methods (BBO [2], NSGA-III [5], PSO [7]) in all three scenarios, demonstrating its significant advantages in practical energy management for SGs:
  • Lower costs and environmental impact in both normal and emergency conditions.
  • Superior emergency handling, particularly in load shedding and overload situations.
  • Comprehensive integration of diverse energy sources, including renewables, batteries, and P2H systems, providing flexibility and scalability in real-world applications.
These results affirm the practical benefits of adopting the proposed optimization method in SG energy management, offering enhanced reliability, cost-effectiveness, and sustainability compared to traditional approaches.

3.6. Sensitivity Analysis

The performance of SGs, particularly those heavily reliant on RERs, is significantly affected by the variability and unpredictability of solar and wind power outputs. To ensure the robustness of the proposed optimization model under real-world conditions, a sensitivity analysis was conducted, focusing on changes in RE output. This analysis assesses how fluctuations in renewable generation impact system performance, including energy costs, battery usage, and the need for DRPs. The results of the sensitivity analysis are shown in Table 10.
For this analysis, the RE output—primarily from solar PV and wind turbines—was varied by ±20% to simulate different weather conditions that could affect energy generation. Three scenarios were analyzed:
  • Base Case (100% of forecasted renewable output),
  • Low Renewable Output (80% of forecasted output),
  • High Renewable Output (120% of forecasted output).
In the base case, the system operates with the forecasted renewable output (500 kWh). The total energy cost is USD 21,934, and battery discharge is kept to 300 kWh, with DRP load adjustments at 50 kWh to balance demand. CHP systems generate 1200 kWh, demonstrating the system’s optimal functioning under normal conditions.
In the low renewable output scenario, where output decreases by 20% (to 400 kWh), the system faces a greater reliance on battery discharge (500 kWh) and increased CHP generation (1500 kWh) to compensate for the lack of RE. The total energy cost rises to USD 25,500 due to higher fuel consumption and operational costs of CHP units. Additionally, DRP load adjustments increase significantly to 150 kWh, requiring more DR interventions to prevent overloading.
In the high renewable output scenario, where renewable generation increases by 20% (to 600 kWh), the system benefits from reduced reliance on battery discharge (200 kWh) and lower CHP generation (1000 kWh). The total energy cost drops to USD 18,500 as the system takes full advantage of the surplus RE. DRP load adjustments also decrease to 25 kWh, as the system experiences fewer fluctuations in demand that require intervention.
These results provide several insights into system performance under variable renewable conditions. First, the high renewable output scenario demonstrates the cost-saving potential of increased renewable penetration. By generating more RE, the system minimizes reliance on CHP systems and battery discharges, leading to a reduction in total energy costs by approximately 15.7% compared to the base case. In contrast, the low output scenario increases the cost by 16.3%, primarily due to higher fuel consumption and operational reliance on CHP systems.
As renewable output decreases, battery discharge increases to provide energy during periods of low renewable generation. This highlights the importance of ESSs in maintaining grid stability under variable renewable conditions. However, with higher renewable generation, the system relies less on batteries, prolonging their lifespan and reducing the need for frequent discharges.
The DRP load adjustments increase substantially in the low renewable output scenario, as the system struggles to balance supply and demand without RE. This demonstrates the critical role of DR in maintaining grid reliability when RERs underperform. Conversely, the high renewable output scenario shows that with ample renewable generation, the need for load adjustments through DRPs decreases, resulting in fewer disruptions to consumers.
The CHP system plays a compensatory role in the event of reduced renewable output, with a 25% increase in generation in the low output scenario. However, in periods of high renewable generation, CHP usage can be minimized, which helps reduce operational costs and emissions.
This sensitivity analysis underscores the importance of RE output in the overall performance of the SG. The proposed model demonstrates robustness across varying renewable generation levels, with cost efficiency improving significantly under high renewable output scenarios. However, in situations where renewable generation falls short, the system relies heavily on ESS, CHP systems, and DRPs to maintain grid stability. Future work could further investigate how integrating stochastic models could better anticipate fluctuations in renewable output, improving the model’s adaptability to real-time grid conditions. Additionally, incorporating advanced battery management systems and renewable forecasting techniques could optimize the use of stored energy and minimize the cost impacts of renewable variability.

3.7. Discussion

The results of this study indicate that the proposed MILP model significantly enhances energy resilience and reduces operational costs in SGs by effectively managing load demands under normal and emergency conditions. In real-world contexts, such improvements in energy management directly translate to greater grid stability, lower energy costs, and enhanced flexibility in adapting to supply and demand fluctuations. The model’s ability to handle overload and load shedding scenarios through DRPs and integrated use of CHP, ESS, and P2H systems showcases its practical value for small-scale SGs.
One of the primary implications is the increase in energy resilience. By dynamically balancing loads and adjusting to emergency conditions, the model mitigates risks associated with unexpected surges in demand or supply shortages. In practice, this can prevent disruptions, reduce the likelihood of blackouts, and ensure that critical loads are maintained even during peak stress events. This resilience is vital for modern power systems, which are increasingly dependent on variable RERs like wind and solar. Through efficient integration of RERs and ESSs, the model optimizes resource use, reduces dependency on fossil fuels, and contributes to environmental sustainability goals.
Cost savings are another key benefit, achieved through operational efficiency and strategic deployment of stored energy. By minimizing fuel and operational costs, the model lessens financial burdens on energy providers and consumers. In settings where energy costs are high, such as urban areas with dense populations or regions dependent on imported energy, these savings can be substantial. Furthermore, by reducing emissions, the model aligns with policy trends pushing for lower-carbon energy systems, potentially qualifying SG operators for incentives or subsidies aimed at promoting clean energy technologies.

3.8. Limitations

However, certain limitations exist in the model. It is currently tailored for small-scale SGs, so applying it to larger networks or multi-grid systems may pose scalability challenges. Larger-scale systems involve increased complexity due to the higher volume of resources, more intricate transmission constraints, and potential for inter-grid interactions. Another limitation is the assumption of linear relationships in the MILP framework, which may oversimplify the inherently non-linear behavior of real-world power systems, particularly in multi-grid or larger settings. Future research could explore applying this model to a larger network or a multi-grid system with more extensive RERs integration and cross-system energy-sharing capabilities.

3.9. Future Research

Potential avenues for enhancement include the incorporation of stochastic models to better capture the uncertainties associated with renewable generation and demand variability. Additionally, integrating more advanced storage technologies, such as V2G solutions, could further enhance flexibility and support bidirectional energy flows. Another valuable direction could be exploring the model’s scalability by testing it on a large-scale network to assess its performance and adaptability across a broader range of grid sizes and configurations.
While the model demonstrates notable advancements for small-scale SGs in terms of resilience, cost savings, and sustainability, its application to larger-scale systems will require further development to handle the unique challenges of large, interconnected networks.

4. Conclusions

This paper has proposed optimal integrated energy management in SGs with the purpose of lessening economic costs and environmental issues. In this paper, economic load distribution, variable load management, optimal charging and discharging of batteries and RERs, electrical and thermal DRP, along with heat storage tanks were considered, which are all up-to-date issues of an SG. In these different scenarios, emergency situations such as overload or reduced load were modeled and the outcomes were analyzed. The simulation outcomes indicated that the proposed integrated energy management optimization model is an efficient method in optimizing electrical and thermal energy in SGs. The suggested algorithm demonstrated superior performance compared to the evolutionary algorithms discussed in this paper. It outperformed the PSO, NSGA-III, and BBO methods by 11.4%, 5.6%, and 11.6%, respectively, across all scenarios, resulting in a significant performance improvement. Overall, the proposed method showed superior performance and notable improvement. The paper discusses the advantages of modeling both electrical and thermal energy using the DRP and heat tank equations. The use of these equations can equalize the relationship between electrical and thermal energy and reduce heat balance losses. Additionally, a larger PV can be introduced into the grid to meet the thermal constraint. Furthermore, the DRP can increase the achievable area of the problem by increasing the thermal load and the constraint of equality.
This study proposes a MILP model designed to enhance small-scale SG resilience during emergency load conditions, including load shedding and overload scenarios. By integrating RERs, ESS, CHP systems, and P2H technology, this model aims to optimize energy distribution while balancing electrical and thermal loads. The incorporation of DRPs for both types of loads improves flexibility and minimizes the risk of disruptions.
Furthermore, the holistic model is capable of optimal load balancing in emergencies and demonstrating significant improvements in grid performance, cost-efficiency, and environmental impact compared to conventional optimization methods. By expanding the feasible solution space and reducing thermal load losses, this study provides a robust solution for small-scale SGs facing frequent load variability, setting a new standard for emergency energy management in future SG frameworks.
In order to continue this study, the following items are recommended for further research: Incorporation of Uncertainty and Stochastic Models, Real-time Energy Management and Optimization, Integration of EVs and V2G Systems, Scalability to Larger and More Complex Grids, Cybersecurity and Grid Vulnerability, DR Enhancement through IoT and Smart Devices, Expansion to Emerging Markets and Developing Regions, Hybrid Energy Systems and Long-term Energy Storage.

Author Contributions

Conceptualization, data curation, formal analysis, software, investigation, resources and writing—original draft carried out by H.J. and M.D.; project administration, supervision carried out by T.N.; validation, writing—review and editing, visualization, and methodology carried out by T.N., P.S., K.O. and M.A. Funding acquisition carried out by P.S. All authors contributed equally to this paper. This research paper is contributed by the authors mentioned above. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations and Nomenclature

Nomenclature
n , T The set of number of units (CHP or PV or battery or heat bank) and the time period studied
a i , b i , c i Fixed coefficient of CHP fuel cost
α i , β i , δ i Fixed coefficient of CHP emission cost
D t , e l e c Hourly electrical load of the grid
D t , h e a t Hourly heat load of the grid
G i t , P V The hourly electric power of the i t h PV
η R h e a t , η R e l e c The percentage amount of flexible thermal and electrical load
φ t , h e a t , φ t , e l e c Hourly flexible thermal and electrical load amount
θ i t The proportionality constant of the i t h  CHP in hour t
μ i h e a t , μ i e x Thermal efficiency and heat exchanger efficiency of the i t h  CHP
H R i Thermal rate of the i t h  CHP
G i C H P ¯ The maximum power of the i t h  CHP unit
G i C H P _ The minimum power of the i t h  CHP unit
η b a t t o t a l Total efficiency of the battery (battery losses + discharge = charge), depending on the quality of the battery
η h e a t t o t a l The total efficiency of the heat bank (heat loss + heat discharge = charge), depends on the heat bank system and the length of the heat transfer pipe
B i t , d i s ¯ The maximum permissible discharge power of the i t h  battery in hour t
B i t , c h a ¯ The maximum permissible charge power of the i t h  battery in hour t
h i t , d i s ¯ Maximum permissible discharge of i t h  thermal bank in hour t
h i t , c h a ¯ Maximum permissible charge of i t h  thermal bank in hour t
s u i , s d i The cost of starting and shutting down of the CHP units
Π e l e c , Π h e a t Total electrical and thermal load shedding capacity
η P 2 H The coefficient of conversion of electrical to heat energy
P i P 2 H , m a x The maximum electrical power that can be used in the P2H system
H C ¯ t , i Maximum heat capacity of P2H
ε P 2 H Thermal efficiency of P2H
G i t . C H P The power of the i t h  CHP unit at time t
F i t , E i t Cost and emissions of the i t h  CHP at time t
D R t , e l e c The electric load obtained from the DRP
D R t , h e a t The heat load obtained from the DRP
H i t The heat produced by the i t h  CHP unit at time t
B i t , d i s , B i t , c h a Discharge and charge of i t h  battery at time t
h i t , d i s , h i t , c h a Discharge and charge of i t h  thermal tank at time t
G i t , P V n The new power value of i t h  PV at time t  (this means the remaining power from PV after charging the battery)
G i t , w d The wind power per hour
Ω t , e l e c , Υ t , e l e c Electrical load shedding and overload at time t
Ω t , h e a t , Υ t , h e a t Thermal load shedding and overload at time t
λ i t , b a t , λ i t , t a n k Electric and thermal energy stored in i t h  battery and thermal tank at time t
i t , U P , i t , D W The maximum time for i t h  unit to be turned on or off consecutively
s i t , u i t Binary variable of turning on and off the i t h  CHP at the time t
s b i t , u b i t Binary variable of charging and discharging the i t h  battery at the time t
s h i t , u h i t Binary variable of charging and discharging the i t h  thermal tank at the time t
e s t , e o t Binary variable of electrical emergency load shedding and overload at the time t
h s t , h o t Binary variable of thermal emergency load shedding and overload at the time t
d e t , d h t Binary variable of electrical and thermal DRP (in order to control the time of constant and unchanging loads)
H t , i P 2 H , D The thermal power injected by the P2H system into the thermal grid
P t , i P 2 H Electric power consumed in the power grid to produce heat in P2H
H C t , i Heat capacity of P2H system
H t , i P 2 H , C H The final heat power charged in the P2H system
Abbreviation
MILPMixed-Integer Linear Programming
CHPCombined heat and power
PSOParticle swarm optimization
RERRenewable energy resource
DRPDemand response program
ESSEnergy storage system
EVElectric vehicle
PVPhotovoltaic
P2HPower to hydrogen
SGSmart Grid
SHSmart Home
BBOBiogeography-Based Optimization
MAEMean absolute error
NSGA-IIINon-dominated sorting genetic algorithm-III
CCGColumn-and-constraint generation
TLBOTeaching–learning-based optimization
MBOMonarch Butterfly Optimization
DSDynamic simulation
GWOGrey wolf optimization

References

  1. Shojaeiyan, S.; Dehghani, M.; Siano, P. Microgrids resiliency enhancement against natural catastrophes based multiple cooperation of water and energy hubs. Smart Cities 2023, 6, 1765–1785. [Google Scholar] [CrossRef]
  2. Li, D.; Guo, S.; He, W.; King, M.; Wang, J. Combined capacity and operation optimisation of lithium-ion battery energy storage working with a combined heat and power system. Renew. Sustain. Energy Rev. 2021, 140, 110731. [Google Scholar] [CrossRef]
  3. Zhao, X.; Bai, M.; Yang, X.; Liu, J.; Yu, D.; Chang, J. Short-term probabilistic predictions of wind multi-parameter based on one-dimensional convolutional neural network with attention mechanism and multivariate copula distribution estimation. Energy 2021, 234, 121306. [Google Scholar] [CrossRef]
  4. Zhou, K.; Fei, Z.; Hu, R. Hybrid robust decentralized optimization of emission-aware multi-energy microgrids considering multiple uncertainties. Energy 2023, 265, 126405. [Google Scholar] [CrossRef]
  5. Amorim, E.A.; Rocha, C. Optimization of wind-thermal economic-emission dispatch problem using NSGA-III. IEEE Lat. Am. Trans. 2020, 18, 1555–1562. [Google Scholar] [CrossRef]
  6. Yang, D.; Xu, Y.; Liu, X.; Jiang, C.; Nie, F.; Ran, Z. Economic-emission dispatch problem in integrated electricity and heat system con-sidering multi-energy demand response and carbon capture Technologies. Energy 2022, 253, 124153. [Google Scholar] [CrossRef]
  7. Ellahi, M.; Abbas, G.; Satrya, G.B.; Usman, M.R.; Gu, J. A Modified hybrid particle swarm optimization with bat algorithm parameter inspired acceleration coefficients for solving eco-friendly and economic dispatch problems. IEEE Access 2021, 9, 82169–82187. [Google Scholar] [CrossRef]
  8. Ellahi, M.; Abbas, G. A hybrid metaheuristic approach for the solution of renewables-incorporated economic dispatch problems. IEEE Access 2020, 8, 127608–127621. [Google Scholar] [CrossRef]
  9. Lu, S.; Gu, W.; Meng, K.; Dong, Z.Y. Economic dispatch of integrated energy systems with robust thermal comfort management. IEEE Trans. Sustain. Energy 2020, 12, 222–233. [Google Scholar] [CrossRef]
  10. Zhu, Z.; Wang, M.; Xing, Z.; Liu, Y.; Chen, S. Optimal configuration of power/thermal energy storage for a park-integrated energy system considering flexible load. Energies 2023, 16, 6424. [Google Scholar] [CrossRef]
  11. Khobaragade, T.; Chaturvedi, K.T. Enhanced Economic Load Dispatch by Teaching–Learning-Based Optimization (TLBO) on Thermal Units: A Comparative Study with Different Plug-in Electric Vehicle (PEV) Charging Strategies. Energies 2023, 16, 6933. [Google Scholar] [CrossRef]
  12. Huang, Q.; Han, S.; Rong, N.; Luo, J.; Hu, X. Stochastic economic dispatch of hydro-thermal-wind-photovoltaic power system con-sidering mixed coal-blending combustion. IEEE Access 2020, 8, 218542–218553. [Google Scholar] [CrossRef]
  13. Wang, Y.; Jin, J.; Liu, H.; Zhang, Z.; Liu, S.; Ma, J.; Gong, C.; Zheng, Y.; Lin, Z.; Yang, L. The optimal emergency demand response (EDR) mechanism for rural power grid considering consumers’ satisfaction. Energy Rep. 2021, 7, 118–125. [Google Scholar] [CrossRef]
  14. Han, J.; Yan, L.; Li, Z.; Zhang, L.; Paaso, A.; Bahramirad, S. A Multi-timescale two-stage robust grid-friendly dispatch model for microgrid operation. IEEE Access 2020, 8, 74267–74279. [Google Scholar] [CrossRef]
  15. Siqin, Z.; Niu, D.; Wang, X.; Zhen, H.; Li, M.; Wang, J. A two-stage distributionally robust optimization model for P2G-CCHP microgrid considering uncertainty and carbon emission. Energy 2022, 260, 124796. [Google Scholar] [CrossRef]
  16. Valipour, E.; Nourollahi, R.; Taghizad-Tavana, K.; Nojavan, S.; Alizadeh, A. Risk assessment of industrial energy hubs and peer-to-peer heat and power transaction in the presence of electric vehicles. Energies 2022, 15, 8920. [Google Scholar] [CrossRef]
  17. Li, Z.; Wu, L.; Xu, Y.; Zheng, X. Stochastic-weighted robust optimization based bilayer operation of a multi-energy building microgrid considering practical thermal loads and battery degradation. IEEE Trans. Sustain. Energy 2021, 13, 668–682. [Google Scholar] [CrossRef]
  18. Akhlaghi, M.; Moravej, Z.; Bagheri, A. Maximizing wind energy utilization in smart power systems using a flexible net-work-constrained unit commitment through dynamic lines and transformers rating. Energy 2022, 261, 124918. [Google Scholar] [CrossRef]
  19. Ahmadi, E.; Noorollahi, Y.; Mohammadi-Ivatloo, B.; Anvari-Moghaddam, A. Stochastic operation of a solar-powered smart home: Capturing thermal load uncertainties. Sustainability 2020, 12, 5089. [Google Scholar] [CrossRef]
  20. Askari, M.; Dehghani, M.; Razmjoui, P.; GhasemiGarpachi, M.; Tahmasebi, D.; Ghasemi, S. A novel stochastic thermo-solar model for water demand supply using point estimate method. IET Renew. Power Gener. 2022, 16, 3559–3572. [Google Scholar] [CrossRef]
  21. Hussain, A.; Bui, V.-H.; Kim, H.-M.; Im, Y.-H.; Lee, J.-Y. Optimal energy management of combined cooling, heat and power in different demand type buildings considering seasonal demand variations. Energies 2017, 10, 789. [Google Scholar] [CrossRef]
  22. Haghighat, H.; Karimianfard, H.; Zeng, B. Integrating energy management of autonomous smart grids in electricity market operation. IEEE Trans. Smart Grid 2020, 11, 4044–4055. [Google Scholar] [CrossRef]
  23. Kumar, S.; Krishnasamy, V.; Kaur, R.; Kandasamy, N.K. Virtual energy storage-based energy management algorithm for optimally sized DC nanogrid. IEEE Syst. J. 2021, 16, 231–239. [Google Scholar] [CrossRef]
  24. Zhao, W.; Diao, H.; Li, P.; Lv, X.; Lei, E.; Mao, Z.; Xue, W. Transactive energy-based joint optimization of energy and flexible reserve for integrated electric-heat systems. IEEE Access 2021, 9, 14491–14503. [Google Scholar] [CrossRef]
  25. Maghanki, M.M.; Ghobadian, B.; Najafi, G.; Galogah, R.J. Micro combined heat and power (MCHP) technologies and applications. Renew. Sustain. Energy Rev. 2013, 28, 510–524. [Google Scholar] [CrossRef]
  26. Daramola, A.S.; Ahmadi, S.E.; Marzband, M.; Ikpehai, A. A cost-effective and ecological stochastic optimization for integration of distributed energy resources in energy networks considering vehicle-to-grid and combined heat and power technologies. J. Energy Storage 2022, 57, 106203. [Google Scholar] [CrossRef]
  27. Zhang, G.; Ge, Y.; Ye, Z.; Al-Bahrani, M. Multi-objective planning of energy hub on economic aspects and resources with heat and power sources, energizable, electric vehicle and hydrogen storage system due to uncertainties and demand response. J. Energy Storage 2022, 57, 106160. [Google Scholar] [CrossRef]
  28. Karimianfard, H.; Haghighat, H.; Zeng, B. Co-optimization of battery storage investment and grid expansion in integrated energy systems. IEEE Syst. J. 2021, 16, 5928–5938. [Google Scholar] [CrossRef]
  29. Battula, A.R.; Vuddanti, S.; Salkuti, S.R. A day ahead demand schedule strategy for optimal operation of microgrid with uncertainty. Smart Cities 2023, 6, 491–509. [Google Scholar] [CrossRef]
  30. Ntafalias, A.; Tsakanikas, S.; Skarvelis-Kazakos, S.; Papadopoulos, P.; Skarmeta-Gómez, A.F.; González-Vidal, A.; Tomat, V.; Ramallo-González, A.P.; Marin-Perez, R.; Vlachou, M.C. Design and Implementation of an Interoperable Architecture for Integrating Building Legacy Systems into Scalable Energy Management Systems. Smart Cities 2022, 5, 1421–1440. [Google Scholar] [CrossRef]
  31. Razghandi, M.; Zhou, H.; Erol-Kantarci, M.; Turgut, D. Smart Home Energy Management: VAE-GAN Synthetic Dataset Generator and Q-Learning. IEEE Trans. Smart Grid 2023, 15, 1562–1573. [Google Scholar] [CrossRef]
  32. Wang, Y.; Chen, C.F.; Kong, P.Y.; Li, H.; Wen, Q. A cyber–physical–social perspective on future smart distribution systems. Proc. IEEE 2022, 111, 694–724. [Google Scholar] [CrossRef]
  33. Shokri, M.; Niknam, T.; Mohammadi, M.; Dehghani, M.; Siano, P.; Ouahada, K.; Sarvarizade-Kouhpaye, M. A novel stochastic framework for optimal scheduling of smart cities as an energy hub. IET Gener. Transm. Distrib. 2024, 18, 2421–2434. [Google Scholar] [CrossRef]
  34. Eltamaly, A.M. Optimal Dispatch Strategy for Electric Vehicles in V2G Applications. Smart Cities 2023, 6, 3161–3191. [Google Scholar] [CrossRef]
  35. Shibu, N.S.; Devidas, A.R.; Balamurugan, S.; Ponnekanti, S.; Ramesh, M.V. Optimising Microgrid Resilience: Integrating IoT, Blockchain, and Smart Contracts for Power Outage Management. IEEE Access 2024, 12, 18782–18803. [Google Scholar] [CrossRef]
  36. Pati, U.; Mistry, K.D. Cyber-Resilient Trading for Sustainable Energy Management: A Three-Phase Demand-Side Management Solution with Integrated Deep Learning-Based Renewable Energy Forecasting. IEEE Trans. Ind. Appl. 2023, 60, 2532–2541. [Google Scholar] [CrossRef]
  37. Azarinfar, H.; Khosravi, M.; Sabzevari, K.; Dzikuć, M. Stochastic Economic–Resilience Management of Combined Cooling, Heat, and Power-Based Microgrids in a Multi-Objective Approach. Sustainability 2024, 16, 1212. [Google Scholar] [CrossRef]
  38. Nasab, M.A.; Zand, M.; Eskandari, M.; Sanjeevikumar, P.; Siano, P. Optimal planning of electrical appliance of residential units in a smart home network using cloud services. Smart Cities 2021, 4, 1173–1195. [Google Scholar] [CrossRef]
  39. Jokar, H.; Niknam, T.; Dehghani, M.; Sheybani, E.; Pourbehzadi, M.; Javidi, G. Efficient Microgrid Management with Meerkat Opti-mization for Energy Storage, Renewables, Hydrogen Storage, Demand Response, and EV Charging. Energies 2023, 17, 25. [Google Scholar] [CrossRef]
  40. Fan, Z.; Cao, J.; Jamal, T.; Fogwill, C.; Samende, C.; Robinson, Z.; Polack, F.; Ormerod, M.; George, S.; Peacock, A.; et al. The role of ‘living laboratories’ in accelerating the energy system decarbonization. Energy Rep. 2022, 8, 11858–11864. [Google Scholar] [CrossRef]
  41. Basu, A.K.; Bhattacharya, A.; Chowdhury, S. Planned scheduling for economic power sharing in a CHP-based micro-grid. IEEE Trans. Power Syst. 2011, 27, 30–38. [Google Scholar] [CrossRef]
  42. Yan, M.; Teng, F.; Gan, W.; Yao, W.; Wen, J. Blockchain for secure decentralized energy management of multi-energy system using state machine replication. Appl. Energy 2023, 337, 120863. [Google Scholar] [CrossRef]
  43. Gourisetti, S.N.G.; Sebastian-Cardenas, D.J.; Bhattarai, B.; Wang, P.; Widergren, S.; Borkum, M.; Randall, A. Blockchain smart contract reference framework and program logic architecture for transactive energy systems. Appl. Energy 2021, 304, 117860. [Google Scholar] [CrossRef]
  44. Christidis, K.; Sikeridis, D.; Wang, Y.; Devetsikiotis, M. A framework for designing and evaluating realistic blockchain-based local energy markets. Appl. Energy 2021, 281, 115963. [Google Scholar] [CrossRef]
  45. Li, Y.; Yang, W.; He, P.; Chen, C.; Wang, X. Design and management of a distributed hybrid energy system through smart contract and blockchain. Appl. Energy 2019, 248, 390–405. [Google Scholar] [CrossRef]
  46. Khalid, R.; Javaid, N.; Javaid, S.; Imran, M.; Naseer, N. A blockchain-based decentralized energy management in a P2P trading system. In Proceedings of the ICC 2020—2020 IEEE International Conference on Communications (ICC), Dublin, Ireland, 7–11 June 2020; pp. 1–6. [Google Scholar]
Figure 1. Flowchart of the Proposed Energy Management Model for Small-Scale SGs.
Figure 1. Flowchart of the Proposed Energy Management Model for Small-Scale SGs.
Smartcities 07 00145 g001
Figure 2. Flowchart of the suggested optimization scheme.
Figure 2. Flowchart of the suggested optimization scheme.
Smartcities 07 00145 g002
Figure 3. Status of the proposed hybrid system in the first scenario.
Figure 3. Status of the proposed hybrid system in the first scenario.
Smartcities 07 00145 g003
Figure 4. The condition of the heat tank in the first scenario.
Figure 4. The condition of the heat tank in the first scenario.
Smartcities 07 00145 g004
Figure 5. Comparison of electric charge before and after the DRP in the first scenario.
Figure 5. Comparison of electric charge before and after the DRP in the first scenario.
Smartcities 07 00145 g005
Figure 6. Comparison of heat load before and after the DRP in the first scenario.
Figure 6. Comparison of heat load before and after the DRP in the first scenario.
Smartcities 07 00145 g006
Figure 7. Status of the proposed hybrid system in the second scenario.
Figure 7. Status of the proposed hybrid system in the second scenario.
Smartcities 07 00145 g007
Figure 8. The status of the heat tank in the second scenario.
Figure 8. The status of the heat tank in the second scenario.
Smartcities 07 00145 g008
Figure 9. Electric and thermal load in the second scenario.
Figure 9. Electric and thermal load in the second scenario.
Smartcities 07 00145 g009
Figure 10. Status of the proposed hybrid system in the third scenario.
Figure 10. Status of the proposed hybrid system in the third scenario.
Smartcities 07 00145 g010
Figure 11. The condition of the heat tank in the third scenario.
Figure 11. The condition of the heat tank in the third scenario.
Smartcities 07 00145 g011
Figure 12. Electric and thermal load in the third scenario.
Figure 12. Electric and thermal load in the third scenario.
Smartcities 07 00145 g012
Figure 13. Comparison of the results obtained from the proposed method with other existing methods.
Figure 13. Comparison of the results obtained from the proposed method with other existing methods.
Smartcities 07 00145 g013
Table 1. The comparison of this paper with prior studies.
Table 1. The comparison of this paper with prior studies.
Ref.SolverModelELMEmission ReductionDRCHPP2HBattery IntegrationThermal StorageRelevance to This Study
This PaperGurobiMILPYesYesYesYesYesYesYesComprehensive multi-source energy management under emergency conditions, focusing on CHP, P2H, and DR.
[2]BBONLPNoYesYesYesNoYesNoLimited to emission reduction and DR, lacks emergency load and P2H integration.
[3]MAENLPNoNoNoNoNoNoNoFocused on renewable integration but lacks CHP, DR, and ELM.
[4]GurobiMILPNoNoYesYesYesYesYesSimilar MILP-based model but no focus on emergency conditions, limiting relevance for load emergencies.
[5]NSGA-IIINLPNoYesNoNoNoNoNoFocused on emission reduction, lacks comprehensive energy management, emergency handling, and thermal storage integration.
[6]GurobiMILPNoYesYesYesNoNoYesLimited focus on CHP and renewables, lacks P2H and emergency load scenarios.
[7]PSONLPNoYesNoNoNoNoNoEconomic and environmental optimization but lacks emergency management and thermal integration.
[8]PSO-BATNLPNoYesNoNoNoNoNoHybrid approach to thermal plants, lacks renewable and storage integration.
[9]CCGMILPNoYesYesNoNoYesYesEconomic load distribution amid uncertainties, limited scope on CHP and storage.
[10]-MILPNoNoNoNoNoYesYesFocus on steam extraction for better energy management, lacks comprehensive energy sources.
[11]TLBONLPNoYesNoNoNoNoNoAddresses wind power and load uncertainties but lacks comprehensive renewable and DR integration.
[12]MBONLPNoYesNoNoNoNoYesStochastic model for heat and hydro-PV, lacks CHP and emergency management.
[13]GANLPYesNoYesYesNoYesYesOptimizes microgrids with electrical and gas sources, lacks CHP and thermal integration.
[14]GurobiMIPNoNoNoYesNoYesNoFocuses on renewable and load uncertainties, lacks ELM.
[15]CplexMILPNoYesYesYesYesYesYesModel for heating and cooling optimization, no emphasis on emergencies or renewables.
[16]CplexMILPNoYesYesYesNoYesYesConsiders uncertainties in EV loads, lacks comprehensive thermal integration.
[17]CplexMILPNoYesYesYesYesYesYesMicrogrid coordination but no CHP or P2H integration.
[18]HeuristicMINLPNoNoYesNoNoYesNoFocuses on unit participation in energy systems, lacks CHP and DR programs.
[19]CplexMILPNoYesYesYesNoYesYesThermal and electrical scheduling, lacks emergency management.
[20]-NLPNoNoNoNoNoYesNoStochastic solar thermal model, lacks CHP integration.
[21]DSNLPNoYesYesYesNoYesYesDynamic simulation of thermal and electrical energy management, lacks emergency handling.
[22]CCGMICPNoYesYesNoNoNoNoOptimal load and energy operation in grids but lacks emergency load scenarios.
[23]GWONLPNoNoNoNoNoNoNoEnergy management algorithm for DC nanogrids but lacks CHP or emergency load focus.
[24]CCGMILPNoNoYesYesNoNoNoEnergy distribution in thermoelectric systems, lacks comprehensive emergency handling.
[25]-NLPNoNoNoYesNoNoYesExplores feasibility of CHP systems, lacks P2H integration.
[26]-MILPNoYesYesNoNoYesYesOptimizes distributed energy but lacks emergency load handling.
[27]HeuristicNLPNoYesYesYesNoYesYesMulti-objective planning for energy hubs, lacks emergency focus.
[28]CCGMILPNoNoYesNoNoYesYesFocuses on electricity and gas transmission grids, lacks emergency management.
Table 2. CHP resource cost parameters.
Table 2. CHP resource cost parameters.
CHP1CHP2CHP3CHP4
a i 2.0350.57681.18250.338
b i 60.2857.78365.3489.1476
c i 44133.091544547.619
α i 14.42963.035819.381.0346
β i 64.153557.3403176.694660.384
δ i 130.4094311.5728821.6573943.1898
s u i 400200300100
s d i 30010020050
H R i 11041113731058112186
μ i h e a t 0.30.50.30.5
μ i e x 0.90.90.90.9
ESS
B i t , m a x , d i s B i t , m a x , c h a ϑ i b a t η b a t t o t a l
56702500.9
Heat storage tank
h i t , m a x , d i s h i t , m a x , c h a ϑ i t a n k η h e a t t o t a l
1602004000.9
Electric and thermal DR
η R e l e c η R h e a t
0.10.1
Table 3. CHP resource slope parameters.
Table 3. CHP resource slope parameters.
CHP1CHP2CHP3CHP4
Min up time1111
Min down time1010
Ramp up rate45204010
Ramp down rate45204010
Table 4. Thermal and electrical storage parameters.
Table 4. Thermal and electrical storage parameters.
Heat Storage TankBattery
Φ i m a x , c h a 10 Θ i m a x , c h a 13
Φ i m a x , d i s 5 Θ i m a x , c h a 6
ϑ i t a n k 400 kWhth ϑ i b a t 250 kWh
Table 5. Daily heat and electrical load with production of PV and wind resources.
Table 5. Daily heat and electrical load with production of PV and wind resources.
h D t , e l e c (kWh) D t , h e a t
(kWhth)
G 1 t , P V
(kWh)
G 1 t , w d
(kWh)
h D t , e l e c
(kWh)
D t , h e a t
(kWhth)
G 1 t , P V
(kWh)
G 1 t , w d
(kWh)
1796901.8132522425217.0
2776701.5142272175018.0
3695901.2152081984819.0
4655501.0161961864620.0
5796901.0172102003220.0
61089802.5182462361618.0
715214284.019254244816.0
8185175166.020223213014.0
9219209328.021164154012.0
102422324610.02212711708.0
112542444812.0231009005.0
122622525015.024887802.0
Table 6. Simulation results in the first scenario.
Table 6. Simulation results in the first scenario.
Hour G 1 t , C H P
(kWh)
G 2 t , C H P
(kWh)
G 3 t , C H P
(kWh)
G 4 t , C H P
(kWh)
D R t , e l e c
(kWh)
D t , e l e c
(kWh)
G 1 t , P V n
(kWh)
G 1 t , w d
(kWh)
B 1 t , c h a
(kWh)
B 1 t , d i s
(kWh)
144.1430.47010.2086.97902.000
242.830010.0384.77701.800
339.526.108.7975.96901.500
40.038.32012.3871.56501.200
544.4731.13010.2086.97901.000
652.3734.232011.12118.810801.000
783.9745.732014.8167.215202.580
893.5748.92016.1189.61856.854.09.140
993.047.62016.120621923.36.08.660
10100.3451.3720.117.723024232.68.013.30
1191.6744.92016.122925446.8710.01.130
1298.046.92017.132622625012.0018.27
1390.6422016.223325249.4815.02.510
1490.3341.22016.423122746.117.03.880
1589.039.72016.1223.20840.218.07.7650
1688.6738.92016.121119628.8819.017.120
1788.3338.272016.1211.221028.320.03.600
1898.3343.9720.617.9221.42461620.004.17
19109.050.822.519.6254254818.0026.3
2092.7742.132016.4200.7223016.0013.1
2179.3335.372013.7162164014.000
2260.823.3209.62125127012.000
2348.016.47206.601104.810008.005.65
2447.7317.67206.33296.78805.000.005
Total1766.7905.5403.3332.340864086376.823375.167.629
Hour H i t
(kWhth)
h 1 t , c h a
(kWhth)
h 1 t , d i s
(kWhth)
D R t , h e a t
(kWhth)
D t , h e a t
(kWhth)
F i t ( U S D ) E i t ( g / k W h ) Z
197.922.03075.96928768355
295.621.95073.76727465339
385.020.15064.95921652268
490.329.84060.55531196407
597.922.03075.96928768355
6126.118.340107.898379120499
7176.220.090156.2142767219986
8192.500192.51759242591183
9192.60.010192.62099252601185
10208.800208.823210973021399
11192.6058.9251.52449252601185
12204.2047.725225210482911339
13193.9023.8217.82429392631202
14195.300195.32179532671220
15192.600192.61989252601185
16192.600192.61869252601185
17192.600192.62009252601185
18212.400212.423611333141447
19232011.924424413523741726
20197.405.97203.42139752731248
21169.400169.4154704205909
22128.700128.7117392128520
239900999022586311
2496.3210.52085.87821383296
Total3863164.9148.43846384617,101483321,934
Table 7. Simulation results in the second scenario.
Table 7. Simulation results in the second scenario.
Hour G 1 t , C H P
(kWh)
G 2 t , C H P
(kWh)
G 3 t , C H P
(kWh)
G 4 t , C H P
(kWh)
D R t , e l e c
(kWh)
G 1 t , P V n
(kWh)
B 1 t , c h a
(kWh)
B 1 t , d i s
(kWh)
146.99630.27909.624386.9000
245.53929.70809.453884.7000
34027.19508.704475.9000
4038.4412012.05870.499000
54531.817010.08386.9000
654.88133.3722010.547118.8000
767.80338.442012.059138.3080
884.30244.9112013.989166.53.298512.7020
992.47250.4132015.747197.118.46813.5320
10102.2657.00120.03417.852217.820.65825.3420
1195.27949.8332015.488228.64800
1296.34750.2522015.61326250029.788
1382.73444.9132014.02226.852013.132
1494.1153.4292016.768204.319.99330.0070
1586.01847.9812015.026187.218.17529.8250
1680.90744.5392013.927176.417.02728.9730
1786.8748.5542015.2118918.36713.6330
1882.73444.9132014.02221.416043.732
19107.3660.86321.00219.0992548037.68
2094.251.552016.11200.70018.84
2172.21640.1712012.575147.6002.639
2260.07433.2362010.395123.7000
2353.5328.82908.986891.346000
2447.28324.62307.642579.549000
Total1718.91005.3361.043153836289.99162.01145.81
Hour H i t
(kWhth)
h 1 t , c h a
(kWhth)
h 1 t , d i s
(kWhth)
D R t , h e a t
(kWhth)
Ω t , e l e c
(kWhth)
Ω t , h e a t
(kWhth)
Z
196.62334.333062.2900236
294.34333.853060.4900225
385.04431.754053.2900183
488.88739.198049.6900308
597.85435.565062.28900242
6124.8336.435088.3900388
7145.0317.0410127.9900511
8170.8400170.8300700
9188.100188.100841
10208.800208.8001030
11189.21030.394219.600854
12190.88061.12425200869
13169.59048.213217.800688
14195.300195.300901
15178.200178.200755
16167.400167.400671
171800018000770
18169.59042.813212.41010688
19221.18022.818244001153
20191.700191.76060872
21151.9300151.936060558
22128.700128.76060412
239900996060251
2485.80085.800189
Total3618.8228.18205.36359625025014,295
Table 8. Simulation results of the third scenario.
Table 8. Simulation results of the third scenario.
Hour G 1 t , C H P
(kWh)
G 2 t , C H P
(kWh)
G 3 t , C H P
(kWh)
G 4 t , C H P
(kWh)
D R t , e l e c
(kWh)
G 1 t , P V n
(kWh)
B 1 t , c h a
(kWh)
B 1 t , d i s
(kWh)
151.82126.77608.303586.9000
250.36326.20408.13384.7000
344.53223.91707.450975.9000
4039.4242012.07671.5000
54532.02909.870786.9000
659.70629.868209.226118.8000
791.77542.4472012.978167.2080
8108.9949.19721.69814.991203.58.62777.37230
9116.8252.74623.26116.074240.93200
10120.2954.10823.96116.48260.844600
11115.1150.62122.96115.366252.064800
12115.9251.16623.11715.542625006.2553
13120.2954.10823.96116.48269.275202.436
14111.4450.63722.17815.445249.75000
15110.6850.34122.02615.357228.830.39217.6080
16110.6850.3422.02615.357215.617.19528.8050
17111.0350.47722.09615.39723131.99900
18120.2954.10823.96116.48230.841600
19126.0457.98225.07217.7192548019.186
20120.2954.10723.96116.48229.640014.8
2197.52438.7792011.581176.04008.1577
2278.26425.81207.4366136.28004.7733
2364.37316.456206106.83000
2454.81620696.8000
Total2146997.65440.28306.234336390.217061.78755.608
Hour H i t
(kWhth)
h 1 t , c h a
(kWhth)
h 1 t , d i s
(kWhth)
D R t , h e a t
(kWhth)
Υ t , e l e c
(kWhth)
Υ t , h e a t
(kWhth)
Z
193.62517.725075.900301
291.34517.645073.700286
382.22617.326064.9020231
490.31229.813060.5020422
597.83321.933075.92020322
6121.8314.0270107.82020503
7171.9815.780156.22020964
8200.247.74120192.52001306
9214.6600214.6620101500
10220.6500220.6520201586
11208.91059.488268.40201429
12210.75041.251252001453
13220.65020.626241.27001586
14205.3900205.39001372
15204.0900204.09001354
16204.0900204.091001354
17204.6900204.692001362
18220.6500220.652001586
19233.69010.313244001770
20220.6505.1564225.82001586
21169.400169.4200966
22128.700128.7200604
23101.712.7119099200420
2493.1357.3355085.800351
Total4011.2152.04136.83399625015024,614
Table 9. Comparison of the proposed method with evolutionary methods.
Table 9. Comparison of the proposed method with evolutionary methods.
Method Z (Objective)
First ScenarioSecond ScenarioThird Scenario
Proposed21,93414,29524,614
BBO [2]31,99818,58435,658
NSGA-III [5]27,07515,72530,215
PSO [7]29,53717,15432,587
Table 10. Sensitivity Analysis Results for Varying Renewable Outputs.
Table 10. Sensitivity Analysis Results for Varying Renewable Outputs.
ScenarioRenewable Output (kWh)Total Energy Cost (USD)Battery Discharge (kWh)Battery Charge (kWh)DRP Load Adjustments (kWh)CHP Energy Generation (kWh)
Base Case (100%)50021,934300400501200
Low Output (80%)40025,5005005001501500
High Output (120%)60018,500200350251000
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.

Share and Cite

MDPI and ACS Style

Jokar, H.; Niknam, T.; Dehghani, M.; Siano, P.; Ouahada, K.; Aly, M. Integrated Energy Management in Small-Scale Smart Grids Considering the Emergency Load Conditions: A Combined Battery Energy Storage, Solar PV, and Power-to-Hydrogen System. Smart Cities 2024, 7, 3764-3797. https://doi.org/10.3390/smartcities7060145

AMA Style

Jokar H, Niknam T, Dehghani M, Siano P, Ouahada K, Aly M. Integrated Energy Management in Small-Scale Smart Grids Considering the Emergency Load Conditions: A Combined Battery Energy Storage, Solar PV, and Power-to-Hydrogen System. Smart Cities. 2024; 7(6):3764-3797. https://doi.org/10.3390/smartcities7060145

Chicago/Turabian Style

Jokar, Hossein, Taher Niknam, Moslem Dehghani, Pierluigi Siano, Khmaies Ouahada, and Mokhtar Aly. 2024. "Integrated Energy Management in Small-Scale Smart Grids Considering the Emergency Load Conditions: A Combined Battery Energy Storage, Solar PV, and Power-to-Hydrogen System" Smart Cities 7, no. 6: 3764-3797. https://doi.org/10.3390/smartcities7060145

APA Style

Jokar, H., Niknam, T., Dehghani, M., Siano, P., Ouahada, K., & Aly, M. (2024). Integrated Energy Management in Small-Scale Smart Grids Considering the Emergency Load Conditions: A Combined Battery Energy Storage, Solar PV, and Power-to-Hydrogen System. Smart Cities, 7(6), 3764-3797. https://doi.org/10.3390/smartcities7060145

Article Metrics

Back to TopTop