Object Oriented Modeling of Thermostatically Controlled Devices for Cold Load Pick-up

Problem statement: During service restoration, the power level at buses can significantly differ from the one presented under steady-state conditions, demanding an amount of electric power significantly higher than the normal load. Hence, their post-outage behavior must be adequately forecasted in order to permit the development of reliable restoration plans, or to avoid inadequate actions that may lead to a subsequent shutdown of the electric power system. This problem is known in the literature as cold load pick-up and the thermostatically controlled loads can be pointed as the main responsible for this behavior. Approach: This study proposes a methodology to model the thermostatically controlled load behavior during the reenergization process, based on object oriented programming and the physical modeling of individual loads, avoiding the explicitly modeling of the electric distribution feeder. In this context, the load aggregation is also implemented using “feeder” classes in an hierarchical structure. Results: The methodology was tested considering distinct devices distributed along a hypothetical feeder and the results show the impacts of interruption duration and environmental temperature in the load behavior. Conclusion: The Cold-load phenomena can be successfully simulated based on physical parameters of thermostatically controlled loads using objectoriented programming, yielding satisfactory results. In special, the impacts of the environmental temperature in the load to be restored can be assessed in detail.


INTRODUCTION
The electric power systems around the world are all vulnerable to great outages. Recent examples of extensive interruptions in the energy supply are the blackouts that occurred in the United Kingdom, USA, Denmark, Sweden and Italy in 2003. In addition to new investments in research and device deployment to reduce the risk of new outages, the elaboration of reliable restoration plans is crucial to minimize the enormous social and economical possible impacts of blackouts (Adibi, 2000;Benachaiba and Ferdi, 2009;Mota et al., 2006;2007a;2007b;Barbuy et al., 2009).
In this context, the load behavior at the reenergization moment and the subsequent instants (cold load pick-up) is a fundamental issue that must be considered when developing restoration plans. If an attempt is made to pick-up a larger load block than the one that can be accommodated by the response capability of the on-line generators, then blocks of load already restored can be lost, due to under-frequency load shedding. If the frequency swing is severe, some generators may trip precipitating another shut-down (Adibi, 2000;Mota et al., 2007a;2007b;Fernandes et al., 2009).
Problems of this nature can occur specially when reenergizing Thermostatically Controlled Devices (TCDs), since this type of load can present an unexpected power demand increase at the reenergization instant (Agneholm, 1999;Mota et al., 2007a). Consequently, forecasting the behavior of these devices can prevent overload problems and improve the reliability of power system restoration plans. Adibi (2000) and Mota et al. (2007a) presents some methods that deal with this problem assuming aggregated loads constituted by groups of the same type of devices.
However, their inherent difficulty in estimating the aggregated behavior of a feeder containing appliances of different types can be considered as a limitation of these methods.
Hence, this study proposes a methodology to forecast the post-outage behavior of the aggregated load in a feeder, considering thermostatically controlled loads of distinct types and based on object oriented programming techniques. This method makes possible the identification of external variables impacts on the post-outage load behavior (as the environment temperature influence and the blackout duration).
This study is organized as follows. In the following, the expected behavior of thermostatically controlled loads under normal operation conditions and for an outage situation is introduced. An overview of the proposed methodology is also presented. After that, the individual object oriented models for TCDs are detailed and, in the sequence, the aggregation procedure is described. Finally, the obtained results are presented and the conclusions of this study are described.
Thermostatically controlled loads: Thermostatically controlled loads can be defined as appliances and devices, which states (turned on or off) are controlled by a thermostat or by temperature sensors, commonly related to thermal comfort (Adibi, 2000;Mota et al., 2007a;Kwong et al., 2009). Examples are refrigerators, air-conditioners, freezers and heating devices. The following subsections describe the behavior of a single TCD under normal operation conditions and for outage situations.
Behavior under normal operation conditions: The behavior of a thermostatically controlled appliance under normal operation conditions is illustrated in Fig. 1. In this Fig. 1, the first curve represents the thermostatic cycle of an individual cooling device and the second curve characterizes its active power demand under normal operation conditions. When the device is turned off, it begins to warm-up and its internal temperature begins to rise. This fact can be observed in the regions marked with a "W". Similarly, when the device is turned on, it begins to cool-down and its internal temperature decreases (region marked with a "C"). It should be noted that this behavior is inverted for heating devices.
Hence, in steady-state conditions, the appliance internal temperature remains between two specified values: a superior limit (T max ) and an inferior limit (T min ). The temperature control is made through a thermostat that changes the appliance state (on or off) at these temperature limits. The device active power demand can be considered constant (P on ) when it is turned on. It must be emphasized that this hypotheses corresponds to a simplification of the real behavior of this type of load. According to references (Agneholm, 1999;Mota et al., 2007a), after the appliance energization, there is an overshoot in the power consumption during the first thermostatic cycle, caused by a set of physical phenomena related to the device functioning. However, the consideration of such phenomenon increases the complexity of the methodology, requiring additional efforts during the resolution process. So, in this study, this overshoot was not considered and the power demand of each device is set as constant during its "on" state, simplifying the aggregated power demand evaluation.
Behavior under outage conditions: The behavior of a cooling device under outage conditions is illustrated in Fig. 2. In this Fig. 2, the first curve represents the thermostatic cycle of a cooling device for an outage situation and the second curve characterizes its active power demand. Depending on the outage duration, the appliance can be unable to turn-on when the upper temperature limit is reached, due to the electric power interruption. This means that the TCD is unable to execute its on cycle when the temperature upper limit is violated, modifying the thermostatic cycle as shown in Fig. 2.
In fact, the interruption causes a thermal energy loss inside the TCD and this loss is the responsible for the alterations in the thermostatic cycle. So, when reconnected, the cooling TCD will execute an "on" cycle with longer duration when compared to its normal "on" cycle, in order to recover its lost thermal energy. This altered cycle will last until the temperature reaches the lower temperature limit T min .
Considering a large number of TCDs (as, for example, the quantity that can be found connected to a distribution feeder), these modifications on the thermostatic cycle of each TCD can imply on a very peculiar phenomenon that corresponds to the loss of diversity among the states of the TCDs. This means that, due to the alterations on the thermostatic cycle, there will be more TCDs (when compared to normal operational conditions) ready to execute their "on" cycle at the reenergization instant. This fact results in an increase on the power demand when the load is restored. The load level in this case can be much greater than the steady-state power demand. This characteristic is commonly associated to the post-outage behavior of aggregated thermostatically controlled loads and is illustrated in Fig. 3 (Agneholm, 1999;Mota et al., 2007a), that shows the actual behavior of a residential area, constituted by many TCDs, after a blackout of 3 h.
If this power peak is not considered during the load pick-up, it can cause serious operational problems that can even lead the system to a new blackout. In this context, this study is focused on the determination of the aggregated load in a feeder with significant penetration of TCDs, based on models that define the behavior of a single TCD. The proposed methodology can be summarized as follows: • Determination of an individual model for each type of appliance. In this study, the TCDs considered for modeling were refrigerators, freezers and airconditioners • Aggregation of the individual post-outage behavior of each appliance to obtain the aggregated behavior of a feeder constituted by many thermostatically controlled loads These models, implemented using object oriented programming techniques and the aggregation procedure are described in the following section.

Object oriented models:
Object Oriented Programming (OOP) techniques are very suitable to implement the individual models of the devices, since they value the physical modeling through the definition of a small number of classes (Rumbaugh, 1991;Mota et al., 2007b;Geetha et al., 2008;Aly and Abuelnasr, 2010). The behavior of a TCD is illustrated in Fig. 1 (normal operation conditions) and 2 (outage conditions) as mentioned before and can be described by Eq. (1) and (2) (Mortensen and Haggerty, 1990;Mota et al., 2007a).
In these equations: • T i is the device internal temperature at instant i • α is a thermal coefficient (cooling or heating), given in degrees per time-units • e i P is the active power demand of device e at instant i • m is a logical variable that represents the state of the device e. If m = 0, the device is turned off; if m = 1, the device is turned on • P on is the power demand of the device e when turned on • ∆t is the time interval between instant i and instant i-1 However, the coefficient α is dependent on the temperature difference between the device internal temperature T i and the external or environmental temperature T ext . To avoid the presence of this dependence in problem formulation, Eq. 1 can be rewritten as: where, α N is the normalized thermal coefficient, given in inverse time units (sec −1 , m −1 or h −1 ). Equation 3 can be used to describe the behavior of both heating and cooling devices, by choosing adequate values for the normalized thermal coefficient. So, although this study is focused on cooling loads (refrigerators, freezers and air-conditioners), the proposed methodology can also be applied to model heating devices, commonly used in non-tropical countries.
Using object oriented techniques, the individual models of freezers, refrigerators and air-conditioners were derived from a superclass named Thermostatically Controlled Device. The main characteristics of this class are represented in the diagram illustrated in Fig. 4.
The basic attributes (fields) of this class are: • α w : A double value that represents the normalized thermal coefficient of the device when it is warming-up (internal temperature rising), given in inverse time units (h −1 , m −1 , sec −1 ) • α c : A double value that represents the normalized thermal coefficient of the device when it is cooling-down (internal temperature lowering), given in inverse time units (h −1 , m −1 , sec −1 ) • T: A double value that represents the current temperature of the device, given in Celsius or Fahrenheit degrees (°C or °F) • T max : A double value that represents the maximum temperature of the device, given in Celsius or Fahrenheit degrees (°C or °F) • T min : A double value that represents the minimum temperature of the device, given in Celsius or Fahrenheit degrees (°C or °F) • T ext : A double value that represents the external temperature of the device, given in Celsius or Fahrenheit degrees (°C or °F) • P: A double value that represents the active power demand of the device at its "on" state, given in Watts (W) • t: A double value that represents the device current time (given in hours, minutes or seconds) The basic procedures (methods) defined in this class are: • Method "setTime": by using this method, it is possible to update the TCD current time (t) • Method "getState": this method returns the current state of the device (turned on or turned off) • Method "setReferenceTemperature": method responsible for the update of the TCD current temperature (T) • Method "getDemand": this method returns the power demand (P) of the device at its current time (t) Based on this superclass and on the mechanism of inheritance related to OOP techniques, one can derive other classes that correspond to different TCDs. The definition of these other classes through inheritance is illustrated in Fig. 5.
These classes have the basic functionalities defined in the superclass and also can use other methods that characterize each class individually. For instance, one can define that the "air-conditioner" class behaves as a TCD only during daylight hours; at night, its power demand is null. So, it is possible to define different classes to represent freezers, refrigerators and airconditioners. The classes correspond to containers that are used to define computational instances, the objects. These objects are the computational entities that really correspond to the electrical devices. For instance, in order to represent 100 freezers connected to the distribution system, 100 objects of the class Freezer must be instantiated. Moreover, OOP techniques make the definition of devices with different characteristics (all connected to the same feeder) an easy task. This allows the adoption of distinct values for the individual power demand and dynamic parameters for each device, even when they are instances (objects) of the same class. Based on this concept, another class was defined to determine the aggregated behavior of the thermostatically controlled loads. This class, TCD Feeder, is illustrated in Fig. 6.
The basic attributes (fields) of this class are: • P: a double value that represents the total power demand related to the feeder at its current time, given in Watts (W) • V: a double value that represents the voltage level related to the feeder, given in Volts (V) • FT (Feeder Time): a double value that represents the feeder current time, given in hours, minutes or seconds The basic procedures (methods) defined in this class are: • Method "setTime": by using this method, it is possible to update the current Feeder Time (FT) • Method "setInterruptionTime": this method permits to define the moment when the outage begins in the simulation timeline (given in hours, minutes or seconds) • Method "setInterruptionDuration": this method is used to define the duration of the outage (given in hours, minutes or seconds) • Method "aggregateDemand": once called, this method simulates the aggregated load behavior during the outage an in the subsequent instants The process activated by the method "aggregateDemand" is the basis of the aggregation methodology and is detailed in the following. The procedure consists of an iterative signal traffic among the feeder object and its corresponding TCDs objects. Each iteration of this traffic can be divided in two sequential stages. In the first, illustrated in Fig. 7-A, the current Feeder Time (FT) and its voltage level (V) are broadcasted to a set of TCDs. When receiving this signal, the TCDs update their internal states. This causes the update of all internal TCD variables, basically ruled by the dynamics defined in Eq. 1-3.
In the subsequent stage, illustrated in Fig. 7-B, each selected TCD sends the updated value of its power demand P to the feeder F. The feeder waits for all demand values and then aggregate them using Eq. 4.
A great advantage of this approach is the heterogeneous nature of the TCDs set. A huge number of different TCDs with very distinct dynamics can be aggregated using the signal coordination of a single feeder. Moreover, the TCDs with faster dynamics can be updated separately at a rate higher than the updates required by the remnant set of devices. This means that the updates signaling can be asynchronous. So, the computational burden associated to feeders with huge dimensions can be attenuated by breaking the TCDs set into smaller groups and then processing them one by one, taking advantage of the asynchronous updating characteristic.

RESULTS
In order to test the proposed methodology, simulations were made considering two hypothetical feeders containing different TCDs, named feeder F1 and feeder F2. Table 1 shows the TCDs parameters. Table 2 summarizes the composition of both feeders. The objective of these simulations was to observe the influence of two important variables, the outage duration and the environment temperature, on the aggregated behavior of the thermostatically controlled loads. These influences are described in the next subsections.
The internal temperature (T) of all TCDs was initially set as an uniform random distribution varying between T min e T max , for each class of objects. The default external temperature (T ext ) is 25 o C. The initial state (turned on or turned off) was also aleatory determined for each TCD. The simulation begins at 06:00 and finishes at 14:00 h.

Impacts of outage duration:
The first test condition corresponds to the simulation of outages with short duration (≤30 min), in feeder F1, starting at 10:00 a.m. Fig. 8 illustrates the aggregated behavior of the TCDs after outages of 5, 10, 20 and 30 min.
This Figure shows that the active power level at the reenergization instant is proportional to the outage duration. The greater this duration, the greater the power peak. In other words, as the outage duration increases, there is also an increase on the diversity loss among the states of these devices, i.e., at the restoration moment, more devices will be ready to start their "on" cycles, consuming nominal power and, consequently, causing an increase on the aggregated power level. α ω 8.10 −3 sec −1 ; α c 24.10 −3 sec −1 ; T max = 12°C; T min = 6°C; P = 50 W. Freezer α ω 5.10 −3 sec −1 ; α c 15.10 −3 sec −1 ; T max = -5°C; T min = -10°C; P = 80 W. Air-conditioner α ω 1, 7.10 −3 sec −1 ; α c 5.10 −3 sec −1 ; T max = 22°C; T min = 20°C; P = 500 W. The second test condition corresponds to the simulation of outages with long duration (>30 min), starting at 10:00 a.m., also in feeder F1. Fig. 9 illustrates the aggregated behavior of the TCDs after outages of 60, 90 and 120 min.
Comparing this test condition to the first one, a different characteristic can be noted in Fig. 9: a constant power plateau starting at the restoration moment. This plateau corresponds to the maximum power demand level and is caused by the total loss of diversity among the TCDs states (all devices turned on at the same time). It is important to observe that the duration of this plateau is also proportional to the outage duration.
As expected, the feeder power demand at the reenergization instant is much greater than its demand at normal operation conditions in both tested situations. This characteristic must be taken into account when planning the restoration process. Impacts of environmental temperature: This test condition, now in feeder F2, corresponds to the simulation of an outage of 60 min, starting at 10:00 a.m.. Fig. 10 illustrates the aggregated behavior of the TCDs considering different environment temperatures: 15, 25 and 32 Celsius degrees. From Fig. 10, it is possible to observe that the environment temperature influences the pre-outage aggregated load behavior. An increase on the temperature causes an increase on the steady-state power level before the interruption. This behavior was expected since the loads simulated are all cooling devices. Concerning the post-outage behavior, one can also observe that an increase on the temperature also implies on an increase on the plateau duration. This was also expected since the environment temperature modifies the thermostatic cycle of the devices and consequently is directly related to the diversity among the states of these loads and to the plateau duration (Adibi, 2000;Mota et al., 2007a;2007b).

DISCUSSION
From the obtained results, it is possible to verify that object-oriented modeling of thermostatically controlled devices, concerning its electrical behavior under blackout conditions, is an adequate approach that can yield satisfactory results. When compared to other techniques to assess the demand level during cold load pickup, the methods presented in this study permit the specification of external variables that can have significant impacts in the power level of restored loads.
Moreover, the aggregation procedure considers actual feeders structures and, in doing so, permits the evaluation of all electrical variables related to electric power distribution, as voltage levels and feeders topological configuration.
The devices specification is flexible and userdefined; so, cooling and heating devices can be defined in the same computational environment and may have different influences of external variables. The approach can be easily extended to larger electrical distribution networks, with several feeders and encompassing different geographical areas.

CONCLUSION
In this study, a methodology to model the behavior of thermostatically controlled loads was proposed. This method allows the determination of the aggregated post-outage behavior of TCDs, based on object oriented programming techniques. Simulations were carried out considering two hypothetical feeders with a large number of TCDs. They satisfactory agree with field measurement data presented in the literature (Adibi, 2000;Agneholm and Daalder, 2000;Mota et al., 2007a;2007b). Furthermore, the obtained results permit to observe the influence of the blackout duration and of the environment temperature on the aggregated behavior of these devices. The differences among the resulting load curves enforce that these impacts, when considered in the development of restoration plans, provide critical insight in the future behavior of a feeder and then can be used order to avoid inadequate load pick-up.
Finally, object-oriented programming has proved to be a suitable approach to model individual thermostatically-controlled loads, permitting the inclusion of specific physical parameters in the individual objects that form a feeder and also the propagation of environmental variables that affect all the objects in the same feeder (such as the temperature or the blackout duration) in the same computational paradigm, in a simple and efficient way.