Introduction

Fig. 1
figure 1

Typical smart grid architecture connectivity

A smart grid is an electricity distribution network that facilitates the exchange of information between suppliers and consumers, enabling real-time adjustments to the flow of electricity for efficient energy management. This technology utilizes computer techniques and computational algorithms to optimize energy production, distribution, consumption, and storage, thereby facilitating better coordination across all aspects of the electricity supply chain, from producers to end-users (Shah et al., 2019; Wood et al., 2013). Consequently, smart grids are expected to enhance energy efficiency by minimizing line losses and optimizing production output through instantaneous consumption control and regulation (Sharda et al., 2021; Benysek et al., 2016; Silva et al., 2020; Asgari et al., 2023). Moreover, numerical techniques and algorithms, combined with energy storage and energy-saving appliances, enable the smoothing and buffering of energy production by reducing demand peaks (Dey et al., 2023). This reduction in production peaks not only improves energy management but also enhances the security of the energy network, leading to decreased total production costs (Park et al., 2017; Dickison et al., 2016; Kefayati & Baldick, 2011). The typical connectivity of a smart grid architecture is illustrated in Fig. 1.

Each user in the grid is equipped with a smart meter embedded with Electrical Scheduling Control (ESC) capabilities. This ESC system is smoothly integrated into the smart meter, empowering users to control every appliance within their homes. Furthermore, users have the flexibility to upload specified software that can be executed at the level of each smart meter, allowing for customized energy management strategies tailored to individual needs and preferences (Raza et al., 2023).

The Local Area Network (LAN) connection facilitates communication between each user in the grid and the production company. This network serves as the conduit for messages to be exchanged not only between users but also between users and the utility company, leveraging Advanced Metering Infrastructure (AMI) architecture for seamless interaction (Güçyetmez & Farhan, 2023).

Through this network, users can communicate with one another, sharing insights, coordinating energy usage patterns, and potentially optimizing consumption collectively. Similarly, the utility company can disseminate important information, such as tariff updates or system notifications, directly to users’ smart meters.

By harnessing the capabilities of smart meters and leveraging the interconnectedness facilitated by LAN and AMI architecture, the energy grid transforms into a dynamic ecosystem where communication flows freely, enabling efficient energy management, enhanced reliability, and improved grid resilience. This architecture and communication are depicted in the Fig. 2.

Fig. 2
figure 2

Advanced metering infrastructure

The Fig. 2 shows the following components of an AMI system:

  • Users: This refers to the consumers of the utility company’s service, such as homeowners or businesses.

  • Smart meters: These are devices that are installed at the customer’s premises to measure their energy use. Smart meters can collect data on a more frequent basis than traditional meters, and they can also transmit data to the utility company wirelessly.

  • Distribution Management System (DMS): This is a computer system that is used by the utility company to monitor and control the distribution of electricity. The DMS can use data from AMI systems to identify and respond to problems on the distribution grid.

  • Load Control Devices: These are devices that can be used by the utility company to reduce electricity demand during peak periods. Load control devices can be used to cycle off appliances or other equipment.

  • Home Area Network (HAN): This is a network that connects smart meters and other devices in the customer’s home. A HAN can be used to provide customers with real-time information about their energy use.

  • Consumer Portal Layer: This is a web-based interface that allows customers to view their energy use data and manage their accounts.

  • Utility Company: This is the company that provides electricity to the customers.

Also, Figure 3 shows the components of a smart meter system.

Fig. 3
figure 3

Appliances encompass home or business electric devices like lights, refrigerators, and televisions. Embedded Software resides in smart meters, collecting and transmitting electricity data. Computational Resources process smart meter data for utility companies

The “smart” electricity grid is also positioned as a set of tools contributing to the reduction of greenhouse gas emissions and should thus serve as an efficient means to limit global warming; this is indeed a fundamental aspect of the smart cities concept. On the other hand, the concept of Demand-Side Management (DSM) encompasses energy-saving actions implemented at the level of the final consumer, irrespective of the energy producer side (Sharda et al., 2021; Aram et al., 2015). Furthermore, Demand Response (DR) programs have been proposed within the DSM framework; these programs quantify “changes in electricity use by demand-side resources from their normal consumption patterns in response to changes in the price of electricity or incentive payments designed to induce lower electricity use at times of high wholesale market prices or when system reliability is jeopardized” (Gils, 2014).

Within a DR program, energy provider companies can directly and remotely control the energy consumption of connected equipment (Pathan et al., 2020; Rastegar et al., 2023); this approach is known as Direct Load Control (DLC) (Ramanathan and Vittal, 2008; Ebrahimi and Abedini, 2022). Other models incentivize users to reduce energy consumption during peak hours by offering discounts on their overall bill (Gellings & Chamberlin, 1987). However, complete connectivity may not be feasible without associated installations such as smart meters, which aim to collect data, provide visualization for better control, and facilitate real-time energy distribution management (Mohsenian-Rad et al., 2010). Smart meters are considered crucial for mapping reliable consumption forecasting to enhance production and distribution management, as well as for reactive review of electricity pricing in the competitive market (Peng et al., 2018; Fan et al., 2017; Ortega et al., 2015). With smart meters installed, users can self-organize and participate in controlling their own consumption and billing management; in Mohsenian-Rad et al. (2010) and Shinwari et al. (2012), authors proposed smart and reactive pricing aimed at encouraging participating users in DR programs to minimize network costs as well as their individual billing. With the wealth of data gathered by these smart meters, the research has the potential to cultivate a sophisticated machine learning algorithm tailored specifically for energy profiling techniques (Abassi et al., 2023). These techniques encompass a range of approaches, from clustering to prediction methods (Ullah et al., 2020). Moreover, the efficacy of these methods has been further refined and optimized by the contributions of various authors as evidenced in (Akhrif et al., 2022; El Khattabi et al., 2024; El Khattabi et al., 2024a).

Actually, the common analytical tool used to study autonomous DR systems is Game Theory (El Khattabi et al., 2024b; Yang et al., 2012). Both competitive and cooperative game theoretical frameworks have been developed. Within DR programs, users can schedule the operating time of their household appliances or electric vehicles to avoid high energy consumption (Alvina et al., 2017; Silva et al., 2020). Indeed, DR approaches facilitate energy management at both individual and production company levels. In (Ibars et al., 2010), authors developed distributed demand management in a smart grid with a congestion game for minimizing the total cost of power generation. Another work proposed Energy Delivery Transaction Pricing (EDTP) for load participation and facilitating demand-side cost-comfort optimization (Kefayati & Baldick, 2011; Malek et al., 2022). Another paper introduced a novel demand-side management technique to reduce system peak load; users submit their energy demands to an energy provider that dynamically reviews and updates energy prices based on user load profiles (Nguyen et al., 2012; Chauhan et al., 2022). Similarly, other researchers developed Direct Costing Control (DDC) using machine learning algorithms (Peng et al., 2018).

On the other hand, billing models are also considered key points in pricing strategies and global energy management. In Cakmak and Altaş (2020), authors proposed a new billing model called Time-Shiftable Appliances (TSAs) for residences, involving separate billing rates rather than a single rate for total electricity usage. This model enables fair billing for consumers. Additionally, they proposed three different billing models, each offering benefits for the consumer (Cakmak & Alta 2020). In (Bakr & Cranefield, 2013), authors proposed an energy consumption scheduler for shiftable appliances at the household level, along with a fair electricity billing mechanism. The dynamic scheduler considers users’ plans and corresponding energy consumption. Other researchers developed an intelligent framework to optimize users’ bills by scheduling appliance activation during peak periods (Adika and Wang, 2014) and employing techniques for electricity storage via batteries installed in the grid (Elio et al., 2021). In (Babaei et al., 2021), energy consumption in the smart grid was reduced using data mining approaches. The study in Niharika & Mukherjee, V. (2018) utilized the Symbiotic Organisms Search (SOS) algorithm to optimize bills and costs in the grid through a day-ahead load shifting approach, while in Ahmad et al. (2017), Reinforcement Learning (RL) was adapted to schedule load activations in smart homes. The corresponding algorithm was based on human-appliance interaction, dividing the day into various states where users interact with appliances to optimize their bills according to the resulting program (Ahmad et al., 2017).

Hybrid Price-based and Robust Demand Response (HPDR) was proposed in Monfared et al. (2019); Rehman (2020); it is more adaptable to local (individual) pricing principles compared to other existing strategies as it is implemented in the day-ahead scheduling of residential microgrids. Moreover, to increase the accuracy of the proposed model, uncertainty regarding decision variables and parameters including generation units and load dispatch in the microgrid was also considered (Monfared et al., 2019). The studies in Yuce et al. (2016) and Ahmed et al. (2016) aimed to reduce energy consumption during peak hours through a smart appliance scheduling approach. The algorithms used in these studies consist of a combination of genetic algorithms (GA) and artificial intelligence (AI) with neural networks; similar GA optimization was adopted in Khan et al. (2015). In Sharifi and Maghouli (2019), authors proposed a strategy to minimize the Peak to Average Ratio (PAR) and the clients’ bills while considering related comfort. A new DR strategy is proposed in Rasheed et al. (2017); Celik et al. (2017); electricity pricing is updated according to the energy consumption of each house in real-time on the grid. In Assaf et al. (2016); Yaagoubi & Mouftah (2015), authors proposed a new billing mechanism to charge users fairly based on their contribution to minimizing total energy consumption in the grid. A novel model of Decentralized Demand Side Management (DDSM) to minimize energy expenditure and costs in the grid is proposed in Ramchurn et al. (2011); Mocci et al. (2015); Benysek et al. (2016). Decentralized DR systems can achieve satisfactory results and resolve the large communication problems and privacy issues of centralized demand response systems (Khan et al., 2015).

Based on the above, the present paper deals with the optimization of both:

  • the total energy cost, defining the single-objective function “at the level of the energy provider”; this constitutes a centralized optimization problem addressed herein,

  • and the individual cost “at the level of the user”, defined as a distributed optimization problem; this involves a set of cost functions assigned to each grid user.

Three different billing models were adopted: \(B_1\) and \(B_2\) from the literature, and another model \(B_3\) defined by the authors of this paper. The flexibility and the number of users are the input parameters adopted for the simulations.

Furthermore, our study delves into optimizing billing strategy and user flexibility. Our work integrates a novel approach focused on solving problems in a centralized manner. This means that the production company, upon finding the optimal solution, distributes workload schedules via the network architecture.

Based on our state-of-the-art review up to the point of writing this paper, most papers address the problem in a centralized manner, while others tackle cases where the problem variables are continuous. In our paper, we address the problem with various appliance types and complex constraints, making it challenging to solve using known quadratic optimization techniques.

Moreover, we approach the problem in a distributed manner with a novel distributed algorithm. In addition to this distributed model, we introduce an intelligent billing mechanism and compare it with other billing models integrated into our distributed model in terms of cost minimization, PAR, and fairness.

Finally, our paper statistically compares these billing models to determine the causal relationship between cost, PAR, and user flexibility.

The remainder of this paper is organized as follows: Section “Methods” presents the system models adopted in the paper, the billing mechanisms, and the indicators adopted for optimizations, costs, and PAR ratio; Section “Resolution approach” outlines the resolution method composed of a set of mathematical tools for solving the single-objective and multi-objective optimization problems. The resulting simulations and data are depicted, analyzed, and statistically discussed within Section “Results and discus-sion”. Finally, Section “Conclusion” presents conclusive remarks and includes related perspectives of this work.

Methods

The present section exhibits the main process steps of this study in terms of problem formulations, variables, and parameters considered within the optimization problems adopted herein, billing mechanisms, and constraints handling. The major resolution algorithms and mathematical analyses are detailed in Section “Resolu-tion approach”. Furthermore, Fig. 4 presents the workflow adopted in the present study; as displayed in Fig. 4, the workflow is organized into four independent main blocks corresponding to the problem input formulation and generation, the resolution step, and the output data organization and treatment. Finally, statistical analysis is conducted to compare generated data populations, model and analyze distributions.

Fig. 4
figure 4

The workflow adopted in the present study

System models

Assume a smart power grid where a group of \(\mathcal {N}=1,\ldots ,N\) consumers share a single energy source.

During one day, time is divided into fixed and equal time slots \(\mathcal {H}=\{1,\ldots ,H\}\). In a building, there are several categories of appliances, each with its specific characteristics and features. In the present study, three main classes of appliances are considered (Veras et al., 2018): interruptible and deferrable (\(A _I\)), uninterruptible and deferrable (\(A _{II}\)), and uninterruptible and non-deferrable (\(A_{III}\)). An operation is referred to as being uninterruptible if it cannot be stopped until it is finished. Non-deferrable and deferrable states correspond to an operation that either can or cannot be started at the first time slot of the operational window to be considered. The following paragraphs exhibit the modeling parameters adopted for the rest of the study.

Let \(\mathcal {A}_{nk}\), \(k=\{I,II,III\}\), be sets of user n’s appliances of type k. The set of all appliances is then denoted \(\mathcal {A}_n\) such that:

$$ \mathcal {A}_n=\mathcal {A}_{nI} \cup \mathcal {A}_{nII} \cup \mathcal {A}_{nIII}. $$

Let \(x_{a_{nk}}^h\) denote the scheduling state of appliance \(a_{nk}\) at time slot \(h \in \mathcal {H}\), and \(E_{a_{nk}}\) the corresponding energy consumption, such that:

$$ x_{a_{nk}}^h= {\left\{ \begin{array}{ll} 1, &{} \text {if appliance}\, a_{nk}\, \text {is on at time slot} h,\\ 0, &{} \text {otherwise}. \end{array}\right. } $$

For each user n, the scheduling vector is denoted \(\textbf{x}_n\) such that:

$$\begin{aligned} \textbf{x}_n=(x_{a_{nk}}^h),\forall a_{nk}\in \mathcal {A}_{n}, \forall h\in \mathcal {H}, \end{aligned}$$
(1)

and

$$\begin{aligned} \textbf{x}=[\textbf{x}_1,\ldots ,\textbf{x}_n], \end{aligned}$$
(2)

where \(\textbf{x}\) denotes the scheduling vector for all users of the grid.

On the other hand, as introduced in Section “Intro-duction”, DSM coupled with intelligent pricing methods should help optimize consumption costs in terms of utility energy management for individual consumers involved. Moreover, incentive-based DSM methods have demonstrated high efficiency in utilizing existing infrastructures by addressing large-scale distributed power generation, thereby ensuring stable system operations even in the face of potential complexity in the optimization systems to be solved.

Another smart pricing technique is Time-Of-Use pricing (TOU), which introduces a series of pricing indices such as “critical pricing at peak times and low pricing at off-peak times”, “critical peak pricing” (CPP), “extreme day” CPP (ED-CPP), and “extreme day pricing” (EDP) (Vardakas et al., 2015; Park et al., 2017).

In this paper, for a given company, the cost of electricity in each time slot in the grid is determined by a generation cost function \(C_h\).

Let \(L_h > 0\) denote the total load in the system at time slot \(h \in \mathcal {H}\), and \(E_{a_{nk}}\) denote the energy consumption of appliance k of user n. The production cost function is defined as a quadratic function of the total energy load, expressed by Eq. (3) :

$$\begin{aligned} C_h(L_h) = a_h{L_h^2} + b_hL_h + c_h, \end{aligned}$$
(3)

where \(a_h > 0\) and \(b_h, c_h \geqslant 0\) for each hour \(h \in \mathcal {H}\).

The use of quadratic production cost functions in TOU pricing frameworks stems from their capacity to accurately depict production costs, capture non-linear relationships present in cost structures, enable economic efficiency optimization, and accurately model consumer price sensitivity (Wood et al., 2013).

The total load at time slot h is given by the summation of energy consumption of all appliances of all users:

$$\begin{aligned} {\begin{matrix} L_h = \sum _{n=1}^{N} \sum _{j=1}^{\vert \mathcal {A}_n \vert } E_{a_{nj}}x_{a_{nj}}^h \end{matrix}} \end{aligned}$$
(4)

The daily peak and average load levels are then computed according to Eqs. (5) and (6):

$$\begin{aligned} L_{\text {peak}} = \max (L_h), \quad h \in \mathcal {H}, \end{aligned}$$
(5)

and

$$\begin{aligned} L_{\text {avg}} = \frac{1}{H}\sum _{h \in H} L_h, \end{aligned}$$
(6)

respectively. Therefore, the Peak-to-Average Ratio (PAR) in load demand is given by:

$$\begin{aligned} PAR = \frac{L_{\text {peak}}}{L_{\text {avg}}}. \end{aligned}$$
(7)

The next paragraphs present three billing mechanisms from the literature and describe their mathematical structures. These billing mechanisms also serve as the foundation for formulating the optimization models described in the present study.

Billing mechanisms

In this section, three billing models from the literature are presented to determine which one can ensure the optimality of the distributed multi-objective problem defined above. The first billing model, denoted as \(B_1\) to charge user n, is formulated as in expression (8), as defined in Mohsenian-Rad et al. (2010); Wu et al. (2011); Zhu et al. (2011).

$$\begin{aligned} B_1(n)=\frac{E_n}{E_T} \times \sum _{h=1}^{H}C_h(L_h), \end{aligned}$$
(8)

where \(E_n\) is energy for a user n, \(E_T=\sum _{i=1}^{N}E_i\) is the total energy, \(L_h\) is load at each time slot h, \(C_h(L_h)\) is the cost of the load at time slot h.

Additionally, the billing mechanism used in Baharlouei et al. (2013) denoted \(B_2\), is displayed by Eq. (9):

$$\begin{aligned} B_2(n)=\sum _{h=1}^{H} \frac{x_n^h}{L_h} C_h \left( L_h \right) \end{aligned}$$
(9)

The last billing model used in this study, denoted as \(B_3\), was proposed by the authors in Abassi et al. (2022) and has been modified to be adapted for the present study (Abdelfattah et al., 2022) . This billing mechanism should take into account the importance given by the user to each objective function in the system (\(B_{n_1}\)) and the daily load compared with the total load in the grid (\(B_{n_2}\)). The expressions for \(B_{n_1}\) and \(B_{n_2}\) are respectively given by Eqs. (10) and (11).

$$\begin{aligned} { }{{{B_{n_1}}}}=\frac{E_n}{E_T} \times \frac{E_T \times \sum _{h=1}^{H} C_h(L_h)}{E_T+W_T(\vert \mathcal {A} \vert -1)}, \end{aligned}$$
(10)

and

$$\begin{aligned} { }{{{B_{n_2}}}}=\frac{w_T-w_{n}}{E_T} \times \frac{E_T \times \sum _{h=1}^{H} C_h(L_h)}{E_T+w_T(\vert \mathcal {A} \vert -1)}, \end{aligned}$$
(11)

where : \(W_T=\sum _{i=1}^{N} w_i\) denote the total flexibility of all users in the system.

The billing model adapted herein is defined as :

$$\begin{aligned} { }{\begin{matrix} {{{B_{3}(n)}}}{=}{{{B_{n_1}}}}{+}{{{B_{n_2}}}} {=\left[ \frac{E_n}{E_T} + \frac{w_T-w_{n} }{E_T} \right] \frac{E_T \sum _{h=1}^{H} C_h(L_h)}{E_T+w_T(\vert \mathcal {A} \vert -1)}}\\ {=\left[ \frac{E_n+W_T-W_{n}}{E_T+w_T(\vert \mathcal {A} \vert -1)} \right] \sum _{h=1}^{H} C_h(L_h) }\end{matrix}} \end{aligned}$$
(12)

The primary objective of implementing the billing model is to motivate users to participate in the global optimization program. Consequently, these models must be made publicly available so that each user can provide the necessary information to determine the best scheduling strategies in terms of minimizing billing costs and maximizing comfort.

The next paragraphs display the formulation of the mono-objective and multi-objective optimization problem of energy involved in the present analysis.

Optimization problems

In this section, optimization problems are formulated to achieve efficient smart grid energy minimization on both global (provider) and local (consumer) levels. The first problem consists of finding the optimal solution for the system by adopting a centralized standpoint. In this case, the optimal solution corresponds to the minimum cost desired by the energy production provider (company). The second problem involves a distributed approach adopted at the user’s level, to be implemented within each dedicated smart meter. Each optimization level corresponds to a set of objective functions to be optimized. Hence, the centralized approach involves a single-objective optimization function, while the second deals with a multi-objective optimization function (or a vector of functions). The next sections detail the formulation of the objective functions adopted herein.

Centralized approach: The First characteristic single-Objective Problem

Generally speaking, each energy provider company aims to enhance its net income by optimizing the interplay between production and distribution parameters throughout the entire process (Rong et al., 2016). For example, the utility should be optimized by minimizing energy consumption during peak hours, as well as minimizing the Peak-to-Average Ratio (PAR) as a single-objective function to be optimized (Shah et al., 2019). On the other hand, Time-Of-Use (ToU) is considered a practical indicator to be managed in order to minimize production costs (Nicolson et al., 2018).

In this paper, it is proposed that the energy provider company should determine optimal cost levels based on the information provided by users’ scheduling. It is also worth mentioning that the present study does not include other non-quantitative or fuzzy indicators such as users’ comfort. In the scenario where data is accessible to the company in a centralized manner, encompassing scheduling vectors and energy consumption details from each user’s ECS, the most efficient system cost can be determined by addressing the subsequent optimization problem as in Eq. (13):

$$\begin{aligned} \begin{array}{rrclcl} \displaystyle \min _{\mathbf {x_n}}&{\sum _{h=1}^{H} C_h(\sum _{n=1}^{N} \sum _{j=1}^{\vert \mathcal {A}_n \vert } E_{a_{nj}} x_{a_{nj}}^h)} \end{array} \end{aligned}$$
(13)

The problem addressed in Eq. (13) presents an opportunity for centralized optimization. When the production company possesses complete information regarding the scheduling of all users throughout the day, a centralized approach can potentially yield solutions that are globally optimal for the utility company.

However, as outlined in problem (13), this solution comes at the cost of user privacy. A centralized approach often necessitates users transmitting their plans through a local area network (LAN) to the utility company. Additionally, the frequent exchange of messages between users and the utility company, particularly within large grids, can incur significant communication overhead.

In the next section, a Distributed Optimization Approaches are discussed, offering a valuable alternative to centralized optimization in this scenario. They address limitations such as privacy concerns and communication overhead by enabling users to collaborate without revealing all their data.

Distributed approach: The second characteristic Multi-Objective problem

In the previous section, we formulated the single-objective minimization of the global load at the energy provider company. However, this approach overlooks a crucial aspect: the comfort and preferences of the smart grid users. By solely focusing on load minimization, the optimal solution fails to account for the individual participation of each user in the Demand Side Management (DSM) program. Furthermore, it neglects to preserve user privacy, as all user data is sent to the utility company to solve the problem in (13). In this regard, we must address the following questions: How do we achieve optimal cost scheduling in the system, as shown in (13), while taking into account users’ participation in the DSM program and preserving their privacy? How describe a solution strategy that can be autonomously implemented and adjusted to adapt to changes occurring within the system ? How can we address the problem (13) in a decentralized manner, leveraging the ECS functionality of the smart meter, while minimizing the need for extensive information exchanges between the smart meters and the energy source? To address this questions, let’s begin by illustrating an example that first demonstrates how user flexibility can impact cost minimization and enhance the Performance Assessment Ratio (PAR) within the system.

For instance, within a smart grid, there are users who are adamant about sticking to their initial energy usage plans and are unwilling to change them under any circumstances, while still insisting on preserving their privacy. On the other hand, there are users who are willing to actively participate in energy optimization efforts and exhibit greater flexibility in terms of adjusting their consumption schedules. Consequently, the optimal solution for an integrated energy distribution system is heavily influenced by the extent of users’ engagement and participation levels.

To summarize this situation, let’s consider the following example to illustrate what should be carried out in terms of the corresponding distributed system modeling: suppose we have two users in the system with 2 loads of some given types each. The scheduling being analyzed considers the next 4 hours, where the energy consumption for each user and load is \(E_1 = E_2 = 10\). Additionally, let’s assume that the cost at every time slot is given by expressions (14) and (15).

$$\begin{aligned} C_h(L_h) = 0.01L_h ^2+ 2L_h ,\forall h \le 2, \end{aligned}$$
(14)

and :

$$\begin{aligned} C_h(L_h) = 0.03L_h^2 + L_h ,\forall h > 2 \end{aligned}$$
(15)

In a first hypothetical scenario, let’s consider that both users prefer to schedule their loads for the first two hours, as depicted in Table 1.

Table 1 First scheduling scenario preferred by the users

One can easily compute the cost and the PAR ratio to find \(Cost = \$88\) and \(PAR = 2\). Another situation arises when the second user shifts their load to the last two hours, as depicted in Table 2.

Table 2 Second scheduling scenario preferred by the users

In the second scenario, the cost decreases to \(\$68\), while the PAR ratio shifts to 1. It’s evident that the scheduling situation represented by Table 2 is better than the first one, as there are savings in consumption in terms of global cost and PAR ratio. This exemplifies a typical situation where a compromise is achieved in optimizing consumption on a global scale, while affecting the local consumption scale.

The preceding scenario suggests that the energy provider company must develop a suitable distributed and autonomous approach to differentiate between participating users and non-participants with minimal information exchange between users and the utility company and minimal reliance on user data, while also preserving users’ privacy. It’s also vital to ensure that users have a motivating reason to actively engage with the ECS features and adhere to the schedules they set. To construct our distributed approach, we assume that the utility company selects a suitable billing mechanism \( b_n \) to differentiate between participating users and non-participants while preserving their privacy. Thus, for additional user flexibility, the billing model \( b_n \) implies that each user in the grid should consider the following main objectives: minimizing the user’s bill, maximizing their comfort, and ensuring autonomy, meaning that all execution of the approach is performed at the level of user smart meters while preserving privacy.

To clarify how this approach preserves user privacy, let us assume that the utility company uses the billing model as shown in Eq. (8). In this case, each user in the grid has the objective of minimizing their bill by solving the following problem:

$$\begin{aligned} { \begin{array}{rrclcl} \displaystyle \min _{{x}_n \in \mathcal {X}_n}&{h(x_n)=\frac{E_n}{E_T} \times \sum _{h=1}^{H} \frac{x_n^h}{L_h} C_h(L_h) }, \end{array} }\end{aligned}$$
(16)

where \(x_n^h\) is the scheduling vector for user \(n\) and \(C_h(\cdot )\) is the cost function defined in Eq. (3). It is noted that this cost function is a public function and is known by all users in the grid.

By replacing the definition of the cost function in Eq. (16), we obtain:

$$\begin{aligned} h(x_n)= & {} \frac{E_n}{E_T} \times \sum _{h=1}^{H} \frac{x_n^h}{L_h} (a_h{L_h^2} + b_hL_h)\nonumber \\= & {} \frac{E_n}{E_T} \times \sum _{h=1}^{H} (x_n^h L_h+b_h) \end{aligned}$$
(17)

For preserving users’ privacy, other users must have access only to the energy consumption scheduling at hour \(h\) for all other users, denoted as \(L_h\), without any details about their planning. We also assume that other users fix their scheduling vector and send only Local Area Network (LAN) signals to other smart meters’ users containing the full energy consumption. Let \(L_h^{'}\) denote the load for the other users, which depends only on their scheduling vector, and \(L_n^h\) denote the load for user \(n\). It is clear that \(L_h=L_n^h+L_h^{'}\). While \(L_h^{'}\) is a fixed variable, the only variable in the problem becomes \(L_n^h=\sum _{h=1}^{H} (x_n^h)\). In this case, the problem in Eq. (16) depends only on the user’s scheduling vector \(x_n\) and could be solved without any information about other users. Finally, users could solve the problem in Eq. (16) without any information about other users’ scheduling vectors, thereby preserving user privacy.

The first example introduced in this section implies that users also take into consideration their comfort. In such a case, each user is supposed to inject a local sub-problem because the only optimization variable is user ’s energy consumption scheduling vector \(x_n\). Each sub-problem can be viewed as a local bi-objective problem involving two objective functions. The solution of each sub-problem, in this case, is a set of non-dominated solutions, representing trade-offs between the bill and the user’s comfort.

The user can then choose one solution from this set according to their own preferences. For example, a user may choose a solution that maximizes their comfort, even if it subsequently increases their bill. Conversely, another user may select a solution that minimizes their comfort in order to obtain a minimal bill.

Based on the above, Equation (13) leads to the definition of a set of “k” solutions (with \(k = \vert \mathcal {N}\vert \)). The contrast is highlighted between participating and non-participating users according to the importance assigned to each objective function by the corresponding user. This differentiation should be carried out at the level of the related sub-problem definition. Finally, the ultimate compromise (solution) will be combined with the “k” solutions of each sub-problem. The optimal solution is then reached when all users are participating in the program. In this paper, the user’s comfort is defined as the difference between the basic scheduling vector and the scheduling vector that minimizes the user’s bill.

Let \(y_{a_{nk}}^h\) represent the base scheduling state of user n and the corresponding appliance \(a_{nk}\) at time slot h as follows:

$$ y_{a_{nk}}^h= {\left\{ \begin{array}{ll} 1,&{} \text {if appliance}\, a_{nk}\, \text {is on at time} h,\\ 0, &{} \text {otherwise}. \end{array}\right. } $$

The local bi-objective problem is formulated as follows:

Minimize:

$$\begin{aligned} f_1(\textbf{x}_n) \!= & {} \! \sum _{h=1}^{H} b_n^h \left( \sum _{j=1}^{|\mathcal {A}_n |} E_{a_{nj}} x_{a_{nj}}^h \!+\! \sum _{m\in \mathcal {N} \backslash \{n\}}^{|\mathcal {A}_m |} E_{a_{mj}} x_{a_{mj}}^h \right) ,\nonumber \\ f_2(\textbf{x}_n)= & {} \sum _{j=1}^{|\mathcal {A}_n |} \sum _{h=1}^{H} \vert x_{a_{nj}}^h - y_{a_{nj}}^h \vert \end{aligned}$$
(18)

Constraints definitions

In order to ensure a reliable problem resolution app-roach, it is essential to define corresponding constraints related to the appliances (\(A_{I}\), \(A_{II}\), and \(A_{III}\)) as introduced in the heading paragraph of Section “System models”. The two optimization problems defined in the previous sections must adhere to certain constraints to determine whether a solution is feasible or not.

Let \(op_{a_{nm}}\) denote the operating time required for appliance \(a_{nm}\) to complete its corresponding task. This is defined as:

- Equation (19) defines the first constraint \(C_1\) that corresponds to the energy consumption of each appliance during the day:

$$\begin{aligned} {\begin{matrix} \sum _{h=1}^{H} x_{a_{nm}}^h=op_{a_{nm}} \end{matrix}} \end{aligned}$$
(19)

-Equation (20) and (21) defines the second constraint \(C_2\) with regards to the appliance type \(A_{II}\). The energy consumption of each appliance during the day according to its operating time to complete its scheduled tasks

$$\begin{aligned} {\begin{matrix} \sum _{h=1}^{H} x_{a_{nm}}^h=op_{a_{nm}}, \end{matrix}} \end{aligned}$$
(20)

and each appliance types \(A_{II}\) when started, must complete its task, and must not switch off. That is :

$$\begin{aligned} {\begin{matrix} \sum _{q=1}^{H-(op_{a_{nm}}-1)} \prod _{t=q}^{op_{a_{nm}}+(q-1)} x_{a_{nm}}^t. \ge 1 \end{matrix}} \end{aligned}$$
(21)

-For the appliance \(A_{III}\), the operation time is strict and the appliance should not turn off the schedule time run. This is translated by the following constraints \(C_3\):

$$\begin{aligned} {\begin{matrix} \sum _{h=start}^{end} x_{a_{nm}}^h=op_{a_{nm}}, \end{matrix}} \end{aligned}$$
(22)

where start is the start time and end is the end time.

Hence, the set \(C=\{C_{1},C_{2},C_{3}\}\) constitutes the feasible space of the whole multi-objective optimization problem defined in this paper.

Resolution approach

The two problems defined in Eqs. (13) and (18) pose challenges for classical methods such as quadratic optimization approaches due to their combinatorial and multi-objective nature (Katoch et al., 2021). These types of problems are generally classified as NP-hard problems (Hochba, 1997). Consequently, a basic Genetic Algorithm (GA) was adopted to solve the single-objective problem defined in (13), while a Non-dominated Sorting Genetic Algorithm II (NSGA-II) was adopted to solve the multi-objective problem defined in (18). Therefore, it is worth recalling the basics of GA for both single-objective and multi-objective optimization problems, as exhibited and detailed in the following paragraphs.

Basic Genetic Algorithm for the single-Objective problem resolution

Genetic Algorithm

A genetic algorithm is a search metaheuristic inspired by Charles Darwin’s theory of natural evolution (Chahar et al., 2021). This class of Evolutionary Algorithms reflects the process of natural evolution, where species evolve through a series of reproduction and the evolution of subsequent generations. The generations in a genetic algorithm consist of parameters that are manipulated in the optimization process, while the fitness function represents the objective to be maximized. In general, a genetic algorithm consists of five phases (Forrest, 1996; Kramer, 2017; Mirjalili, 2019):

Initial population: The initial population is composed of a set of individuals randomly generated as the first step. Each individual is then represented in binary form, where each gene is a series of zeros and ones. The size of each individual corresponds to \(\vert \mathcal {A}_n \vert \times H\) genes, with the length being related to the precision required for computing and interpreting the results.

Fitness function: The fitness function is formulated and designed to be maximized or minimized in order to select individuals based on their adaptation to the problem. The fitness function value \(\bar{f(x_i)}\) of individual \(x_i\) in the population is designed to vary within the range [0,1]. In the case of the present study, it is proposed to adopt the fitness function displayed in expression (23).

$$\begin{aligned} \bar{f(x_i)}=\frac{f(x_i)}{\sum f(x_i)}, \end{aligned}$$
(23)

where f the objective function.

Selection: The selection step involves choosing the best-adapted individuals from the population generated at each step. The selection operator can be seen as applying the principle of adaptation proposed by Darwin’s theory. In genetic algorithms, the selection operator discriminates the most influential individuals that maximize the fitness functions, while the less significant individuals are discarded and may disappear in the next generations. There are several selection techniques in the literature, including but not limited to:

  • Selection by rank: This technique always proceeds by the selection of the individuals with the best adaptation scores. so that the probability of selection is proportional to the score; a roulette wheel named also wheel of fortune technique, is launched for each individual resulting in the competitive set of remaining individuals in the current generation.

  • Tournament selection: This technique uses proportional selection on pairs of individuals, and then selects from these pairs the individual with the best adaptation score.

  • Uniform selection: The selection is done randomly, uniformly, and without the intervention of an adaptation value.

The proposed approach adopts the method of Tournament selection due to its simplicity and straightforwardness in implementation. This technique involves selecting individuals through pairwise comparisons, where the winners of each pair form the population of the new generation. While it may allow some “bad” components to enter the mating pool, depending on the number of comparisons made, it tends to select only the best individuals. Tournament selection typically has a time complexity of O(n) or \(O(n^2)\), with the most common method involving pairwise comparisons, resulting in an O(n) complexity. However, if the number of comparisons equals the number of population elements, the complexity would be \(O(n^2)\).

Crossover: In GAs, the goal is to improve the generation from the parent population through the crossover operation. This operation is crucial in the algorithm, as it involves randomly splitting a pair of parents from the previous generation into a certain number of binary words (chromosomes), which are then combined to create new offspring. Essentially, the crossover process aims to combine the favorable traits of each parent to generate improved offspring in the subsequent generation.

Mutation: In any general optimization algorithm, in-cluding genetic algorithms, it is crucial to avoid local convergence. Mutation plays a key role in maintaining genetic diversity within the population, preventing premature convergence to local optima. Mutation involves randomly modifying a gene to generate a new solution, ensuring exploration of the search space. It’s important to recognize that while crossover is a fundamental operation in genetic algorithms, mutation serves as an additional mechanism to introduce genetic variation and prevent stagnation.

NSGA-II for the resolution of the Distributed Multi-Objective Problem

NSGA-II stands out as one of the most widely recognized multi-objective optimization algorithms due to three key characteristics: its ability to quickly identify non-dominated solutions, its efficient estimation of crowded distances, and its straightforward implementation of the crowded comparison operator. In a study by Deb et al. (2002), the efficiency of NSGA-II was evaluated through simulations using various benchmark test problems commonly employed in optimization techniques.

Based on the above, it’s evident that solving problem (18) requires identifying a set of Pareto optimal solutions that are not dominated by any other feasible solutions (Deb et al., 2002). Given the technical complexity of the problem, analytical procedures are not suitable due to factors such as the non-linearity of functions, the binary nature of variables, and the multi-objective nature of the problem. Consequently, the use of the non-dominated Genetic Algorithm II (NSGA-II) is appropriate (Dickison et al., 2016).

Fig. 5
figure 5

NSGA-II Algorithm

Preliminary definitions

The NSGA-II algorithm, developed by Professor Deb and his team, stands out as a robust method for multi-objective optimization. It boasts three key attributes: a rapid non-dominated sorting mechanism, an efficient crowded distance estimation approach, and an effective crowded comparison operator (Konak et al., 2006). In their research, Deb et al. evaluated the performance of NSGA-II across various test problems, demonstrating its superiority over other optimization techniques such as PAES and SPEA in terms of discovering diverse solutions (Kodali et al., 2008). As a result, NSGA-II has become widely adopted in both academic and industrial settings. It’s essential to introduce foundational concepts to facilitate understanding of the process (Yusoff et al., 2011).

  • The principal of solution “Domination” : A solution \(x^{(1)}\) is said to dominate another solution \(x^{(2)}\) while the following conditions 1 and 2 below are respected:

    • Condition 1: \(x^{(1)}\) is not worse than \(x^{(2)}\) for all objective functions vector f.

    • Condition 2 : \(x^{(1)}\) is strictly better than \(x^{(2)}\) in at least one objective,

    in that case a solution \(x^{(1)}\) dominates \(x^{(2)}\) is expressed as \(x^{(1)} \preceq x^{(2)}\).

  • The Non-Dominated set: Among a set of solutions P, the non-dominated set of solutions P’ are those that are not dominated by any member of P;

  • The Globally Pareto-optimal set: defines the ultimate non-dominated set of the entire feasible search space S. This set is then qualified as globally Pareto-optimal and it correspond to the convergence of a MOGA algorithm.

NSGA-II description

General speaking, and according to Fig. 5, NSGA- II can be roughly detailed by the following list (Deb et al., 2002):.

  • Population initialization: Initializing the population based on the problem range and constraints;

  • Non-dominated sort: Sorting process based on non-domination criteria of the population that done;

  • Crowding distance assignment: Once the non-dominated sorting is completed, the crowding distance value is front-wise assigned . The individuals in the population are selected based on the corresponding rank and crowding distance;

  • Selection: The selection of individuals is carried out using a binary tournament selection with the crowded-comparison operator.

  • Genetic Operators: Real coded GA using simulated binary crossover and polynomial mutation is performed.

  • Recombination and selection (Elitism approach): Offspring population and current generation population are combined and the individuals of the next generation are set by selection process. The new generation is filled by each front subsequently until the population size exceeds the current population size;

With this approach,the multi-objective problem defined in (18) which represents a distributed optimization problem will be solved for each user resulting in optimal non-dominated sets. The main lines of this algorithm are illustrated in Fig. 5 (Lee et al., 2009; Liu et al., 2015).

Multi-Criteria Analysis coupled with NSGA-II

The NSGA-II algorithm yields a set of Pareto optimal non-dominated solutions based on the various objective functions involved. Subsequently, users must choose their preferred solution based on input parameters and desired performance in cost saving and comfort. Let \(W_n=[w_n,1-w_n]\) denote the preference vector assigned by user n for cost saving and comfort, respectively, where \(0 \le w_n \le 1\). At this juncture, user decisions should be bolstered by Multi-Criteria Analysis (MCA), which supports intricate decisions based on predetermined criteria and objectives. MCA techniques excel in addressing complex decision-making scenarios with multiple and conflicting objectives and criteria, facilitating the identification of a single preferred solution or the ranking and short-listing of potential solutions from a pool of candidates. Consequently, MCA provides a practical framework for exploring various trade-offs, elucidating differences and similarities among different exploitation scenarios. With this approach, each user endeavors to address their own multi-objective problem using their preference vector \(W_n\), with the optimal solution representing one among the optimal Pareto front.

In this paper, NSGA-II and MCA were integrated at the level of each user n to determine their optimal solution based on their preference vector \(W_n\). Each user’s optimal solution is contingent solely on their corresponding scheduling vector, while the scheduling vectors of other users are presumed to remain fixed. As a result, the optimal solution for each user varies when the scheduling of other users changes.

Based on the latter statement, the optimization problem defined in Eq. (18) can be regarded as a “consumption game” among all users. This game can be formulated through the following process:

  • Players: Registeration of users in set \(\mathcal {N}\).

  • Players’ strategies: Each user \( n \in \mathcal {N} \) selects their energy consumption scheduling vector \( \textbf{x}_n \) according to their preference vector \( W_n \).

  • Computing the payoffs \(F_n(\mathbf {x_n},\mathbf {x_{-n}})\) for each user \(n\in \mathcal {N}\); the vector \(\mathbf {x_{-n}}=[\mathbf {x_1},...,\mathbf {x_{n-1}},\mathbf {x_{n+1}},...,\) \(\mathbf {x_{N}}]\) denotes the vector containing the energy consumption schedules and \(F_n\) denotes the billing model implemented by the company to provide the users in the smart grid.

The proposed model is a distributed model that resolves at each user’s smart meter with only their personal load schedule. This configuration allows users to preserve privacy and minimizes the controls performed by the utility. That is, each user solves their own problem and obtains the optimal solution that minimizes their bill and maximizes their comfort. While the solution depends on the solutions of other users, it’s important to update the solution according to the solutions of other users (Game1). When any user updates their schedule, the final solution (Nash equilibrium) is obtained. With this paradigm, each user has a bill according to their participation in the DSM program.

(Mohsenian-Rad et al., 2010) demonstrated that the Nash equilibrium of that game always exists and is unique. Thus, based on Mohsenian-Rad’s approach, a distributed algorithm is proposed herein to reach the Nash equilibrium among all users of the grid. The corresponding algorithm is presented in Algorithm 1.

Algorithm 1
figure a

Distributed Game-based algorithm

The Algorithm 1 is a distributed game-based approach for solving a problem in (18) as distributed manner. Here are some comments on the algorithm:

Initialization: The algorithm starts by randomly initializing \(x_n\) and \(x_{-n}\), where \(x_n\) represents the decision variables of the current ECS (Embedded Control System) unit, and \(x_{-n}\) represents the decision variables of other ECS units in the system.

Main Loop: The algorithm then enters a while loop, where it continuously runs until no ECS unit announces any new schedule. This loop seems to be the main iterative process of the algorithm.

Solution Finding: Inside the loop, the algorithm solves a problem defined by Eq. (18) using the NSGA-II algorithm. This involves finding Pareto-optimal solutions to a multi-objective optimization problem.

Solution Selection: After obtaining solutions using NSGA-II, the algorithm chooses one solution from the Pareto front using MCA (Multi-Criteria Analysis). MCA is likely employed to select a solution based on certain criteria or preferences.

Updating Schedule: If the selected solution differs from the current schedule (\(x_n\)), the algorithm updates \(x_n\) according to the new solution and broadcasts a control message to announce this new schedule to other ECS units in the system.

Receiving Control Messages: If a control message is received from another ECS unit, the algorithm updates \(x_n\) accordingly.

The Algorithm 1 could potentially be implemented in practice within smart grid technologies. Here’s how:

Distributed Control in Smart Grids: Smart grids often involve distributed control systems where various devices (like ECS units in the algorithm) make decisions autonomously based on local information. The algorithm’s approach of each ECS unit making decisions based on its local information and occasionally sharing updates with others fits well within this framework (Mahela et al., 2020; Pipattanasomporn et al., 2009) .

Optimization in Smart Grid Operation: Smart grids face various optimization problems, such as load balancing, energy trading, and grid stability enhancement. The algorithm’s ability to solve optimization problems using techniques like NSGA-II can be useful in addressing these challenges, especially in scenarios involving multiple conflicting objectives.

Communication Infrastructure: The algorithm relies on communication among ECS units to exchange control messages. In a smart grid context, communication infrastructure, such as advanced metering infrastructure (AMI) or communication networks between devices, would be necessary to facilitate this communication (Anupong et al., 2022) .

Integration with Existing Technologies: The algorithm can potentially be integrated with existing smart grid technologies and standards. For example, it could be implemented within a distributed energy management system (EMS) or integrated into existing SCADA (Supervisory Control and Data Acquisition) systems (Sadeeq and Zeebaree, 2021) .

It is worth to note that the quality of the solutions produced by the Algorithm 1 in terms of optimality, fairness, and convergence, depends mainly on the choice of a billing model; that is to say, the energy provider company should consider the preferences of each user by means of dedicated customization a the users’ billing models. After all, the billing model shall charge the users according to their participation in the program. The next section, exhibits three different billing charging models to be implemented within the smart grid.

Constraint handling

The problems presented in this paper must adhere to the constraints discussed in Section “Constraints definitions”. Generally speaking, there are two major approaches for solving these types of problems. One approach is to include a penalty for solutions that violate the constraints and then optimize based on the resulting fitness computation. This method requires several parameters for each constraint. Therefore, setting up the appropriate parameters necessitates extensive experimentation to define the penalty function (Michalewicz, 1995; Michalewicz and Schoenauer, 1996).

The other method corresponds to adaption of the Pareto-dominance principle that is used comparing a pair of solutions and to get the constraint violation into account (Snyman & Helbig, 2017). In sum, the penalty constraint handling is one of the techniques that are widely used in the evolutionary algorithms in general, and this is also the case for the NSGA-II. In consequence, the constraint handling technique adopted in the present work was inspired from (Deb, 2000). The non-feasible and feasible solutions are contrasted on the basis of their constraint violation using the following formulation :

$$ F(x)= {\left\{ \begin{array}{ll} f(x),&{} \text {if}\, g(x) \le 0 \\ f_{max}+\sum _{j=1}^{m} <g(x)>, &{} \text {otherwise}, \end{array}\right. } $$

where g(x) is the jth constraint; m is the number of constraints presented in the problem and :

$$\begin{aligned} {\begin{matrix} <g(x)>=max(0,g(x)). \end{matrix}} \end{aligned}$$
(24)

Results and discussion

This section is dedicated to presenting the solutions of optimization problems defined above. The simulations are performed according to the following process;

  • Number of users are assigned to the smart grid and are varied for each simulation;

  • The appliances of each user are randomly generated within the set of appliances \(A_I\), \(A_{II}\), and \(A_{III}\); this configuration allows diversifying the resulting solutions;

  • Concerning the distributed GA, the parameters of the NSGA-II are exhibited in Table 3 as they are used within the DR model for the validation step;

  • The values of Table 3 parameters were obtained via simulations with a control map, which corresponds to a series of tests with different configurations that were assigned to the NSGA-II. Then, the best combinations adopted for the multi-objective problem resolution are indicated by the NSGA-II in the some table.

Table 3 NSGA-II parameters

It is worth noting that the simulations carried out in the present work targets two main objectives; the first corresponds to the improvement of the convergence of the Algorithm 1 under the different billing mechanisms proposed. The second objective deals with the optimal resolution of the optimization problems and then exploring the impact of the users’ flexibility on the total cost of the system by means of the indicators “user’s bills” and “PAR ratio”. From a multiobjective standpoint, an optimal billing model should take into account all these parameters leading to motivate the users to participate to the global program. For these reasons, each simulation compared the three billing models that were introduced in Section “Billing mechanisms” in order to select the best of them. The optimal solution of the system is obtained in a centralized way using the genetic algorithm described in Section “Genetic Algorithm”. In the distributed case, each solution is obtained using Algorithm 1 under different billing mechanisms.

Load scheduling comparison for one day: Centralized approach VS Distributed approach under different billing models with a full flexibility scenario

In this section, the distributed load schedules during a day are compared according to the three billing scenarios; subsequently, the optimal billing model is selected. It is assumed here that all users have the same number of appliances, and all users are participating in the program; a maximum flexibility is supposed at this level. The initial schedules are generated in such a way that we exactly two hours of peak time are reached; Figure 6 depicts this scenario.

According to the simulations, it is remarkable that the sum of the loads are minimized at the peak hours regarding the single-objective optimal solution which is related to the energy provider company. This is also the case for the multi-objective distributed scenarios with regards to the user’s billing methods. Hence, compared to the initial schedule, the optimality is supposed reached out since the user’s flexibility is maximized. Furthermore, Table 4 present the Coefficient of Variation (CV) for each distributed scheduling load under different scenarios.

Fig. 6
figure 6

Daily load comparison

Table 4 Daily load main statistics

Cost comparison: Centralized problem vs. Distributed approach according to the number of users under billing models with a full flexibility scenario

In this section, simulations are conducted to compare the resulting costs related to both the company’s optimal solution and the users’ distributed problem according to different numbers of users. The cost computation also involves the different billing mechanisms. Figure 7 displays resulting costs versus the number of users for each case.

Fig. 7
figure 7

Cost Versus number of users

From Fig. 7, it is remarkable that all the optimization problems likely show similar results. The difference between the optimized costs and initial loading schedule cost showed salient difference.

These findings clearly demonstrate that the Distributed multi-objective approach resulted in similar performance compared to the single-objective approach. This is quite reasonable as a maximum level of flexibility brought by the users is assumed; thus, the global minimum (related to the company optimum) is equivalent to the distributed minimum related to each user’s insight. Furthermore, the curves in Fig. 7 exhibit an exponential behavior of the costs with regards to the number of users on the grid. Efficient techniques of energy distribution optimization should therefore reveal valuable gains in cost reduction, as highlighted by the gap between the curves in Fig. 7. Equations (25), (26), and (27) propose exponential fittings of the cost’s evolution under different billing mechanisms. The fitting results are plotted in Fig. 8. Moreover, it would be interesting to note the point-wise difference increase between these costs as a function of the number of users. This evolution is plotted in Fig. 9 for the different billing mechanisms, showing also an exponential increase according to \( n \).

$$\begin{aligned} \left\{ {\begin{matrix} c_{B_1}(n) =-0.0311+0.0928\times e^{0.0284\times n} \\ R^2=0.9986 \\ \end{matrix}}\right. \end{aligned}$$
(25)
$$\begin{aligned} \left\{ {\begin{matrix} c_{B_2}(n) =-0.0319+0.0927\times e^{0.0287\times n} \\ R^2=0.9984 \\ \end{matrix}}\right. \end{aligned}$$
(26)
$$\begin{aligned} \left\{ {\begin{matrix} c_{B_3}(n) =-0.0339+0.0902\times e^{0.03044\times n} \\ R^2=0.9975\\ \end{matrix}}\right. \end{aligned}$$
(27)
Fig. 8
figure 8

Fitting results

Fig. 9
figure 9

Cost difference function \(\Delta c\) according to the number of users

Fig. 10
figure 10

PAR comparison

Fig. 11
figure 11

Probability distribution of the PAR ratios

PAR ratio Comparison under several scenarios

The following simulations exhibit the PAR ratio computed under different billing mechanisms with regards to the distributed problem. Figure 10 displays the PAR ratio computed in each simulation; notably, for all simulated cases, the PAR was minimized compared to the unscheduled plan. In summary, the average PAR for the entire simulation is 1.527 for billing \( B_1 \), while it is about 1.627 for \( B_2 \), and it reached 1.5424 for the model \( B_3 \). These results clearly demonstrate that the distributed approach presents more efficiency in terms of PAR minimization under Billing models \( B_1 \) and \( B_3 \).

Furthermore, Figures 11 and 12 display the statistical distribution of the PAR ratios under the different scenarios.

According to these figures, and regardless of the billing mechanisms, all PAR distributions exhibit a Gaussian mixture behavior of two Gaussian models as bimodal distributions, as presented in Eq. (28). Consequently, chi-square tests were carried out to emphasize the pairwise similarities of these distributions. Table 5 displays the p-values of the chi-square tests. These values are extremely less than the risk \(\alpha \), which is typically set to 5%, indicating a quasi-similarity between the PAR distributions regarding the billing models adopted in this work. Hence, Table 6 presents the two Gaussian models for each billing mechanism with the corresponding chi-square test statistics.

$$\begin{aligned} \left\{ {\begin{matrix} f_1(x) =\frac{1}{\sigma _1 \sqrt{2\pi }} e^{\frac{-1}{2}(\frac{x-\mu _1}{\sigma _1})^2} \\ f_2(x) =\frac{1}{\sigma _2 \sqrt{2\pi }} e^{\frac{-1}{2}(\frac{x-\mu _2}{\sigma _2})^2}\\ \end{matrix}}\right. \end{aligned}$$
(28)
Fig. 12
figure 12

Probability distribution of the PAR ratios

Impact of users’ flexibility on their bills

In the previous three sections, one can observe the efficient reduction in energy loads achieved by the optimization methods, leading to corresponding cost savings. However, these simulations were conducted assuming maximum user flexibility, which may not be realistic in a more generalized perspective of user behavior. Therefore, it would be valuable to further investigate this study through an additional flexibility-sensitivity analysis.

In this section, the impact of single-user participation in the program is discussed for each billing model. The selection of a specific participation vector \( W_n \) for each user will visibly impact their bill. A robust billing model should charge users with more flexibility differently compared to other users who do not participate in the optimization program.

Let’s consider a scenario where a loading plan involves three users, all of whom have fixed their schedules and thus refused to participate in a common program, except for the first user, for whom random flexibility was uniformly generated in order to study its impact on the bills of this set of users. Then, Figures 13, 14, and 15 respectively display the simulated bills for all users according to the billing models \( B_1 \), \( B_2 \), and \( B_3 \). In these figures, the horizontal axis represents the flexibility of user 1, while the vertical axis represents the billing of the users.

Table 5 p-values of KHi2 test
Table 6 Gaussian models parameters

From all the figures, it’s evident that the variation in user 1’s flexibility significantly impacts the bills of all users.

For billing model \( B_1 \), user 1’s flexibility affects not only their own bill but also those of the other users in the grid. Initially, the bills of all users are high, but they receive discounts once user 1’s flexibility exceeds the 50% threshold, resulting in all users paying the same price. This billing model fails to motivate other users to participate in the program.

Fig. 13
figure 13

Users’ bills vs. user 1’s flexibility under billing mechanism \(B_1\)

Fig. 14
figure 14

Users’ bills vs. user 1’s flexibility under billing mechanism \(B_2\)

For billing model \( B_2 \), bills are also minimized after a threshold of 50% for user 1, who receives a discount on their bill. However, the other users also receive discounts even though they are not participating. Furthermore, user 2 receives a discount on their bill, although their flexibility is the same as user 3, who receives the highest bill. This billing model is not fair either.

Regarding billing model \( B_3 \), it is notable that user 1’s bills are minimized at each value of flexibility. Additionally, users 2 and 3 receive identical bills and also benefit from a relatively small billing saving even though they did not participate in the program. This reduction can be attributed to the flexibility of user 1, which allows for a relative minimization of the system’s cost, subsequently decreasing the personal bills of the other users as well. Hence, billing model \( B_3 \) should encourage other users to take part in the energy optimization program.

Fig. 15
figure 15

Users’ bills vs. user 1’s flexibility under billing mechanism \(B_3\)

Fig. 16
figure 16

Bills of participating and non-participating users under billing \( B_1 \)

Fig. 17
figure 17

Bills of participating and non-participating users under billing \( B_2\)

Billing results from participating and non-participating users

This section generalizes the previous section so that a higher number of users are involved. Hence, in order to quantify the impact of the user’s flexibility on the personal bill, 10 users were included in this analysis, all having a unique load of the same type. Users 1 to 5 are supposed to be flexible, while users 6 to 10 are not.

Fig. 18
figure 18

Bills of participating and non-participating users under billing \( B_3 \)

Fig. 19
figure 19

Total cost versus users’ flexibility

According to Figs. 16, 17, and 18, it is evident that the users receive the same bill, even though 5 users are flexible for billing model \( B_1 \). Concerning billing model \( B_2 \), the flexibility of the users does not have an impact on the billing. Additionally, users 4 to 6 observe lower bills than the others. A preliminary analysis suggests that this minimization is due to the first stage of the algorithm, which started with these users (4 to 6). Regarding billing model \( B_3 \), the users participating in the optimization program (1 to 5) receive minimal and equal bills since they are supposed to have the same energy consumption and flexibility, while the others (6 to 10) have relatively higher bills since they did not participate in the program. This result demonstrates that billing model \( B_3 \) fairly charges the users in this case.

Impact of the percentage of users participating in the program on the total cost of the system

According to the simulations in Fig. 19, it is evident that the number (or percentage) of participating users in the program significantly impacts the total cost of the system. In this simulation, the users’ loads are assumed to be fixed, so the only variable that varies is the number of participants in the optimization program. The total cost is noted to be very sensitive to the number of users for all billing models.

Fig. 20
figure 20

Number of iteration: centralized algorithm

A likely linear behavior can be observed for the total cost according to the number of participating users. Equations (29), (30), and (31) propose three linear models to fit these variations with the corresponding fitting parameters \( R^2 \) according to each billing model. The fitting results are also plotted in Fig. 19.

$$\begin{aligned} \left\{ {\begin{matrix} c_{B_1}(np) =-0.00730 \times np + 0.10133 \\ R^2=0.9596 \\ \end{matrix}}\right. \end{aligned}$$
(29)
$$\begin{aligned} \left\{ {\begin{matrix} c_{B_2}(np) =-0.00650 \times np + 0.09552 \\ R^2=0.9572 \\ \end{matrix}}\right. \end{aligned}$$
(30)
$$\begin{aligned} \left\{ {\begin{matrix} c_{B_3}(np) =-0.00730 \times np + 0.10133 \\ R^2=0.9596,\\ \end{matrix}}\right. \end{aligned}$$
(31)

where np is number of users participating in the program.

Cost analysis based on the optimization steps

This section aims to demonstrate the cost reduction per algorithm step to reach convergence. Convergence of both algorithms is assumed to occur when the cost stabilizes after a given number of iterations. Figures 20 and 21 plot the number of iterations per algorithm and the corresponding simulated costs. The flexibility of the users is set to maximum for this simulation to ensure convergence of the algorithm for each billing model when all users are participating in the program. Hence, Figure 20 shows that the centralized algorithm converges to the optimal solution after 40 iterations, as do the three billing models, which converge to the optimal solution in 40 iterations according to the distributed algorithm, with a decreasing exponential behavior for both algorithms.

Fig. 21
figure 21

Number of iteration: distributed algorithm

User’s gain based on flexibility

In this scenario, 10 users were considered in the grid, and it is assumed that the loads are fixed with a single variable to be changed, which is the flexibility of the users. This setup allowed for detecting the decrease rate per user according to the corresponding user’s flexibility level denoted \( F_n \), and the total flexibility in the system, also the amount of billings according to the total billings in the system. Table 7 presents the results obtained for the three billing models, respectively \( B_1 \), \( B_2 \), and \( B_3 \), where \( F \) and \( BR \) represent the user’s flexibility rate and billing reduction rate, respectively. As observed, for billing model \( B_1 \), the flexibility of the users still has no impact on the individual bills, although the invoices are minimized. For billing model \( B_2 \), it is observed that user 7 is not a participant (flexibility = 1.59%), but they benefit from a 13.54% reduction in their bill. For billing model \( B_3 \), the personal bills are proportional to the flexibility of the users. This result shows that billing model \( B_3 \) is the fairest model compared to the other two models.

Table 7 Billing reduction(%) vs Flexibility(%)
Fig. 22
figure 22

Billing reduction(%) Vs Flexibility(%)

According to Table 7, it is remarkable that the variation coefficient (CV) of the billing reduction for mechanism \( B_3 \) is lower than the CV related to billing \( B_2 \). This indicates that the billing reduction of 7% under mechanism \( B_3 \) is quite stable, showing less variability compared to billing \( B_2 \), which displays a CV of over 60%. Regarding billing \( B_1 \), it is evident that it presents a constant decrease at all levels of flexibility, which may not be realistic for users if they choose to participate in the optimization program. Hence, this situation may deviate from the objectives and the core characteristics of smart grid management, which aim to optimize billing as the input combinations vary.

From Fig. 22, a particular behavior of billing reduction is highlighted. For the billing mechanisms \( B_2 \) and \( B_3 \), the billing reduction is observed to decrease with flexibility levels, even below the levels of billing reduction for \( B_1 \), which was estimated at 10%. This leads to the question of whether an optimum value of flexibility can be estimated based on the analysis of multiple billing mechanisms, or at least to compare the billing reductions based on their respective evolution.

In conclusion, the competitiveness of Billing models \( B_2 \) and \( B_3 \) is questionable. Indeed, for flexibilities less than 10%, billing model \( B_2 \) performs better than \( B_3 \), and vice versa when flexibility is higher than 10%. However, it should be noted that \( B_3 \) has been shown to be more stable than \( B_2 \) mechanisms, as discussed earlier, as it exhibits less reduction variability (VC = 7%) compared to \( B_2 \) (VC = 60%).

Conclusion

In this work, a two-fold Optimization Problem of smart grid’s energy management was studied. The centralized Optimization Problem resolution allowed simulating the billing results with regards to a given energy provider company, while the distributed Optimization Problem took into account the levels of comfort in terms of the users’ flexibility. Three billing strategies, namely \( B_1 \), \( B_2 \), and \( B_3 \), were proposed by the authors. The analysis also considered the number of users, random appliances, and random flexibility assigned to the users for the simulations. The optimization procedure included NSGA-II, MCA, and a Game-based algorithm designed by the authors. The most important findings can be summarized as follows:

  • For all billing strategies, the total cost exponentially increases with the number of users. The difference between the unscheduled program cost and the costs under the three billing strategies also exponentially evolves with the number of users.

  • The PAR ratios related to the billing and the unscheduled program exhibit random behavior with the simulation number. This variation was particularly observed to be bimodal, resembling a 2-Gaussian mixture. This could be very interesting for energy provider management to determine how energy management can tend towards the lowest mode in terms of technical aspects.

  • Simulations also proved that as the users’ flexibility increases, there is a considerable drop in the total billing, especially for the participating users within the optimization program. Conversely, the non-participating users did not benefit from cost reduction and their bills remained much higher.

  • The billing mechanism \( B_3 \) proposed by the authors was observed to be competitive since it resulted in the best decrease of the cost according to the percentage of flexible users. Moreover, \( B_3 \) showed lower standard deviation and thus a lower CV of the billing reduction versus flexibility; the VC did not exceed 7%, compared to \( B_2 \), which reached 60% CV.

Hence, it is noticeable that the distributed optimization problem, which included a variety of billing strategies and individual users’ flexibility, led to simulating different scenarios and producing various output data in terms of individual and total cost, according to the number of the three-fold parameters: the participating and non-participating users fractions, the total number of users, and the flexibility, which expresses the level of both comfort and users’ implication in the optimization program. In other words, the distributed approach is quite interesting in adopting a parametrized energy management, better than the centralized way, which is more interested in total costs.

Further work will focus on the application of other optimization approaches coupled with different billing mechanisms, while an inferential analysis of the produced data is also targeted in order to quantify the stability and robustness of the resolution approaches to different input data variabilities.Additionnaly, we will explore the possibility of testing additional billing mechanisms to further augment the comparison and provide a more comprehensive evaluation of our approach. Another work currently in progress aims to project the proposed study to a larger user administration size in Morocco.