Keywords

1 Introduction

The development of new technologies has increased significantly in recent years and the area of electricity is not different. Due to the forecast of a 75% increase in energy demand by the end of 2021, utilities need to rethink how electricity should be generated, transmitted, and distributed to all consumers, in order to avoid excessive costs in expanding the network to meet this new demand [1]. Thus, in this new energy scenario, associated with more efficient use of energy, the growing need to use renewable energy sources, and the reduction of polluting gas emissions, the so-called Smart Grids (SGs) emerged.

The SGs can be considered as an evolution of the classic energy model to enable more efficient management of the relationship between energy supply and demand, in order to overcome the contingency problems of the modern world and offer new services to consumers and the utility [2,3,4]. To achieve their goals, they need to use advanced Information and Communication Technologies (ICTs) to monitor and control the power grid as a whole [4].

One of the technologies available in the SGs is the Demand Response (DR), which allows optimizing the use of electricity according to some constraints imposed by the utility. DR plans can be basically divided into two categories: incentive-based programs and price-based programs [3].

Incentive-based programs provide consumers with financial incentives to reduce demand at critical times, when energy availability is scarce or when grid reliability declines. On the other hand, in price-based programs, which will be the focus of this study, consumers manage energy consumption by activating and deactivating loads according to, among other factors, the variation in the energy tariff throughout the day.

However, the implementation of price-based DR programs is not trivial, especially as the number of appliances increases and operating constraints become more severe [5]. Thus, an interesting way to solve this problem is the use of low-complexity bioinspired optimization techniques, such as Genetic Algorithm (GA), Ant Colony Optimization (ACO), and Particle Swarm Optimization (PSO), among others [6,7,8,9].

In this context, this article presents an analysis of the use of the PSO technique in the load management of a residence, which integrates a price-based DR program, to reduce electricity costs, considering the constraints imposed by both the utility and the consumers.

This article is divided into 5 sections. In Sect. 2, the system model is introduced and the PSO technique is presented. In Sect. 3, the analyzed problem is presented. Section 4 presents the results obtained and the analyzes carried out. Finally, Sect. 5 presents the main conclusions of the work.

2 System Model and PSO Technique

In optimization problems, two main phases can be defined, the elaboration of the mathematical model and the choice of the optimization technique. According to [10], there must be a compromise between these two phases, so that the model can adequately represent the real problem and allow its solution through optimization techniques with acceptable computational effort.

This study focuses on reducing the cost of electricity in a home, considering that it is part of a utility price-based DR program. The cost reduction is obtained through the use of the PSO technique in the management of household appliances, taking into account, in addition to the energy price variation, the appliance operation constraints defined by the consumer and the utility.

The cost function of the problem is given in (1) and corresponds to the total energy cost in the 24-h period.

$$ C = \mathop \sum \limits_{h = 1}^H \left( {T^h * \sum \limits_{l \in L} P_l^h } \right) $$
(1)

where \(T^h { }\) represents the hourly rate throughout the day determined by the utility, \(P_l^h\) is the consumption of an appliance \(l \in L\), where \(l\) is an appliance and \(L\) is the set of appliances involved in usage programming, at time \(h \in H\), where \(h\) is the time of the day and \(H\) the 24-h set.

Equation (1) must be optimized taking into account the constraints indicated in Eqs. (3) to (7). According to (2), an appliance cannot be turned on outside the hours programmed by the consumer.

$${\text{If}}\;s_l \le h \le f_l \;{\text{then}}\;P_l \ge 0;{\text{else}}\;P_l = 0$$
(2)

where: \(s_l\) represents the initial hour and \(f_l\) the final hour of operation of each appliance, defined by the consumer.

As shown in (3), the sum of consumption in the period between \(s_l \) and \(f_l\) must not be greater than the total consumption (represented by \(E_l\)) allocated to each appliance.

$$ \mathop \sum \limits_{h = s_l }^{f_l } P_l^h = E_l $$
(3)

The programmed appliance operating interval l must be within the 24-h period, as indicated in (4).

$$ s_l \le f_l \le H $$
(4)

The operating time of each appliance \(t_l\) must not be greater than the programmed operating interval, as shown in (5).

$$ f_l - s_l \le t_l $$
(5)

According to (6), the sum of the consumption of all appliances in a period of one hour, Ptotal/h, must not exceed \(D_{max}\).

$$ \sum \limits_{l \in L} P_l^h \le D_{max} $$
(6)

Finally, as indicated in (7), the consumption of each appliance in one hour must not exceed \(E_{max}\) (which represents the maximum consumption per hour).

$$ P_l^h \le E_{max} $$
(7)

The PSO technique, developed by Kennedy and Eberhart [11], is known for solving nonlinear optimization problems. It is a stochastic search technique developed through an evolutionary process that simulates the action performed by birds in search of food and that can be used to solve the problem of reducing the cost of electricity described in this section. The advantages of PSO over other metaheuristic methods include its flexibility, feasibility, and computational efficiency [11].

The PSO is based on a very simple theory of social cognition. All individuals in the population have their own experience and can assess the quality of that experience. As individuals are social, they also understand their neighbors’ behavior. These two pieces of information correspond to individual learning (cognitive) and cultural transmission (social), respectively. Therefore, the probability of a certain individual making a specific decision will depend on his previous performance and the performance of some of his neighbors. In [8], the process of cultural adaptation was summarized using three principles:

  • Evaluation – individuals can feel the environment to estimate their own behavior;

  • Comparison – individuals use each other as a comparative reference;

  • Imitation – imitation is fundamental in human social organizations and is important for the acquisition and maintenance of mental abilities.

Similar to other collective intelligence approaches, the PSO algorithm is based on a population of individuals that interact with each other and with the environment. Based on the properties of self-assessment, comparison, and imitation, individuals can deal with a number of possible situations that the environment presents to them. Therefore, global behaviors will emerge from the results of these interactions [8, 9].

In PSO, individuals in the population are represented by dots, known as particles, that fly in a search space. Variations in the attributes of these particles lead to new particles in space. Most PSO algorithms employ two sociometric principles, which represent two types of important information in the decision process. The first metric, pb, conceptually connects all members of a population, as a consequence, the behavior of each particle is influenced by the behavior of all other particles. The second metric, \(p_i\), creates a neighborhood for each individual composed of itself and its closest neighbors. Both metrics are measured by a cost function \(f\left( p \right)\), usually called fitness function, which corresponds to the optimal solution to the problem [11].

The implementation of the PSO algorithm is given as follows: Let \(M\) be the size of the swarm, \(n\) the dimension of the problem and \(t\) the current instant, each particle \({\text{i}}\) has a position \(x_i \left( t \right) \in R_n\) in the solution space and a velocity \(v_i \left( t \right) \in R_n\), which indicates the direction and magnitude of its displacement. Additionally, each particle has the memory of the best visited individual position \({\text{p}}_i^{*} \left( t \right) \in R_n\), and the swarm has the memory of the best position visited by some particle so far \(p_b^{*} \left( t \right) \in R_n\).

During the execution of the algorithm, the velocity of each particle is calculated according to the best individual position visited \(p_i^{*} \left( t \right)\), the best position visited by the swarm \(p_b^{*} \left( t \right){ }\) and the component that groups its previous velocity, serving as a term of momentum (inertia). A particle \(p_i \left( t \right){ }\) moves in a certain direction depending on the current position of the particle \(x_i \left( t \right)\), the velocity \(v_i \left( {t + 1} \right)\), the position of the particle that led to its best performance so far, and the best overall system performance so far \(p_b^{*} \left( t \right)\). Thus, the speed update of each particle is given in (8).

$$ v_i \left( {t + 1} \right) = wv_i \left( t \right) + c_1 r_1 \left( {p_i^* \left( t \right) - x_i \left( t \right)} \right) + c_2 r_2 \left( {p_b^* \left( t \right) - x_i \left( t \right)} \right) $$
(8)

where: \(r_1 \) and \(r_2 \) are random components taken from a uniform distribution that varies between 0 and 1, responsible for a more natural search during the optimization process [11]; \(c_1\) and \(c_2 { }\) are, respectively, the local and global learning factors, responsible for controlling the distance that a particle will move in just one iteration; \(w\) is the inertia weight that multiplies the velocity at the previous instant \(t\) and makes the search more exploratory at the beginning and the end, for a linearly decreasing inertia value, as suggested in [11].

After updating the velocity, the particle changes its current position, as can be seen in (9).

$$ x_i \left( {t + 1} \right) = x_i \left( t \right) + v_i \left( {t + 1} \right) $$
(9)

In order to guarantee the convergence of the algorithm within the search space, the particle velocity module must be within a pre-established maximum limit \(v_{max}\). The PSO algorithm runs until the stopping criterion is met or changes in particle velocities are close to zero.

3 Problem Description

In this analysis, the white tariff created in 2016 by the Brazilian National Electric Energy Agency (ANEEL) is adopted [12]. This pricing model establishes that the value of electricity in a residence varies according to the consumption time concerning the peak hours of the electricity grid. Table 1 shows the value of ANEEL’s white tariff for each period of the day.

Table 1. White tariff from ANEEL [13].

In Brazil, before the creation of the white tariff, there was only the conventional tariff, with a single value (in R$/kWh), regardless of consumption time. In this DR program, consumers try to avoid, whenever possible, consumption during periods with higher tariffs [13].

To analyze the effectiveness of using the PSO technique in price-based load management problems, a household that adopts ANEEL white tariff program with the following appliances was considered, without loss of generality: 1 refrigerator (Refrig), 1 washing machine (Wmach), 1 microwave oven (Moven), 1 electric shower (Eshower), 1 air conditioning (Aircon) and some lamps (Lamps).

Appliances, except the refrigerator, which needs to work practically all day (only 1 h off per day), must be programmed to work within the constraints imposed by the consumer, preferably during off-peak periods. Loads contribute differently to the formation of the cost function, as they have different powers and come into operation at different times, according to the consumer’s needs, which may have different pricing rates.

Table 2 shows the power and operating time of each appliance, as well as the allowed operating hours. Additionally, in this analysis, \(E_{max}\) will be considered greater than the highest power among all the appliances used, and \(D_{max}\) is considered as 8000 W.

Table 2. Power and operating restriction of each appliance [14].

Table 3 shows the possible hours of operation of each appliance, taking into account the constraints previously established. For better visualization, the time instants in which the appliances can be turned on were represented as ‘1’ and those that cannot, as ‘0’. Additionally, different tariff periods were differentiated by distinct colors. White cells indicate off-peak fare, yellow cells indicate mid-range fare, and red cells indicate peak fare, as specified earlier in Table 1.

Table 3. Allowed operating hours for each appliance.

4 Results and Discussions

Once the system model and the PSO technique were properly presented, the feasibility of using the PSO technique in the studied problem can be analyzed through computational simulation in MatLab.

4.1 Integer Linear Programming

In this work, the Integer Linear Programming (ILP) technique [4] was used as a performance reference and it considered all the defined constraints. The results for the analyzed problem are presented in Table 4. In the table, the individual cost of each appliance during the 24-h period is presented, as well as, the total cost, which is R$29.18.

Table 4. Obtained results with the ILP method.

4.2 Particle Swarm Optimization

The performance of the PSO technique depends significantly on the values of its parameters, such as population size, the maximum number of iterations, \(c_1\), and \(c_2\). Therefore, it is important to analyze statistically the best values to reach the optimal solution.

Table 5 shows the results of some of the tests performed, varying the PSO parameters values.

Table 5. Performed tests with the PSO.

According to the results obtained in the tests, the best optimization result (in agreement with the optimal result reached by the ILP technique) is obtained for \(M = 6.000\), \(c_1 = 4,5\), \(c_2 = 0,5\), \(w_{max} = 0,9\), \(w_{min} = 0,4\), \(v_{max} = 1\), and the maximum number of iterations, \(I_{max} = 3.000\).

In Fig. 1, the results of the 50 performed tests (runs) are presented, considering the best configuration of PSO parameters obtained. It can be seen that 50 of the 50 runs performed reached the optimal result indicated by the ILP technique, resulting in a 100% hit probability.

Fig. 1.
figure 1

Electricity cost for each PSO realization with optimized parameters.

In Fig. 2, the convergence curves of each of the 50 runs analyzed are presented. It can be seen that to ensure convergence with a high probability of success, the algorithm needs to perform more than 2.000 iterations.

Fig. 2.
figure 2

PSO convergence by number of iterations.

Table 6 shows the power consumption of each appliance throughout the day, after the optimization process performed by the PSO technique. The first column represents the hours of the day and the other columns represent the power consumed by each appliance throughout the day. It can be seen that the allocation of appliances in the 24-h period meets all predefined operating constraints (including PTotal/h ≤ Dmax, that is, PTotal/h ≤ 8.000 W).

Table 6. Power per appliance throughout the day using the PSO technique.

Table 7 shows the cost spent by each appliance throughout the day, after the optimization process performed by the PSO technique. The costs for each appliance per hour are shown in each row corresponding to the appliance column and the total cost per appliance for the day is shown at the end of each column. The sum of these values corresponds to the total cost of electricity on the day, which was R$29.18. This value corresponds to the optimal solution of the problem presented by the ILP technique, validating the PSO technique analyzed for the proposed problem.

Table 7. Cost per appliance throughout the day using the PSO technique.

5 Conclusion

This work presented a PSO-based load management technique for residential applications, which takes into account a utility price-based DR program and load operation constraints defined by the consumers or even by the utility. Analyzing the obtained results, it can be verified that the proposed technique proved to be a very efficient and attractive low-complexity strategy to reduce electricity costs in domestic applications.

For future work, other bioinspired optimization techniques, such as FPA or ACO, can be applied to the analyzed problem and their performance can be compared to that obtained by the PSO technique.