A Heating Controller Designing Based on Living Space Heating Dynamic’s Model Approach in a Smart Building

: Most already advanced developed heating control systems remain either in a prototype state (because of their relatively complex implementation requirements) or require very specific technologies not implementable in most existing buildings. On the other hand, the above-mentioned analysis has also pointed out that most smart building energy management systems deploy quite very basic heating control strategies limited to quite simplistic predesigned use-case scenarios. In the present paper, we propose a heating control strategy taking advantage of the overall identification of the living space by taking advantage of the consideration of the living space users’ presence as additional thermal sources. To handle this, an adaptive controller for the operation of heating transmitters on the basis of soft computing techniques by taking into account the diverse range of occupants in the heating chain is introduced. The strategy of the controller is constructed on a basis of the modeling heating dynamics of living spaces by considering occupants as an additional heating source. The proposed approach for modeling the heating dynamics of living spaces is on the basis of time series prediction by a multilayer perceptron neural network, and the controlling strategy regarding the heating controller takes advantage of a Fuzzy Inference System with the Takagi-Sugeno model. The proposed approach has been implemented for facing the dynamic heating con-duct of a real five-floor building’s living spaces located at Senart Campus of University Paris-Est Créteil, taking into account the occupants of spaces in the control chain. The obtained results as-sessing the efficiency and adaptive functionality of the investigated fuzzy controller designed model-based approach are reported and discussed.


Introduction and Related Works
In recent years, the importance of energy-saving is increasing and becoming one of the top trending subjects in the world. At first glance, it is just a consequential subject for engineers and investigators. However, gradually, it is turning into a general aspect for all sorts of consumers. On one hand, energy demand by consumers is growing; therefore, the energy companies must increment their products continuously, and at the same time, the fact of limited resources is irrefutable. Residential and commercial buildings, because of their huge part in energy consumption, can play a decisive role in facing the swelling demand of the growth of energy consumption. In the EU, the portion of energy consumption in this sector is about 40% of the total energy consumption (about 27% for the residential sector and 14% for the commercial sector). This amount of energy consumption in the EU was responsible for 17% (12% and 4.9% for the residential and commercial sectors, respectively) of CO2 emissions in 2017 [1]. The most consuming part of this section is regarding the heating. According to the US energy information administration (EIA) [2,3] reports, the part of energy consumption for space heating was 43 percent in residential buildings in 2015 and 25 percent in commercial buildings in 2012. In France, also, space heating has a share of 67% of the energy consumption in buildings [4]. This shows a significant slice of energy consumptions related to space heating. Smart building energy management systems (SBEMS) are one of the key solutions to face consumption growth. They are one of the top attractive subjects in the energy efficiency field. Due to technological advancement in the field of the internet of things (IoT) [5], control technics and sensory technology are in parallel with development in computer science. They provide the inhabitants plenty of services to increase the energy efficiency, along with user comfort.
Although sensor quality and high-level technologies play an undeniable role in the performance of heating controllers in SBEMS, the main inefficiency is regarding the control strategies of the designed controller. The vast majority of controllers are designed based on model-free approaches because of plenty nonlinear and unknown factors in the thermal behavior of heating spaces. It leads to inefficiency and shortage in representative control strategies.
Within this context, and regarding our previous work about the identification of the heating dynamic model of living spaces by a data-driven machine learning approach, taking into account the thermodynamical influence of occupations (by users or residents) [6], we investigated the design, implementation, and validation of a heating controller by the fuzzy inference system.
There are plenty of works based on model-free approaches to a building's heating. The authors of [7] proposed a heating controller for supporting the thermal satisfaction of the user. It was based on a thermostatic controller (operating on "On/Off") with a microcontroller. When the temperature reaches higher than the setpoint temperature, the fan turns on, and conversely, when it is lower than the setpoint temperature, the heater turns on. The introduced space heating controller operates in harmony with the difference between the setpoint temperature and actual temperature. It is a model-free approach for designing a heating controller. It is independent from the complexity of the concerned heating dynamics. The proposed strategy can be generalized to specific homogeneous living spaces and not be widespread to sophisticated buildings with heterogeneous living spaces.
The authors of [8] presented a model-free approach and sensor-free HVAC control algorithm. It utilizes simple user input (hot/cold) and adapts to change of the office occupancy or ambient temperature in real time. Alternatively, the proposed strategy involves users in the HVAC control loop. It is done through distributed smartphone-based votes about the thermal comfort for the control of HVAC. The iterative data fusion algorithm finds optimal temperature in offices with multiple user and address techniques. It can save energy by shifting the indoor temperature towards the outdoor temperature. The evaluation of the proposed approach is based on empirical data collection in 12 different offices over three weeks. It illustrated that the introduced controller can save up to 60% of the energy at a relatively small increase of 0.3°C on average of occupant discomfort. The idea is appealing; however, the concerned technique is very specific.
There are a variety of controllers for managing a heating system. One of the widely used and well-known controllers is fuzzy controllers. In [9], an adaptive thermostat controller model was proposed that is usable in the hottest and coldest countries. The authors designed a controller based on the Mamdani and Sugeno [10][11][12] fuzzy techniques and wireless sensor capabilities. The proposed fuzzy controller for automating thermostat setpoints considers the initialized setpoint, outdoor temperature, home occupancy, and utility price (the price of electricity in the different hours of the day is different according to user demands) as inputs.
The authors claim, at the minimum level, their system can save 6.5% on energy. They concluded that both the fuzzy Mamdani and Sugeno techniques are more efficient than other methods. The authors did not discuss the optimal strategies for reaching the desired setpoint, and it seems the controller was designed based on a model-free approach.
In [13], the authors dealt with the intelligent control and monitoring of an industrial chilling and heating system. As reported by the authors, predominantly, Proportional-Integral-Derivative (PID) controllers are used for this purpose; nevertheless, considering the nonlinearity behavior of these systems, PID cannot be the best choice. Concerning this point, the authors presented a fuzzy logic controller. As stated by the authors, the results of this work showed the fuzzy logic controller in the case of setpoint tracking had a better performance in comparison with the PID controller. It should be emphasized that the proposed research is a controller design of heating and chilling for industrial purposes, and it may not be sufficient for places where user comfort has priority. Despite that, the interesting point of this work is the ability of the fuzzy controller in setpoint tracking. The authors in this work for the fuzzy controller just considered error and rate of error. The investigators in [13], like [9], designed their controller based on a model-free approach.
An investigation by [14] was about an adaptive Hierarchical Fuzzy controller. They believed the hierarchical structure has several benefits: The number of rules in the fuzzy logic controller will decrease, the system is more accurate and less complex, and the computational part of the work will decrease. The proposed fuzzy system has two levels. As many traditional closed-loop controllers, the control process needs to be corrected during the operation. In this investigation, the responsibility of the correction is related to the first level of fuzzy controllers in order to correct the second level. The unexpected changes in the system (like entering the new fresh air in the room) can affect and make an error in the controlling process. However, because there is no feedback about that, the error (difference between reference temperature and actual indoor temperature) will not change, and also, because the true nature of heat spread is slow, the air temperature is unknown just after heating the system. This control strategy is based on compensating for indoor temperature loss. The Hierarchical model suggested by [14] is fitting and effective in the case of reducing the number of rules. However, as the investigation is on an integrated environment and the inherent behavior of the heating systems is very slow, it is questionable how they want to measure air temperature immediately after disturbances. The authors did not discuss this part. In addition, this work was in line with the proposed method; the goal is to reach a setpoint temperature at any cost. It may improve user comfort; however, if the user behaves in the wrong framework, it not only increases the cost but, also, the loss of energy. In opposite to recent works, the authors proposed a solution to face the dynamic parameters that affect the system.
Another investigation based on fuzzy approaches was done by [15]. A heating and cooling system controller was introduced to bring a level of comfort for users and, in parallel, save energy. They used the Mamdani technique. As the inputs of the fuzzy controller, they injected the deviation between the actual temperature and target temperature (ΔT), (in fuzzification mode, it contains seven membership functions), ratio of the temperature changes in a certain time interval (same number of membership functions as ΔT), and distance from heating/cooling device to the coldest/hottest area of the room (contains three membership functions). The output of the system is the power of the heating/cooling device, and it is composed of two different parts. The first part is about the operating mode of the heating/cooling system composed of six membership functions. The second part is about the speed of the fan composed of four membership functions.
The notion of choosing a temperature rate and, also, the distance of the heating device to the hottest or coldest section of the room is quietly appealing. It shows the authors paid attention to every detail. Like [13], the error and rate of error were taken into consideration; however, the advantage of this investigation was the third input of the fuzzy controller (distance to the coldest and hottest parts of the space). It would have a positive effect in the control chain.
In another investigation with the fuzzy approach, the authors of [16] demonstrated how the fuzzy logic controller is effective to save energy in a chiller system. The frequency of the compressor electric motor should be adjusted to change the compressor speed and cooling capacity modulation. The fuzzy controller for this part has two inputs and one output. The first input is the difference between the setpoint water temperature and real water temperature (water temperature error). The second one is the previous value of frequency sent to the inverter by the controller, the output converted to a voltage that can be used by a pulse width modulation (PVM) [17] inverter in order to control the speed of the compressor.
Regarding controlling the Electronic Expansion Valve (EEV), the fuzzy controller is applied with the same number of inputs and outputs of the compressor speed controller. As inputs, the error of superheat temperature (the difference between the setpoint superheat temperature and actual superheat temperature) and previous values of the opening valve of the EEV are considered. The output is the values of the opening valve of the EEV. The authors remarked on a 17% performance improvement obtained by the fuzzy controller in comparison with the on/off controller. Like recently reviewed investigations, the work of [16] was also designed based on a model-free approach.
The investigators of [18] designed an IoT-based smart thermostat for the heating system in order to save energy. The case study in this work was a home with combi boiler [19] for heating. In each room of this home, there was a sensor temperature, and the system would calculate the average temperatures of the rooms, and accordingly, the combi boiler should heat the rooms. Each temperature node communicated with the smart thermostat by the nRF24L01 module [20], and just the root temperature node communicated through the internet by the ESP8266 module.
The smart thermostat decided on the temperature of the combi boiler. This decision was made remotely by a mobile application that was controlled by the user. The decision could also be made automatically, depending on the user's location. The smart thermostat could turn on the combi boiler if the user was in the home or he was approaching home. If the user went away from the home, it could turn it off. The idea of action and reaction of the thermostat pursuant to user location is interesting. However, the flexibility of the system is low, owing to how there is just one smart thermostat that is responsible for setting the whole building temperature and it just has two modes of working: On or Off. The authors paid attention to the localization of the user and did not consider the optimum operation of the thermostat.
Most of the investigations regarding an effective heating controller design are on the basis of model-free approaches. Lack of information about the effects of dynamic factors in these works leads to simplistic solutions for facing control issues. In some works, like [14], the authors would like to decrease the effects of the dynamic parameters by a hierarchical fuzzy architecture, or in the work of [13,15], the practical operation of the error and error rate in a feedback loop helped reach the same goal. The authors of [9], with a fuzzy controller and considering dynamic parameters that have an influence on the control chain, faced that problem; however, in [18], the authors, by localization of the user, dealt with the control challenge, which was suffering from an effective algorithmic controller. The work of [9], as it was noted earlier, considered several factors that affected the control chain. It is interesting to note, however, the control strategies (rule-based part of the fuzzy controller) mostly had an empiric basis.
In this article, we aim to propose a model-based approach for designing a heating controller. It would enhance the responsiveness and adaptiveness of the heating controller to an ambient condition, especially by taking into account the presence and absence of inhabitants as an additional heating source in spaces. The focus of this article is on a heating system, as the concerned smart building is located in the Paris region, where the weather most days of the year is cold and, as a result, it is not occupied by a cooling system. However, the proposed approach in this article is applicable to air conditioning and cooling systems. The proposed approach for designing a heating controller is based on two steps: 1. Modeling the living spaces, considering the occupants as an additional heating source in parallel with heating transmitters by taking advantage of the time-series prediction capacity of the Nonlinear Autoregressive Network with Exogenous inputs (NARX) model on the basis of a Multilayer Perceptron (MLP) neural network. 2. Designing a heating controller on the basis of Takagi-Sugeno fuzzy inference by considering and analyzing the thermal behavior of the heating dynamics model of living spaces for constructing the knowledgebase part of the controller.
In the second part of this article, the implementation of living spaces regarding the heating system in the Senart Campus of Université Paris Est Créteil is introduced. In the third part, the modeling of the heating dynamic of living spaces, which is completely discussed in our previous work [6], is highlighted. In the fourth, fifth, and sixth parts, respectively, the structure of the heating control chain, construction of the knowledge-based part of the Fuzzy controller, plus the simulation and evaluation of the proposed approach based on a neuro-fuzzy structure (modeling of living spaces and the heating controller) is presented. In the seventh part, the results and validation of the approach are discussed, and finally, in the last part of this article, you can find the conclusion of this investigation.

The Framework of the Living Spaces in SBEMS Considering the Heating System
The concerned heating spaces are located in a five-floor building of Senart Campus of the Université Paris Est Créteil (UPEC). The concerned building is automated, and it is the host of the Electrical Engineering and Industrial Informatics departments [21]. The concerned building is heated by a central heating system. It also supplies radiators (heating devices) in different living spaces. There are a variety of living spaces (offices, classrooms, practical rooms, etc.). The control of the radiators is operated through the valves that are installed on each individual heating device. This building is fully equipped with plenty of sensors and actuators. It allows monitoring of the related environmental and operational information of spaces (such as outdoor temperature, indoor temperature, state of windows, etc.). Four different sensors and an actuator serve in this building: temperature sensors (TS), magnetic sensors (MS), presence detectors (PD), luminance sensors (LS), and motors valves (MV). The sensors and connected actuators concerned in this paper use EnOcean technology. EnOcean is an energy-harvesting technology. It provides wireless communication protocols that provide self-powered wireless sensors or actuators for building energy management systems [22]. Figure 1 illustrates the implementation of the heating system in SBEMS. It is composed of four different layers: the supervision layer, the control layer, the distributed local intelligence layer, and the physical layer.

•
At the supervisory level, a computer that includes TopKapi server software is in charge of the supervision of the system. It acts as a supervision agent.

•
The control layer includes a programmable logic controller of the Wago I/O system. It supports the Modbus/Tcp and Ethernet/IP protocols in order to integrate into plenty of IT environments easily.

•
EnOcean technology is in charge of communications between devices (sensors, actuators, etc.) and the control layer.  Regarding the implementation of the heating system in the concerned building, on each floor, there is a Programmable Logic Controller (PLC). It allows on each floor the PLC control motor valves and also reads the data of the sensors through EnOcean technology. In the following section, the modeling of the heating dynamic of the living spaces of SBEMS is introduced.

Highlighting the Modeling of Heating Dynamics of Living Spaces by a Data-Driven Machine Learning Approach
Before introducing the fuzzy controller architecture design for the dynamics of heating spaces, we will review the modeling of heating dynamics of living spaces, which was done in our last paper [6].
The concerned living spaces include various types of spaces (such as practical classrooms, theoretical classrooms, working spaces, etc.). As it is explained in Section 2, the heating system of the building is based on a central heating system, and each concerned space is heated by a radiator. The target model for identification includes the heat transmitters (radiators) and the heating spaces. The living spaces contain an amount of N (0 ≤ ≤ ) occupants. N = 0 means the living space is empty; on the other hand, indicates a fully occupied living space (maximum capacity of the living spaces). The identification method of living spaces is accomplished by MLP-based NARX with a feed-forward backpropagation learning algorithm. Thus, the considered parameters in identification are as follows: "valve position of the radiator at time t" (denoted by ( )), "outdoor temperature measured at time t" (denoted by ( ) and expressed in °C), "indoor temperature measured at time t" (denoted by ( ) and expressed in °C), and "occupancy rate at time t" (denoted by ( ) and expressed in % or number of occupants). All the data regarding the training and testing phases were collected by the proposed SBEMS at the Senart Campus of UPEC. Finally, Figure 2 illustrates the proposed identification structure of the target heating spaces model, regarding the above-stated working hypothesis on the effect of the occupancy in living spaces, where the indoor temperature of a living space is predicted according to past values of the indoor temperature (tapped delayed line (TDL)), past values of the outdoor temperature, valve position, and the number of occupants. The effect of occupancy heating dynamics in living spaces in the above figure is modeled based on a hypothesis that the occupancy of the living space by residents increases the effective overall heating power. Building designers determine the nominal power of heating devices according to the volume of the living spaces by keeping constant a parameter that is called the "heating ratio". It is a division of the nominal power of heating devices by the volume of concerned spaces (Equation (1)) in different spaces (where , expressed in W/m 3 , denotes the heating device's nominal power, and is the volume of the living space. The proper heating ratio is determined versus the norms of construction of heating spaces (materials of construction, type of windows, etc.). However, the inhabitants in spaces that are seen as an additional heating power can dynamically change the heating ratio (Equation (2)).
( ) is the additional heating power provided by the living space's occupancy (with As much as the number of occupants in spaces is higher, the increment of temperature is faster (higher temperature velocity). In other words, bigger heating rates have a direct relation to bigger heating slopes (Equation (3)). In Equation (3), ( ) and ( ) stand for values of the indoor temperature (supposed to be provided by the temperature sensor at times: and , respectively) and ∆ = − .
On the basis of the aforesaid, the heating slopes can be varied following the valve position or number of occupants in spaces. In other words, the identified heating slope is a function of the occupants and valve position of the heating device (ℎ ( ) = ( ( ), )), and the indoor temperature can be estimated by the identified heating slope (the identified value of ℎ( )). With regards to the mentioned formulation, the approach for the modeling of a living space dynamic by considering the effect of occupants is presented in [6].
Finally, Figure 3 shows ( ) (W/m 3 ) versus the occupancy rate for the three considered categories of living spaces of building A that are identified by this approach, where denotes the "fuzzy value" of VLS, and = 100% corresponds to the occupancy of each considered living space category by up to 28 individuals. Regarding Figure 3, as an example, if the medium space is equipped with 28 people, the 3-kW radiator (the nominal power of the radiator in a medium space) should work on lower power or even remain off to bring thermal satisfaction and reach the desired temperature, since the additional heating power relating to occupants (7 kW) is higher than the installed radiator size in the mentioned room. In the next sections, we present the structure of the controller and its positioning in the control chain of the heating system. We will show how the fuzzy controller can control the temperature of the room in consonance with the control strategies. The role of the living space model will be illustrated in constructing the controller knowledgebase and the performance of the fuzzy controller in a neuro-fuzzy structure will be evaluated.

Fuzzy Controller and Control Loop Structure for Facing Heating Dynamics in Living Spaces
Considering the additional heating power by occupants as it is illustrated in Section 3 by the identification method (modeling heating dynamics of living spaces), the inhabitants can play an imperative role in the heating control loop in order to decrease the part of heating devices in thermal generation. The vast majority model of the output feedback controller is based on the following general model: where ( ) is the control signal (i.e., controller's output), ( ) is the controlled device's (or system's) output, ( ) is the measuring device's (or system's) output, * is the desired device's (or system's) output, and ℎ(•) represents the control law that is supposed to stabilize the feedback control system [12]. Figure 4 shows the structure of a feedback controller. According to the structure of the aforesaid feedback controller, the proposed fuzzy controller involves several parameters as inputs for its control loop: The volume of the living space (VLS) • The temperature error (ΔT) (It is a subtraction of the desired temperature and measured temperature).
Each parameter plays a role in the rule-based part of the fuzzy controller. The output signal is the valve position of the radiator that has an effect on the output power of the radiator. Figure 5 presents the block diagram of the neuro-fuzzy model, where the fuzzy controller (FC) in a closed-loop control system acts on the valve position of the radiator in order to control the temperatures of the living spaces in which its heating dynamics are modeled by a neural network. The fuzzy controller acts as a control agent on the PLC, and according to the information that it receives from the appropriate sensors or existing data, it can act on the motor valve of the radiator. By changing the valve position of the radiator, the output power of the radiator is changed and can adapt its functionalities in different situations. The proposed controller structure will lead to a fully automated and efficient system for controlling the thermal environment of the spaces. In the case of comfortability, it declines the involvement and unnecessary interaction of the user for controlling heating devices to a minimum while it offering thermal satisfaction. Thermal satisfaction means "reaching the desired temperature in a proper time while automatically adjusting heating devices in different spaces by following the proper strategies (without involving users) and reducing the consumption of energy". In the next section, the control strategies regarding fuzzy controller are presented. We will show how the knowledge-based part of the controller is constructed according to the identified (modeled) heating dynamics of living spaces.

Control Strategies of the Proposed Fuzzy Controller
Regarding the control of heating devices in spaces, the Takagi-Sugeno fuzzy model is proposed. It is more attractive for control and nonlinear problems in comparison with the Mamdani fuzzy model [23]. The fuzzy inference architecture is split into three different parts ( Figure 6): Inference engine and rule-based part • Defuzzification.
In fuzzification, the input value (fuzzy set) is mapped by a function to the degree of compatibility in rhe linguistic variables. The knowledgebase consists of a rule base and a database. A rule base contains a number of fuzzy if-then rules. The inference engine is the process of formulating the map from a given input to an output. Finally, in defuzzification, the fuzzy set is mapped to a crisp output set [24,25].
where σ is the standard deviation, c is the mean for each Gaussian membership function, and the membership value is calculated for each input value of x.  (Figure 8). The outdoor temperature besides the other input parameters plays a role to reach the desired temperature (setpoint).

•
The occupancy is divided into 5 different Gaussian membership functions: very small, small, medium, large, and very large (Figure 9).

•
The last input is ΔT (Error) (Equation (6)) with two Gaussian membership functions ( Figure 10): (1) small and (2) large. As long as ΔT is bigger than 0, the valve position, which is the output of the fuzzy controller, will work in higher values, and when ΔT is 0 or a negative value, the valve position will decrease.    The crisp output of the fuzzy controller is the valve position. The values of the crisp output are illustrated in Table 1. They are in the range of 0% (off) to 100% (nominal power).

VP1
VP2 VP3  VP4  VP5  VP6  VP7  VP8  VP9  VP10  VP11  VP12  VP13   0  20  22  25  30  36  69  71  74  76  77  78  100 As it is aforementioned, the crisp input in the fuzzification process is mapped to linguistic variables by membership functions that are stored in the fuzzy knowledgebase, and the grade of membership is quantified by the membership degree (μ). The next step after fuzzification is related to the rule-based part (knowledgebase) and inference engine. In this part, in agreement with the defined rules, the inputs are mapped to an output. They are mapped with the weighted average defuzzification method (Equation (6)). * = ∑ . ∑ where w is the rule firing strength of the membership functions, is the rule output level, and * is the output.
Here, ( ) and ( ) are the membership functions for inputs 1 and 2, respectively. The rule-based part of the fuzzy controller is constructed by considering the conditions of the crisp inputs. Among all crisp inputs, the presence of people (occupants) plays the most imperative role (regarding their additional heating power). As it is stated in Section 3, the additional heating power of the occupants is presented in Figure 3. The objective is the indoor temperature of living spaces reaching the desired value at a certain time interval by adjusting the radiator valve ( ( )), considering the presence or absence of inhabitants in spaces. As mentioned earlier, the heating slope is a function of valve position and occupancy (ℎ ( ) = ( ( ) , )). In order to reach the desired temperature efficiently, the optimized valve position should be estimated. The rules always offer an optimized valve position. It leads to the optimum total output power (the power of the heating devices and additional power by occupation ( ( ) = ( ) + ( )) in diverse conditions. It finally gives an optimized ℎ ( ) and reaches the desired temperature in a certain time interval. On a basis of the rules, the total output power in the presence of people is never less than the output power of the heating devices while the room is empty ( ( ≠ 0) ≥ ( = 0)). Additionally, in all cases, in reference to the proposed control rules, the desired temperature in the presence of people reaches the setpoint not later than while the room is empty and the radiator is working to reach the desired temperature (by considering the same initial temperature). Following the abovesaid, the rules-based part is constructed and illustrated in Table  2. The fuzzy controller is always offering a radiator the power to have an average temperature velocity of 1.1 (°c ℎ ) when the space is occupied and reach the setpoint. It will lead to having a harmonized heating environment. As an example of the rules: Based on the "If" clause part, VP11 (= 77) is estimated by the fuzzy controller in order to reach the setpoint temperature by taking into account the additional heat source that is radiated by the occupants (OCC = M), reaching the desired temperature with an average velocity of 1.1 (°c ℎ ).
As much as the occupancy increases, the optimized value of the valve position declines, and that is because of the heating energy being exploited by human body radiation. Regarding the delta in this table, as long as the delta is positive and far from the setpoint, the valve position on the basis of a number of occupants is chosen by the fuzzy controller, and when the delta is close to the setpoint, the valve position will decrease until the delta becomes zero. The output temperature as one of the inputs also plays a role. It has a small effect on the heating slope (for reaching the setpoints), and it assists in order to better optimize the valve position.
In the next section, we will evaluate the proposed approach in simulations of several scenarios. It is promising that the proposed architecture of the feedback controller with the aforementioned control strategies shows their effectiveness in reducing the energy consumption. The simulations rely on the neuro-fuzzy model that is presented in Section 4.

Simulation, Results, and Evaluation of the Fuzzy Controller in Comparison with the On/Off Control Strategy
In order to evaluate the proposed controller, several experimental simulation assessments were considered. The purpose of these simulations was to evaluate the adaptiveness and energy-saving advantage of the fuzzy controller in various conditions. Regarding these facts, several scenarios were implemented with two different controllers in a feedback loop control structure: The feedback loop control with the fuzzy controller is earlier mentioned in Figure 5. Regarding the On/Off controller, it is in the same feedback loop structure; however, it just considers the difference between actual temperature with setpoint temperature for the operations in the feedback. In the first experimental simulation, a scenario is implemented in a theoretical classroom with a medium size. The second experimental simulation is done in a practical classroom with a large size. The third simulation is in an office room with a small size. Finally, after the experimental simulations, in the last part of this section, we propose the results regarding the performance of the controller.
As regards energy-saving and the comparison of the performance of the FC with an on/off controller, it is necessary to refer to the thermodynamics law and specific heat capacity [26]. All elements absorb or desorb heat. Nevertheless, with regards to the importance of the indoor temperatures of spaces, the one that is important in our case is the amount of heat gained or lost by a space's air. Following this fact, the specific heat capacity can indicate the amount of thermal energy that is absorbed or lost by the air in the room (Equation (9)).
where Q (Joule) is the absorption heat, m (kg) is the mass of air in the room, c ° . )is the specific heat capacity, and ΔT is the difference between the initial temperature and the final temperature.
In order to find the mass of air in a room, the following equation should be utilized [27]: where is the density of the air ( ), and V is the volume of the room in cubic meters (m 3 ).

Experimental Simulation in the Theoretical Classroom with a Medium Size
Concerning the first experiment, it is assumed to reach the setpoint temperature (20 °C) and keep the smoothness of the temperature evolution. The first experimental simulation was done in a theoretical classroom room (which is a room with a medium size ( = Medium). During the first 150 min, it is supposed that the room is empty (no occupation) and the initial indoor temperature is 17 °C. Afterward, the room gets fully occupied (28 students) by students for four hours for a lecture. Finally, the lecture is accomplished, and students begin to leave the classroom, and the room will remain empty for the rest of the day. The outdoor temperature is supposed to be 5 °C during the simulation. The control of the radiator in the experimentations is done by an On/Off controller and the fuzzy controller (FC). According to the functional nature of the FC, it is expected that the controller shows its adaptiveness capabilities and adjusts the motor valve to different conditions. Figure 11 shows the occupation during the scenario. Figure 12 and Figure 13, respectively, present the valve position and temperature evolution of a FC and On/Off controller in a theoretical room of medium size.   The initial indoor temperature is 17 °C. In zone 1, while the room is empty, both controllers let the motor valve open the valve position to 100% (radiator works at nominal power). After two-and-a-half hours, the indoor temperature in both cases is 18.5 °C. When the room is occupied (zone2) by 28 people, the FC changes its functionalities, and the valve position turns to 0. That is because 28 people in a room are able to produce even more power than the 3-kW radiator and generate appropriate ℎ ( ). It should be noted that, 200 min after beginning the experimentation, the indoor temperature reached the setpoint temperature ( = 0) and then passed it ( < 0). However, on the other hand, the On/Off controller was still working at nominal power, because it was still far from the upper hysteresis limit, and it reached there one hour later. At time 390 min (beginning of zone 3), the room was becoming empty. However, the temperature was high (23 °C) in both cases, and as a result, both controllers remained at zero power. When the temperature decreased and went lower than 20 °C, the FC changed its functionalities from a lack of occupation power and turned the valve position to 100% to keep the temperature at 20 °C. About 50 min later, when the indoor temperature reached the lower limits of the hysteresis (19.5 °C), the On/Off controller turned the valve position to 100 percent in order to increase the temperature again. In the next section, we will implement another scenario in a practical classroom where the size of the space is large.

Experimental Simulation of the Practical Classroom with a Large Size
The experimental simulation in this section is in a practical classroom. The maximum capacity of occupants is 15 people. The physical activity in this room is higher than the theoretical room, and occupants during the lectures are using devices that produce heat (e.g., computers, PLCs, power supplies, etc.). Figure 14 shows the occupation of the room during the experimentation. The first one hour and half, the room is empty, and after, during four hours of lecture, it was occupied by 15 people. Finally, after the lecture, it became empty and remained unoccupied for the rest of the experiment. The outdoor temperature was set at 5 °C during the simulation, like the theoretical classroom, where the heating device was controlled once with a FC and once with an On/Off controller. Figures  15 and 16 show the valve position changes during the time ( ( )) and temperature variations during experimentation for the FC and On/Off controller, respectively.   In zone 1, the space is empty, and radiators are working at nominal power in both controller cases, and the indoor temperature reaches 19.2 °C in both cases. In zone 2, the room is occupied by 15 people. The FC changes the radiator output power to 25% (valve position = 25%) of the nominal power in order to adapt itself to the new conditions. It gains part of the needed heat from the occupants. However, the On/Off controller lets the radiator work at nominal power (valve position = 100%) for 60 min more, because it needs more time to reach the upper limit of hysteresis. When the occupants start to leave the classroom, the indoor temperature is 21.5 °C in the case of the FC and 21.7 °C in the case of the On/Off controller (beginning of zone 3). In both cases, the radiators remain off, because the indoor temperature is higher than the desired temperature. When the indoor temperature reaches 20 °C, the FC controller increases the valve position to 65% in order to keep it at the desired value (setpoint indoor temperature), although the On/Off controller keeps the valve position zero until the indoor temperature reaches the lower limit of hysteresis and then turns the valve position to 100 550 min after the beginning of the experimentation.

Experimental Simulation of an Office Room with a Small Size
With the same approach as the last Sections, 6.1 and 6.2, an experiment was done in an office room. The size of this room was small ( = Small). The scenario happened during a meeting. In the first two-and-a-half hours of the experiment, there were two people in the room, and then four more people join, and the meeting starts. The meeting is held for four hours. Finally, the meeting finishes and just two people remain in the room until the end of the experiment. The outdoor temperature is 5 °C during the simulation. Figure  17, Figure 18, and Figure 19, respectively, present the occupation during the experiment, the output signal of the fuzzy and On/Off controllers ( ), and the temperature fluctuation during the experiment.   In zone 1, while there are two occupants, the FC sets the valve position at 98% nominal power and the On/Off controller at 100. In zone 2, while the room is occupied with four additional people at the beginning, the indoor temperature is 19 °C in the case of the FC and 19.2 °C in the case of the On/OFF controller. The FC adapts the radiator power to the next condition by decreasing 20% of the valve position; however, the On/Off controller still works at 100% in order to reach the upper limit of hysteresis. In zone 2, in both cases, the valve position declines-for the FC, when the setpoint is achieved ( = 0), and for the On/Off controller, when the indoor temperature meets the upper limit of hysteresis. The FC sets the valve position at 42% and the On/Off to zero. When the meeting finished, the indoor temperature declined (zone3), and following this, fact both controllers increased their valve positions. However, the FC turned the valve position to 95% 30 minutes earlier than the On/Off controller in order to keep the indoor temperature at the desired temperature ( = 0).
In all scenarios, the FC shows sensitivity to the number of inhabitants in living spaces, while in contrast, the On/Off controller changes the state of the valve position based on the upper and lower hysteresis limits of the indoor temperature without taking into consideration any other parameters. The FC always optimizes the valve position according to the ambient information that it receives through a feedback loop from sensors and actuators. However, on the other side, the On/Off controller switches the valve position between the nominal power and off mode. The obtained results show the FC is perfectly able to adapt its functionalities to different situations. It optimizes the generation of thermal energy by radiators, owing to human body heat radiation. The time to reach the desired temperature in all cases is approximately the same to have a harmonized environment in different spaces with different occupations. For example, by looking at the results of the simulations, in all cases, the temperature reached the range of 19.5 to 20 °C approximately during 180 min, while the initial temperature was 17 °C. In addition, the selfadaptiveness functionality of the proposed controller declines the involvement of users or inhabitants for controlling the indoor temperature of spaces. In the next section, the results regarding the energy consumption and efficiency according to the FC and On/Off controller will be discussed.

Results
The temperature-time curve in simulations is analyzed in order to obtain the heat loss and gain during experimentations. It is split into several parts for analysis: Profitable heat Gain ( ) Unnecessary heat Gained ( ) Heat loss ( ) The profitable heat gain is where the temperature reaches the indoor temperature setpoint for the first time. The unnecessary heat gain is where the temperature for the second and more reaches the setpoint, and it also passes the setpoint, and finally, the heat loss is wherever there is a loss of temperature. It should be remarked that and , individually are split into three parts: : It is the heat that is gained just from the radiator in the absence of occupants during the experimentation.
: It is the heat that is gained just from occupants in the absence of the radiator during the experimentation. & : It is the heat that is gained at the same time from the occupants and radiator during experimentation.
In accordance with Equation (9), the portion of each part (the profitable gain, unnecessary gain, and loss) for the two control modes (On/Off controller and FC) are analyzed. Table 3 illustrates the portion of each part. In conformity with Table 3, the part of the heat that is gained or is lost in different spaces is illustrated. The effect of the operation of each controller individually in the presence and absence of the occupants regarding the abovesaid scenarios are presented. The profitable heat gain ( ) in each case for the FC and On/Off is equal, because the initial temperature is defined as 17 °C and the desired temperature is defined as 20 °C, and all cases achieved the desired temperature, although the unnecessary heat gain ( ) in all cases for the FC was less than the On/Off controller, except the medium classroom, which was equal. However, the interesting part is that , in all cases, the FC had a smaller part. In another word, it represented that the loss of energy in the FC was less. Finally, the results relating to & showed the heating gain from the occupants and radiator at the same time was reduced for the FC in comparison with the On/Off controller. It was due to the reduction of the radiator's participation in heat generation because of the occupants' presence.
In order to have an estimation of the thermal energy saving capacity that was achieved by the FC, Table 4 is presented. The thermal energy savings were computed according to Equation (11): The thermal energy savings regarding the unnecessary gain for the medium classroom were zero, because in both cases (FC and On/Off controllers), the indoor temperature increased to the same upper limit. However, in the case of the large classroom and office, this amount was 40% and 89%, respectively, which showed a great part in the energy savings. In all spaces (rooms), the loss of heat was reduced. In the office room, this amount was remarkable (62%). Regarding the heat that was gained just by the radiator, as it was apparent in large classroom as 25.8%, less energy was consumed. In the case of the office room, this amount was zero, because during all the experimentation, there were at least two occupants in the space. In the medium room, this value was not too much. It indicated the heating gained in that room was highly under the influence of more occupants (28 occupants). Nevertheless, the radiator had an effect on the slope of the indoor temperature. As it is apparent in the case of the FC, in the medium room, there was not the unnecessary aggressiveness of the indoor temperature increasing that was caused by the On/off controller. The last part related to heat that was gained from the radiator and occupants at the same time. This amount for the medium classroom was 100%. It means there was no time that the space was occupied and radiators worked at the same time. In fact, this indicated that, when there were occupancies during the experimentation, the radiators did not work and gained heat just from human body heat radiation.
In the large classroom and the office room, saving energy from the occupants and radiators at the same time was 4 % and 44%, respectively. It represents that, while there were occupants, the radiators were working with less power. However, the amount of energy savings in the office room and medium room were higher than the large room. This was because, during the scenario of the office room, from the first minutes to the last, occupants were in the room, and regarding the medium room, when there are occupants, the radiator turned off, although in the large room when there were occupants in the room, it took time to turn the radiators off. In the next section, we will validate the controller in some spaces of Senart Campus of the UPEC and evaluate its performance.

Validation of the Proposed Controller in the Living Spaces of Senart Campus of UPEC
In the final step, the readable code of the FC for downloading on a PLC is generated by MATLAB PLC CODER, and it is downloaded on PLC for validation. To validate the results, two classrooms were selected. The first one was a theoretical classroom with a = Medium size. The data was recorded by the monitoring system of SBEMS for 233 min. During the mentioned time, a lecture with 28 occupants was held. The second classroom for validation was a practical classroom with = Large size. The data regarding the practical classroom was recorded for 560 min. During this period, a lecture for four hours was held. Figures 20 and 21 show the recorded measurements in a theoretical classroom with a medium size. During the recording of the data, the outdoor temperature increased from 8 to 11.69 °C. In the first 15 min, the space was empty, and the initial indoor temperature was 16.2 °C. The radiator was working at nominal power in order to reach the desired temperature (ΔT>0). After 30 min, the lecture began, and the space was occupied by 28 people. As 28 people in the room generated more heat than the nominal power of the radiator, the FC turned the valve position to 0 and gained the needed heat from the human body heat radiation. Finally, after 60 min from the beginning of the lecture, the indoor temperature reached the desired temperature (ΔT = 0). It showed that the indoor temperature kept increasing until the end of the lecture to 23 °C (ΔT < 0).  Figures 22 and 23 illustrate the relating results to a large room during a practical lecture. The outdoor temperature during the data recording was increased between 3.8 °C to 14.2 °C. During the first 330 min, the room was empty. The initial indoor temperature was 18 °C (ΔT > 0). In zone 1, after 170 min, the indoor temperature reached the desired temperature (ΔT = 0). The FC changed its functionality to adapt itself to the new conditions in order to keep the indoor temperature at the desired temperature. As a result, the valve position changed from 100% to 25% of the nominal power. It fluctuated between 5% to 65% in order to keep the desired temperature. In zone 2, when the room was occupied by 15 people, the FC adapted to the new conditions and decreased the valve position in order to gain some part of the needed heat from human body radiation. By increasing the indoor temperature and passing the desired temperature to a higher indoor temperature (ΔT < 0), the FC acted on the motor valve to turn off the radiator by changing the valve position to zero.  The results of the validation confirmed the results that were obtained in Section 6 in conformity with the simulation scenarios evaluation. The proposed approach showed its effectiveness in designing and developing a controller on the basis of the model of living space approaches by considering the inhabitants as an additional heating power. According to the obtained results, the presented controller illustrated its performance in the case of energy efficiency.

Conclusions
In this article, we focused on the implementation, designing, simulation, and validation of a heating controller for the heating system of a smart building that is located on Senart Campus of the University Paris-Est Créteil. Regarding complex thermodynamical behavior in living spaces, there is always a simplistic view for designing heating controllers. The presence or absence of the user in the living space highly affects the heating dynamics of living spaces; they are one of the most important parameters that can be seen as an additional heating source. However, because of the unidentified heating dynamic effect of occupants (user), it is always ignored in the heating control chain design.
Due to these facts, in order to cover this drawback, an approach regarding a heating controller design was done in two steps: 1. Modeling the heating dynamic of the living spaces by taking into account their occupancy by using system identification methods. 2. Designing an adaptive controller based on analyzing the heating dynamics model of living spaces and constructing the knowledgebase part of the controller.
The methods relating to identification tools demonstrate their ability to discover and model the dynamic behaviors of a building's living space heating system in different conditions (presence and absence of people). The related approach in the identification was on the basis of a time-series prediction provided by the NARX model that profits from multilayer perceptron learning and generalization. The identification approach in this part offered an interesting application for thermal studies of living spaces where the occupancy of the spaces was also taken into consideration. It also served for the designing and evaluation of the fuzzy controller in a neuro-fuzzy model. According to the heating dynamics model of living spaces, we were able to analyze the thermodynamical behaviors of spaces by taking into consideration the heating dynamic influence of occupants in living spaces. It led to the extraction of the fuzzy rules in order to construct the knowledgebase part of the fuzzy controller. This step is necessary for designing any kind of modelbased controllers, whether the approach is on the basis of the fuzzy logic technique or not.
In the second step, a fuzzy controller with the Takagi-Sugeno method was presented to face the control problem of the aforesaid dynamic behaviors regarding various conditions. Indeed, fuzzy logic techniques are perfectly suited to tackle the control challenges of nonlinear and dynamic systems, as regards the results of this article, which demonstrate this fact. For the purpose of illustrating the advantage of model-based design controllers over simple popular controllers like the On/Off controller, several simulations with different scenarios were done.
On the basis of the obtained results, the model-based controller by the FC showed responsiveness in order to cope with control challenges in diverse conditions, especially occupancy. It showed that the proposed approach can improve the performances of heating control systems in contrast with model-free approaches. In all the scenarios, the FC could save energy in comparison with the On/Off controller. In some cases (the experiment in a medium room with 28 occupants), the system did not even use the radiator's power to heat the space, and all the needed energy was exploited from the occupants' bodies. In all cases, the loss of energy declined, and when the spaces were occupied by inhabitants, the use of the radiator for heat generation decreased in order to gain the rest of the needed heat from the human body heat radiation in the spaces. In all cases of the simulations, the optimal total output power by considering the occupants as an additional heating source and output power of heating devices was proposed by the FC. It led to reaching the range of the desired temperature at the same time interval in all cases without involving the user to operate the heating device. It also gave rise to decreasing the unnecessary aggressiveness of indoor temperature increments or decrements, which is a huge drawback of On/Off controllers. In fact, it is one of the reasons for the higher consumption in this kind of controller. The exploitation of perfect results according to neuro-fuzzy approaches also illustrated the effectiveness and power of artificial intelligence techniques in the problem-solving of complex issues nowadays for smart buildings. They can play decisive roles in the next generation of controllers in smart buildings.

Data Availability Statement:
The data regarding the concerned paper is retrieved from the involved smart building (Senart campus of Université Paris-est Créteil) as explained in the context. It is the platform that we used as our frame work. In future probably it can serve as a benchmark, however, the decision regarding this fact is still not made by UPEC and we use data for internal aspects.

Conflicts of Interest:
The authors declare no conflicts of interest.