1 Introduction

In the field of energy, Virtual Power Plants (VPPs) have emerged as a groundbreaking solution, creating an effective, flexible, and environmentally conscious energy network. The need for complex approaches to efficiently control and improve the assets within a VPP has arisen due to the integration of sustainable energy sources, decentralized power generation, and advanced technologies. Virtual Power Plants (VPPs) merge sustainable energy sources to optimize productivity and eliminate diminishment. Optimal scheduling strategies distribute and dispatch energy resources considering demand, supply dynamics, and market conditions. Effective management of variability and intermittency is achieved through aggregation and scheduling techniques. VPPs deliver supplementary utilities to enhance grid stability and promote sustainable energy [1, 2].

A Virtual Power Plant (VPP) combines dispersed energy resources (DERs) to operate as a united entity. VPPs use components like solar panels, HVAC, energy storage systems, and demand response programs. This is enabled by advanced control systems, communication technologies, and intelligent algorithms. VPPs go beyond conventional power plants, ensuring a resilient and sustainable energy landscape for the future [3]. Photovoltaic arrays are a significant and increasingly favored renewable energy source that uses sunlight to generate electricity. HVAC systems can be integrated into VPPs, providing advantages such as flexibility, efficiency, and demand-side management. Energy storage systems, including batteries, are crucial components in VPPs, helping to address the variability of sustainable energy sources and optimize grid stability. Electric vehicles can be integrated into VPPs, utilizing their bidirectional charging capabilities to enhance grid stability and energy management. Smart grid technologies have transformed the methods of electricity generation, distribution, and utilization, leading to a more efficient and sustainable grid infrastructure [6, 7, 10, 13, 15].

Continuous examination and evaluation are crucial for advanced Smart Grid technologies. Real-time monitoring, facilitated by sensors and communication networks, provides immediate information for proactive decision-making. In Virtual Power Plants (VPPs), real-time monitoring ensures transparency and empowers operators to optimize resource allocation. The main goal of Smart Grid technologies is to enhance grid infrastructure through performance optimization. Smart Grid technologies utilize advanced analytics to analyze data, forecast demand, and optimize energy dispatch. Ensuring grid stability is important, achieved through fault detection and self-repair mechanisms. In Virtual Power Plants (VPPs), grid reliability is ensured through orchestration of energy resources and cyber security protocols [16,17,18].

  1. (A)

    Aims and Objectives of the study.

The study aims to comprehensively investigate aggregation and optimal scheduling techniques in Virtual Power Plants (VPPs) by reviewing existing literature and case studies. It will evaluate the advantages and challenges of including renewable energy sources, such as photovoltaic arrays, in VPP operations. The impact of incorporating HVAC systems and Energy Storage Systems (ESS) will also be assessed. Additionally, the potential of Electric Vehicles (EVs) as flexible energy assets and the role of Smart Grid technologies in enhancing VPP operations will be explored. Recommendations for optimizing the integration of these technologies will be provided.

2 Literature Review

Virtual Power Plants (VPPs) have surfaced as a feasible and promising solution for the smooth incorporation of different distributed energy resources (DERs) into the electrical grid system, ensuring maximum efficiency. Numerous investigations have been undertaken to delve into the most advantageous scheduling approaches, aggregation techniques, and market engagement of VPPs. The primary objective of this comprehensive examination is to succinctly outline and assess the discoveries presented in pertinent academic works within this field.

Xueting et al. [12] put forth a distributed hierarchically optimal scheduling strategy for the aggregation of Virtual Power Plants (VPPs) within a distribution network. Their proposed method tackles the intricate optimization problem of effectively coordinating multiple VPPs. Nevertheless, the scholarly article fails to delve into the detailed process of aggregating the VPPs, potentially constraining its practicality in real-world situations where aggregation plays a pivotal role in market participation.

Xiong and colleagues [13] directed their attention towards the distributed optimal scheduling of aggregated Electric Vehicles (EVs) and Photovoltaics (PVs), with a particular emphasis on the dynamic distribution locational marginal price (DLMP). With the inclusion of DLMP in their optimization model, their objective was to enhance the economic efficiency of Virtual Power Plants (VPPs). Nevertheless, this investigation failed to take into consideration the aggregation process itself, a crucial element in the expansion of VPP operations.

Yongbo et al. [14] presented an optimization model for VPP scheduling considering both generation and demand sides based on time-of-use electricity prices. While the study addresses various objectives in VPP scheduling, it lacks explicit discussion on the aggregation process of DERs within the VPP, potentially limiting its practical implementation in real-world scenarios.

Haoran et al. [15] introduced a bi-level optimization scheduling technique for multi-VPPs that relies on a complementary water-light-storage system. Their method is designed to improve the profitability of VPPs by coordinating various power sources. However, the study does not specifically focus on the consolidation of VPPs, an aspect that is crucial for successful market engagement and scalability.

Ayana et al. [16] examined the optimal arrangement of Virtual Power Plants (VPPs) in light of distributed generation and energy storage within the context of a carbon rights trading system. Although the article establishes a model that is ideal for both economic and environmental dispatching, it fails to consider the crucial element of aggregating VPPs, which is essential for their seamless integration into the grid infrastructure.

Niloofar and colleagues [17] introduced a optimization framework for Virtual Power Plants (VPPs) in order to consolidate various Distributed Energy Resources (DERs) and organize them for the purpose of supplying energy and reserve services in the wholesale electricity markets. Their research focuses on the consolidation aspect and highlights the importance of participating in the market. Nevertheless, it does not thoroughly explore the particular difficulties and methodologies associated with consolidation, thus opening up opportunities for further investigation.

Existing researches [12,13,14,15,16,17] have made progress in developing optimal scheduling strategies for VPPs, but there is a need for more focus on the aggregation process. This paper aims to address this gap by providing an overview of aggregation techniques and their implications for VPP operation and market participation, including challenges and practical guidance for implementing aggregation strategies.

3 System Model

The analysis of system model targets to thoroughly investigate and understand the complex processes involved in modeling and evaluating different systems in sustainable energy, specifically focusing on photovoltaic systems, heating, ventilation, and air conditioning systems, electric vehicles, and energy storage systems, in order to gain a deep understanding of their operations, assess their effectiveness, and explore potential improvements in sustainable energy. System model is further divided into five sections that are given below.

3.1 PV System

The modeling of PV systems involves analyzing solar cell operation, current-voltage characteristics, an equivalent circuit model, the impact of irradiance and temperature, shading and mismatch effects, modeling of individual components, and using simulation tools for assessment and analysis, with silicon being a widely used semiconductor material due to its abundance and suitable band gap for efficient energy conversion.

When high-energy photons hit the semiconductor in a solar cell, they can cause electrons to move and create electron-hole pairs in the depletion region, which can be described using the concept of optical absorption and the generation rate Eq. 1 denoted as G(x) per unit volume per unit time.

$$\:\text{G}\left(\text{x}\right)=\:{\upalpha\:}\left(\text{x}\right)\:\cdot\:\text{I}\left(\text{x}\right)$$
(1)

where G(x) is the generation rate of electron holes pair at position x, \(\:\alpha\:\left(x\right)\) is the friction of photon absorbed per unit length and act as absorption coefficient at position x, \(\:I\left(x\right)\) is the intensity of photon at position x. The absorption coefficient changes depending on the wavelength of light and material properties of the semiconductor material, but for this study, it remains constant; the frequency of electron-hole pair generation, G(x), can be determined by multiplying the photon flux Φ(x) with the quantum efficiency η, which indicates the likelihood of photons being absorbed and generating electron-hole pairs. Equation 2 is used to represent generation rate in term of photon flux and quantum efficiency.

$$\:\text{G}\left(\text{x}\right) = \:{\upvarphi\:}\left(\text{x}\right)\:\cdot\: {\eta}$$
(2)

The photovoltaic effect can be explained through the application of semiconductor physics principles, specifically the behavior of charge carriers in a p-n junction under an internal electric field Eint, resulting in the separation of electron-hole pairs and the generation of a potential difference Voc across the solar cell. The Eq. 3 can be used to express the voltage as a function of the electric field Eint and the thickness W of the depletion region.

$$\:{\text{V}}_{\text{oc}}=\:{\text{E}}_{\text{int}}\cdot\:\text{W}$$
(3)

After generation, electron-hole pairs have three possible likelihoods: recombination, drift, or diffusion, with recombination competing with carrier extraction for electric current, and these processes can be mathematically expressed using rate and continuity Eqs. 4 and 5. Equation 4 is used to show the rate of change of electrons generated, and Eq. 5 is used to show the time rate of holes created. Time rate of electrons generated is the function of generation rate G(x), recombination rate R(x) and divergence of electronic current density whereas; time rate of holes created is the function of generation rate, recombination rate and divergence of holes current density.

$$\frac{{{\text{dn}}}}{{{\text{dt}}}} = {\text{G}}\left( {\text{x}} \right) - R\left( {\text{x}} \right) - (\nabla \cdot {\text{J}}_{{\text{n}}} )$$
(4)
$$\frac{{{\text{d}}p}}{{{\text{d}}t}} = G\left( x \right) - R\left( x \right) - (\nabla \cdot J_{p} )$$
(5)

The generation rate of electron-holes pair is given in Eq. 1, whereas, recombination rate of electron-holes pair is dependent on electrons (n) and holes (p) concentrations, and irradiative coefficient (B). Equation 6 shows the recombination rate of electrons and holes.

$$\:\text{R}\left(\text{x}\right)=\text{B}\cdot\:\text{n}\cdot\:\text{p}$$
(6)

In equilibrium, G(x) = R(x), which leads to a steady-state carrier concentration. Under non-equilibrium conditions, such as when a solar cell operates under illumination or is connected to an external circuit, changes in carrier concentrations and device performance occur due to altered balance between generation and recombination. The movement of charge carriers under the built-in electric field and their concentration gradients results in a combined drift and diffusion current within a solar cell, which can be expressed as the total current density (J) in Eq. 7.

$$\:\text{J}={\text{J}}_{\mathrm{drift}}+{\text{J}}_{\mathrm{diffusion}}$$
(7)

where drift current density is proportional to the electric field (E), charge mobility µ and elementary charge of electron (n) and holes (p). The drift current density is given in Eq. 8.

$$\:{\text{J}}_{\text{d}\text{r}\text{i}\text{f}\text{t}}=\left(\text{q}\cdot\:\text{n}\cdot\:{{\upmu\:}}_{\text{n}}\cdot\:\text{E}\right)-(\text{q}\cdot\:\text{p}\cdot\:{{\upmu\:}}_{\text{p}}\cdot\:\text{E})$$
(8)

where q is the elementary charge, n is the number of electrons, \(\:{\mu\:}_{n}\) is the charge mobility of electrons, p is the number of holes, \(\:{\mu\:}_{p}\) is the charge mobility of holes, and E is the electric field intensity. The mathematical representation of the diffusion current density Jdiffusion can be found in Eq. 9 by utilizing Fick’s first law of diffusion, a fundamental principle in mass transport phenomena.

$$\:{\text{J}}_{\text{d}\text{i}\text{f}\text{f}\text{u}\text{s}\text{i}\text{o}\text{n}}=\text{q}\cdot\:({\text{D}}_{\text{n}}\cdot\:{\nabla\:}_{\text{n}}-{\text{D}}_{\text{p}}\cdot\:{\nabla\:}_{\text{p}})$$
(9)

\(\:{D}_{n}\) And \(\:{D}_{p}\) are the diffusion coefficients for electrons and holes, \(\:{\nabla\:}_{n}\) and \(\:{\nabla\:}_{p}\) are the gradients for electron and holes concentrations. Equation 8 and Eq. 9 can contribute altogether in the overall current flow in solar cells.

The working of PV systems is greatly impacted by environmental elements like the intensity of sunlight and the surrounding temperature. The variability in the amount of sunlight during the day and the constantly shifting weather conditions play a role in the dynamic character of power production in PV systems. Likewise, alterations in temperature have the potential to influence the effectiveness and voltage properties of solar cells, thereby causing fluctuations in overall performance. The performance of PV systems can be described by mathematical models that relate the variables of irradiance E(x) and temperature T(x) to the output power Pout or other performance parameters. Formula 10, known as the mystical equation, is a widely embraced empirical representation that manifests the majestic power Pout due to the radiant energy E(x) and the climatic temperature T(x).

$$\:{\text{P}}_{\text{o}\text{u}\text{t}}={\text{P}}_{\text{r}\text{e}\text{f}}(1+\:{{\upalpha\:}}_{\text{E}\left(\text{x}\right)}\left(\text{E}\left(\text{x}\right)-{\text{E}\left(\text{x}\right)}_{\text{r}\text{e}\text{f}}\right)+{{\upalpha\:}}_{\text{T}\left(\text{x}\right)}\left(\text{T}\left(\text{x}\right)-{\text{T}\left(\text{x}\right)}_{\text{r}\text{e}\text{f}}\right))$$
(10)

where Pout is the output power, Pref is the reference output power of PV under standard test condition (STC), \(\:{\alpha\:}_{E\left(x\right)}\) is the temperature coefficient power with respect to irradiance E(x), E(x)ref is the reference irradiance of PV under standard test condition, \(\:{\alpha\:}_{T\left(x\right)}\) is the temperature coefficient of power with respect to temperature T(x) at the position x and T(x)ref is the reference temperature at standard test condition (STC) and its typical value is 250C.

With series and parallel connection of PV system changes the value of power, voltage and current of the system. With series connection, the value of current remains same, where value of voltage changes with number of panels. By changing voltage, power is also change with increasing number of panels in series. With parallel connection, the value of voltage remains same, while the value of current changes with number of panels and power of the system also changes with change of current. Equation 11 shows the voltage of series connection, Eq. 12 shows the power of series connection, and Eq. 13 shows the current of parallel connection and Eq. 14 shows the power of parallel connection.

$$\:{\text{V}}_{\text{s}\text{e}\text{r}\text{i}\text{e}\text{s}}=\text{n}\times\:{\text{V}}_{\text{p}\text{v}}$$
(11)
$$\:{\text{P}}_{\text{s}\text{e}\text{r}\text{i}\text{e}\text{s}}={\text{I}}_{\text{p}\text{v}}\times\:{\text{V}}_{\text{s}\text{e}\text{r}\text{i}\text{e}\text{s}}$$
(12)
$$\:{\text{I}}_{\text{P}\text{a}\text{r}\text{a}\text{l}\text{l}\text{e}\text{l}}=\text{n}\times\:{\text{I}}_{\text{p}\text{v}}$$
(13)
$$\:{\text{P}}_{\text{p}\text{a}\text{r}\text{a}\text{l}\text{l}\text{e}\text{l}}={\text{V}}_{\text{p}\text{v}}\times\:{\text{I}}_{\text{p}\text{a}\text{r}\text{a}\text{l}\text{l}\text{e}\text{l}}$$
(14)

The energy output of PV arrays EPV, is determined by the number of arrays, efficiency, area, and solar radiation, and can be calculated using Eq. 15 for each time interval t.

$$\:{\text{E}}_{\text{P} \text{V}}\left(\text{t}\right) = {\text{N}}_{\text{A} \text{r}\text{r}\text{a}\text{y}}\:\times\:{{{\eta}}}_{\text{P}\text{V}}\times\:{\text{A}}_{\text{P}\text{V}}\times\:{\text{G}}_{\text{T}}\left(\text{t}\right)$$
(15)

where NArray is the number of panels per plant, nPV is the efficiency of PV panels, APV is the area of per panel, and GT(t) is the temperature gradient of the area.

3.2 HVAC System

HVAC systems, an acronym for Heating, Ventilation, and Air Conditioning, hold a significant and influential position in architectural structures. By skillfully controlling internal temperature, humidity, air quality, and airflow, these systems create a harmonious and comfortable indoor environment, ensuring the well-being of occupants and the smooth operation of processes and equipment.

Heating in HVAC systems encompasses the intricate process of effectively transferring heat energy from a source to a designated space, thereby significantly augmenting the temperature within said space to create a more comfortable and conducive environment. Equation 16 is based on first law of thermodynamics and it can be used to quantify the amount of heat transferred Q, which is the function of mass m, specific heat capacity c, and change in temperature (Tf - Ti).

$$\:Q=m\times\:c\times\:({T}_{f}-{T}_{i})$$
(16)

Typically, m represents the mass of fluid that is undergoing heating, while c represents the specific heat capacity of fluid. The desired temperature increase is represented by Tf - Ti. The energy balance equation is of utmost importance in comprehending heat transfer in HVAC systems, particularly in buildings, as it is founded on the principle that the energy entering and exiting a system must be equal for thermal equilibrium to be achieved. The equation labeled as 17 serves to illustrate the energy balance equation of HVAC.

$$\:Q=U\times\:A\times\:({T}_{f}-{T}_{i})$$
(17)

The Eq. 17 depicts the rate of heat transfer between two mediums that are separated by a surface area A. This rate is influenced by the temperature difference Tf-Ti and the heat transfer coefficient U, which takes into account the thermal properties of the materials and the mode of heat transfer. The rate of heat transfer, denoted as Q and measured in watts, can be determined using the overall heat transfer coefficient U, which is measured in W/m²K. The surface area A, measured in m², through which heat is transferred also plays a crucial role in this process. The temperature difference, Tf-Ti, between the hot side and the cold side is another important factor to consider.

Ventilation in HVAC systems is a critical component that facilitates the circulation of air within indoor spaces, thereby ensuring the provision of sufficient indoor air quality and comfort. When it comes to representing ventilation mathematically, it often entails the utilization of equations that are directly associated with airflow rates, pressure differentials, and energy consumption. These equations serve as valuable tools for comprehending and analyzing the complex dynamics of air movement and its subsequent impact on the overall performance and efficiency of HVAC systems. The Eq. 18 demonstrates that the rate at which air flows is directly related to both the cross-sectional area and the velocity of the air.

$$\:\text{q}=\text{A}\times\:\text{v}$$
(18)

The airflow rate, denoted by q, is measured in cubic meters per second. The cross-sectional area, through which the air flows, represented by A, is measured in square meters. The velocity of the air, denoted by v, is measured in meters per second. In the realm of ductwork systems, the measurement of pressure drop holds significant significance in guaranteeing the optimal flow of air. This pressure drop, symbolized by ΔP, is ascertainable through the utilization of equations such as the Darcy-Weisbach equation. An abridged rendition of the Darcy-Weisbach equation is represented by Eq. 19.

$$\Delta \:P = f \times \:\frac{L}{D} \times \:\frac{{\rho \: \times \:v^{2} }}{2}$$
(19)

The pressure drop (expressed in Pascals), denoted as ΔP, is contingent upon several factors, including the dimensionless Darcy friction factor (f), the duct’s length (L) measured in meters, the duct’s diameter (D) also in meters, the air’s density (ρ) expressed in kilograms per cubic meter, and lastly, the air’s velocity (v) measured in meters per second. Fan laws elucidate the correlation among airflow, fan velocity, and energy consumption in centrifugal fans. Equation 20 is employed to demonstrate the interrelation of fluid flow rate with respect to fan velocity, Eq. 21 is employed to illustrate the fluid flow pressure in relation to fan velocity, and Eq. 22 is employed to delineate the power consumption in reference to fan velocity.

$$\:\frac{{q}_{2}}{{q}_{1}}=\frac{{N}_{2}}{{N}_{1}}$$
(20)
$$\frac{{P_{2} }}{{P_{1} }} = \left( {\frac{{N_{2} }}{{N_{1} }}} \right)^{2}$$
(21)
$$\:\frac{{S}_{2}}{{S}_{1}}={\left(\frac{{N}_{2}}{{N}_{1}}\right)}^{3}$$
(22)

where q1 and q2 are the fluid flow rate, N1 and N2 are the fan speed rate, P1 and P2 are the pressure of fluid flow, and S1 and S2 are the power consumption of fan. The mathematical Eqs. 18 to 22 present a theoretical structure that facilitates comprehension and examination of ventilation systems in the context of HVAC applications. These equations are indispensable in the process of devising ventilation systems that are both effective in meeting air quality regulations and efficient in terms of energy usage and operational expenses.

Air conditioning in HVAC systems encompasses the intricate and meticulous process of regulating and manipulating temperature, moisture levels, and the overall air purity in order to uphold and sustain a state of utmost comfort and well-being within a designated area or environment. Here are a few fundamental principles that form the foundation of the air conditioning field: Psychrometrics, Refrigeration Cycle.

Psychrometrics pertains to the characteristics of moist air, which encompass temperature, humidity, and enthalpy. The psychrometric chart serves as a visual representation of these properties. The psychrometric equations are complex and encompass various interconnected attributes of moist air, including dry-bulb temperature (Td), and enthalpy (h). Equation 23 depicts a simplified version of the psychrometric equation for enthalpy (h).

$$\:h={c}_{p}{T}_{d}+q({h}_{v}+{c}_{p}{T}_{d}$$
(23)

The enthalpy of moist air, denoted as h (in J/kg), can be calculated using the specific heat capacity of dry air, cp. (in J/kgK), the dry-bulb temperature, Td (in K), the specific humidity, q (in kg of water vapor/kg of dry air), and the enthalpy of water vapor, hv (in J/kg).

The refrigeration cycle of air conditioning system comprised of compression cycle, condensation cycle, expansion cycle and evaporation cycle. The primary function of the compressor is to increase the pressure and temperature of the refrigerant fluid by compressing it, thereby raising its energy level for the subsequent stages of the cooling cycle. The mathematical representation of compression in air conditioning systems can be achieved by applying thermodynamic principles and the ideal gas law, where the relationship between pressure (P), volume (V), and temperature (T) for an ideal gas is expressed by Eq. 24.

$$\:\text{P}\text{V}=\text{n}\text{R}\text{T}$$
(24)

In the realm of gas laws, the variables P and V represent pressure and volume respectively, while n and R represent the quantity of moles and the ideal gas constant. Additionally, the temperature of the gas, denoted by T, is measured in Kelvin. During compression, the refrigerant’s pressure is increased while the volume remains constant, a process that can be mathematically represented by the Eq. 25.

$$\:{\text{P}}_{1}{\text{V}}_{1}={\text{P}}_{2}{\text{V}}_{2}$$
(25)

where P1 and P2 are the initial and final pressures of the refrigerant respectively, and V1 and V2 are the initial and final volumes of the refrigerant respectively. During the compression process, where the volume is kept constant (known as an isentropic process), the refrigerant undergoes a rise in temperature, as described by Eq. 26.

$$\:\frac{{P}_{1}}{{T}_{1}}=\frac{{P}_{2}}{{T}_{2}}$$
(26)

where T1 and T2 are the initial and final temperature of the refrigerant, respectively. Equations 25 and 26 are the ideal gas equations and Eq. 26 indicate that temperature of the refrigerant is increasing proportionally with pressure in the phase of compression and thereby increasing the energy level of the refrigerant with the increase of pressure and temperature.

During the condensation process, the refrigerant undergoes an increase in pressure and temperature, causing it to flow through a condenser coil and release heat to the surrounding environment. This results in a change from a gaseous to a liquid state through condensation, which occurs at a consistent pressure and leads to a temperature decrease. The relationship between pressure, volume, and temperature of the refrigerant before and after condensation can be established using the principles of the ideal gas equation, represented by Eqs. 27 and 28.

$$\:{\text{P}}_{2}{\text{V}}_{2}={\text{P}}_{3}{\text{V}}_{3}$$
(27)
$$\:\frac{{P}_{2}}{{T}_{2}}=\frac{{P}_{3}}{{T}_{3}}$$
(28)

where P2 and P3 are the pressure of refrigerant respectively and V2 and V3 are the volumes of refrigerant, and T2 and T3 are the temperatures of refrigerant at state 2 and state 3.

During the expansion phase, the refrigerant undergoes a decrease in pressure and temperature as it passes through an expansion valve or capillary tube, resulting in a rapid adiabatic expansion with no heat transfer to the surrounding environment, which can be described using Eqs. 29 and 30 of the ideal gas law.

$$\:{\text{P}}_{3}{\text{V}}_{3}={\text{P}}_{4}{\text{V}}_{4}$$
(29)
$$\:\frac{{\text{P}}_{3}}{{\text{T}}_{3}}=\frac{{\text{P}}_{4}}{{\text{T}}_{4}}$$
(30)

The pressures and volumes of refrigerant at state 3 and state 4 are represented by P3, P4, V3, and V4 respectively, while the temperatures of the refrigerant at state 3 and state 4 are denoted as T3 and T4.

Evaporation within air conditioning systems entails the refrigerant absorbing heat, leading to a transformative shift from liquid to gas. This intricate process can be effectively elucidated by employing the principles of thermodynamics and heat transfer. In the course of evaporation, the refrigerant, characterized by low pressure and temperature, enters an evaporator coil, where it draws in heat emanating from the warmer indoor air that passes over the coil. During the evaporation stage of air conditioning, wherein the refrigerant assimilates heat from the indoor atmosphere, it is plausible to explicate the progression by employing the principles delineated in Boyle’s law and Charles’s law. These laws, which pertain to the fundamental attributes of ideal gases, effectively regulate their performance. Equation 31 shows Boyle’s law of refrigerant used in air condition of HVAC whereas 32 shows Charles’s of the refrigerant used in air conditioning of HVAC.

$$\:{\text{P}}_{4}{\text{V}}_{4}={\text{P}}_{1}{\text{V}}_{1}$$
(31)
$$\:\frac{{\text{P}}_{4}}{{\text{T}}_{4}}=\frac{{\text{P}}_{1}}{{\text{T}}_{1}}$$
(32)

where P4 and P1 are the pressures of refrigerant at state 4 and state 1, V4 and V1 are the volumes of refrigerant at state 4 and state 1, T1 and T4 are the temperature of refrigerant at state 1 and state 4 respectively. The compression, condensation, expansion, and evaporation process persists in air conditioning units to remove heat from the indoor air and create a cool environment.

3.3 Modeling of EVs

The process of integrating Electric Vehicles (EVs) into Virtual Power Plants (VPP) necessitates the comprehensive representation of numerous facets pertaining to EV behavior, encompassing the intricate dynamics of charging and discharging, the distinctive characteristics of the battery, as well as the intricate interaction with the power grid. The Battery State of Charge (SoC) phenomenon in an electric vehicle (EV) is characterized by the changes in the quantity of charge contained within the EV battery. The aforementioned alterations occur due to the mechanisms of charging and discharging. This dynamic phenomenon is of utmost importance for comprehending and effectively controlling the energy storage capacities of EV batteries. The mathematical representation of the SoC of EV batteries in relation to time is elucidated by Eq. 33.

$$\:\frac{\text{d}\text{S}\text{o}\text{C}\left(\text{t}\right)}{\text{d}\text{t}}=\frac{{\text{P}}_{\text{c}\text{h}\text{a}\text{r}\text{g}\text{e}}\left(\text{t}\right)}{{\text{E}}_{\text{b}\text{a}\text{t}\text{t}}}-\frac{{\text{P}}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{e}}\left(\text{t}\right)}{{\text{E}}_{\text{b}\text{a}\text{t}\text{t}}}$$
(33)

where SoC(t) is the state of charge of charge of battery at time t. It is used to show the total charge capacity of a battery that is currently stored. Pcharge(t) is the charging power at time t, Pdischarge(t) is the discharging power at time t and Ebatt is the total energy capacity of the battery of EVs and indicates the maximum energy capacity stored by the battery of EVs. The relationship between the charging and discharging rates of a battery is effectively depicted by the Eq. 33, which quantifies the power consumed during these processes. This equation adjusts the balance according to the battery’s overall energy capacity, causing the State of Charge (SoC) to rise when the power used for recharging exceeds that used for discharging, and to decrease when the discharging power exceeds the charging power.

The charging power, denoted in kilowatts, refers to the rate of energy supply from an external source to the battery of an electric vehicle. It is influenced by factors such as charging infrastructure, onboard charger, and chosen charging mode, and can be expressed mathematically by multiplying the charging current and voltage. Equation 34 is used to shows the charging power of the battery of EVs.

$$\:{\text{P}}_{\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)={\text{I}}_{\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)\cdot\:{\text{V}}_{\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)$$
(34)

The discharging of power, denoting the process of extracting energy from the battery of an electric vehicle (EV) in order to operate its electric motor and other functionalities such as heat provision, air conditioning, and the operation of additional accessories, is intricately linked to the velocity at which this energy is acquired. The power utilized for extraction, similar to charging, is measured in kilowatts (kW) and assumes a pivotal role in ascertaining the overall performance and range of the vehicle; it is subject to various influences such as driving conditions, speed, acceleration, and terrain, as the battery converts chemical energy into electrical energy to propel the vehicle forward. Equation 35 is formulated to show the discharging power of the battery of EVs.

$$\:{\text{P}}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)={\text{I}}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)\cdot\:{\text{V}}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)$$
(35)

The Eq. 36 illustrates the overall power transfer going into or coming out of the battery system of the electric vehicle at every moment. An affirmative value for the total power implies that the battery is getting charged, whereas a negative total power signifies that the battery is being utilized to supply power to the vehicle. Comprehending and effectively handling the processes of giving in and taking out of power are fundamental for enhancing the efficiency, output, and distance capabilities of electric vehicles (EVs).

$$\:{\text{P}}_{\text{n}\text{e}\text{t}}\left(\text{t}\right)={\text{P}}_{\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)-\:{\text{P}}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}\left(\text{t}\right)$$
(36)

Electric Vehicle (EV) aggregation involves managing and using multiple electric vehicles as a single unit, allowing for better control over charging and discharging behaviors to improve grid services, stability, and energy management through mathematical Eq. 37.

$${\text{P}}_{{{\text{net}}}} \left( {\text{t}} \right) = \sum\limits_{{{\text{i}} = 1}}^{{{\text{i}} = {\text{N}}}} {{\text{P}}_{{\text{i}}} \left( {\text{t}} \right)}$$
(37)

where Pnet(t) is the total power aggregated by all the EVs at time t, N is the total number of EVs and Pi(t) is the power of ith number of EV. The Eq. 37 summarizes the power contributions of individual electric vehicles (EVs) over a period of time in order to ascertain the overall power output or consumption of the grouped EVs.

The charging or discharging behavior of electric vehicles, influenced by battery charge, charging preferences, driving habits, and grid signals, can impact their power output. During periods of high demand, EV aggregators may synchronize the charging schedules of multiple EVs to minimize stress on the grid and reduce electricity costs. In instances of high renewable energy availability, electric vehicles can be used to absorb surplus energy through vehicle-to-grid capabilities, aiding in grid stabilization and renewable energy integration. This allows them to offer grid-balancing services and support the integration of renewable energy. This enables them to offer grid-balancing services and support the integration of renewable energy. This allows them to provide grid-balancing services and support the integration of renewable energy. The formula 38 demonstrates how the total power contribution fluctuates dynamically over time as individual EVs adjust their charging or discharging rates. The total energy transferred by all aggregated EVs over a specified time interval can be calculated using the Eq. 39.

$$\frac{{{\text{dP}}_{{{\text{net}}}} \left( {\text{t}} \right)}}{{{\text{dt}}}} = \sum\limits_{{{\text{i}} = 1}}^{{{\text{i}} = {\text{N}}}} {\frac{{{\text{P}}_{{\text{i}}} \left( {\text{t}} \right)}}{{{\text{dt}}}}}$$
(38)
$$\:{\text{E}}_{\text{n}\text{e}\text{t}}=\underset{\text{t}1}{\overset{\text{t}2}{\int\:}}{\text{P}}_{\text{n}\text{e}\text{t}}\left(\text{t}\right)\text{d}\text{t}$$
(39)

By treating multiple electric vehicles as a unified resource, EV aggregation has the potential to enhance grid flexibility, demand response, and renewable energy integration, allowing for precise control and coordination of charging and discharging activities for efficient energy management and grid optimization.

3.4 Distributed Energy Storage System

Distributed energy storage (DES) involves placing energy storage systems throughout an electrical grid, near end-users or localized energy generation facilities, to address local energy demands, improve grid resilience, and optimize energy management, playing a crucial role in modernizing power systems, integrating renewable energy resources, and enhancing grid flexibility. Energy storage systems, such as batteries, flywheels, thermal storage, and super capacitors, are the main component of DES that retain electrical energy and can accumulate surplus energy during periods of low demand or high renewable generation to stabilize the equilibrium between supply and demand, and the battery’s energy capacity can be determined using Eq. 40 in either watt-hours or kilowatt-hours for precise measurement.

$$\:{\text{E}}_{\text{b}\text{a}\text{t}}=\text{Q}\times\:{\text{V}}_{\text{n}\text{o}\text{m}}$$
(40)

where Ebat is the energy of battery capacity, Q is the rated charge capacity and Vnom is the nominal voltage of the battery. The SoC represents the fraction of total energy capacity which is stored in a battery. It is always measured in percentage and it is the ratio of charge stored by battery and total charge capacity. Equation 41 shows the fraction of total energy capacity in term of state of charge.

$$\:\text{S}\text{o}\text{C}=\frac{{\text{Q}}_{\text{s}\text{t}\text{o}\text{r}\text{e}\text{d}}}{{\text{Q}}_{\text{t}\text{o}\text{t}\text{a}\text{l}}}$$
(41)

where Qstored is the amount of charge stored by battery, Qtotal is the total charge capacity of a battery. Battery charging power is the amount of power that can charge a battery. It is mostly measured in watt or in Kilowatt. It is the product of charging current and charging voltage. Similar to the battery charging power, battery discharging power is also the product of discharging current and discharging voltage. The efficiency of the battery can be determined from the efficiency of the battery. The efficiency of the battery is the ratio of energy supplied by battery to the energy taken by battery as formulated by Eq. 42.

$$\: {\eta} =\frac{{\text{E}}_{\text{o}\text{u}\text{t}}}{{\text{E}}_{\text{i}\text{n}}}$$
(42)

where ɳ is the efficiency of battery, Eout is the energy supplied by battery, Ein is the energy taken by battery. But the efficiencies that are accounting for losses during charging and discharging are formulated by Eqs. 43 and 44. Charging efficiency is the ratio of stored energy and total input energy whereas discharging efficiency is the ratio of supplied energy and total stored energy.

$$\:{\eta}_{\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}=\frac{{\text{E}}_{\text{s}\text{t}\text{o}\text{r}\text{e}\text{d}}}{{\text{E}}_{\text{i}\text{n}}}$$
(43)
$$\:{\eta}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{i}\text{n}\text{g}}=\frac{{\text{E}}_{\text{s}\text{u}\text{p}\text{p}\text{l}\text{i}\text{e}\text{d}}}{{\text{E}}_{\text{S}\text{t}\text{o}\text{r}\text{e}\text{d}}}$$
(44)

A crucial principle in the domain of battery technology, describes the complex and non-linear relationship that exists between the discharge rate of a battery and its total capacity is Peukart’s law. This crucial law takes into consideration the compelling reality that as the discharge rate of a battery escalates to higher levels, the effective capacity of said battery tends to diminish due to internal losses that occur within the battery system. The heightened rate of discharge leads to internal losses, which are a critical factor to consider when evaluating the actual capacity of a battery and its ability to sustain a consistent level of performance over time. Equation 45 is used to represent Peukart’s law.

$$\:{\text{I}}_{\text{d}\text{i}\text{s}\text{c}\text{h}\text{a}\text{r}\text{g}\text{e}}={\text{I}}_{\text{r}\text{a}\text{t}\text{e}\text{d}}\times\:{\left(\frac{\text{C}}{{\text{C}}_{\text{r}\text{a}\text{t}\text{e}\text{d}}}\right)}^{\text{K}}$$
(45)

where Idischarge is the discharging current of battery, Irated is the rated current of battery, C is the actual capacity of the battery, Crated is the rated capacity of the battery and K is Peukart’s constant or Peukart’s exponent and its value is ranging from 1.0 to 1.3 for lead acid battery and it is dimensionless quantity.

3.5 Bidirectional grid Interconnection

A bi-directional interconnection between the power grid and virtual power plant (VPP) is required to ensure the efficient transmission of surplus energy and to receive required energy from the grid, which involves physical connection, adherence to regulations, and establishing a framework of variables and constraints. The variables precisely measure and analyze the energy transfer between the consumer’s site and the grid, while also facilitating a comprehensive understanding of energy flow dynamics in both directions.

The variable Psell is employed as a means to denote the power that is sold to the grid, and its negative numerical value signifies the act of selling energy. Pbuy, on the other hand, is utilized to symbolize the power that is procured from the grid, and its positive numerical value signifies the act of purchasing energy. Psurplus serves as a representation of the surplus power that is generated locally. Pdemand serves to illustrate the energy demand that originates from the consumer. The net power flow between electrical grid system and virtual power plant is the difference between power sold to the grid and power bought from electrical grid system as formulated by Eqs. 46 and 47.

$$\:{\text{P}}_{\text{n}\text{e}\text{t}}={\text{P}}_{\text{s}\text{e}\text{l}\text{l}}-{\text{P}}_{\text{b}\text{u}\text{y}}$$
(46)
$$\:{\text{P}}_{\text{S}\_\text{D}}={\text{P}}_{\text{s}\text{u}\text{r}\text{p}\text{l}\text{u}\text{s}}-{\text{P}}_{\text{d}\text{e}\text{m}\text{a}\text{n}\text{d}}$$
(47)

where Pnet is the total power, Psell is the delivered to the grid by virtual power plant, Pbuy is the power delivered by grid to virtual power plant. PS_D is used to show the disparity between surplus power produced by virtual power plant and demand power of consumer.

The function depicted in Eq. 48 yields the utmost value among two entities, namely PS_D and 0. This particular function guarantees that the value of Psell​ remains non-negative. In the event that the outcome of PS_D is affirmative (thus indicating an excess of energy), Psell ​shall correspond to this surplus value. Conversely, if the outcome is negative (pointing towards an insufficiency of surplus energy), Psell​ shall be assigned a value of zero, thereby signifying the impossibility of selling any surplus energy back to the grid.

$$\:{P}_{sell}=\text{m}\text{a}\text{x}(0,\:{P}_{{S}_{D}})$$
(48)

Function Pbuy is formulated by Eq. 49 is used to show the power bought from electrical grid system to operate the components of virtual power plant. In this case surplus power is lower than demand power. PD_S is the difference between demand power and surplus power.

$$\:{P}_{buy}=\text{m}\text{a}\text{x}(0,\:{P}_{DS})$$
(49)

Bi-directional grid interconnection is established in adherence to relevant regulations and standards by effectively maintaining the net power flow within regulatory limits and ensuring that the power sold and bought do not surpass the specified thresholds.

4 Aggregation Method of VPP

This section provides an overview of the methodology utilized to examine the consolidation and ideal scheduling of a Virtual Power Plant (VPP). The VPP encompasses a variety of dispersed energy resources (DERs), such as photovoltaic (PV) arrays, electric vehicles (EVs), heating, ventilation, and air conditioning (HVAC) systems, and energy storage systems (ESS). The aim is to assess the economic feasibility and efficiency of the VPP in optimizing energy consumption and maximizing earnings by selling surplus energy back to the power grid.

4.1 Method for Modeling of PV System

The operational procedure for photovoltaic arrays involves a sequence of measures to ensure efficiency. This includes setting the number of time intervals for analysis and defining array specifications. Determining constants and parameters for the PV model and estimating installation and maintenance costs are also important. The choice of season impacts solar radiation and temperature, affecting energy production. The conversion of DC to AC power is done with attention to inverter effectiveness and power factor. Results are displayed iteratively for analysis and optimization of virtual power plants, enabling informed judgments and suggestions to improve effectiveness and productivity. The Overall method of PV arrays for simulation and designing of MATLAB based model is shown in Fig. 1.

Fig. 1
figure 1

Flow chart for modeling and simulation of PV system

4.2 Method for Modeling of HVAC

A variety of coefficients and parameters are used to effectively operate the HVAC system, with the main aim of accurately representing its complex functionality; the model relies on user inputs and crucial parameters to forecast power consumption and simulate behavior, making them integral to ensuring accuracy in the simulation process. The simulation process is designed to capture the natural variations in HVAC power consumption throughout different seasons by considering changes in temperature, moisture, and other environmental factors, and the outcomes are visually presented as graphs to facilitate clear understanding of the system’s behavior and relationships. The HVAC system’s operating parameters and coefficients are carefully determined to accurately model its behavior, with user inputs playing a crucial role in simulating power usage and accounting for seasonal fluctuations, ultimately resulting in visually represented simulation results that facilitate understanding of the data. The Overall method for designing and simulation of Heat, ventilation and air conditioning using MATLAB as a software tool can be efficiently analyzed with help of flow chart as illustrated in Fig. 2.

Fig. 2
figure 2

Flow chart for modeling and simulation of HVAC

4.3 Method for Modeling of EVs

In the dedicated section for electric vehicles (EVs), a comprehensive discussion is provided on the important factors for their efficient operation, including the examination of existing EVs and the boundaries for charging and discharging powers, which is crucial in improving the efficiency and effectiveness of EVs and supporting sustainable and eco-friendly mobility solutions. An advanced simulated approach is used to accurately represent the charging and discharging patterns of each electric vehicle, through the implementation of a carefully crafted control strategy that regulates power levels based on electricity prices, resulting in comprehensive graphical representations of the charging power, discharging power, and state of charge (SoC) of the vehicles, offering a detailed overview of their operational performance. The overall method for integration of electric vehicles in virtual power plant can easily be analyzed with more efficient way with an insight of flow chart of EVs as illustrated in Fig. 3.

Fig. 3
figure 3

Flow chart for modeling of EVs in the context of VPP

4.4 Method for Modeling of ESS

The successful operation of an energy storage system (ESS) requires careful consideration of factors such as efficiency, power limits, and state of charge (SoC). Simulations are carried out using a control strategy that relies on fluctuations in electricity prices to determine charging and discharging powers. The outcomes of these simulations are visually represented through plots, providing a comprehensive visualization and valuable insights into the behavior and performance of the ESS. The overall method for electrical energy storage system can be illustrated with help of flow chart and Fig. 4 is used to illustrate the whole method for energy storage system of virtual power plant.

Fig. 4
figure 4

Flow chart for modeling and simulation of ESS in the realm of VPP

4.5 Integration of VPP into Electrical grid

The integration and implementation of the Virtual Power Plant (VPP) involves combining various components, such as PV arrays, HVAC systems, EVs, and an ESS, with the existing electrical grid infrastructure. This integration aims to effectively inject electrical power into the grid by aggregating and synchronizing the power outputs from each component. It is crucial to ensure that the injected power does not exceed the predetermined upper limit set by regulatory authorities to avoid any adverse effects. Graphical representations of the power injection over time provide valuable insights into the contributions of each component and the interactions between the VPP and the electrical grid. The method for integration of VPP into electrical grid system can be shown with help of flow chart and the flow chart is illustrated with help of Fig. 5.

Fig. 5
figure 5

Flow chart for modeling and simulation of unification of VPP into electrical grid system

5 Result and Discussion

The findings have enhanced our understanding of the system’s dynamic characteristics and energy exchanges, and we will discuss the outcomes of each component of the virtual power plant and their broader implications in power generation and distribution.

The calculation of PV energy production is conducted for each specific time frame, taking into account the solar radiation values provided for the chosen season and the designated efficiency of the PV arrays. The Fig. 6 visually illustrates that the cumulative solar irradiance increases from 0 Wh/m²/nm at the start of the time interval to a peak of approximately 300 Wh/m²/nm in the middle of the interval, before decreasing back to 0 Wh/m²/nm at the end.

Fig. 6
figure 6

Solar irradiance during summer

The graph’s configuration toes the line to the customary pattern of the diurnal solar irradiance cycle, with the sun reaching its peak luminosity at noon, gradually diminishing throughout the forenoon and afternoon. Figure 6 is the solar irradiance of sun during summer and the Fig. 7 which can be shown below is used to illustrate the solar irradiance during winter.

Fig. 7
figure 7

Solar irradiance during winter

The solar irradiance was subjected to technical analysis, which revealed noteworthy discrepancies in the duration and intensity of sunlight throughout different seasons. The summer season, characterized by approximately 10 h of sunshine, experiences a peak solar irradiance of 250 W-hours per square meter per nanometer (Wh/m²/nm), signifying elevated levels of solar radiation. Conversely, during winter, the hours of sunlight decrease to around 8 h, accompanied by a peak solar irradiance of 200 Wh/m²/nm. The geographical and climatic factors in Union Council Dallan District, Hangu, KPK, Pakistan, greatly influence the design and implementation of solar energy systems, and understanding the seasonal variations enables efficient use of solar resources for sustainable energy generation.

The analysis of solar irradiance shows seasonal fluctuations in sunlight length and strength. The highest solar irradiance is 250 Wh/m²/nm in summer and decreases to 200 Wh/m²/nm in winter. This highlights the importance of understanding seasonal variations in solar energy availability for effective energy planning. Analyzing the power generated by a single photovoltaic (PV) panel throughout a summer day provides more insight into solar energy production. The power output starts at around 100 watts in the morning and steadily increases, reaching over 500 watts at midday. As the day progresses towards sunset, power generation gradually decreases until it reaches its minimum level. The observed trend highlights the connection between solar radiation and power generation, emphasizing the importance of using advanced energy management techniques to maximize solar resources. Figure 8 displays the power output of a single PV panel on a hot summer day.

Fig. 8
figure 8

Output power of single solar panel during summer

The configuration of a photovoltaic (PV) system is composed of 100 solar plants, each containing arrays of 10 PV panels of 500 W. To ensure optimal performance and integration with the power system, it is crucial to carefully consider the characteristics of the PV arrays, the inverter’s design parameters, and the grid connection parameters. Thorough analysis and consideration of these factors can enhance the efficiency and functionality of the entire PV system, leading to exceptional outcomes. In addition to explicitly specifying the grid connection parameters, the PV energy output and information on the system’s operation provide valuable insights. Furthermore, it is crucial to thoroughly examine the intricate economic aspects of implementing and endorsing PV systems to fully understand their diverse characteristics and outcomes. Figures 9 and 10 depict the active and reactive power provided to the electrical grid system by 100 PV plants daily, with the x-axis representing time in hours and the y-axis in Fig. 9 showing active power in watts (W) and in Fig. 10 showing reactive power in VAR.

Fig. 9
figure 9

Active power generation of 100 PV plants

Fig. 10
figure 10

Reactive power of 100 inverters of PV plant

Figure 9 illustrates the active power output generated by 100 photovoltaic plants throughout the day, showing the impact of sunlight intensity and system performance. The power output rises steadily as solar radiation increases, peaking at midday, and gradually decreases towards sunset, emphasizing the need for effective energy management to address fluctuations and maintain grid stability. The bar graph in Fig. 10 illustrates the relationship between reactive power output and active power delivery from 100 photovoltaic plants. Reactive power, measured in VAR, is crucial for maintaining voltage levels and grid stability. The graph shows how variations in active power output influence the fluctuations in reactive power throughout the day, highlighting the importance of controlling reactive power for optimizing power factor, reducing line losses, and enhancing grid performance.

Figure 11 presents a comprehensive portrayal of the power consumption of the HVAC system during a 24-hour period, consisting of three separate subplots. The uppermost subplot centers on the heating phase of HVAC operation; however, due to the summer season, the power consumption for heating remains consistently at zero for duration of 14 h. Conversely, the middle subplot demonstrates the power consumption for air conditioning, which maintains a constant demand of 20 MW throughout the entire day to ensure optimal control of the indoor climate. The lower subplot showcases the power consumption for ventilation, initially reaching a peak of 3 MW and gradually decreasing to 1.8 MW over time, indicating a decrease in the energy requirement of the ventilation system as the day progresses. This graphical representation effectively emphasizes the dynamic patterns of energy consumption exhibited by the different components of the HVAC system throughout the day.

Fig. 11
figure 11

Power consumption of HVAC during summer

Figure 12 provides important information on the energy usage of the HVAC system in winter. At the outset, in line with expectations for colder weather, there is a rapid surge in heating power, with the system swiftly escalating from zero kilowatts (kW) to 20 kW within the initial hour. This significant increase indicates the system’s immediate responsiveness in rectifying the temperature deficit within indoor spaces. Subsequently, the heating power stabilizes at 20 kW for an extended duration of around 12 h, signifying a sustained effort to uphold the desired temperature level indoors. As the 24-hour period comes to an end, it is worth noting that there is a marginal decrease in the heating capacity, specifically to 16 kW. This suggests a gradual adjustment that occurs throughout the day or as a reaction to external factors such as changes in the ambient temperature.

During winter, the thermal load and airflow demand remain negligible due to the absence of requirements for cooling and ventilation, resulting in zero cooling capacity and ventilation rate throughout the diurnal cycle.

Fig. 12
figure 12

Power consumption of HVAC during winter

The visual representation in Fig. 13 offers valuable insight into the fluctuation of indoor temperature over a 24-hour period. It shows a consistent passage of time along the x-axis and accurately depicts temperature in degrees Celsius (°C) on the y-axis. The temperature starts at 46 °C, gradually decreases, and eventually stabilizes at 32 °C. Notably, there is a significant phase from the tenth to the fifteenth hour where the temperature rapidly drops by 10 °C. This observation requires further investigation and analysis. The decrease in temperature indicates an increased cooling effect, possibly caused by the activation of cooling systems or environmental changes, emphasizing the effectiveness of temperature regulation mechanisms in reducing indoor heat and ensuring comfortable living conditions, highlighting the need for efficient cooling strategies to ensure occupant well-being and satisfaction.

Fig. 13
figure 13

Indoor temperature of HVAC during summer

The graph in Fig. 14 visually presents the variation in indoor temperature within an HVAC system during winter. Starting from a cold − 5 °C, the indoor climate gradually warms up to a comfortable 20 °C, demonstrating the system’s effectiveness in providing warmth and ensuring a pleasant indoor atmosphere. This temperature increase highlights the system’s ability to regulate indoor conditions and maintain thermal comfort despite external weather conditions, emphasizing its crucial role in sustaining optimal comfort throughout the winter season.

Fig. 14
figure 14

Indoor temperature of HVAC during winter

Figure 15 illustrates the power profiles of electric vehicles (EVs) over a 24-hour period. The rate of electric power supply gradually rises, peaking at approximately 9.5 kilowatts after approximately 2.5 h. This indicates a steady increase in electricity demand, attributed to the growing number of connected EVs. Subsequently, the charging power experiences a slight decrease to 5.5 kW for duration of 30 min. This suggests that certain EVs may have reached their desired state of charge. Following a brief decline, the level of charging power remains constant at 5.5 kW for an additional hour, indicating that the majority of EVs are consistently receiving a uniform level of power. Subsequently, at the three-and-a-half-hour mark, the charging power begins to decrease once again, ultimately reaching 2 kW after an additional hour. This decline could potentially indicate that the remaining EVs have either completed their charging process or that the charging infrastructure has reached its maximum capacity. From the fifth hour until the eighth hour, the charging power gradually and non-linearly increases to reach 3.5 kW, and this level is maintained for the remainder of the day. This trend suggests that the demand for charging continues to grow steadily, potentially due to changes in usage patterns or the availability of charging stations. In conclusion, the power profile depicted in Fig. 15 emphasizes the dynamic nature of EV charging demands and underscores the importance of effective management of the charging infrastructure to ensure optimal utilization and minimize congestion issues.

Fig. 15
figure 15

Charging power of EVs with a passage of time

The power profile of electric vehicles (EVs) discharged over a 24-hour period exhibits distinct patterns and fluctuations, with the power discharge initially increasing linearly from zero to 2.7 kW in the first hour, followed by a decrease to 2.3 kW in the second hour, and subsequently increasing to 2.8 kW in the third hour, indicating a surge in EV activity during that specific hour. The power then stabilizes at 2.8 kW for the next two hours before experiencing a nonlinear decrease to 2.4 kW between the fifth and eighth hours as shown in Fig. 16. It is noteworthy that during this period, the power being discharged fluctuates, indicating the dynamic nature of EV usage patterns. From the ninth hour onwards, the power discharging at a rate of 2.4 kilowatts remains unchanging and continuous throughout the duration of the 24-hour period. The constant and unchanging power discharge during this specific period demonstrates a consistent level of power usage, which can be attributed to factors such as driving habits, charging infrastructure, and grid demand, emphasizing the need to comprehend these patterns for effective EV fleet management and resource utilization.

Fig. 16
figure 16

Discharging power of EVs with passage of time

Figure 17 presents a line graph depicting the average charging and discharging power of an ESS over a specific period, illustrating that the ESS is efficiently charged during off-peak hours and discharged during peak hours, resulting in significant cost savings. The implementation of an Energy Storage System (ESS) helps alleviate strain on the power grid by continuously providing power during peak hours, ensuring uninterrupted electricity supply. The significance of integrating an ESS lies in its cost-saving benefits and the reinforcement it provides to the power grid. The charging rate of the ESS remains constant, while the discharge rate varies due to limitations in charging and the demand for electricity. The ESS is not completely charged or discharged at any given point in the graph due to its crucial role in maintaining balance in the power grid and its reserve capacity to respond to fluctuations in electricity demand, which allows it to promptly adjust its power output and offer steadiness and dependability to the electrical power distribution system.

Fig. 17
figure 17

Charging and discharging power of ESS

The variations in the state of charge of the energy storage system (ESS) illustrated in Fig. 18 provide significant observations into the operational traits of the system and the fundamental factors influencing its charging, static storage, and discharging stages. During the initial stage, lasting about 8 h, the state of charge displays a nearly uniform increase, signifying the active charging process of the Energy Storage System. This charging pattern is commonly observed during times of low electricity demand or surplus renewable energy generation, enabling the ESS to accumulate excess energy for future use. The subsequent stabilization of SOC after the charging phase indicates the effective utilization of available energy resources by the ESS to store electrical power for extended periods of approximately 8 h. During a stable state of the SOC energy is stored without any charging or discharging processes, indicating a period of static storage. This occurs when electricity demand matches supply, resulting in balanced consumption and reduced reliance on immediate power requirements. In the later simulation phase, the SoC gradually decreases, indicating discharge as stored energy is used to meet increasing electricity demand, typically during periods of high demand or insufficient renewable energy generation. The decrease in state of charge during this phase highlights the vital function performed by the energy storage system (ESS) in supplying stored energy to support the power grid, thereby contributing to load balancing and ensuring grid stability, ultimately enhancing the reliability, determination, and effectiveness of the virtual power plant (VPP).

Fig. 18
figure 18

State of charge of ESS with passage of time

The visual representation in Fig. 19 demonstrates the infusion of power into the grid by VPP over a 24-hour period. Initially, there is a net withdrawal of approximately − 10 MW, which may be attributed to consumption surpassing generation. However, within the first hour, there is a sudden increase in power injection to around 5 MW, possibly due to an upsurge in generation or a decrease in consumption, followed by a sharp decrease in the second hour to approximately − 42 MW, indicating a possible drop in generation or surge in consumption. Throughout the 24-hour period, there are continuous fluctuations in power injection, characterized by alternating increases and decreases. These fluctuations are indicative of the ever-changing dynamics of generation capacity, consumption patterns, and grid operations, which are influenced by varying demand, generation, and system conditions.

Fig. 19
figure 19

Power injection to Grid system

The information shown in Table 1 provides a summary of the hourly, daily, monthly and yearly energy transactions of the Virtual Power Plant (VPP). It includes details on the energy that was purchased from and sold to the grid, as well as the energy used by the VPP. The provided data on hourly, daily, monthly and yearly energy transactions reveals a dynamic scenario of energy exchange within the Virtual Power Plant (VPP). The VPP demonstrates a surplus in energy generation, as evidenced by the substantial amount of energy sold to the grid. This surplus indicates the effective utilization of renewable energy sources, specifically solar power, which aligns with the commonly associated sustainability objectives of VPPs. The purchase energy from the grid suggests a minor reliance on external sources during certain period of time, likely due to fluctuations in demand or intermittent availability of renewable energy. Significantly, the negative value representing the energy consumed by the VPP implies that the VPP’s energy generation exceeds its internal consumption requirements. This surplus energy can be utilized for grid stabilization or stored for future use, thereby contributing to the resilience and operational flexibility of the grid.

Table 1 Energy transaction of VPP

6 Conclusion

In conclusion, VPPs represent a transformative approach to energy management and grid optimization, particularly through their aggregation and strategic bidding strategies. By harnessing diverse energy sources like solar power and integrating ESS, VPPs effectively balance supply and demand dynamics. The analysis of solar energy production within VPPs highlights their ability to adapt to seasonal variations in solar irradiance, ensuring efficient utilization of renewable resources across different climatic conditions. For instance, the observed peak solar irradiance during summer underscores the VPPs’ capacity to maximize energy generation during periods of high solar availability. Moreover, the integration of ESS enhances grid stability by storing excess energy during off-peak hours and discharging it during peak demand periods, thereby reducing reliance on traditional fossil fuel-based power generation and minimizing grid strain. Insights into HVAC system energy consumption patterns further emphasize VPPs’ holistic approach to energy management, demonstrating their capability to optimize energy flows for heating, ventilation, and air conditioning needs throughout the year. Additionally, dynamic profiles of EV charging and discharging behaviors illustrate VPPs’ adaptability to evolving energy demands and their role in supporting the widespread adoption of electric mobility. Overall, VPPs emerge as pivotal enablers of sustainable energy solutions, fostering grid reliability, promoting renewable energy integration, and paving the way towards a resilient and low-carbon energy future.