Keywords

1 Introduction

Nowadays, electricity consumption is substantially increasing, and it is transforming the global energy mix framework [1]. The residential sector represents a large part of the total energy consumption worldwide due to the growing usage of modern electronic devices and appliances. The fast growth of urbanization and the actual global environmental situation has lead to several initiatives to promote the use of clean energy [2, 3].

New control systems and appropriate methodologies such as demand-side management (DSM) and demand response (DR) must be developed and adopted, allowing the participation of consumers through the use of flexibility from home appliances [3, 4]. The scheduling usage of loads can be useful for energy management in residential buildings [5]. From a residential point of view, this flexibility consists of modifying the consumption profiles of domestic appliances through reducing or shifting their loads over different periods [3]. This flexibility allows to shave the curve’s load peaks by planning and shifting the electricity demand of household appliances. The shaping of the load curve also ensures lower costs for consumers and improves environmental sustainability. The better matching of demand and supply saves the building of additional generation capacity and, consequently, reduces greenhouse emissions [4]. Also, these modifications on the amount of load (either shifted or decreased over time) can avoid some concerns such as the balance or congestion of distribution networks [3].

With an overall control algorithm optimizing domestic appliances’ behavior, high-efficiency levels can be achieved [6]. The optimization of household appliances’ use can be accomplished through meta-heuristic optimization techniques. Meta-heuristic techniques have been broadly used due to their simplicity, flexibility, derivation-free mechanism, and local optima avoidance. They can be divided into two main groups: single-solution-based and population-based. Swarm Intelligence (SI) is an interesting branch of population-based meta-heuristics [7].

A vast majority of SI algorithms focus on swarm’s members’ behavior, and their way of living beside the interactions and relations among them to locate their food sources [8]. Two popular SI algorithms are the Grey Wolf Optimizer (GWO) and Particle Swarm Optimization (PSO). PSO is the most popular in recent time, and GWO is the most recently developed method. In this problem, the accuracy of the chosen method is way more important than the computational flexibility of that method [9].

This paper presents an optimization of two household appliances’ energy consumption, namely the dishwasher and the washing machine, for the first Saturday of January. The problem is the minimization of the energy price according to the required consumption of both machines. A PSO and GWO optimization algorithms are used to find suitable solutions for the re-schedule of the two domestic appliances on that day. The main objective of this paper is to analyze and compare the optimization results of these two algorithms.

This paper is structured as follows. The following section reviews some different approaches to the use of PSO and GWO. In Sect. 3, the methodology used in this paper is proposed, and the two SI optimization algorithms used are described as well as the mathematical optimization model. Section 4 characterizes the case studies and the respective scenarios, and Sect. 5 shows the experimental results and a discussion. Finally, Sect. 6 concludes this work.

2 Related Work

Several articles propose different methodologies and also other approaches related to the use of the PSO and GWO.

[10] suggests a multi-objective hybrid PSO-GWO method for system optimization. The main objective is to find the optimal size of the different system components to minimize the total cost of freshwater production and \(CO_2\) emissions. The results show that the proposed PSO-GWO hybrid has a better performance than the same optimization methods used separately to reduce computational time and achieve the best function values.

In [11] it is proposed a new hybrid algorithm fusing the exploitation capability of the PSO with the exploration skill of GWO. This way, this combination aims to prevent the PSO from falling into local minimums by exploring GWO. The results show that this hybrid approach performs better than all methods employed in the comparisons (artificial bee colony and social spider algorithm) and indicates that it converges to more optimal solutions with fewer iterations.

The paper [12] presents a comparative analysis for selective harmonic elimination technique using PSO and GWO for Pulse Width Modulation inverters. It has been observed that the harmonics elimination by the GWO is better than PSO. The authors concluded that GWO can be used efficiently and works better for the scheme presented in this work.

The objective of [13] is to draw a fair comparison among eminent Nature-Inspired Algorithms in solving benchmark test functions. Among these methods, GA is the pioneer method for optimization, PSO is the most popular, and GWO is the most recent method developed. Results show that GWO is the overall best optimization technique, and PSO is still propitious to solve benchmark functions. Also, GWO is capable of solving a function successfully with a small number of populations and iterations.

3 Proposed Methodology

This section introduces a straightforward approach to the concept of PSO and GWO, and it is provided the mathematical formulation of the optimization problem.

3.1 Swarm Intelligence Optimization Algorithms

The original PSO algorithm was inspired by the social behavior and nature patterns, specifically the ability of groups of some species of animals to work together in locating desirable positions in a given area. This seeking behavior was associated with an optimization search for solutions to non-linear equations in a real-valued search space [14, 15].

PSO is initialized with a population of random particles and placed in some problem or function search space. Each of them evaluates the objective function and its current location. Then, each particle determines its movement through the search space by combining some aspects of the history of its current and the best location (fitness) achieved so far with those of one or more members of the swarm, with some random perturbations (acceleration). The best solution of each particle is called pbest, and the best global value and its location, obtained by any particle in the population, is called gbest. The PSO concept consists of, at each time step, changing the velocity (accelerating) of each particle towards its pbest and gbest locations. Eventually, the swarm as a whole is likely to move close to an optimum of the fitness function. On each iteration of the algorithm, the current position is evaluated as a problem solution [14, 16].

The GWO algorithm is a swarm intelligence technique, and it is inspired in nature by the social intelligence of grey wolves in leadership and hunting preys [7]. Grey wolves are social animals with a rigid dominant hierarchy shown in Fig. 1. They are divided into four levels, namely \(\alpha \), \(\beta \), \(\delta \), and \(\omega \), and their dominance decreases from top to bottom. Group hunting is another interesting social activity of grey wolves, besides their social hierarchy [7].

Fig. 1.
figure 1

Hierarchy of grey wolves [6].

According to this, the mathematical modeling of GWO is based on these two characteristics: social hierarchy and hunting behavior of grey wolves. Thus, the mathematical models resemble grey wolves’ hunting process: searching for prey, encircling prey, and attacking prey [7].

Like other Swarm Intelligence algorithms, the GWO search process starts with creating a random population of grey wolves. After that, the four wolf groups and their locations are established, and the distances to the prey are measured. Each wolf is a candidate solution and is updated through the searching process. Besides, GWO uses powerful operations managed by two parameters to maintain the exploration and exploitation because it is prone to stagnation in local solutions [8].

Compared with PSO, which has two vectors (position and velocity), GWO has only one position vector, requiring less memory. GWO saves three best solutions while PSO only saves one best solution for each particle [8].

The optimizing energy consumption of household appliances problem was performed using PSO and GWO techniques to compare both. These two techniques were simulated, as the flowchart of Fig. 2 shows. It demonstrates the entire procedure performed by the optimization algorithms developed to find satisfactory results for each period’s energy consumption for the two machines in the analysis.

Fig. 2.
figure 2

Optimization based simulation to obtain the energy consumption of the two domestic appliances.

3.2 Mathematical Model

Since PV power production does not satisfy the consumer’s energy consumption, the optimization problem’s objective is to minimize the cost of the energy to be purchased according to the energy consumption of flexible appliances. The optimization problem consists of eight decision variables related to the four periods of the two washing machines.

The optimization problem can be formulated as follows:

$$\begin{aligned} Minimize Z= \sum _{t} \sum _{r} C_t \cdot P_{(r,t)} \end{aligned}$$
(1)

Where \(C_t\) is the energy cost in period t and \(P_(r,t)\) represents the energy consumption of machine r in period t and \(t=1,2,3,4\) and \(r=1,2\). The washing machine corresponds to \(r=1\) and the dishwasher corresponds to \(r=2\).

The constraints of the optimization problem are:

$$\begin{aligned} \sum _{t} P_{(r,t)} \ge D_r, \forall {r} \end{aligned}$$
(2)

D represents the minimum consumption required for each machine to begin working for the four periods of the day. \(D_1\) is for the washing machine, and it is equal to 0.75, and \(D_2\) is equal to 1.5 for the dishwasher machine. These restrictions present the minimum consumption that is necessary for each machine to be switched on.

In order to analyse the results of the objective function, the average \((\overline{x})\) and standard deviation \((\sigma )\) are calculated and described in (3) and (4), respectively.

$$\begin{aligned} \overline{x} = \frac{\sum x_i}{n} \end{aligned}$$
(3)
$$\begin{aligned} \sigma = \sqrt{\frac{\sum (x_i - \overline{x})^2}{n}} \end{aligned}$$
(4)

Where \(x_i\) is a set of objective function values and n is the total number of values.

4 Case Study

The household under analysis is inserted in a residential building composed of 15 apartments of different typologies. This building roof is installed with 28 PV panels, each having a 400 Wp power, making a total installed power of 11.04 kW. Since the solar panels installed in the building feed 15 homes, the whole PV production on January 5 was divided by the same number. Thus, it was possible to determine the amount of PV energy consumed by household appliances of one consumer. The household’s energy consumption and the energy market prices on January 5 of 2019 are also taken into account.

When energy consumption is higher than the PV generation, it is necessary to buy energy from the market. Therefore, from the data obtained, it was necessary to analyze energy consumption and production to understand the amount of energy required to buy.

Before starting the optimization algorithm, a survey was conducted on household appliances. First, devices were divided into two categories: non-flexible and flexible. In the non-flexible group, appliances have no flexibility regarding the time when they can be switched on/off. On the other hand, machines that have higher hourly flexibility belong to the flexible group. Figure 3 shows the appliances that belong to each group.

Fig. 3.
figure 3

Two categories of home appliances: rigid and flexible.

Since the washing machine and the dishwasher belong to the group of flexible home appliances, these will be the variables to use in the optimization algorithm. The daily consumption of the devices on January 5 totals an energy consumption of 23.8 kWh.

For a better understanding of the problem, the day was divided into four periods, which comprise the following periods:

  • Period 1: 0 h–07 h;

  • Period 2: 07 h–12 h;

  • Period 3: 12 h–18 h;

  • Period 4: 18 h–24 h.

The study case is divided into three scenarios that analyze the energy consumption, and all of the three consist of changing the energy market price. Each situation’s energy price varies according to the time of day and the type of energy tariff used by the consumer. There are, therefore, three types of energy tariff corresponding to each scenario.

Scenario 1 corresponds to the simple tariff, scenario 2, the bi-hourly tariff’s energy price, and scenario 3 to the tri-hourly tariff. The characteristics of each tariff are as follow:

  • Simple tariff: the energy price is the same during all day;

  • Bi-hourly tariff: the energy price is lower in off-peak hours and higher in peak hours;

  • Tri-hourly tariff: the energy price is more expensive at peak times, cheaper at off-peak times and an intermediate price at half peak hours.

According to this, the energy prices for each tariff are represented on Table 1.

Table 1. Energy prices (€/kWh) for each scenario

Table 2 presents the PSO and GWO parameters used in the simulations. The population size, number of iterations, and maximum velocity were tested and adjusted to obtain better results. GWO was simulated using only two parameters (population size and iteration number) were applied.

Table 2. PSO and GWO parameters

All these simulations made for the three scenarios were performed using the R language in the RStudio program. The used system has 16 GB RAM and a Ryzen 5 3500U 2.10 GHz processor running Windows 10.

5 Results and Discussion

The methodology presented in Sect. 3 was applied to the three case studies of Sect. 4.

In scenario 1, for PSO, the best value through the 500 runs performed to the algorithm was obtained in run 437 and run 132 for GWO.

Table 3 presents the energy consumption of each machine in the four periods and the total consumption of both devices after implementing PSO and GWO techniques. The GWO algorithm obtained the highest total consumption compared to PSO. Since the energy price is the same all day long, this variable does not influence the results. Both machines could switch on at any time since the price is the same during all periods.

Table 3. Energy consumption (kWh) of both machines in scenario 1 obtained with PSO and GWO

Figure 4 shows the graph of the energy consumption of the two machines during the day. It can be observed that both devices registered the highest consumption value in period two and the lowest in period 1 with PSO optimization. Regarding GWO, the two machines reach their maximum energy consumption in period 3. About the minimum consumption values, machine 1 achieve it in period four and machine 2 in period 2.

In scenario 2, for PSO, the best value through the 500 runs performed to the algorithm was obtained in run 231 and run 132 for GWO.

Fig. 4.
figure 4

PSO and GWO optimization techniques for energy consumption of machine 1 and 2 (scenario 1).

Fig. 5.
figure 5

PSO and GWO optimization techniques for energy consumption of machine 1 and 2 (scenario 2).

Table 4 presents the energy consumption of each machine in the four periods. On the opposite of scenario 1, the PSO registered the highest value of total energy consumption. Still, in this case, the values were much more competitive in comparison to the previous point.

Table 4. Energy consumption (kWh) of both machines in scenario 2 obtained with PSO and GWO

Figure 5 presents the graph of both devices’ energy consumption on that day, using PSO and GWO techniques. In period 4, machine 2 showed the highest energy consumption value for the PSO algorithm. This situation is expected because, according to Table 1, period 4 corresponds to one of the cheapest energy prices. This way, machine two will be switched on in period 4, when the price is lowest. Regarding machine 1, it presents its maximum value in period 2 with the PSO algorithm, but it corresponds to a more expensive energy price period. This way, machine one could also be switched on in period 4, since the consumption values are very close to period 2. It is also possible to observe that both lines of the optimization values of PSO are very similar. Regarding the GWO algorithm, both machines presented the highest consumption in periods two and three, where the tariff is more expensive. Still, this technique presented better results than PSO in the first period because it presents more energy consumption when the price is at its lowest.

In scenario 3, for PSO, the best value through the 500 runs performed to the algorithm was obtained in run 139 and run 430 for GWO.

Table 5 presents the energy consumption of each machine in the four periods, using PSO and GWO. Like the previous scenario, PSO demonstrated the highest value of total energy consumption for both devices than GWO.

Table 5. Energy consumption (kWh) of both machines in scenario 3 obtained with PSO and GWO

The graph represented in Fig. 6 shows the energy consumption of the two machines for the day. It illustrates that device 2 presents the highest energy consumption on period 1 for both techniques as expected, because the cheapest energy prices correspond to period 1, in conformity with Table 1. At period 1, machine two could be switched on by the residents to minimize energy costs. Regarding machine 1, periods 1 and 2 registered the same and highest energy consumption values, using the PSO algorithm. Considering that period one is cheaper than period 2, the user could switch on machine one at the first period. In period three, when the price is the most expensive, the GWO presents the better results for machine 2, and the PSO for machine one with GWO presents the best overall results.

Fig. 6.
figure 6

PSO and GWO optimization techniques for energy consumption of machine 1 and 2 (scenario 3).

Table 6. Objective function values (€) for PSO and GWO

The optimization problem is to minimize the energy cost that depends on the two machines’ energy consumption regarding the objective function. So, the lower the value of the objective function, the better. Table 6 exhibits the objective function values obtained for the two optimization techniques used. For PSO and GWO, the objective function got the best value in scenario one because it gives the most economical energy price among the three. The best objective function value is achieved with PSO when comparing these two lowest prices.

For the 500 runs, 500 values were obtained for the objective function for each technique and scenario. These values were analyzed, achieving the minimum and maximum of all and calculating the average and standard deviation, applying (3) and (4) and they are presented in Table 7.

Table 7. Maximum, minimum, average and standard deviation values (€) obtained with PSO and GWO for the 3 scenarios

By analyzing each scenario’s standard deviation, the values of scenario 1 are less dispersed among themselves, approaching the average cost presented. On the contrary, scenario 3 shows a more significant standard deviation, which means that the values obtained in the 500 runs are quite dispersed, diverging from the average value obtained. Taking both techniques into account, the table results are quite competitive between the two SI algorithms. The exception is for the standard deviation results with the GWO algorithm that keep presenting worse outcomes than the PSO technique. This situation means that the obtained values from GWO diverge more from the calculated average objective function value.

6 Conclusions

With the increasing energy consumption in households, the control and optimization of domestic appliances’ behavior have become crucial to achieve high-efficiency levels.

This paper presented an optimization approach regarding the energy consumption of two washing machines. The main objective is to implement two different Swarm Intelligence optimization algorithms (PSO and GWO) to minimize energy cost according to the machines’ energy consumption, respecting the restrictions applied. This optimization approach was divided into three scenarios, in which the energy price differed during the day.

When the energy price is low, the energy consumption should be the highest and the user is allowed to switch the washing machines. In scenario 1, the residents could switch on the machines at any time since the energy price is always the same all day. Regarding scenario 2, both machines could be switched on by the user in period four because the PSO algorithm values were higher than GWO. For scenario 3, they should turn on both washing devices in period one as it is the most economical and registered the highest use for both optimization methods.

Then, the objective function was analyzed. The lowest value, i.e., the lowest energy price to be paid by the user, was obtained in scenario 1 for PSO and GWO. In this scenario, the smallest amount of energy consumption was registered for both machines using PSO, so it was expected that the objective function’s value would also be the most economical.

Note that both SI algorithms were used because of their simplicity of implementation and performance. Due to the simplicity of the optimization problem that is proposed, deterministic methods could be more suitable to solve this problem. This situation is because they could guarantee a better solution than the one obtained with heuristics. Since the complexity is low, this type of algorithm’s optimization time and computation would not be an issue. For future work, implementing this type of method and comparing it with heuristics could be something interesting.