## 3 WSAN System Models
### Control System Model  
As described before, the temperature behavior in the room is characterized by its physical model. The physical model employed in our study is the zone temperature model. It can be expressed by:  
\[\begin{split} H_{a}\,\frac{dT_{z}}{dt}&=F_{sa}\rho_ {a}C_{a}\left(T_{sa}\ -T_{z}\right)+U_{Road}\ A_{Road}\left(T_{Road}\ -T_{z}\right)+2U_{Wall1}A_{Wall1}\left(T_{ Wall1}\ -T_{z}\right)\\ &\quad+2U_{Wall2}A_{Wall2}\left(T_{Wall2}\ -T_{z}\right)+q(t)\end{split} \tag{1}\]  
This model is characterized by four state variables which are the supply air temperature ( \(T_{sa}\) ), the inner roof temperature ( \(T_{Road}\) ), the inner wall temperatures ( \(T_{wa11}\)  and \(T_{wa12}\) ), and the internal temperature caused by the heat sources \([\,q(t)\,]\). The supply air temperature is the control input of the  
Figure 1: Building-temperature control systems.  
model which is determined by the controller and the actuator, while the control output of interest is the zone temperature (_T\({}_{z}\)_). _T\({}_{z}\)_ as the latest zone temperature value is collected by the source node at every certain sampling time, and _T\({}_{sa}\)_ is immediately updated after the controller finds a new control error. We assume that effects of the East and the West walls on the zone temperature are the same. Effects of the North and the South walls are also considered to be the same. Additionally, we define that two people with load of 150 watts, two lamps with load of 50 watts, and two computers with load of 120 watts are the heat sources causing the warmth of the inside temperature. More details and explanations about Equation (1) can be found in [3,35].  
The controller considered in our work is the proportional integral derivative (PID) controller [2]. It is widely used in the wireless networked control process of many applications [2, 3, 4, 5]. The PID controller maintains the zone temperature to the desired level by adjusting the supply air temperature based on the control system error. The PID algorithm can be written by:  
\[U(t)=K_{p}e(t)+K_{I}\int e(t).dt+K_{D}\frac{de(t)}{dt} \tag{2}\]  
where _U_(_t_) is the controller output (_i.e._, the supply air temperature in our case), _K\({}_{p}\)_ is the proportional gain, _K\({}_{I}\)_ is the integral gain, _K\({}_{D}\)_ is the derivative gain, and _e\((t)\)_ is the control system  
\begin{table}
\begin{tabular}{l|c|c} \hline \hline \multicolumn{1}{c|}{**Parameters (Unit)**} & **Notation** & **Values** \\ \hline Heat capacity (J/ \({}^{\circ}\)C) & \(H_{s}\) & 89,036.7 [3] \\ Air density [kg/m\({}^{3}\)] & \(\rho_{a}\) & 1.25 [3] \\ Specific heat capacity of air (J/kg \({}^{\circ}\)C) & \(c_{a}\) & 1,005 [3] \\ Room volume (m\({}^{3}\)) & \(V_{z}\) & 70.875 \\ Supply air flow (m\({}^{3}\)/s) & \(F_{sa}\) & 0.0172[3] \\ Heat-transfer coefficient of the roof (W/m\({}^{2}\) C) & \(U_{hof}\) & 1 [35] \\ Heat-transfer coefficients of (East, West) walls (W/m\({}^{2}\) C) & \(U_{hof1}\) & 2 [35] \\ Heat-transfer coefficients of (North, South) walls (W/m\({}^{2}\) C) & \(U_{hof2}\) & 2 [35] \\ Area of the roof (m\({}^{2}\)) & \(A_{Roo\_{o\_{o\_{o\_{o\_{o\_{o\_{o\_{o\_{o\_{o_{error between the desired and the measured temperature values. All parameters assigned for the zone temperature model and the PID controller are listed in Table 1.  
To evaluate the performance of routing protocols on these WSAN control systems, we conduct a set of experiments using the PicoSIM tool [31]. This tool is an integration of control and communication simulators. Control functions as the zone temperature model and the PID controller are simulated by MATLAB/Simulink, while wireless network communications are simulated by NS2 version 2.33 under Linux operating systems.