A NOVEL MODEL FOR SMART GRID AS A NETWORK OF NETWORKS WITH HYBRID COMPOSITE CROSS LAYER DESCRIPTION

Original scientific paper This paper is an effort towards constructing a comprehensive model for the smart grid as a network of networks with the ability of evaluating events in presence of every smart grid feature. To this end, the network modelling laws are employed to attain a proper structure for the model, the automata theory is used to explain the performance of the proposed model, and the hybrid function theory is utilized to define an appropriate mathematical description for it. By evaluating the smart grid cooperative processes, and determining the role of special smart grid features in these processes, a six-layered hierarchical structure is chosen. Each layer of this structure is considered as an automaton and its autonomous performance is described by a hybrid function, mathematically. The composition of these six hybrid functions introduces the final formulation of the model. To verify the suitability of the proposed model the mechanism of the smart load management strategy is captured.


Introduction
The main goal of a smart grid is to achieve a perfect power system by providing new digital technologies, utilizing economic incentive programs, and sending control signals to its active members.The realization of this goal is possible in the presence of bidirectional communication infrastructure which revolutionizes the smart grid to an integrated infrastructure of computation, networking, and energy exchange.This can be called internet of energy [1].In such an integrated power system, the model-based studies will be very helpful to make a correct decision when an event occurs.The utilized model should derive conditions for an optimal operation of the grid in such a way that all physical constraints are satisfied.Also, it should capture the implemented strategies and the intelligent behaviour of the smart grid members comprehensively.
The smart grid has been widely studied from the various aspects in the literature.Given the power system reliability, in [2] and [3], this preliminary concept was discussed in the presence of smart grid resources.Similarly, the quality of the power delivery as a critical characteristic of the smart grid was discussed in [4].In [5], the authors conducted a study on supporting the quality of voltage by controlling the intelligent feeders and active loads in a distributed way.Some studies on the smart grid strategies Demand Side Management (DSM), Demand Response (DR), energy and load management programs were presented in [6 ÷ 10].Some smart grid programs, which are useful in emergency conditions and can prevent outage and unplanned load shedding from happening, were investigated in [10,11].In [12] and [13], the roles of storage batteries and Distributed Generation (DG) in improving the restoration process were discussed.
Recently, two-way communication, as a fundamental infrastructure in the smart grid, has attracted several researchers, directly or indirectly.Considerable research has been conducted on this infrastructure and its related issues.Advanced metering infrastructure [14], data transfer security [15], controlling the data traffic [16] and communication latency [12] are attractive topics in this infrastructure.
Additionally, the communication technologies and some required practical standards are important concepts to be concerned [17].
The reviewed research has mostly investigated the smart grid problems from a limited perspective that considers a limited number of smart grid strategies.In other words, the available studies in the literature obtain a solution method for implementing a smart grid strategy without incorporating the influences of other objectives at the same time.It may lead to achieve a non-realistic solution and decrease the reliability of the proposed method.To overcome this problem, smart grid should be studied using a comprehensive model including all the features of smart grids.Unfortunately, model-based studies have received little attention in the literature.Recently, in [18] and [19] two conceptual and physical models were proposed, but, there has been no study to present a well-structured model with a proper mathematical formulation.Furthermore, to the best of our knowledge, no much research evaluates the smart grids using a mathematical reference model with the ability of considering all features of the smart grid simultaneously.Such a model guarantees the applicability and optimality of the results.In this study, a comprehensive well-defined and well-structured model for smart grid is proposed which investigates the smart grid problems in presence of smart grid strategies together.At the same time, an appropriate mathematical formulation is introduced to describe the performance of the proposed model in general manner which gives a wide degrees of freedom for adjusting the parameters of the proposed model to the studied problem.To this end, some knowledge and techniques from other disciplines are applied innovatively to the smart grid.More specifically, considering the network characteristic of smart grid, we used networking modelling laws from computer science, automata theory from theoretical computer science and hybrid functions from mathematics to construct the proposed model.
According to the network nature of the smart grid, the cross-layer design phenomena as a method of building the network systems in computer science is used to construct the structure of the smart grid model.To this end, the OSI model, which was designed in [20] as a network model for open system interconnection networks, is considered as a guidance example to illustrate the steps of the network model designing clearly.To reduce the complexity, smart grid strategies are divided into various smaller and simpler objectives, namely, the design of several layers.Regarding the important aspects of smart grids including communication, economic, automatic control and security, the structure of the network model is designed including six layers.
The proposed network model describes the performance of intelligent electronic devices in the smart grid including monitoring the environmental status, evaluating the sensor measurements and deciding to conduct various tasks autonomously.Pursuant to the intelligent behaviour of smart grid members, each of the introduced layers of the proposed model is considered as a virtual finite state machine with some logic variables and a function selector, which investigates the variables and automatically chooses a particular task to be conducted.Due to similarity between the performance of layers in the proposed model and hybrid automata, the performance of layers in the proposed model is modeled using the automata theory and defining some relative parameters: variables, sets, and actions for each layer.Considering the defined parameters, the mathematical description of the responsibility of each layer in the proposed model is formulated as a general function that is made up of two or more individual functions, each with own condition to be performed.From the mathematical perspective, such functions belong to a specific category of functions, namely hybrid functions.The final formulation is introduced using the combination of hybrid functions that refers to mathematical description of the relation among layers.To verify the suitability of the proposed model, the mechanism of the Smart Load Management (SLM) as a case study is captured in details.
The remainder of this article is organized as follows.The smart grid characteristics are described in section 2. Section 3 illustrates the smart grid layered model and describes the defined services in each layer separately.Mathematical definition of the model is constructed by introducing a hybrid composite cross layer model in section 4. The suitability of presented model is verified in section 5. Finally, section 6 provides conclusions.

Smart grid characteristics
In this section, some important smart grid features are discussed and highlighted.Identifying these features is a preliminary objective of the smart grid modelling process.
Considering these new technologies and management algorithms in smart grids, the intelligent control is distributed in every component level of smart grids that leads to major evolutions and various useful features appear.Some of the common smart grid characteristics have been presented in [21].These features offer many benefits to utilities and consumers and cause big improvements in energy efficiency.According to the smart grid features, utilities use two-way communication technology and computer processing in every component level based on the implementation road maps and practical policies designed by aggregators.In such a modern power system, given the continuously available online sensor measurements, intelligent electronic devices, which are automated and computerized, cooperate together as agents to make correlative decisions and keep the grid in its optimal operating condition automatically.In other words, smart grid as an integrated system includes intelligent agents which communicate with their environment to receive network information and cooperate together based on the utilities' policies to achieve the smart grid features.The performance of the intelligent electronic devices is investigated in this work without considering the role of aggregators that design the operating policies for agents based on the government strategies.Fig. 1 illustrates the agents' performance, when they cooperate together, take more actions and move among operating statuses.This figure demonstrates our perspective about the position of aggregators.
Figure 1 The behaviour of an agent Indeed, aggregators perform in a higher level than the agents because they design the state-actions for each agent and define the condition to move from one state to another.This study focuses on the lower level and aims to propose a comprehensive model to explain the performance of each intelligent device in smart grids in presence of all smart grid features.

Aggregators design some policies for agent actions in a higher level
Agents cooperate in a lower level In this section, it is illustrated how an appropriate structure for the smart grid model is design which meets its high level of complexity, correlation and intelligence.The structure of the proposed model and the natural characteristics of the smart grid should be compatible.

The layered model introduction
Smart grid is a network of fully interconnected devices that is naturally made up of a combination of several fundamental infrastructures including economic infrastructure, communication network, managing infrastructure and power network.Hence, the basic concepts of networking such as layers, protocols and interfaces [20] can be considered in the smart grid.According to the network design methodology, to reduce the complexity of the smart grid model design, the proposed model is organized as a stack of layers, each one built upon the one below it.In this study, the OSI reference model is considered as a guidance example to explain the procedure of a network design.
In the proposed layered model, the number of layers, the name, contents and the functions of each layer are identified based on the smart grid objectives which are divided into several smaller and manageable design problems.The purpose of each layer is to offer certain services to the higher layers, shielding those layers from the details of how the offered services are actually implemented.Since the cooperation of layers in the model addresses the smart grid functions, the number of layers in the proposed network model should be introduced such that during their cooperation energies and loads are managed in an optimal and economic way using advanced computerized control algorithm and bi-directional communication technologies.Furthermore, the number of layers should be large enough that distinct functions need not be thrown together in the same layer out of necessity and small enough that the architecture does not become unwieldy.The structural layers are created by allocating particular services to them.These services are introduced based on the roles of each layer in the model.After that the presented layers are arranged in a well-defined ranking.This arrangement of layers indicates their communication and reciprocal influences.

Figure 2 The virtual layers of proposed model
As it can be seen in Fig. 2, the structure of the proposed model consists of six distinct fundamental layers.The number of these layers and their names are defined on the basis of smart grid features, characteristics and important objectives: two way communication, control, secure and asset management.These layers are arranged such that the model is enabled to illustrate the smart grid strategies via the cooperation of layers.Regarding the points of the proposed model new concepts are introduced by the following definitions.
Definition 1 (User).A user is an active smart grid participant that operates intelligently in the network.
Definition 2 (Services).Each layer is equipped by a set of predefined actions, namely services, that enables the layer to perform its responsibilities.

Identifying layers in the model
In the following, the layers of the proposed model are presented by defining their services in a general way, considering the mentioned definitions.

Application layer
This layer is a direct interface between the model and users.It contains common services and various protocols to support the user requirements.
Assumption 1.We assume that when an intelligent agent decides to conduct any activity automatically, it enters its requested application into the layered model.
Based on this assumption, every intelligent device is a user of the smart grid model without considering its situation in the power system.Therefore, when an agent operates in the transmission domain, distribution domain or consumer domain, it enters its request into the model via a similar way.The first layer is equipped with welldefined protocols to support these requested applications based on the situation of the user.Defining these protocols can be conducted ad hoc and be considered when a layer is studied internally.

Economic layer
Some smart grid strategies depend on the market clearing price such as demand response, demand side management, and energy management program.This layer considers the role of economic factors like energy price and load priority, financial incentives (e.g.premium contracts) and motivation programs (e.g.dynamic pricing, time of use pricing).The market structure (i.e., real time, day ahead) and the pricing and billing tariff are considered in this layer because they are effective factors in the future decision making and management processes.

Communication layer
The smart grid requirement to higher degrees of network connectivity is satisfied by two-way communication.In the proposed model, the responsibility of the communication layer is defined as real-time monitoring, online measurement, and gathering the information from all over the grid.

Security layer
This layer provides security for smart grids.Definition 3 (Security).The security is a collection of knowledge, solutions and standards related to the secure performance of the power system and the cyber security of high degree of connectivity in smart grids.
Two-way communication system and the electric power system are two important infrastructures of the smart grid that both of them must operate in a secure condition to guarantee smart grid satisfactory performance.First, the security solutions can be utilized for each portion of the smart grid communication networks.If this security approach is implemented incorrectly, it leaves utilities open to cyber-attacks.Second, the security approach can be performed in electric power system to provide a secure environment and avoid physical damage.To provide the secure condition in the power network, the operating constraints (i.e.voltage and current limitations) should be controlled.

Control layer
This layer is the decision centre of the model that determines the autonomous behaviour of each agent in every smart grid situation.The control layer is equipped with various decision making algorithms to optimize the agent performance and satisfy the operating constraints.This layer receives its required network information through its above layers.

Physical layer
This layer is hardware oriented and consists of the information path and the energy path through the feeders, substations, relays, switches, customers, DGs and etc.In other words, this layer is the traditional power system in presence of new digital technologies and the smart grid resources that is capable of transferring the mixture of energy and data through the elements and delivering this admixture to the receiver as it has been illustrated in [19].Definition 4 clarifies the concept of transfer channel in smart grid in the presence of communication system in electrical power grid.
Definition 4 (Transfer channel).The transfer channel in the smart grid is a collection of ways that information signals and the electricity transfer through them.Sometimes, data transferring and power delivery is performed via a common path.
According to the hardware nature of this layer, there are some physical constraints which limit its operation.To reduce the complexity of designing procedure, the satisfaction of the physical constraints is allocated to other layers as their services rather than be embedded in the physical layer.Thus, the predefined service determined for the physical layer is to just transfer the mixed signal contains the data and electrical power components through a transfer channel.

The proposed model specifications
The suggested model is a comprehensive model that is used in any smart grids to explain the smart grid operational capabilities and intelligence.It supports practical standards and protocols to develop a secure condition for interoperating vendor free intelligent devices in the energy domain, information domain and among both of them.With the assistance of well-defined regulations, standards and protocols, the proposed model is capable of extending on every smart grid.Practical studies and some applicable standards and communication technologies in the smart grid were reviewed in [17].In this study a network model for smart grid is developed without introducing the necessary protocols.

A mathematical description of proposed model: Hybrid
Composite Cross Layer Model (HCCL) In this section, a mathematical description for the proposed cross layer model is introduced with considering the intelligent abilities of any member of the smart grid, and the variety of tasks which are allocated to each layer of the model.This section first presents some basic definitions and then develops the mathematical description of the smart grid layered model.

Definitions and notations
Notations.In the following, some notations are introduced which are used in the subsequent sections.A notation (•) as an operator is adopted to define the operating a hybrid function on another single or hybrid function.For instance, the Eq. ( 1) explains how a hybrid function operates on another function as its argument.Another notification that is introduced here is "↓".This sign is used to show the conceptual inverse of a hybrid function based on the operating point of view.For instances, the equation f=g ↓ means that the function f interprets the output of the function g based on its domain and predefined rules.
Functions.In the following, the concepts of a hybrid function and a hybrid composite function are given.
Hybrid function.A function constituted by multiple sub-functions.Each constituent sub-function is applied to a certain interval of the main function's domain.
Hybrid composite function.Operating a hybrid function on another function as one of its argument constructs a hybrid composite function.
To give the readers a clear sense, a hybrid composite function is given as follows.
where the function g i is the i th sub-function of the definition of the hybrid function G, X denotes the input vector with dimension k, D G ij represents the j th subset of the domain of g i , ∏ k j=1 D G ij represents the product of k subsets to introduce the domain set of g i , R gi denotes the range set of g i , N G is a set of some integer numbers, and n G is the number of sub-functions which the hybrid function definition is consisted of, and x j denotes the j th component of the input vector.
The second function, namely H(.), which is a single input hybrid function is defined as where the function h i is the i th sub-function of the definition of the hybrid function, D i H and R i H represent the domain and the range sets of h i , N H is a set of some integer numbers, n H is the number of parts of the definition of the hybrid function H.
The composition of two hybrid functions, namely G(.) and H(.) is given as As it is described in Eq. (1c) the range of the function H(.) has an intersection with at least one sub-set of the domain of the function G(.).
Variables.A variable is a parameter which a layer may receive from its previous layer as its input, or may have knowledge about it internally, or may send it to the next layer as its output.
Sets.The collection of some variables or some objects constructs a set.In this study, various sets will be defined as variable set, action set, and function set.

Automata models and hybrid functions
A mathematical model for the smart grid is constructed in this subsection.First, each layer of the model is considered as an automaton and its duty is modelled by identifying some independent sets of variables and actions for this automaton.Then, the performance of each layer and the layers' relationship are described mathematically using the hybrid function theory.
Regarding the various autonomous performances of intelligent electronic devices in smart grids, each layer of the proposed network model is considered as a finite state machine with some services as its dynamic operation which can be described by utilizing automata, if-then-else and propositional rules.Therefore, automata models as general ways of describing real systems [22] are used to model the performance of each layer by defining some logic variables (states, inputs, and events) and various functions based on the smart grid strategies.
According to the multiplicity of services in each layer, the mathematical description of the performance of each layer is introduced using a hybrid function theory.
To this end, a general function is identified for describing the performance of each layer mathematically such that each service is formulated as a sub-function.During this definition, the input, output and internal sets of variables, and internal and output actions of each automaton are considered to develop the domain and range of this hybrid function.In other words, according to an action which the agent decides to conduct, some predefined services in each layer of the model are activated.Finally, considering the hierarchical relation between layers, the composition of these hybrid functions presents the mathematical formulation of the layered model.This Hybrid Composite Cross Layer (HCCL) model is identified generally which can be reformulated in details ad hoc.

Hybrid composite cross layer model
In this section the mathematical model is introduced.

Each layer as an automaton
In the following, by considering each layer as an automaton, some useful sets of variables and actions are presented as (X, Y, Z, H, O, t 0 , F i ) where X, Y and Z are disjoint sets of the input, internal and output variables.Each layer has various variable sets which are different from other layers and should be identified separately.For instance, our proposed model has six layers and each layer has special input, internal and output variable sets that are identified based on the capabilities of each layer.Eq. ( 2) gives union of the input, internal and output variable sets of all six layers.where X i , Y i and Z i denotes the input, internal and output variable sets of the i th layer.
H and O are disjoint sets of the internal and output actions which are different from one layer to another.Since each layer performs dedicated functions, it is equipped with some rules and strategies to perform its responsibilities.The category of strategies, which determines how each layer performs its internal duties, constructs the internal action set in each layer.Besides, the collection of rules that introduces how each layer communicates with other layers establishes the output action set.The union of these two sets, namely S i , constructs the service set of the i th layer illustrated as where S i denotes the service set of the i th layer, and H i and O i denote the sets of the internal and output actions of the i th layer, respectively.t 0 is the time that an application is requested by a user.It is similar to a start time of a process.
F i is the i th hybrid function and may be defined as function of decision making, setting parameters, optimization, or physical operation.
Using the introduced useful sets, variables and actions, a hybrid function F i describes the services of each layer as where i denotes the layer index, f ij denotes the mathematical model of the j th service of the i th layer, M i is the number of functions that denote services of the i th layer, F i represents a hybrid function which explains the services of the i th layer, Ν denotes a set of all integer numbers, and N L denotes a set of some integer numbers.
Considering the hierarchical structure of the cross layer model, the output variable set of each layer is the input variable set of the next layer as Z i−1 = X i .Hence, the domain set of the proposed hybrid function related to a layer has an intersection with the range of the hybrid function that identifies the previous layer performance.Notably, in the proposed model the first layer is excluded from this discussion.The input variable set of the first layer is introduced based the applications that are requested by a user of cross layer model.There is no layer above the application layer so the Eq. ( 4) defines Z 0 as an empty set and X 1 as a non-empty set.The output variable in each layer is provided after performing the internal actions H on it.In addition, each layer sends its output to the next layer by implementing a set of output actions O.The Eq. ( 4) considers this mechanism when it defines the range of the hybrid function related to each layer.Fig. 3 shows how the layers communicate with each other and how this communication is modelled mathematically.Furthermore, this figure illustrates the relation between hybrid functions that are represented in Eq. (4).

HCCL model from the sender perspective
In the proposed cross layer model, the structural layers cooperate together hierarchically.In other words, each layer communicates with the layers placed below and above.From the mathematical view, it can be concluded that the hybrid function related to each layer operates on the defined function of the previous layer as its argument.Thus, as it can be seen in Fig. 3, the final mathematical model that describes the performance of the sender agent is constructed by composition of six hybrid functions as: where X 1 denotes the first layer input variable.

HCCL model from the receiver perspective
In the receiver agent, the layers of the proposed model communicate with each other in an inverse direction.In this intelligent device the physical layer receives the provided mixed signal from the transfer channel.Then each layer of the model retranslates the operation of the peer layer in the sender and sends the result to its above layer.Similarly, the next layer repeats this function based on its predefined protocols and services.In other words, in comparison with the performance of the peer layer in the sender model, each layer of the receiver model operates on the entered entity inversely to discover the primal data which the peer layer performed its active services on.The performance of the layer in receiver agent model amounts to translating the performance of its peer layer in the sender model.To describe this translation mathematically, a new operator is defined in subsection 4.1.that denotes the conceptual inverse of the hybrid function operator.Hence, the final mathematical model which describes the receiver abilities is similar to the sender, while the conceptual inverse of each hybrid function is replaced in the model as where φ 6 denotes the input parameter of the 6 th layer (physical layer) of the receiver model, and G i is the conceptual inverse of the hybrid function F i .
According to the general form of the defined hybrid functions, the proposed model is able to be used in every smart grid studies.So, according to any subject examined in the smart grid, the define parameters and functions of the model are identified exactly.

Model verification
In this section, to verify the validity of the proposed model, a popular smart grid strategy, which was considered in references [6], is re-analysed from the view points of the proposed model.To this end, the roles of each of the six layers are discovered sequentially and the general HCCL model is re-formulated in details.
Smart load management (SLM) is a smart grid strategy for controlling loads in an optimal manner with the objective of loss reduction used in [6] to coordinate Plug-in Electric Vehicle (PEV) charging from a limited perspective.Loss reduction as a smart grid objective has been only considered in [6] and other smart grid features such as uncertainty in loads and renewable generations are ignored, while the proposed model considers them simultaneously.In the following, first, the SLM subprocesses are explained using the proposed cross layer model.Then, its mathematical model is expressed in details and the simulation is considered.
When a PEV owner plugs its vehicle into the charging port, the process is started and the smart charging port, as a sender agent enters its request into the layered model from the application layer.Here, the performance of the smart charging port is investigated modelled by using the HCCL model.To this end, the performance of each layer is represented by defining a hybrid function and its relative parameters.The composition of these hybrid functions introduces the final smart grid model.Furthermore, the performance of a receiver device which is a switching device placed behind the changing port is investigated using the HCCL model.

Presentation of the layered model
The proposed network model is presented in this section considering each layer as an automaton.

Application layer
The application layer is an interface between users and the layered model.It categorizes some rules related to each entered request.In this case study the entered request is related to the PEV battery charging process.Therefore, the set of variables and actions in this layer are defined according to this request.The input variables of this layer consist of important parameters such as: the time that charging is requested, the geographical situation of the charging port, and the amount of power demand.The vector of input variables is defined as follows.


 , , , , , where x 11 =t 0 denotes the time that the charging is requested, x 12 is the GIS location of the smart charging port and its domain (distribution or consumer), x 13 represents the type of the entered request, and x 14 determines the amount of the power demand that is equal to d(t), t>t 0 .
After recognizing the type of the entered request, the application layer introduces some output variables and sends them to the next layer.Due to the variation of energy tariff during the special time periods, the starting time of charging process is an effective factor for triggering some services of the economic layer.Thus, the GIS location of the charging port is considered as output.The internal and output variables are introduced as where η denotes the numerical parameter as a code which is allocated to identify the charging PEV batteries as the requested service, and x 11 * and x 12 * represent the saved values of x 11 and x 12 , respectively.
The application layer performs its responsibilities via conducting some actions.It saves some important input parameters, and allocates a number to a numerical parameter η to identify the type of the requested application as its internal actions, namely H 1 .Moreover, the application layer sends its output variables to the next layer as its output action, namely O 1 .In the following an internal and output action sets are defined.

 ,
, where h 11 ='*' denotes saving a parameter as an internal action, and h 12 denotes allocating a number to the numerical parameter η as a code to denote that the entered request is a PEV charging process.
The following equation represents a hybrid function that describes the first layer activities mathematically.This hybrid function allocates a number to parameter η based on the type of the variable x 13 as:

Economic layer
The type of the power market and the market clearing price are important factors in the economic layer.For instance, as it was shown in [6], the electricity tariff is changed during some periods, so the popularity of the PEV charging process varies in these periods.Considering the expert based acknowledgment about the behaviour of the PEV owners, the charging process popularity depends on the price tariffs and the implemented economic programs.This layer triggers some financial programs by considering its input and internal variable sets.It receives the output of the previous layer as its input variable which is represented by the following equation.Also, this layer has some internal variables such as the subscription options of charging time zones, the power market structure, and the method of determining tariffs., where X 2 denotes the vector of input variables of the economic layer which is equal to the output vector of the previous layer.
The following equation identifies the vector of the internal variables.
where y 21 denotes the electricity tariff at time t 0 , y 22 denotes the category of economic programs which the sender device participates in.The notation y 23 represents the structure of the power market, y 24 denotes the expert based charging data, and y 25 is a cumulative uncertain parameter which represents the impact of another request that enters the model at t 0 on the services of this layer.
According to define sets and the responsibility of second layer, the output variables are considered as where z 21 presents the priority of charging PEV based on the expert based data, and z 22 denotes the time frame that charging is allowed by considering economic programs.This layer performs a series of internal and output actions to achieve its goals automatically as an automaton.In the following the internal and output actions are represented, respectively.programs.economic related the Triggering : where o 21 denotes the set of economic programs that should be triggered, and o 22 represents some useful rule based sets to identify the priority of charging time periods.

Figure 4 Fuzzy sets
The internal rules give the economic layer a predicted amount of power demand based on the popularity of charging PEV batteries in various periods.Thus, this layer identifies three fuzzy sets to allocate a level of priority to any hours of a day based on the predicted amount of charging demand.These fuzzy sets present the grade of membership of each time to the high priority time interval, average priority time interval and low priority time interval.These degrees of membership are quantified by introducing three separated membership functions which are shown in Fig. 4. The economic layer introduces these fuzzy sets based on the billing tariff as its service as: sets.Fuzzy : In [6] the determination of power loss is investigated in some scenarios for PEV charging without considering these fuzzy sets.

Communication layer
This layer collects up the data from all over the grid, as its internal variables, by real-time monitoring and continuous measurement.This layer joins its internal data and its input variable as its internal action, and then sends them to the next layer.The performance of this layer is described mathematically via the hybrid function F 3 ., : where F 3 denotes a hybrid function that attaches some information to the input variable, Y 3 denotes the existing information about the power grid, Z 3 represents the output variable which is sent to the next layer, and finally O 3 and H 3 denote the sending ability as an output action an some internal actions respectively.

Security layer
The security layer is responsible to provide the secure condition for operating the communication network and the power system.It is equipped with some internal variables and internal actions.The predefined internal variables namelyY 4 , include the allowable limitations for power system parameters, such as the allowable maximum and minimum magnitude of bus voltages.Using these internal variables, security layer achieves its goal by performing some internal actions, namely H 4 .These internal actions consist of some rules to check the existing physical limitations in the grid which are the appearance of the power flow modelling.In other words, maintaining these limitations, points to adhere the power flow limitation.If none of these fundamental concepts are considered, the proposed model is not realizable.The following equation describes this layer performance as where f 4j denotes the special duty that must be conducted when a constraint is violated, M 4 is the number of rules that determine the services of the fourth layer, U min and U max represent the minimum and maximum allowable bus voltage, I min and I max denote the lower and upper bounds of line current limitation, and Cap max denotes the maximum existing free capacity of a transmission line.
It is worthwhile to emphasize that, the important role of communication layer and security layer appears when the decision making is performed according to the realtime data and the online situation of the grid performance.

Control layer
The control layer receives the output of the previous layer and detects the type of the solicited application and makes a suitable decision to optimize the behaviour of the intelligent device considering the peak shaving and loss minimization as well as operational constraints.The mathematical description of these responsibilities is explained in Eq. ( 20) as well as [6] to show that the HCCL model can support the existing study.From the HCCL model view, selecting the suitable and relative optimizers is the internal action of this layer which is presented by H 5 .The control layer is internally equipped with pre-defined optimization function categories as its internal variables which are related to any requested application separately.Based on these categories, it selects a suitable mathematical model.This selected mathematical model considers the physical laws related to power system and the power flow equations as where j denotes index of each sub-function of the hybrid function F 5 , Ν denotes the set of all integer numbers, f 5j denotes the selected objective function which is related to the entered request, M 5 is the number of functions that denote services of the fifth layer, d(t) denotes the power demand at time t, P loss h represents the power loss at hour h, D max is the maximum allowable daily peak demand, and D(h) denotes the total consumption at hour h.

Physical layer
This layer is responsible for transferring the mixed provided signal from the existing channel to the target actuator.This mixed signal is the result of operating the combination of all functions represented by Eqs. from (7) to (20).The physical layer receives its input variable from the previous layer as where Z 5 denotes the output variables of the control layer which includes some components such as the provided controlled data-energy signal, the target actuator address, and the information about the environmental situation.This layer is equipped with a predefined list of addresses, paths and channels and their situations as its internal variables.
where F 6 gives the behaviour of the physical layer includes receiving the entered signal, and sends the result to the target actuator.

The complete HCCL model
Regarding the existing relation between layers, that each layer offers some services for the next layer, the final mathematical model was constructed after combining six independent hybrid functions as where F i denotes the hybrid function related to the i th layer, and X 1 denotes the requested application.
Regarding the SLM strategies, an intelligent receiver agent is a switching device placed behind the smart charging port.It gives the provided signal from the channel via its physical layer and retranslates it to decide whether the electrical energy delivery must be stopped or not.According to the proposed model, the receiver conducts its services inversely because it tries to know the meaning of the received mixed signal.From the mathematical perspective, the services of each layer in the receiver model are formulated as an inverse of the hybrid function related to the corresponding layer in a sender model.Thus, the final model is introduced by combining all inverse hybrid functions related to the layers from bottom of the designed stack to its above layer as

Verify the advantages of the proposed model
For the seek of comparison, the coordination of PEV chargers is investigated using the HCCL model for 46 % PEV penetration which is explained in [6].In this work, the online measurements and their possible variation, which are available according to the performance of the economis layer and communication layer, is used during the decision making instead of the historical load pattern which is utilized in [6].In this work, the possibility of the uncertainty in loads is modelled by the second layer of the proposed model as a fuzzy description with considering the possibility of ±15% variation in the monitored measurements.Using this prepared data the fifth layer of the proposed model obtains a charging program demonstrated in Fig. 5.
As can be seen, in comparison with [6], due to the possibility of the load variations, the obtained result allows the high priority PEV owners to charge their PEVs at the next possible hours to avoid any operating constraint violation.If the coordinated PEV charging explained in [6] is implemented to the sample distribution system in presence of the uncertainty in loads the voltage constraints are violated in the power system and also the power loss increases.Because the smart grid study presented in [6] focuses only on decreasing power loss during the PEV charging process using the historical load patterns and ignores the uncertainty in smart grid which is available due to the probabilistic nature of distributed generations and load variations.However, the proposed HCCL model considers all the smart grid features simultaneously.Therefore, its obtained PEV charging program is applicable in real world smart grids.

Conclusion
Most of the smart grid studies have introduced a method to implement one of the smart grid strategies without the consideration of other smart grid objectives simultaneously that may lead to obtain not applicable results.To guarantee the applicability and reliability of the obtained results, the smart grid studies should investigate problems through a comprehensive framework which considers all the smart grid features.To this end, in this study a general model is introduced for smart grid including all strategies in a hierarchical layered structure.
At the same time, a general mathematical description for the proposed model is constructed to describe the performance of each intelligent electronic device in presence of all smart grid features.
Considering the network nature of smart grids, structure of the model is designed as a stack of layers to separate the fundamental infrastructures of the smart grid and decrease the complexity.Considering the power system automation and the variety of the smart grid functions, each layer of the proposed model considers as a virtual finite state machine which its autonomous performance is modeled using the automata models.The mathematical description of the proposed model is developed by assisting a special type of mathematical functions, namely a hybrid function.The proposed model is tested on a sample smart distribution system to manage the PEV charging process.The obtained results demonstrate the ability of the HCCL model.In addition, comparing the results with [6] emphasizes the robustness and reliability of the HCCL model.
Notably, the proposed mathematical model is in general form using various propositional rules which may lead to increase the complexity.Furthermore, the presented model is a network architecture without the consideration of the interoperability concept and required protocols.The future work presents a simpler and vendor free model considering suitable protocols for smart grids.

Figure 3
Figure 3 The relation between the hybrid functions

F
model of the operating smart port after receiving a control signal from the transfer channel, and  i denotes the conceptual inverse of the i th hybrid function.

Figure 5
Figure 5 Proposed SLM coordinated PEV charging to voltage constraint violations in presence of uncertainty SLM schedules PEV chargers at next possible hour That is, 61 denotes the list of the electrical paths, and y 62 represents the lists of the data transfer paths.This layer is responsible to receive the provided final mixed signal and send it to the target actuator.The physical layer selects a suitable path considering the physical constraints as its internal action, namely H 6 , which is denoted as follows.