## 3 Problem Formulation
### Model of Residential Heating System  
In order to model the working of the heater inside a room and simulate the variation in room temperature, heater and its thermal characteristics, room and its thermal characteristics and a thermostat are taken as a model component. The thermal model is an adaption of the [46], which was created using the model of heat gain and heat loss of system.  
As shown in Figure 3, thermostat plays a central role in the room-heater model with having a room temperature sensor and controller. In this model, heat generated by the heater is calculated as well as the heat lost to the surroundings. After all the calculations have been performed, the controller part of the thermostat reads the value of the indoor temperature and sends the control signal if the room temperature is different as compared to the set-point temperature. The components of residential heating system are described below:  
1. Heater: Heater component is modeled using the amount of heat gain supplied to the room. When the heater is ON, hot air is blown at a constant temperature \(T_{Heater}\) and a flow rate \(M_{Heater}\). Heat gain inside the room is calculated using the equation below. Output of the heat is dependent on the thermostat control signal: \[\frac{dQ_{gain}}{dt}=(T_{Heater}-T_{Room})\times M_{Heater}\times c_{air},\] (6) where \(\frac{dQ_{gain}}{dt}\) is heat gain because of hot air flow from heater, \(T_{Heater}\) is temperature of hot air from heater, \(T_{Room}\) is room air temperature at real time, \(M_{Heater}\) is air mass flow rate through heater, and \(c_{air}\) is heat capacity of air at constant pressure.
2. Thermostat: Thermostat in the room calculates the difference in the initialized thermostat value and room temperature and turns the heater ON or OFF based on the difference. Thermostat computes the difference at each 5-min interval. The working of the thermostat can be summarized as follows: 1. When the room temperature is below the desired set-point, the heater state is ON and it supplies the heat gain and value of control signal is equal to 1.  
2. When the room temperature is above the initialized set-point for that particular time, the heater is turned OFF by the thermostat and heat gain is equal to zero as the control signal is 0.
3. Room: In order to calculate the temperature variation, the system considers both the heat gain from the heater and heat loss from room to the surroundings. Heat loss (\(\frac{dQ_{loss}}{dt}\)) was calculated using the equation mentioned below where \(T_{outside}\) is outdoor temperature at real time and \(R_{thermal}\) is equivalent thermal resistance of the house: \[\frac{dQ_{loss}}{dt}=\frac{T_{Room}-T_{outside}}{R_{thermal}}.\] (7) In order to compute the variation in indoor temperature (\(\frac{dT_{Room}}{dt}\)), heat gain and heat loss calculated using the Equations (6)-(7) two formulas were added in the following equation, where \(M_{air}\) is the mass of air inside room: \[\frac{dT_{room}}{dt}=\frac{1}{M_{air}\times c_{air}}(\frac{dQ_{gain}}{dt}- \frac{dQ_{loss}}{dt}).\] (8) In order to validate the proposed methodology, two extremal temperatures are considered i.e., coldest and hottest day from Yakutsk, Russia.