Complexity

Volume 2018, Article ID 9597158, 11 pages

https://doi.org/10.1155/2018/9597158

## An Evaluation of a Metaheuristic Artificial Immune System for Household Energy Optimization

^{1}University of Salamanca, s/n. Salamanca, 37003 Espejo, Spain^{2}Media Lab, Massachusetts Institute of Technology, 20 Amherst St, Cambridge, MA, USA^{3}Holcombe Department of Electrical and Computer Engineering, Real-Time Power and Intelligent Systems Laboratory and Clemson University, Clemson, SC 29634, USA^{4}School of Engineering, University of KwaZulu-Natal, Durban, South Africa

Correspondence should be addressed to Maria Navarro-Caceres; se.lasu@09airam

Received 25 October 2017; Accepted 4 March 2018; Published 2 July 2018

Academic Editor: Hugo Morais

Copyright © 2018 Maria Navarro-Caceres et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Devices in a smart home should be connected in an optimal way; this helps save energy and money. Among numerous optimization models that can be found in the literature, we would like to highlight artificial immune systems, which use special bioinspired algorithms to solve optimization problems effectively. The aim of this work is to present the application of an artificial immune system in the context of different energy optimization problems. Likewise, a case study is performed in which an artificial immune system is incorporated in order to solve an energy management problem in a domestic environment. A thorough analysis of the different strategies is carried out to demonstrate the ability of an artificial immune system to find a successful optima which satisfies the problem constraints.

#### 1. Introduction

A Home Energy Management System (HEMS) is a key element in a domestic environment that improves household economy through automated technologies.

In the recent years, different domestic buildings equipped with communication channels (*smart houses*) have actively participated in electrical networks [1] as building blocks in smart grids (SGs). Therefore, they play an important role in optimizing the scheduling of electric power [1, 2].

There are a number of strategies that employ different techniques to optimize the scheduling of energy use in the home. Among many other strategies, statistical models are one example of them. We can see how they are leveraged in the work of [3], which models controllable loads using a Markovian approach. These loads depend on weather conditions. In [4], a demand-response program is automatically applied from classical methods to control the devices connected to the network under the uncertainty of the outside temperature and the price of electricity. In [5], three problems related to HEMS have been solved by applying an observable Markovian decision process. This work made it possible to reduce domestic energy costs in the electricity price market.

Classical approaches had some limitations [6]; thus, new paradigms have been applied to solve HEMS. One successfully developed paradigm is that which uses bioinspired algorithms to solve optimization problems. These algorithms try to mimic the behavior of some biological entities to find solutions which, applying classical computation, would be too costly or even implausible in terms of time and resources. Some widely used and noteworthy algorithms are artificial neural networks (ANN), genetic algorithms (GA), or swarm intelligence [7]. Some bioinspired algorithms work in different contexts, and they render good results. One of these algorithms is the artificial immune system (AIS) which follows the principles of the vertebrae immune system to find solutions in an optimization problem. The AIS algorithm can be designed in a variety of ways. From the different variants, in this work, it is decided to use Opt-aiNet [8], which has been used successfully for the optimization of functions in different contexts [8]. Opt-aiNet allows finding several solutions in parallel. By using operations such as mutation, cloning, and suppression, each solution corresponds to different optima (maxima or minima) points in the optimization function.

In the area of intelligent network optimization, several works that follow the bioinspired paradigm have been proposed. These include [9], who propose an energetic services modeling method based on the particle swarm optimization (PSO) algorithm. Soares et al. [10] propose a multiobjective genetic approach for scheduling domestic charge in an energy management system. Yuce et al. [11] present a neural network with a genetic algorithm (ANN-GA) to optimize energy management in the domestic sector. However, to the authors’ knowledge, AIS has only been implicated in some preliminary achievements in power management, such as solving power supply problems, or electrical reconfigurations. For example, in [12], an AIS is used to control thermal units in residential buildings, and in [13], the authors optimize a wind energy-generating system also with an AIS.

In this paper, an in-depth review of the AIS concept and its application to different electrical problems is made. From the results of this review, a case study on a problem of home energy management optimization is described and solved using this algorithm. We aim to demonstrate that AIS can be successfully applied to electrical management problems in domestic settings. Part of our objective has been to adapt the Opt-aiNet algorithm to include complex constraints on the optimization problem and to work efficiently with a large number of variables.

This paper presents a simple electric context with different devices, namely, a photovoltaic panel (PV), a battery system, a space heater or heater, a water heater, and must-run services. All of them are connected in a smart home, within an electrical system. It is aimed at optimizing the scheduling for the next 24 hours so that the electrical benefit is maximized between the energy that is sold and the energy that is bought.

Two strategies are designed in our case study to represent two different electrical situations. In strategy 1, the HEMS manages the electric power with the electricity grid without considering any internal restriction. In other words, we do not consider any variable related to the maintenance of the domestic electric charge through the electrical energy produced by the PV system. Therefore, this strategy only seeks to optimize energy benefits. However, strategy 2 is aimed at supplying the electricity demand autonomously whenever possible. Therefore, the surplus generated by the PV is stored in the battery. HEMS will sell electricity to the grid when the battery is fully charged. Also, the battery is discharged when the electrical demand is greater than the power generated by the PV. If the battery cannot supply all the electrical charge, then the HEMS must buy electricity from the power grid. Based on these two strategies, three different experiments were developed. Firstly, a comparison of AIS with two different bioinspired algorithms is made, namely, the classical genetic algorithm (GA) and the particle swarm optimization (PSO). Secondly, both strategies are compared to analyze the influence of the battery in the home network. Finally, a deep analysis is carried out with different situations of the battery charge in the home network. The results obtained in all situations are expected to validate the AIS as an appropriate algorithm for the optimization of HEMS.

This document is structured as follows. Section 2 provides an overview of the design of AIS and a review about its involvement in electrical problems. Section 3 describes the technical details of the addressed electrical problem. Section 4 presents the configuration of AIS and its application to the electrical problem. In Section 5, the results obtained in the three case studies are outlined and discussed. Finally, Section 6 presents the conclusions of our research and future work.

#### 2. Artificial Immune Systems

The organisms of many species have developed immune systems to protect them from external agents. Above all, vertebrate immune systems consist of different molecules, cells, and organs that are distributed throughout the body and are not controlled by any central entity. From an immunological point of view, any element present in the immune system is called an antigen. If this antigen belongs to the internal organism to protect the body, it is called self-antigen or antibody. Otherwise, the antigens from the external environment are called non-self-antigens and can provoke different diseases. Therefore, immune systems are aimed at distinguishing between self-antigens and non-self-antigens through a pattern recognition process, attacking only those that are harmful for the body [14].

Drawing on the concept of the immune system, [15] developed the *CLONALG* algorithm, a clonal selection procedure that allows mutating some antibodies according to their affinity to an external antigen; therefore, in order to perform pattern recognition, it generates copies of the antibodies according to their affinity with the antigen. The copies are mutated following a rate *δ* inversely proportional to their affinity with the antigen (1).
where *β* is a constant obtained empirically to normalize the effect of the fitness value *f _{i}* of each cell. These new individuals are added to the general population and reevaluated to be reproduced and mutated again.

In order to give a new solution for the optimization of functions, [8] developed Opt-aiNet, an artificial immune system (AIS) based on the *CLONALG* behavior. The information is encoded as antigens which should be recognized by the antibodies of our immune system. Then, the fitness value of an antigen is defined as the affinity between the antigen and the antibody and can be compared with a distance metric. Henceforth, small distances between an antigen and an antibody represent high affinity, whereas longer distances represent lower affinity.

The Opt-aiNet algorithm follows the general description of an artificial immune system. Firstly, antibodies, which represent the different data to optimize, are randomly generated. Then, they are presented to the antigens, which encode the objective function, in order to calculate the affinity between them when the data are applied to the function. If one antibody obtains a good rating in the objective function, that means it has high affinity and therefore is selected. These chosen antibodies are reproduced and mutated based on their fitness value according to the *CLONALG* algorithm and the *β* parameter. In order to preserve diversity, antibodies whose affinity is lower than a given threshold *t _{s}* are removed from the population.

Artificial immune systems, in particular Opt-aiNet, are able to find several optima of the objective function in parallel. This means that AIS can find a set of good candidates for the solution of optimization problems that are different from one another. Additionally, AIS can preserve those individuals that are good enough to be reproduced and mutated in consecutive iterations.

##### 2.1. AIS Applications in Energy Contexts

The concept of a next-generation power system such as smart grid, efficient energy management, and better power system planning cannot be achieved without electrical load forecasting [16]. Consequently, multiple time horizons which are associated with the regulation, dispatching, scheduling, and unit commitment of the power grid are analyzed and solved using different methods. Artificial intelligence (AI) is widely applied to a variety of applications, as it can handle the complexity derived from such electrical problems. In particular, bioinspired algorithms, such as artificial neural networks or swarm intelligence, are especially effective in solving this kind of problems. In this section, a brief but comprehensive literature review of a special bioinspired algorithm, the artificial immune systems, is provided. AIS was applied in different contexts with positive results: when solving combinatorial problems [17, 18], to detect intrusions in wireless sensor networks [19], or even to generate chord progressions [20]. The major goal of this section is to review, identify, evaluate, and analyze the performance of AIS in power systems and model research.

Regarding the electrical context, there are plenty of proposals focusing on diverse fields. One of them is related to the control of variables and configuration of an electrical system. de Mello Honorio et al. [21] model an optimal power flow (OPF), which is a nonlinear, nonconvex, and large-scale problem with both continuous and discrete control variables, using a modified artificial immune system (AIS). The AIS makes use of hypermutation, which is responsible for local search, and receptor edition, which explores different areas in the solution space. The proposed AIS is combined with a gradient vector to improve the final results. This combination is also aimed at collecting valuable information during the hypermutation process, decreasing the number of generations and clones, and, consequently, speeding up the convergence process while reducing the computational time. Belkacemi and Feliachi [22] use a multiagent system (MAS) which follows the human immune system behavior to propose a new technique for power system reconfiguration and restoration, applied to a model of Southern California Edison’s Circuit of the Future. Each element of the MAS represents a natural immunological element that interacts with the other elements to heal the body. Similarly, the MAS is able to detect and isolate faults and restore power to the affected loads taking into consideration line capacity, voltage profile, and power losses [22]. de Oliveira et al. [23] present a methodology for the reconfiguration of radial electrical distribution systems to minimize energy losses making use of the bioinspired metaheuristic artificial immune system. The AISs have to plan the system operation considering both radiality and connectivity constraints and different load levels. Consequently, the AIS algorithm is adapted to accommodate the features of the problem better and to improve the search process. The algorithm developed is tested in well-known distribution systems, with very successful results. Souza et al. [24] solve the reconfiguration problem of electrical distribution systems (EDSs) with variable demand, using the artificial immune algorithm. As the reconfiguration problem with variable demand is a complex problem of a combinatorial nature, Copt-aiNet (artificial immune network for combinatorial optimization), which is a combinatorial version of the algorithm Opt-aiNet, is applied to identify the best radial topology for an EDS in order to minimize the cost of energy losses in a given operation period. A specialized sweep load flow for radial systems was used to evaluate the feasibility of the topology with respect to the operational constraints of the EDS and to calculate the active power losses for each demand level. The obtained results were compared with those in the literature in order to validate and prove the efficiency of the proposed algorithm. Souza et al. [25] also aim to solve the reconfiguration problem of EDS by comparing the results of the Copt-aiNet (artificial immune network for combinatorial optimization) and the Opt-aiNet (artificial immune network for optimization) algorithms. A specialized forward/backward radial power flow was used to evaluate each of the proposed solutions in order to determine its power losses and its feasibility regarding the operational constraints of the EDS. To validate the use of an AIS, the final results were compared with other solutions obtained with other algorithms in the literature.

Other important field of application is the forecasting of electrical variables (loads and power generation or consumption). Abdul Hamid and Abdul Rahman [26] propose an artificial neural net (ANN) trained following the behavior of an artificial immune system (AIS) to generate a short-term load forecasting model. Two sets of electrical energy demand data were used to test the capability of the proposed algorithm. The results presented in the manuscript show that the proposed AIS learning algorithm is capable of providing a forecast comparable to that of an artificial neural network with an integrated back propagation (BP) algorithm. Consequently, the AIS is an alternative learning algorithm for an artificial neural network. The work proposed by [27] is one of the first studies using an integrated AIS simulation for improved forecasting of electricity consumption with random variations. They develop a new system with different algorithms, namely, AIS, genetic algorithm (GA), and particle swarm optimization (PSO), to simulate annual electricity consumptions in selected countries. The mean absolute percentage error (MAPE) is applied to evaluate the results and select the best forecasting model. A case study with data of the annual electricity consumptions for 16 countries from 1980 to 2006 is analyzed. For the selected countries, the AIS method with the clonal selection algorithm (CLONALG) shows satisfactory results when applied with simulated data and has been selected as the preferred method. Hernandez et al. [28] model a hybrid artificial immune system (AIS) combining the back propagation method with the artificial immune system, to achieve higher accuracy, lesser input load data requirement, and faster convergence. The hybrid approach is implemented, and its results are compared with a GA and a PSO. This analysis reveals that AIS solves the problem in a more efficient way than do GA and PSO.

Dudek [29] proposes a short-term load forecast model based on an AIS to predict the hourly load demand of a week. In this proposed technique, each antigen of AIS, which contains the time series load sequences (some part is a forecast sequence), is compared with historical load patterns. MAPE is also used to evaluate the performance of the proposed forecast model. The system achieves a minimum MAPE of 1.77%, which means the AIS obtains very successful results. AISs are also applied for economic optimization in an electrical environment. Dynamic economic dispatch determines the optimal scheduling of online generator outputs with predicted load demands over a certain period of time taking into consideration the ramp rate limits of the generators [30]. Basu [31] presents an artificial immune system algorithm that solves a heat and power economic optimization problem. The AIS is adapted to this problem, adding new operations such as hypermutation and tournament, and is then used in a preliminary test system.

Basu [30] implements adaptive cloning, hypermutation, aging operation, and tournament selection. In order to validate the new AIS, numerical results of a ten-unit system with fuel cost function have been developed. The results obtained from the proposed algorithm are compared with those obtained from particle swarm optimization and evolutionary programming. From numerical results, it is shown that the proposed AIS provides a more efficient solution than do particle swarm optimization and evolutionary programming in terms of minimum cost and computation time. Aragón et al. [32] present an AIS-inspired algorithm, called IA EDP, which tries to solve an economic dispatch problem. It makes use of two versions of a redistribution power operator which tries to keep the solutions that it finds. The proposal is applied to eight problems taken from the literature. The results are compared with those derived from several other approaches to determine the advantages of the IA EDP against classical evolutionary computing.

This brief background leads us to the conclusion that AIS can be applied to a variety of electrical contexts with very successful results. This fact encourages us to work with a specific AIS, called Opt-aiNet, also leveraged in different papers [24, 25] and to adjust it specifically to our case study. The classical Opt-aiNet usually works with a low number of variables (each individual contains about 6 variables at most) and without constraints encoded as mathematical functions. In the present work, this algorithm is adjusted to admit up to 336 variables and 25 linear constraints (inequalities and equations).

#### 3. Home Energy Management Problem

In the designed case study, we consider a home electrical system that has some household appliance connected to it (Figure 1).