A New Stability Criterion for IoT Systems in Smart Buildings: Temperature Case Study

: The concept of smart cities emerged in the 1990s. Since then, smart buildings have become a closely interconnected element of smart cities. This type of building implements Internet of Things technology and control algorithms to monitor and control their indoor environment. The aim of this paper is to develop a new stability criterion method for smart building Internet of Things (IoT) systems, subject to external disturbances. The new stability criterion is going to optimize the operation of control algorithms since this criterion does not depend on the transmission function of the control algorithm but on the data collected by the IoT system. We present a new matrix called “Laplacian IoT matrix”, containing IoT network information associated with the graph of a smart building. The proposal is supported by the results of a numerical case study.


Introduction
Over recent years, the Internet of Things (IoT) paradigm has attracted the interest of the research community [1,2], especially because of its ability to make monitoring, control, and communication more effective. The Internet of Things involves a system of interrelated objects, such as sensors, vehicles, houses, and appliances, which are connected to the Internet and can, therefore, share information, data, and resources. The IoT has become a key element of smart cities and smart building applications designed to monitor and save energy [3][4][5]. The monitoring and control of environmental parameters, such as temperature and humidity, are important in many smart buildings [6]. For example, biological labs need to have close control over temperature and humidity, to ensure that biological samples do not get spoiled. State-of-the-art research focuses primarily on improving the accuracy of sensors and optimizing the operation of control algorithms [7,8]. The state of the art lacks a system that would measure the stability of the IoT network with precision, enhancing the operation of control algorithms and reducing energy consumption.
Efficiency in the use of resources is an important aspect of smart buildings, researchers are continually striving to improve through IoT networks [9,10]. An IoT network is usually shared by multiple sensors, as well as controller and actuator nodes. These IoT nodes collect data from a range of smart buildings. Data are then sent to a control algorithm that controls the environmental conditions within smart buildings. The main purpose of monitoring and controlling is to improve the energy efficiency of smart buildings [11,12]. This research proposes a novelty in the field of automatic control; a new stability criterion and not a control algorithm is used to determine whether a system is stable or not [13]. In this way, control algorithms are executed only when it is truly necessary, i.e., when the stability criterion detects disturbances in the system. Moreover, the proposed IoT stability criterion has a margin of comfort, this means that small disturbances in environmental conditions are not considered to be such and a control algorithm is not executed. The ability to limit the execution of control algorithms to a minimum contributes to energy conservation since actuators do not have to continually use energy in the process of adjusting the values of environmental variables.
Control algorithms are used to monitor and control IoT networks in smart buildings. These control algorithms have different methods of detecting the instability of the IoT network, i.e., when the values collected by the IoT network are not the same as the established values. However, these methods of detecting deviations usually do not take into account the topology of the smart building's IoT network and they do not evaluate the degree of the disturbances in the smart building. In this paper, we define an IoT system as the smart building and its IoT network. Therefore, we present a new stability criterion for IoT systems. We say that an IoT system is stable, if the disturbances made to the system are within an established confidence margin for that smart building (i.e., a medical laboratory has a stable temperature of 16 • C, if the disturbances of the IoT system are less than 1 • C the biological samples will not be affected and it is not necessary to execute a control algorithm). In our proposal, we use IoT graphs and the Laplacian IoT matrix, which we have defined in the previous sections. Thus, the results of the Spectral graph theory and the Bauer-Fike theorem were used to support our proposal. The motivation behind this research is to find a solution to the problem of instability in IoT networks implemented in smart buildings. Spectral graph theory has a long history. In the early days, matrix theory and linear algebra were used to analyze the adjacency matrices of graphs. Algebraic methods are especially effective in treating graphs that are regular and symmetric. There is extensive literature on algebraic aspects of spectral graph theory, well documented in several surveys and books, such as Biggs [14] and Cvetkovic [15]. Graph theory has been used to give optimal solutions to many problems (see, for example [16][17][18]). These new approaches offer new solutions that could not be achieved otherwise.
This article describes how IoT systems can be represented on a graph and how it is possible to determine the state of an IoT system (stable or unstable) through Spectral Graph Theory. An undirected graph G is a pair (V, E) where V is the set of vertices and E is the set of edges. With the IoT network of a smart building, we create a graph G where the vertices are the IoT devices of the smart building. Once we have defined the concept of Laplacian IoT matrix L IoT associated with graph G and based on the eigenvalues of L IoT , we defined a new IoT stability criterion capable of optimizing the operation of control algorithms in smart buildings. Hereafter we assume that: If X ∈ C n×n is invertible, its condition number in p-norm is denoted by K p (X) and defined by: This research presents a novel approach to automatic control because the stability of the IoT network is determined before the data enters the control algorithm. The stability of IoT systems can be determined by studying the stability of control systems. Therefore, the stability criterion that we propose in this paper optimizes the operation of control algorithms by executing them only if the IoT stability criterion detects disturbances in the system. The techniques for the study of the stability of control systems generally consist of examining the roots of the transfer function. The most commonly used criteria for studying the stability of control systems are the Routh-Hurwitz criterion [19,20], the Jury stability criterion [21,22], the root site method [23], and the Bode diagram method [24,25]. Before these criteria can be applied, they need to discretize or linearize the transfer function. In comparison, the IoT stability criterion proposed in this paper applies Spectral Graph Theory and the data collected by the IoT network. In this way, the monitoring and control of IoT systems are improved as this stability criterion is executed in the monitoring part without the need for the control algorithms to be executed unnecessarily. The main contribution of this paper can be summarized as follows: 1. To the best of our knowledge, the proposed novel approach allows obtaining a mathematical model of the IoT system based on graph theory. 2. A new Laplacian IoT matrix has been created from the network associated with the IoT system.
This new matrix has allowed the authors to apply the Spectral Graph Theory to obtain useful information from the IoT system and thus improve its operation. 3. A new IoT stability criterion for IoT systems based on the Spectral Graph Theory that increases the efficiency of IoT control systems since the IoT stability criterion does not involve the transfer function of the control algorithm.
Although in this paper, without loss of generality, we are going to use the temperature of the smart buildings to make the analysis, this research is consistent with other measures that can be taken in smart buildings.
The remainder of this paper is organized as follows: In this paper, a new stability criterion has been proposed which has led to a new algorithm to be used in conjunction with smart building monitoring and control algorithms. In Section 2, the Laplacian IoT matrix is presented as a new mathematical tool that we will consider in this paper, we will give the basic definitions and the notation that will be used throughout the paper. Also, in this section, we have explained how to build an IoT graph from the IoT sensors in the smart building. The details of the Laplacian IoT matrix spectrum are shown in Section 3. Moreover, we present the Gershgorin theorem which gives us a very accurate view of where the eigenvalues are. Section 4 presents the new stability criterion in perturbed IoT systems. En esta sección se muestran varios teoremas que hemos usado como base matematica para poder diseñar el nuevo algoritmo para detectar la estabilidad en los sistemas IoT.
In Section 5 a numerical case study of how our new IoT stability criterion works are presented. Finally, Section 6 concludes the conducted research and describes future lines of research.

Basic Definition and Notation of Laplacian IoT Matrix
Researchers' attention has recently been focused on optimizing energy consumption in smart buildings [26][27][28][29]. Several kinds of research focused on improving the control systems of the IoT network [30,31]. Our approach optimizes the operation of control algorithms by introducing a new stability criterion into IoT networks. To introduce this criterion, we have designed a graph and a new Laplacian IoT matrix associated with an IoT network. In this section, we present the definition of an IoT graph and a new Laplacian IoT matrix associated with an IoT network in a smart building.
Then, the next step is to describe the structure of the network. G IoT consists of the topology of the IoT nodes in the smart building. In this way, a graph is formed where the vertices of the graph are the IoT nodes and the edges of the graph are the physical connections between the rooms where the IoT nodes are located (i.e., no obstacles are placed between the nodes), i.e., if two rooms are separated by a door or a corridor, then there is an edge in the graph. The graph represents the heat transfer between the physically connected rooms. An illustrative example can be found in Figure 1.
Let us define the graph of an IoT network in a smart building. Given an undirected graph . . , v n } is a set of vertices and E = {e 1 , e 2 , . . . , e m } is a set of edges. This graph is constructed according to the topology of the building, which allows us to use graph theory to study the IoT network. The IoT graph is defined as follows: Definition 1. Given an IoT network in a smart building, the IoT graph, G IoT , is defined as the graph of the IoT network.
Once we have the graph of the IoT network, it is convenient to define a new Laplacian matrix associated with this IoT network, the Laplacian IoT matrix. In this way, Spectral graph theory can be used to study the properties of the IoT network based on its Laplacian matrix.

Definition 2.
Given an IoT graph G IoT with n vertices, its Laplacian IoT matrix L IoT is defined as: where D IoT is the IoT measurement matrix (i.e., the measurements collected by the IoT network are placed on the diagonal of this matrix) and A is the adjacency matrix of the graph. The elements of L IoT are given by Example 1. For the example proposed in the Figure 1, the Laplacian IoT matrix is: where m i are the measurements collected by the IoT network.

The IoT Matrix Spectrum
An essential part of graph theory and Spectral graph theory are eigenvalues and eigenvectors. In this section, we are going to present the mathematical background that has allowed us to obtain new results on the eigenvalues of the Laplacian IoT matrix. First, we discuss the properties of the eigenvalues that allow us to enunciate and prove the Theorem 1. Next, we study the location of the eigenvalues, which enable us to present the Remark 1.

Eigenvalue Properties
The following are well-known results [32,33]: If P ∈ C n×n is unitary and x 2 = 1 with x ∈ C n , then Ax 2 = 1.
The above lemmas allow us to enunciate and demonstrate Theorem 1. This theorem proves that all the values of matrix P are complex. The theorem proves that it is possible to construct the stability criterion that we propose in this work.
As L IoT n×n ∈ C n×n is diagonalizable (it is a symmetric real-valued matrix), and let λ IoT be the eigenvalues of L IoT and let { v IoT 1 , v IoT 2 , · · · , v IoT n } the orthogonal eigenvectors associated with those eigenvalues. Then, there exists an unitary matrix P ∈ C n×n with the { v IoT i } 1≤i≤n vectors as columns, such that P −1 L IoT P is a diagonal matrix. Theorem 1. In a matrix P of eigenvectors of a Laplacian IoT matrix, all the eigenvalues are complex.
Proof. Let us suppose that all one's eigenvalues are real. This means that because of the spectral theorem for symmetric matrices, the matrix should be symmetric and have real coefficients; however, this is not so, leading to a contradiction and complexity of the values in the matrix.

Eigenvalue Location
Let A be a complex n × n matrix with inputs a ij . For i ∈ {1, . . . , n} let ρ i = ∑ j =i a ij be the sum of the absolute values of the non-diagonal entries in the ith row. Let D(a ii , ρ i ) ⊆ C be a closed disc centered at a ii with radius ρ i . Such a disc is called a Gershgorin disc. The Gershgorin theorem can be found in [34,35].
Theorem 2 (Gershgorin). Every eigenvalue of A lies within at least one of the discs D(a ii , ρ i ). Therefore, all the eigenvalues of A are located at the union of the n discs: Also, if the union of k discs is disjoint from the union of the other n − k discs then the former union contains exactly k and the latter n − k eigenvalues of L IoT .
Proof. The proof can be found in [36].

Remark 1.
All the eigenvalues of the matrix P of eigenvectors of the Laplacian IoT matrix are in the boundary of the disk D (0,1).

Stability Criterion in a Perturbed IoT System
In this section, we are going to discuss what happens with the eigenvalues of a matrix when a disturbance occurs (the disturbed matrix). The main result of this analysis is the IoT stability criterion that we propose in this work. The first step is finding an absolute boundary for the eigenvalues of the original Laplacian IoT matrix and then for the disturbed one. In this way, we show that if the matrix is well conditioned, the disturbance is small and the eigenvalues of a L IoT matrix and the L IoT + δL IoT perturbed matrix are limited. Finally, in this section we formally describe the IoT stability criterion based on the Laplacian IoT matrix.

IoT Stability Criterion
Temperature control in smart buildings is an important field in research to increase sustainability. If the temperature in the smart building is kept at a low level, the heating, ventilation and air conditioning systems (HVAC) will not have to make any extra effort to bring the temperature of the building back to the comfort temperature selected by the smart building manager.

Definition 3 (Stability).
A system is stable if the response to a signal, whether the change of the reference point or a disturbance, reaches and maintains a useful value over a reasonable period. An unstable control system will, for example, produce persistent or large amplitude oscillations in the signal, or may cause the signal to take on values corresponding to extreme limits. An unstable response is undesirable from a control point of view. It is also necessary to know the amount or degree of stability that a system has, because it can happen that a system that is stable, is close to the limits of going from being stable to unstable by the use that is given to the system in the course of time, or by the replacement of some component when carrying out any type of maintenance. Instability is latent in every system, so it is important to be able to measure the level of stability.

Definition 4 (Disturbance).
A disturbance is a signal that can affect the value of a system's output. If the disturbance is generated within the system it is called internal, while an external disturbance is generated outside the system and is an input [37].
For example, if you consider the temperature control system of a room, the temperature outside could be considered an external disturbance, while the activity of people inside could be considered an internal disturbance.
An important theorem on the absolute error of the eigenvalues of disturbed matrix is presented below.

Remark 2.
If A + δA is small, Theorem 3 states that every eigenvalue of A + δA is close to some eigenvalue of A, and the distance between eigenvalues of A + δA and eigenvalues of A varies linearly with the perturbation δA.
For every δA matrix one has: where Remark 3. Since P is a unitary complex matrix, all of its eigenvalues hold the following: Remark 4. As every normal matrix A is diagonalizable through an unitary matrix (Schur's Theorem), considering the matrix standard norm · 2 we have that K p (A) = 1.
In this paper, we will study the connection of the spectrum of the unitary matrices P and P to define the stability criterion. The matrix P is defined by the eigenvectors of the matrix L IoT , and the matrix P is defined by the eigenvectors of the disturbed matrix L IoT . Since Theorem 3 is only valid for diagonalizable matrices, we claim a more powerful result for any arbitrary matrix. This result also relates the eigenvalues of the A matrix and A + δA as follows: Theorem 4. Let A ∈ C n×n an arbitrary matrix, and let µ an eigenvalue of A + δA. Then, either µ is also an eigenvalue of A or Proof. The left inequality follows immediately from a simple matrix manipulation using the norm properties and the properties of the eigenvalues. Since µ is an eigenvalue of A + δA, then µ holds: (A + (δA))x = µx, taking norms, one has Then, the right inequality follows from the Holder inequality [40]: leading immediately to Theorem 3 for any arbitrary matrix A ∈ C n×n .
Given an IoT system, we have its IoT Matrix and also its IoT Laplacian Matrix L IoT and let δ ∈ R n be a disturbance (i.e., measurements of an IoT system). Let Λ = {λ IoT 1 , · · · , λ IoT n } (Λ = {λ IoT 1 , · · · , λ IoT n }) be the eigenvalues of L IoT (resp. L IoT ) and let L IoT with L IoT = PΛP −1 and L IoT with L IoT = P · Λ · P −1 (L IoT = L IoT + δI) be the Laplacian IoT matrix (resp. the Laplacian IoT disturbed matrix) associated with the IoT graph G IoT . Let σ(P) = {µ IoT 1 , . . . , µ IoT n } (σ(P) = {µ IoT 1 , . . . , µ IoT n }) be the spectrum of P (Resp. the spectrum of P). Definition 5. The IoT system is said to be IoT stable, if, for every disturbance δ ∈ R n > 0, the following equation under the conditions of the Theorem 2 and Remark 1 holds Based on the previous definition, we have designed the algorithm that will detect whether an IoT system is stable or is running into some disturbances. Algorithm 1 will be implemented in the monitoring and control systems of smart buildings to enhance the operation of the system. if abs(roots) > 1 then 7: stable ← 0 8:

Break;
9: else 10: This algorithm gets as input the IoT Laplacian matrix at the time t − 1 and t, i.e., the current and previous temperature measurements. This way the algorithm will be able to check if there has been a disturbance big enough to make the IoT system lose stability and the HVAC control system needs to operate to recover stability. In the next step of the algorithm, the eigenvectors of the IoT Laplacian matrix are calculated to build the P matrices. Also, the eigenvalues of the P matrices are calculated. Then, the algorithm applies the Definition 5 to check if the IoT system is stable. Here you have two possibilities: stable = 0 and stable = 1. When the system has lost its stability the result of calculating (µ IoT i − µ IoT ) −1 is that these elements are out of disk D C (0, 1) which implies that stable = 0. One of the main advantages of this algorithm is that it operates as a switching controller (operating when the system is not stable). This allows the system to be more optimal since it will only operate when the system is not stable (stable =0). In terms of energy saving, this will be a big step forward, since presently smart building HVAC systems are controlling the temperature continuously without taking into account small disturbances. In the case of our algorithm, the temperature of the entire building is taken into account for this temperature control to avoid false positives. Suppose that in a smart building the entrance door is left open in the summer, the IoT devices will detect that it is hot in that area of the smart building and will turn on the air conditioning to stabilize the temperature. However, in the rest of the building you have the desired temperature, what you are going to achieve is that all the staff in the building is getting cold.

Numerical Case Study
In this section, we evaluate through an experimental case study the proposed method, which is about providing a novel method to compute the equilibrium of IoT systems. To demonstrate the efficiency of this technique, temperature data collected by the IoT devices in a smart building will be used.

General Description of the Case Study
To test the proposed stability criterion, we have chosen a smart building. The chosen smart building is one of the buildings of the University of Salamanca; the R&D building, located on Espejo Street. This building is a center of reference for the region of Castilla y Leon, both nationally (Spain) and internationally. Built between 2010 and 2014, 25 million euros have been invested in its building and equipment. It implements the latest energy efficiency technologies and techniques. The building has more than 13,000 square meters distributed over six floors, three of which are lower ground. Due to the size of the building and the large number of people that work there (more than 250 people), it is difficult to monitor and control its indoor temperature throughout the year. For this reason, the building was an ideal place for conducting our case study. To monitor and control the temperature in the smart building a total of 25 IoT nodes were deployed. The IoT devices were placed over a mesh in the smart building. This was done with the help of laser levels, which made it possible to place the IoT devices vertically one in every section of the building. The smart building where the case study was deployed is shown in Figure 2. The type of sensor deployed in the building was a combination of the ESP8266 microcontroller in its commercial version "ESP-01" and of a DHT22 temperature and humidity IoT node. This combination gives greater flexibility (e.g., in comparison to the previous version of this model, the DHT22 sensor measures temperature within this range: 0 • to 50 • Celsius. Moreover, it has an accuracy of +/−0.5 • Celsius.) The temperature IoT device had been collecting data at 15 min intervals, for 6 h in the same day. For the analysis we selected the data collected by the sensors in the following time interval 2020-06-17T08:30:00Z-2020-06-17T14:30:00Z. To test the efficiency of the temperature algorithm, disturbances in the temperature of the building were introduced at 1 h intervals, simulating the random behavior of the employees' thermostat use (i.e., a group of people could set the thermostats in their offices at different temperatures). Below, Table 1 presents a statistical summary of the measurements collected by the IoT devices.

Case Study Results and Discussions
The case study aims to test the efficiency of the new stability criterion proposed in this paper. This stability criterion is designed to determine whether the IoT system is stable or not. The case study has been conducted in a real environment, as described in this section, an IoT system has been deployed in a smart building. The IoT network collected temperature data which were then processed by the stability criterion to assess the stability of the IoT system in real time.
In Figure 3, one can see the results of the experiment. On the x-axis the time is measured, while on the y-axis the absolute value of the eigenvalues of the P matrix is evaluated. In this figure the disturbances that have been introduced during the experiment are detected; in fact, the stability criterion proposed in this paper classifies the system as unstable. We have zoomed in on 2 parts of the figure: (1) The IoT system is unstable. When zooming (network) one can see the internal functioning of the stability criterion by detecting how 2 of the eigenvalues of P are on the disk D(0, 1), these 2 eigenvalues are on the circles network. (2) The IoT system is stable. In this case, (green) one can see how all eigenvalues of P are inside disk D(0, 1) which means that the IoT system is stable. Figure 3. The stability of the IoT system in the case study. In the figure one can see the zones of stability (green) and instability (red). During the experiment, 4 disturbances have been introduced in the temperature of the IoT system. There has also been an additional period of instability when the IoT network was first implemented in the smart building and the control algorithm had to reach the equilibrium of the IoT system. The stability criterion (i.e., absolute value of the eigenvalues of P of this case study) provides its output in two different colors: in green when the system is stable; in red when the system is unstable.
Control algorithms are designed to detect even the smallest disturbances in the IoT network and they are to reach equilibrium in the shortest possible time (i.e., they optimize the settling time); their continuous execution leads to high energy expenses. As a solution to this problem, a new stability criterion has been proposed in this research work. It made it possible to establish confidence margins, meaning that the control algorithm was executed only when significant disturbances occurred in the system. This, as demonstrated in the conducted case study, has improved the efficiency of monitoring and control in smart buildings.

Conclusions
In this paper, we proposed a novel stability criterion for IoT systems in smart buildings. This criterion is based on the associated IoT graph and its Laplacian IoT matrix. We study how the disturbances affect the stability of the IoT network implemented in a smart building to improve the detection of disturbances and enhance the operation of control algorithms. We performed a numerical study of the IoT stability criterion in three simulation examples. The main advantage of our stability criterion is that it is not necessary to execute a control algorithm to determine whether a system is stable or not. The numerical results demonstrate that the IoT stability criterion detects the disturbances that occur in the IoT system. Our paper has several limitations that offer opportunities for future research. We apply this stability criterion to a control algorithm in a smart building to prove that the control algorithm operates more efficiently. Also, the stability criterion is a means of pre-processing the data that is later used as the input of the IoT system control algorithm.