# Internet of Things Energy Consumption Optimization in Buildings: A Step toward Sustainability
## 4 Evaluation of the Proposed Method  
MATLAB has been used to simulate and evaluate IoT and PSO, CPSO, and FCPSO information security in smart buildings. In addition, the results of the proposed method were compared to those of similar methods. Numerous parameters are affected; the values of these parameters are highly dependent on convergence improvement. In this study, the following parameters are considered when transferring data to the center or between objects:  
- Etx, Erx: the energy used to transmit and receive data in nodes, respectively. - Dij: distance between node i and j. - Eelec: the available energy in each node. - Fij: data transmission rate between two nodes. - CS, CR, CB: base station node cost, sensor node cost, and amplifier node cost, respectively. \begin{table}
\begin{tabular}{c c c c} \hline  & \(\mathbf{T_{p}}\) & \(\mathbf{P}\) & \(\mathbf{Cost}\) \\ \hline PSO & O(1) & O(N) & O(N) \\ CPSO & O(N/2) & O(N) & O(N\({}^{2}\)/2) \\ FCPSO & O(N\({}^{1-\text{x}}\)) & O(N\({}^{2}\)) & O(N \(\log\) N) \\ \hline \end{tabular}
\end{table} 
Table 1: Complexity comparison of the optimization method. All simulations are performed in a Windows 10 operating system using 2.5 GHz quad-core processors, a working frequency 2 and with a memory capacity of 8 GB. Simulation is done in MATLAB 2020 software. To check the efficiency of the proposed algorithm, 10 testbench functions were used (Table 2) [30; 31]. In all functions, the target point is zero, the optimal point is zero, and the dimensions of all functions are r = 50. The simulation results of initial population generation with the help of chaos with objective functions are shown in Table 3. As can be seen Table 1, in some cases, the results of the improved algorithm with CPSO are weaker than the standard algorithm. The presentation of the FCPSO shows a better performance than the PSO and CPSO for higher fractional order derivative values. According to the obtained results, the proposed FCPSO algorithm shows better performance than the other two algorithms for each, which is one of the most important achievements of this proposed algorithm. \begin{table}
\begin{tabular}{c c} \hline \hline
**ID** & **Function** & **Interval** \\ \hline F\({}_{1}\) & \(f(x)=\sum_{i=1}^{n}x_{i}^{2}\) & \(-\infty\leq x_{i}\leq\infty\) \\ F\({}_{2}\) & \(f(x)=\sum_{i=1}^{n}\left[(x_{i}+0.5)\right]^{2}\) & \(1\leq i\leq n\) \\ F\({}_{3}\) & \(f(x)=An\sum_{i=1}^{n}\left[x_{i}^{2}-\Lambda\cos(2\pi x_{i})\right]\) & \(1\leq i\leq n\) \\ F\({}_{4}\) & \(f(x)=\sum_{i=1}^{n-1}\left[100{(x_{i+1}-x_{i}^{2})}^{2}+{(x_{i}-1)}^{2}\right]\) & \(-\infty\leq x_{i}\leq\infty\) \\ F\({}_{5}\) & \(f(x)=418.9829-\sum_{i=1}^{d}x_{i}\text{sin}\Big{(}\sqrt{|x_{i}|}\Big{)}\) & \(-\infty\leq x_{i}\leq\infty\) \\ F\({}_{6}\) & \(f(x)=\sum_{i=1}^{n}\left[x_{i}^{2}-10\text{cos}(2\pi x_{i}+10)\right]\) & \(-5.12\leq x_{i}\leq 5.12\) \\ F\({}_{7}\) & \(f(x)=-20\text{exp}\Big{(}-0.2\sqrt{1/n}\sum_{i=1}^{n}x_{i}^{2}\Big{)}-\text{ exp}(1/n\sum_{i=1}^{n}\cos(2\pi x_{i}))+20+e\) & \(-5\leq x,y\leq 5\) \\ F\({}_{8}\) & \(f(x)=1/4000\sum_{i=1}^{n}x_{i}^{2}-\frac{n}{i!}\cos\Big{(}\frac{x_{i}}{\sqrt{i} }\Big{)}+1\) & \(-100\leq x_{i}\leq 100\) \\ F\({}_{9}\) & \(f(x)=0.1\Big{\{}\sin^{2}(3\pi x_{i})+\sum_{i=1}^{n}(x_{i}-1)^{2}\big{[}1+\sin^ {2}(3\pi x_{i}+1)\big{]}+(x_{n}-1)^{2}\big{[}1+\sin^{2}(2\pi x_{n})\big{]}\Big{\}}+\) & \(-50\leq x_{i}\leq 50\) \\ \(\sum_{i=1}^{n}u(x_{i},5,100,4)\) & \(f(x)=\pi/n\Big{\{}10\text{sin}(\pi y_{1})+\sum_{i=1}^{n-1}(y_{i}-1)^{2}\Big{[}1 +10\text{sin}^{2}(\pi y_{i+1})\Big{]}+(y_{n}-1)^{2}\Big{\}}+\) \\ F\({}_{10}\) & \(\sum_{i=1}^{n}u(x_{i},10,100,4)\) \\ F\({}_{10}\) & \(y_{i}=1+(x_{i}+1/4)u(x_{i},a,k,m)=\left\{\begin{array}{ll}k(x_{i}-a)^{m},x_{i}>a,&-50\leq x_{i}\leq 50\\ 0-a<x_{i}<a,&\\ k(-x_{i}-a)^{m},x_{i}<-a.&\end{array}\right.\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Testbench functions and interval.