Demand response as a distributed resource has proved its significant potential for power systems. It is capable of providing flexibility that, in some cases, can be an advantage to suppress the unpredictability of distributed generation. The ability for participating in demand response programs for small or medium facilities has been limited; with the new policy regulations this limitation might be overstated. The prosumers are a new entity that is considered both as producers and consumers of electricity, which can provide excess production to the grid. Moreover, the decision-making in facilities with different generation resources, energy storage systems, and demand flexibility becomes more complex according to the number of considered variables. This paper proposes a demand response optimization methodology for application in a generic residential house. In this model, the users are able to perform actions of demand response in their facilities without any contracts with demand response service providers. The model considers the facilities that have the required devices to carry out the demand response actions. The photovoltaic generation, the available storage capacity, and the flexibility of the loads are used as the resources to find the optimal scheduling of minimal operating costs. The presented results are obtained using a particle swarm optimization and compared with a deterministic resolution in order to prove the performance of the model. The results show that the use of demand response can reduce the operational daily cost.
The future of power systems has been guided of a new structure where consumers (end-users) are considered as a central entity. This vision is presented in the Strategic Energy Technology (SET) plan of the European Union . The transformation of end-users’ roles allows these entities to have an active contribution in electric power systems. The prosumer is a new concept that has its origin in the proliferation of Distributed Generation (DG) in end-user facilities. The Prosumer definition is presented in Reference , where prosumers are considered agents that can either consume or produce energy. The integration of renewable energy sources (RESs) and energy storage systems results in the increase the complexity of energy management. In Reference , some methods to optimize renewable energy systems management are revised.
Regarding demand response (DR) programs, the potential for participation in facilities is significantly increased by the distributed energy resources and especially the energy storage systems. With the participation in DR programs, the roles of the consumers change from a passive entity to an active entity that manages both local consumption and generation resources . DR constitutes a modification of load profile in response to monetary or price signals, and thus provides flexibility and aims to help power systems during peak hours of demand or contingencies cases . As the DR programs are able to reschedule part of the load, the use of these programs is a way to increase the flexibility of the grid management, avoiding the need to invest in more capacity .
Categorizing DR programs, it can be divided into two main categories: incentive-based DR programs and price-based DR programs. The incentive-based DR programs are referred to as the first category for DR programs, where the consumers can offer an incentive to change their consumption patterns. Direct load control programs, load curtailment programs, demand bidding programs, and emergency demand reduction programs are examples of incentive-based DR programs. The “price-based DR programs” are the second category of DR programs, where the consumers are charged with different rates at different consumptions times. Therefore, the retail electricity tariff is affected by the cost of electricity supply. The price-based DR programs types are a time of use pricing, critical peak pricing, real-time pricing, and inclining block rate . Advanced infrastructure metering is needed to implement DR programs at the residential, commercial, or industrial level. Such infrastructure (i.e., smart meters) is able to measure and store energy utilization at different times and also obtain the current usage information remotely.
The European Union has shown significant interest in the concept of smart metering. According to , it is expected by 2020 to invest ~45 million euros for 200 million smart electricity meters and 45 million smart meters of natural gas. This facilitates the application of DR programs in most electrical facilities.
Regarding the formulation of DR optimization problems, linear programming (LP) or nonlinear programming (NLP) can be used. Frequently the DR problems are able to use binary decision variables for determining the status (ON or OFF) of various consumers or appliances; in these situations, mixed-integer linear programming (MILP) or mixed-integer nonlinear programming (MINLP) may be used. In Reference , the authors use MILP to optimize DR and generate scheduling in a residential community grid using renewable energies, batteries, and electric vehicles. In this optimization, a minimization problem of purchased energy costs of the residential community has been solved. In Reference  a cost minimization in smart building microgrid considering DR optimization and day-ahead operation is implemented using MILP. This case study is composed of two different smart buildings with 30 and 90 houses. During the optimization process, the optimal schedule of house appliances is found. Another MILP approach is applied in Reference , showing how strategies like DR can achieve suitability in any region considering the presence of high penetration of renewable-based generation.
An example of NLP applied for DR optimization is presented in Reference , where the unit commitment problem for a microgrid is solved. The optimization problem finds the amount of load reduction and paid incentives for each time interval. Another example of MINLP has been presented in Reference , which considers the minimization of purchase gas and electricity from the grid by including the consumption of different loads at different periods. The optimal day-ahead scheduling of resources in energy hubs is determined.
The DR application in end consumers has been over time applied through an aggregator. It works as a service provider, and the DR services must be paid to this provider. In Reference , an aggregation of thermostatically controlled loads for performing DR is presented. In this case, the air conditioning consumption is considered as the load. The aggregation services are not restricted to the application of DR programs, in Reference  an aggregation of generalized energy storage can be found. The aggregator storage is used to participate in the energy and regulation market. DR programs targeting independent users, without the need of contracts or service providers, are also possible [16,17]. These applications are considered independent because the user is not connected to any aggregator. Usually, when the application is independent the user has a device installed in its house to control the loads. In Reference , the controller is a PV inverter, while in Reference , a home energy management system is used. The controllable loads can be divided into passive (i.e., air conditioning, fridges, washing machine) and active (i.e., DG, ESS, vehicle-to-grid, PV) loads . In References [16,19] the DR is applied on discrete loads, which only have two states: on or off.
With focus on artificial intelligence (AI), its application in power systems has increased in the past years. The metaheuristics are a very popular part of AI for solving optimization problems. These techniques have acceptable performance in order to solve engineering problems by finding a near-optimal solution with a limited computation burden. Metaheuristics can be applied in problems with a large number of decision variables and easily adapted to a problem that has several constraints . A PSO variant is used in Reference  for finding the optimal operation of price-driven demand response with a load shifting dispatch strategy for photovoltaic, storage battery, and power grid systems. The optimization algorithm is implemented on Home Energy Manage System. In Reference , the PSO algorithm is also used. The DR is optimized considering the variation of electricity price imposed by DSO to provoke a consumption reduction. In the microgrid environment , a PSO is used for solve the DR optimization problem. In this case a dynamic pricing model is considered for increase the profit of costumers. In Reference  a PSO algorithm is proposed to optimize the performance of a smart microgrid in a short term to minimize operating costs and emissions. Other algorithms like genetic algorithm , simulated annealing , and differential evolution  are frequently used algorithms to solve DR optimization problems.
The present paper proposes DR optimization considering the optimal battery schedule in a residential house with Photovoltaic (PV) generation. A PSO approach is implemented to solve the optimization problem (MILP), and the results are compared with a deterministic resolution (CPLEX solver). The consumer (residential house) is provided with independent management that approaches the several resources capabilities and contributions for the minimization of energy bought from the grid. The main contributions of this paper are as follows.
To perform DR without any contract with the DR service provider—this presented methodology allows the user to perform DR actions without any connection with DR services provider. The consumer is provided with independent management that approaches the several resources capabilities and contributions for the minimization of bought energy from the grid.
The implementation of PSO which is a very simple metaheuristic to implement, open access, multiplatform (Windows, MacOS, Linux, etc.), executable from an Arduino/Raspberry and also is the cheapest implementation option. Referring to the presented solution in , which uses a CPLEX solver for MATLAB/TOMLAB platform, the implementation of the PSO is a much affordable solution, once that MATLAB and TOMLAB are non-open access. PSO can be implemented in an open access environment and can be executed in free simple platforms, such as Python.
The proposed methodology represents an optimization problem that can considerably improve the consumer’s energy savings—the combined use of resources (PV production, storage capacity, and loads flexibility) allows for a significant reduction in daily operation costs. The optimal solution obtained by PSO has a daily cost of 3.28 €, while an operation without PV production, storage capacity and loads flexibility has a cost of 16.83 € per day, which is five times higher than PSO result for best scenario. If one considers a base scenario that was obtained by using a simple management mechanism considering the PV production and storage capacity, the daily cost is 9.33 €, which is three times higher than PSO result for the best scenario. The assessment of PSO can be verified in the comparison of the base scenario and the optimized base scenario with the PSO. The daily costs with PSO decreases 1.38 €.
The paper is structured into seven sections: In Section 1 an introduction about DR and how to solve DR problems is presented. Section 2 presents the proposed methodology; in Section 3 the problem formulation is presented. Section 4 presents the algorithm (PSO) and its adaptation to the problem formulation. In Section 5, the case study is presented as well as all input variables and PSO parameters. Section 6 presents the results, and the conclusions are presented in Section 7.
2. Proposed Methodology
With the goal to reduce the electricity bill of the end consumers is introduced the presented methodology. This methodology aims to minimize the operation costs considering the batteries and flexibility provided by the DR actions. The costs minimization considered the grid, the PV systems, energy storage batteries, and consumption flexibility through load scheduling. The end consumer is connected to the grid, and has a tariff contract that allows selling energy in the grid in exchange for monetary payment. This methodology is able to be expanded to other consumers with different conditions and with different numbers of resources. Figure 1 presents the context scheme of the idea proposed. This scheme is typical for a household prosumer. The scheme of Figure 1 has a unit generation (PV), energy storage system (ESS) (battery), one inverter module, the controllable and noncontrollable loads, and a smart meter.
For household, the use of PV generation is considered free (the generation unit is household property). In this paper, the PV generation is considered priority above all others, meaning that when it is available it will always be used either by load’s necessities, battery charge, or injection in the grid. The connection with the grid is considered bidirectional. The PV rated power is usually limited by a contract between retailer and household. This limitation occurs because it can be a source of problems for the physical grid. In this way, it is difficult to reach a situation in which, as limit case if no injection to the grid is allowed, the PV is higher than the load plus the energy that can be used to charge the battery. However, if it happens, the inverter will disconnect the PV in order to avoid overvoltage. In Figure 1 one can see power flows and information flows. The information flows are connected to the inverter and controllable loads. In this case, the inverter is enabled with a control and management system that allows controlling loads, adding DR actions in household installation.
In general, the consumer can take advantage of the use of PV generation, ESS, and DR actions to minimize the cost of consumption from the grid. The consumer can look for the periods where electricity is cheaper to satisfy the consumption and charge the ESS, and the periods where the electricity price is most expensive to sell the excess electricity from the facility. Thus, it can be considered as a management system for the consumer to improve his energy bill.
Figure 2 is a representative illustration of the load’s control using relays. The controller, in this case, is a component of the inverter. Each controllable load must have one relay associated with it, which allows for its control. So, when the controller sends the signal to the relay, the load is connected or disconnected from the electrical circuit. In this case, this control is considered a DR cut (direct load control). The scheme in Figure 2 considers only one relay for simplification; however, the proposed methodology is able to consider several relays, one for each load in the facility.
3. Problem Formulation
The mathematical formulation is presented throughout this section. With the formulation presented it is intended to simulate the interaction of a consumer with the grid. The main goal is to minimize the operation costs, considering that the user has storage units and is also enabled to do DR in specific loads. The presented optimization model is considered a mixed-integer linear problem. Equation (1) presents the objective function.
Equation (1) is comprised of the sum of two different parcels: the energy bill present in Equation (2) and the DR curtailment present in Equation (3). The Energy Bill represents the cost of buying and selling energy, and the DR curtailment refers to cost weighting associated with kWh curtailment.
In Equation (2) the variable represents the flow of energy between household and grid, is an indicator variable for power flow into the grid and control the energy buy and energy sell , represents the cost of buying electricity and represents the cost of selling electricity. The Energy bill in Equation (2), consider the costs of buying electricity and the revenues of selling electricity . In each period the user can make a single operation (buy or sell).
Also, in Equation (2) the term represents the power sent to the network. The term is used for to adjust the consumption to the tariff price because normally the tariff is available in €/kWh and the optimization can be scheduled at different time intervals (e.g., 15 min). represents the daily contracted power cost. If the term has a positive value during optimization it means that there is electricity consumption from the network. However, if it has a negative value it means that there is a sale of electricity to the network. Equation (3) presents the DR curtailment.
If the DR curtailment equation is implemented the cost of load is cut with the use of weights, and in fact does not have cost for the user. The variable represents the cut energy of load in period , the represents the decision binary variable to active the cut of load in period , and represents the cut weight of load in period . The term shows the interest of the user to perform cut in load in period .
Equation (4) represents the balance between load and generation, represents the energy charged or discharged by baterry in period . If the value of is less than 0 the battery is discharging, otherwise, if the value of is greater than 0, the battery is charging. The variable represents the photovoltaic production of unit at period , and corresponds to the value of load at period .
The Equation (5) shows the balance of battery systems.
Variable represents the state of the battery in period , in other words, it represents the amount of energy it has available. So, by Equation (5) the current battery state is obtained by adding the previous state to the value of the variable .The power term in Equation (5) is multiplied by to convert power into energy units. The system is governed by the following constraints (Equations (6)–(10)).
In Equation (6), the variable and represent the limit values for variable . Equation (7) identifies that can only take the maximum value . The variables can take a value between and ; if the value of is less than zero it represents a discharge and if the value is greater than zero it represents a charge. The variable
is a binary variable and represents a decision variable. When is equal to 1 the cut of load ( at period is active.
4. Particle Swarm Optimization
PSO was proposed by Kennedy and Eberhart in 1995, and it is a random search algorithm that simulates the foraging and flocking of birds in nature . When birds look randomly for food in a given area, each bird can be associated with a single solution and can be considered as a particle in the swarm.
For PSO implementations assume that it has particles in the n-dimensional search space and each particle represent a solution in the search space. Equation (11) presents the position vector of particle j and in Equation (12) the velocity vector for particle j.
where, . represents the position vector of particle for . variables at iteration . The represents the velocity vector of particle for n variables. When the search process starts, both vectors are generated randomly between the respective limits of the n variables.
Equation (13) represents the velocity update equation. This equation is composed of three different components: the component represents the previous positions in memory search, corresponds to the cognitive learning component, and is a global learning component. Equation (14) represents the position update.
where, is the velocity vector at iteration ; represents the inertia weight obtained through Equation (15); and are acceleration coefficients, which are obtained by Equations (16) and (17), respectively; and and are two uniformly distributed random numbers independently generated within [0,1] for the n-dimensional search space. denotes the historical best position and denotes the population historical best position. Equation (15) presents an inertia weight.
where, is the maximum value for inertia weight, is the minimum value for inertia weight, and represents the maximum value of iterations. The inertia weight present in Equation (15) is a linear decreasing method during the search process. The inertia weight reduction ensures strong global exploration properties in the initial phase and strong local exploitation properties in the advanced phase. The inertia weight is calculated at each iteration and is the same for the set of particles at each iteration . Equations (16) and (17) present the acceleration coefficients calculation:
where, and are the maximum and minimum values for the personal acceleration coefficient, respectively. decreases over the iterations, which means that the acceleration component for the personal position at the beginning of the search is high allowing exploration. The parameters and represent the minimum and maximum values for the global acceleration coefficient. increases over the iterations, which means that the acceleration component for the global position at the end of the search is high allowing exploitation. The encoding of the solutions is crucial for the success of the algorithm. Equation (18) shows the encoded vector used for solving the problem present in Section 2.
where, is a group of continuous variables representing the electricity amount of charge or discharge in each battery ( at period and are binary variables to enable the possibility of performed cut action in load at period . Therefore, particle has dimensions of . This encoding allows a direct evaluation in Equation (1).
The PSO implementation starts by defining the search space limits by setting the lower and upper bounds of each variable. In Equation (19), represents the lower limits for the solution of particle and in Equation (20) represent the upper limit for particle.
Equation (21) presents the process of initialization where the initial solution was created. In this case, a random process into allowed bounds is executed. is a random number within the lower and the upper bounds of particle for variables.
Equation (22) presents the boundary constrains method. The search process over the iterations will generate new solutions that may not be within the initially stipulated limits. To address this issue the boundary control strategies are used to repair infeasible individuals. In this paper is used a boundary control technique known as bounce-back .
In contrast to random reinitialization (the most used control technique), bounce-back uses the information on the progress towards the optimum region by reinitialized the variable value between the base variable value and the bound being violated. Making use of domain knowledge about the problem, the Equations (23) and (24) is proposed as a direct repair equation. The Equation (23) concerns the direct repair of .
Although boundary control is used it can only control the variables and , the variable is a variable of control and balance, and when it is repaired other variables are necessarily changed. For the repair process is needed to test two different conditions, represents a greater discharge than the allowed one, being that it fixes the variable to the minimum value. means that the battery has a charge greater than the allowed, the value of maximum energy in the battery is fixed in maximum that can accumulate. Equation (24) presents the direct repair for variable.
is repaired in Equation (22), but with the direct repair used in Equation (23) the variable may not be correct, and it is necessary to perform direct repair on it. So, a battery power level test is performed, if the value for is equal to the difference between the battery power level in the previous period and the current period . The same rule is applied when the battery power level is greater than the allowed maximum .
The particles should be evaluated according to a fitness function , Equation (25), including objective function Equation (1) and constrains violation .
where, in Equation (26) represents the penalty value for a solution . Despite the application of bounce-back method Equation (22) and direct repair methods (23) and (24), the solution may still be infeasible. The penalty value is obtained checking the limits of variable for every period. In each period that the variable is out of limit is counted and multiplied by a penalty amount , the sum of all individual (per period) penalties represents the total penalties per each solution.
Pseudocode of the PSO algorithm is presented in Algorithm 1.
Algorithm 1. PSO pseudocode.
INITIALIZE Set control parameters ,,,,, , and . Create an initial Pop (Equation (21)) and initial velocities. IF Direct repair is used THEN Apply direct repair to unfeasible individuals END IF Evaluate the fitness of Pop (Equation (25)). Create a vector for every particle. Create vector of the swarm. FOR = 1 to FOR = 1 to Velocity update (Equation (13)) Position update (Equation (14)) Update , and (Equations (15)–(17)) Verify boundary constraints for (Equation (9))and (Equation (10)) IF Boundary constraints are violated THEN Apply boundary control (Equation (22)) END IF Verify boundary constraints for (Equation (8)) and (Equation (9)) IF Boundary constraints are violated THEN Apply direct repair (Equations (23) and (24)) END IF Evaluate fitness of (Equation (25)). Verify boundary constraints for (Equation (6)) IF is out of limits THEN Apply penalty function (Equation (26)) Update fitness value (Equation (25)) END IF Update vector for particle. END FOR Update vector of the swarm. END FOR
Basically, if in the evaluation process constraints violations are identified, the individual is randomly repaired using the initialization process from Equation (22). The pseudocode of Algorithm 1 is displayed step-by-step, starts with the definition of the parameters related to the PSO. The search begins with the creation of the initial population. After being evaluated, the best position of each particle and the best position of the population are defined. The main cycle starts, and at each iteration of the main cycle, another cycle is performed for each particle. For each particle a new velocity is generated, updated, verified, and evaluated. When all particles repeat the process, the value of the best personal position of each particle and the best overall position of the population is updated.
5. Case Study
This section presents the case study. The optimization problem was solved using PSO metaheuristic and compared to a solution obtained by a CPLEX solver in MATLAB™/TOMSYM™ environment to compare the results.
The proposed methodology addresses a Portuguese consumer and complies with actual Portuguese legislation, which allows small producers (consumers with local generation) to use the energy produced to satisfy the own load necessities and sell it to the grid. The consumer has a supply power contract of 10.35 KVA with the retailer, and it is characterized by three different periods: peak, intermediate, and off-peak . The prices applied to a consumer operation are present in Table 1. The input prices in Table 1 are real values of a Portuguese retailer (https://www.edp.pt/particulares/energia/tarifarios), which provides a realistic case study. The prosumer can inject his excess production into grid, but a limit is imposed by the retailer. The maximum value injected into grid is half of its contracted power, approximately 5.1 kW. The real prices and real condition inclusion in this problem contribute to more accurate in this study and prove the real value of the methodology application.
The DR weights present in Table 1 are defined by the consumer taking into account the energy price variation within the day, adapted from . The use of DR is more appreciated when the energy is cheaper, so the weight of 0 is given in peak periods (highest price). With this weight distribution, the DR actions are expected to be executed during peak periods. Equation (3) gives the amount of DR actions contributing to the objective function. It does not represent costs for the consumer, but is rather a consumer’s preference that influences the scheduling. In Table 2 are presented the problem input variables adapted from .
The system has two PV panels with different production, one has a maximum production of 7.5 kW and other has a maximum production of 2.5 kW. This PV panels and the battery storage unit are connected to the inverter. The battery can receive power from the PV production or the grid. In this case study, the inverter has two functionalities: the first is to convert the power from DC to AC and vice versa; the other functionality is to give the signal to manage certain loads. In this study, three different loads are considered: a dishwasher, an air conditioner, and a water heater. Figure 3 shows the disaggregated consumption and PV generation forecasts. In this case study, the forecast is performed for the next 24 h. In real-time operation, the forecast can be updated at every instant. Each time that user update the forecast can perform a new optimization. Regarding the influence of the forecasting results on optimization, in the case that the presented day-ahead forecasting strategies in References [30,31] are considered, the forecasting error, using Supporter Vector Machine algorithms to predict the values for the next 24 h, will be 9.11%.
Figure 3 presents a typical load profile with a peak of 11.5 kW at ~11.45 h. The consumption per controllable load is present in Figure 3 with different colors. The total consumption includes the sum of all loads and the same situation for PV but is the sum of two PV units. The peak of production is forecasted between the 12.00 h and 13.30 h with 6 kW. In some periods, such as 10:30, the sum of the controllable loads corresponds to the total consumption. Table 3 presents the parameters for PSO; they were obtained from a previous study.
The member of evaluation is equal to and presents the number of fitness function is evaluated during the search process. Considering that the PSO is an algorithm of a random nature, a group of 30 trials is performed. With a sample of 30 results, it is possible to extract a more robust conclusion from the application of the PSO to the problem in question.
This section presents the results and analysis obtained from the implementation of the proposed methodology and respective case study. Table 4 presents the results for Equation (1) in both the CPLEX (deterministic) obtaining the optimal value, and PSO obtained an approximate resolution. Four different scenarios were created considering the resources combination: the scenario “PV + Bat + DR” combine the all available resources (PV production, the storage capacity and loads flexibility), scenario “PV + Bat” combines the PV production and storage capacity resources and “PV” scenario only considers the PV production resource. The nonoptimized value is used as a base case scenario and was obtained by using a simple management mechanism; the scenario “PV + Bat” considers PV production and storage capacity, and the “Without resources” scenario does not consider any resource. Analyzing the results of CPLEX for the set of scenarios can conclude that “PV + Bat + DR” presents the smallest fitness function. It can be said with resources combinations brings benefits for household management.
The analysis of results is performed for the “PV + Bat + DR” scenario. The results present in Table 4 of PSO correspond to 30 trials. The minimum value that the PSO reached is 2.8% higher when compared with CPLEX value. Analyzing the standard deviation (std) value for the sample of PSO results is possible to conclude that it is relatively small and the values of the 30 trials should be relatively close to the mean value. The STD analysis is important because it is a measure that expresses the degree of dispersion of 30 trials solutions. Figure 4 presented the results related to the DR actions applied to the profile shown in Figure 3.
In Figure 4, the positive values correspond to the consumption of appliances that had no changes with the application of the methodology. Negative values are energy that has been reduced due to cut of loads. With the loads cut, reduction of 63% in the total consumption of three loads (dish washer, air conditioner, and water heater) was obtained. The DR actions are performed during 10.00 h to 13.00 h and 19.00 to 21.00. Crossing this information with Table 1, one can see that these periods correspond to a peak hour, precisely when energy is more expensive. During peak hours the consumption with the present optimization methodology is 44.8 kW, without its application and not considering PV generation and energy storage systems, the consumption will be 115.4 kW. This reduction represents 20% reduction of total daily consumption. In this way, it is concluded that the present methodology has an impact on the consumption of peak hours. In Figure 5 are presented the total load consumption (controllable and noncontrollable loads), the battery actions (charge and discharge), and the final load (load consumption plus battery charge).
Figure 5 shows that due to this condition, the generation (see Figure 3) exceeds the consumption needs, and in this case, the energy surplus will either be used to charge the battery or sell to the grid. In this way, the user avoids buying energy from the grid to charge the battery and to meet consumption necessities. The battery discharge cycles are mostly represented between 11.00 and 21.00 periods that correspond to a peak and intermediate hour. Table 5 presents a summary of the results obtained by both methods applied.
With the proposed methodology, the daily cost of operation for CPLEX is 3.18 (€) and 3.28 (€) for PSO, but if the PV system, battery and DR do not exist and the daily costs are 16.83 (€). When compared the results of Table 5 is possible to observe that daily cost for CPLEX is larger compared to PSO daily cost, but the value of revenues in CPLEX are also large than PSO values. With the case study present in Section 5, the value of Equation (1) is equal to Equation (2) in both of methods, which means that the value of Equation (3) is zero because Equation (1) is the sum of Equation (2) and (3). When Equation (3) has the value zero represents that the DR is performed on periods with weight equal to zero and do not have a contribution to Equation (1). Table 5 also presents the monthly costs, which are calculated considering that the profile present in Figure 3 is repeated for the 30 days of the month. The value obtained for PSO is 2.96 (€) higher.
The present work addresses a methodology for resource scheduling (PV battery, storage capacity, and load flexibility) in a residential house that has not any contract with a DR service provider. Usually, the DR services for residential consumers are available using a DR service provider. In contrast, in the presented methodology the user is independent of applying his preferences in decision-making. In this case, the PV inverter, installed to convert the PV production into DC to AC, can control the charge or discharge of the battery system and the interruption of the loads. The optimization results for and are the inputs for the PV inverter control to act on the battery system and controllable loads.
The optimization problem was solved using a stochastic method (PSO) and a deterministic method (CPLEX). The results obtained by PSO have a close approximation to the deterministic results. The simple implementation and open access possibility of programming PSO over different platforms are factors that potentiate its use in this type of problems. In fact, in the present work, it was possible to demonstrate the results of running a PSO-based algorithm on a connection with the inverter of the PV system for control of the connected loads and the charge or discharge of the battery storage system.
The numerical results presented demonstrate that it is possible to obtain advantages by using the optimal combination of available resources. Table 4 presents the fitness function value for different resources combination, showing that the scenario that combines the all available resources is the best. Although PSO can obtain near-optimal solutions, its solution using the best combination resource scenario is better than the normal operating solution. With the comparison between the base scenario and the same scenario with PSO optimization, it is possible to make the assessment of the PSO approach. The daily cost optimized by PSO for the base scenario is 14% lower compared with the obtained in the nonoptimized base scenario.
As the presented methodology was built for been applied in an independent agent, the agent facility (residential house) needs to be prepared with equipment to perform the actions that the presented method imposes. This condition may be a weakness of the methodology, as it will increase the initial investment in equipment. Assuming that the DR program is implemented efficiently, such investment can be recovered over time, as the user does not need to pay fees to any service provider to use the service. The use of PSO instead of CPLEX can make the initial investment more appealing, for reasons already discussed in the introduction.
For future work, an analysis incorporating more DR actions (e.g., reduction and shifting capabilities) in the presented methodology can be done. Also, robust optimization considering the forecast error in PV production and domestic consumption can also be made to analyze the impact of forecasts errors in the electricity bill.
Investigation, R.F.; Methodology, P.F. and Z.V.; Resources, Z.V.; Software, R.F. and J.S.; Writing—original draft, R.F.; Writing—review & editing, P.F. and Z.V.
The present work was done and funded in the scope of the following projects: SIMOCE Project (P2020-23575) and UID/EEA/00760/2019 funded by FEDER Funds through COMPETE program and by National Funds through FCT. Ricardo Faia is supported by national funds through Fundação para a Ciência e a Tecnologia (FCT) with PhD grant reference SFRH/BD/133086/2017.
Conflicts of Interest
The authors declare no conflicts of interest.
Energy Storage System
Mixed-integer Linear Programming
Mixed-integer Nonlinear Programming
Particle Swarm Optimization
Renewable Energy Sources
Strategic Energy Technology
Cost of buying electricity to the grid
Cost of selling electricity to the grid
Cut weight of load
Daily contracted power cost
Lower bond for
Maximum limit for
Maximum number of iterations
Maximum numbers of particles
Maximum value for cut load
Maximum value for energy charge
Maximum value for energy discharge
Maximum value for global acceleration coefficient
Maximum value for inertia weight
Maximum value for personal acceleration coefficient
Maximum value of accumulated energy in battery
Minimum limit for
Minimum value for global acceleration coefficient
Minimum value for inertia weight
Minimum value for personal acceleration coefficient
Multiplicative factor related with the time to calculate energy
Number of batteries
Number of controllable loads
Number of Periods
Upper bond for
Value of load
Binary variable for control the flow direction
Cut power of load
Decision binary variable to active the cut of loads
Energy charged or discharged by battery
Fitness function with penalty
Flow of energy between household and grid
Historical best position
Personal and global acceleration coefficients
Population historical best position
State of the battery
Uniform distribution random numbers
European Union. The Strategic Energy Technology (SET) Plan; European Union: Brussels, Belgium, 2017. [Google Scholar]
Bhandari, B.; Lee, K.-T.; Lee, G.-Y.; Cho, Y.-M.; Ahn, S.-H. Optimization of hybrid renewable energy power systems: A review. Int. J. Precis. Eng. Manuf. Technol.2015, 2, 99–112. [Google Scholar] [CrossRef][Green Version]
Roldán-Blay, C.; Escrivá-Escrivá, G.; Roldán-Porta, C. Improving the benefits of demand response participation in facilities with distributed energy resources. Energy2019, 169, 710–718. [Google Scholar] [CrossRef]
Paterakis, N.G.; Erdinç, O.; Catalão, J.P.S. An overview of Demand Response: Key-elements and international experience. Renew. Sustain. Energy Rev.2017, 69, 871–891. [Google Scholar] [CrossRef]
Neves, D.; Silva, C.A. Optimal electricity dispatch on isolated mini-grids using a demand response strategy for thermal storage backup with genetic algorithms. Energy2015, 82, 436–445. [Google Scholar] [CrossRef]
Jordehi, A.R. Optimisation of demand response in electric power systems, a review. Renew. Sustain. Energy Rev.2019, 103, 308–319. [Google Scholar] [CrossRef]
European Commission. Benchmarking Smart Metering Deployment in the EU-27 with a Focus on Electricity; European Commission: Brussels, Belgium, 2014. [Google Scholar]
Nan, S.; Zhou, M.; Li, G. Optimal residential community demand response scheduling in smart grid. Appl. Energy2018, 210, 1280–1289. [Google Scholar] [CrossRef]
Zhang, D.; Shah, N.; Papageorgiou, L.G. Efficient energy consumption and operation management in a smart building with microgrid. Energy Convers. Manag.2013, 74, 209–222. [Google Scholar] [CrossRef]
Pina, A.; Silva, C.; Ferrão, P. The impact of demand side management strategies in the penetration of renewable electricity. Energy2012, 41, 128–137. [Google Scholar] [CrossRef]
Nwulu, N.I.; Xia, X. Optimal dispatch for a microgrid incorporating renewables and demand response. Renew. Energy2017, 101, 16–28. [Google Scholar] [CrossRef]
Alipour, M.; Zare, K.; Abapour, M. MINLP Probabilistic Scheduling Model for Demand Response Programs Integrated Energy Hubs. IEEE Trans. Ind. Inform.2018, 14, 79–88. [Google Scholar] [CrossRef]
Zhou, X.; Shi, J.; Tang, Y.; Li, Y.; Li, S.; Gong, K. Aggregate Control Strategy for Thermostatically Controlled Loads with Demand Response. Energies2019, 12, 683. [Google Scholar] [CrossRef]
Yao, Y.; Zhang, P.; Chen, S. Aggregating Large-Scale Generalized Energy Storages to Participate in the Energy and Regulation Market. Energies2019, 12, 1024. [Google Scholar] [CrossRef]
Spínola, J.; Faria, P.; Vale, Z. Photovoltaic inverter scheduler with the support of storage unit to minimize electricity bill. Adv. Intell. Syst. Comput.2017, 619, 63–71. [Google Scholar]
Hussain, B.; Khan, A.; Javaid, N.; Hasan, Q.; Malik, S.A.; Ahmad, O.; Dar, A.; Kazmi, A. A Weighted-Sum PSO Algorithm for HEMS: A New Approach for the Design and Diversified Performance Analysis. Electronics2019, 8, 180. [Google Scholar] [CrossRef]
Kong, D.-Y.; Bao, Y.-Q.; Hong, Y.-Y.; Wang, B.-B.; Huang, H.-B.; Liu, L.; Jiang, H.-H. Distributed Control Strategy for Smart Home Appliances Considering the Discrete Response Characteristics of the On/Off Loads. Appl. Sci.2019, 9, 457. [Google Scholar] [CrossRef]
Jordehi, A.R. A review on constraint handling strategies in particle swarm optimisation. Neural Comput. Appl.2015, 26, 1265–1275. [Google Scholar] [CrossRef]
Faria, P.; Vale, Z.; Soares, J.; Ferreira, J. Demand Response Management in Power Systems Using Particle Swarm Optimization. IEEE Intell. Syst.2013, 28, 43–51. [Google Scholar] [CrossRef][Green Version]
Shehzad Hassan, M.A.; Chen, M.; Lin, H.; Ahmed, M.H.; Khan, M.Z.; Chughtai, G.R. Optimization Modeling for Dynamic Price Based Demand Response in Microgrids. J. Clean. Prod.2019, 222, 231–241. [Google Scholar] [CrossRef]
Aghajani, G.R.; Shayanfar, H.A.; Shayeghi, H. Demand side management in a smart micro-grid in the presence of renewable generation and demand response. Energy2017, 126, 622–637. [Google Scholar] [CrossRef]
Hu, M.; Xiao, F. Price-responsive model-based optimal demand response control of inverter air conditioners using genetic algorithm. Appl. Energy2018, 219, 151–164. [Google Scholar] [CrossRef]
Qian, L.P.; Wu, Y.; Zhang, Y.J.A.; Huang, J. Demand response management via real-time electricity price control in smart grids. Smart Grid Netw. Data Manag. Bus. Model.2017, 169–192. [Google Scholar]
Lezama, F.; Sucar, L.E.; de Cote, E.M.; Soares, J.; Vale, Z. Differential evolution strategies for large-scale energy resource management in smart grids. In Proceedings of the Genetic and Evolutionary Computation Conference Companion on GECCO ’17, Berlin, Germany, 15–19 July 2017; ACM Press: New York, New York, USA, 2017; pp. 1279–1286. [Google Scholar]
Eberhart, R.; Kennedy, J. A new optimizer using particle swarm theory. In Proceedings of the Sixth International Symposium on Micro Machine and Human Science (MHS’95), Nagoya, Japan, 4–6 October 1995; pp. 39–43. [Google Scholar]
Jozi, A.; Pinto, T.; Praca, I.; Vale, Z. Day-ahead forecasting approach for energy consumption of an office building using support vector machines. In Proceedings of the 2018 IEEE Symposium Series on Computational Intelligence (SSCI), Bangalore, India, 18–21 November 2018; pp. 1620–1625. [Google Scholar]
Jozi, A.; Pinto, T.; Praça, I.; Vale, Z. Decision Support Application for Energy Consumption Forecasting. Appl. Sci.2019, 9, 699. [Google Scholar] [CrossRef]
Implementation scheme of the proposed work.
Implementation scheme of the proposed work.
The control scheme for the demand response (DR) cut with one load.
The control scheme for the demand response (DR) cut with one load.
Disaggregated consumption by appliance and photovoltaic (PV) generation.
Disaggregated consumption by appliance and photovoltaic (PV) generation.
DR result regarding initial profile.
DR result regarding initial profile.
Load consumptions, battery actions, and final load scheduling.
Load consumptions, battery actions, and final load scheduling.
Prices of the different periods and contracted power.
Prices of the different periods and contracted power.
Contracted Power (€/Day)
Buy from grid
10.30 h–13 h 19.30 h–21 h
08 h–10.30 h 13 h–19.30 h, 21 h–22 h
22 h–02 h 02 h–08 h
Sell to grid
* is used for all periods.
Problem input variables.
Problem input variables.
Maximum power injected to grid
Maximum power required from grid
Maximum power accumulated in battery
Maximum energy of battery discharge
Maximum energy of battery charge
Total of controllable loads
Total of batteries
Total of PV units
* The factor of 4 comes from the fact that there are four 15-min periods in an hour.