Power Flow Management With Demand Response Profiles Based on User-Defined Area, Load, and Phase Classification

In recent times, the electric power management based on customers’ demand has drawn significant attention of smart-grid (SG) governors. The SG requires real-time management of dynamic load to maintain the quality of service (i.e., balance between supply and demand) by interfacing with users. In this paper, we propose an approach to respond to the active demand (AD) based on user-defined energy-management policy. An algorithm is also proposed for the smart-controller device (SCD) modeled with the load aggregator and connected to the customers. The total contracted load and the user ADs are determined based on area, load, and phase classification, which specify the individual energy consumption. The proposed scheme is implemented in MATLAB/Simulink using the load-information of the IEEE 30-bus system, and the feasibility is assessed in IEEE 13 and IEEE 34 node test feeder systems. By applying the customer’s controlled SCD device both the deficiency and redundancy of generation in terms of grid controllable load have been improved that lead the maximization of generation and distribution services. The voltage regulation and power factor of the particular area have been enhanced by integrating appropriate distributed generation and power factor improvement devices. The results garnered from the performance analysis show that the proposed scheme can optimize power generation based on the user-defined demand.


I. INTRODUCTION
In modern technology era, the demand for electricity is exponentially growing due to extensive developments of energybased devices. In particular, an increasing number of devices widen energy consumption, thereby escalating complexity, mis-interfacing in energy management, and growing energy waste. Therefore, co-operation among supplier, distribution authorities, and customers is necessary for improving generation and consumption volume. Forecasting the demand, supplying required power, controlling power generation, and reducing power losses have been appeared as essential requirements for a smartly controlled power generation grid.
The associate editor coordinating the review of this manuscript and approving it for publication was Jiayong Li. Some of the developed countries reconstitute the conventional power system architectures by deploying smart appliances, renewable energy resources [1], optimized operation utilizing customers' involvement, and real-time, automated, and interactive technologies that is termed as smart grid (SG). Consequently, more convenience has been drawn for both energy retailers and customers [2], [3]. However, alternation of electric load is a prevailing characteristic of power systems technology. It is challenging to estimate the load-type by analyzing outdated information. In addition, the dynamic characteristic of the customer's demand response enhances the massive dispersion between generation and consumption, which is a key challenge for the power distribution network (PDN). VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ At present, demand-side management [4]- [7] is considered as the most popular solution to mitigate this problem, whereas distributed generation (DG) improves the consumption profile and power generation and transmission for both the users and retailers. Different management and optimization algorithms in the function of economic dispatches, such as dynamic, dynamic with unit commitment, and static has been reported in [7]- [11]. For controlling SG operation, energy management [12]- [15] is an effective approach to perform via control centers through which the daily consumption volume of different types of distribution consumers can be obtained and configured based on area, diversity of users, load-type, and phase information. The demand response (DR) of SG has been developed based on load classification [16], [17], whereas the area specification was not enumerated. In addition, the load aggregation [18] and classification derived by end user was not accounted for analyzing demand response. In an SG, installed electric load categorization based on phase information through smart node is needed for proper load flow balancing, which was unstudied in [19]. In the recent studies [6], [20], [21], the energy management of multiple DG, such as micro-grid was presented, which is a sophisticated approach for DR stability. Their proposed model focused on total cost minimization by scheduling power exchange and trading between micro-grids and PDN, respectively. However, the collaboration among producer, distribution authority, and customers which is a crucial step for balancing generation and consumption [22], were not considered. Nevertheless, in [13], [15] unpredictable load demand without informing distribution substation operators (DSO) about their motive of changing DR was considered. In addition, increasing newly installed and automatic shifting appliances 23,24,25,26 are responsible for changing active DR of the customers. Moreover, load shifting due to reward and penalties [27] and scheduling electric vehicle [28] are also responsible for dynamic DR in an SG. In [29], the loadclassification algorithm based on individual information was described, which divides the customers into different categories in the function of the price scheme designed for DR. Therefore, the users are grouped according to their behavior [30] and consumption patterns [31]- [33]. In [34], the authors classified the residential users into different groups by considering individual electricity price schemes. On the other hand, in [35], the load data was classified based on the information entropy, piecewise aggregated approximation, and spectral clustering. However, power scheduling with SG, such as centralized [36]- [39] and distributed [5], [40], [41] approaches dealing with customers has been adopted to minimize costs. Therefore, to make balance between active demand and energy generation, the load control method [42] should follow customer's concerns. In [43], Gholinejad et al. presented the hierarchical energy management system of multiple homes where they made a collaboration among the home for balancing between energy generation and energy storing in terms of cost. However, most of the recent works skipped the collaboration with end-user (EU). In addition, the willingness to share data and information [44] of users and retailers with demand-side management [4] can play a crucial role in mitigating the existing problems in terms of economic dispatch [45].
From the literature review, it is found that there is no works reported in the SG systems so far that include communication between customers and generation authority about the generation and consumption profile provided by the EU. The [46] paper presents an autonomous and distributed demand-side energy management system among users that takes advantage of a two-way digital communication infrastructure that is envisioned in the future smart grid. However, their proposed communication infrastructure did not consider the types of information provided by the users. Furthermore, in [47]- [49], communication protocols between the users and grid authority were proposed deeming about frequent price updates and new challenges for DSM, that are completely different from our objectives. In addition, the SG models proposed so far that the energy management of EU along with DG do not considering the detailed network constraints, operating constraints associated with the customer's defined DR, and power management. Also, there is no study about the impact of such power flow management systems in the operation of standard grid systems with a large number of customers. Furthermore, the effect of such classification of customer's based on extensive category is not mentioned in any literature. To address the shortcomings identified in the presented literature review, an algorithm of smart-controller device (SCD) including all information is proposed in this paper to integrate into SG systems for collecting and providing information based on users' preference.
Customer's defined DR is a novel idea where users can change their contracted load, consumption and generation pattern, and power constraints under dynamic pricing in return of a monetary reward. Thus, it is conceivable to determine the load profile and generation profile at specific nodes of PDN. In addition, it paves the path of developing a new probability for approving the advancement of renewable energy sources and dealing with network constraints, which possibly elaborates many preferences, especially economic benefits to all users in the electric distribution system. In case of energy generation authorities, it is possible to maintain a high level of coordination, which is very important to balance the demand and supply while maintaining adequate reserve margins in terms of installing energy storage systems [50]- [52].
From the different literature, the aims of the smart controller devices include the control of domestic appliances [53] for decreasing the electricity cost and controlling the storage systems and consumption profiles to improve the demand response [54]. In addition, the controller devices are also used for improving power quality [55], [56] of the system. In [57], the micro-source controllers and load controllers are proposed that are responsible for the coordination with the micro-grid systems. However, the proposed architecture is based on the conception of contracted load and contemporary DR moderately delivered by the user. The memory-based programmable SCD, which is connected to the DSO and interfaced with customers, provides the incoming DR and contracted load to the system. In particular, SCD architecture relies on an algorithm that defines the assessment of customers and electric energy retailers. Therefore, the main objectives of the SCD are fourfold, such as 1) characterization of customer appearance, 2) accumulation of generation and of generation and consumption of customers, 3) consummation of DR and enumerate imminent demand, and 4) dispatch this information to the control center of the power grid via DSO and load dispatch center (LDC). Afterward, DSO gathers information from every node in this PDN that becomes increasingly indispensable when power generation from DG exceeds the consumer's DR. The generation of power, peak demand, base demand [54], and variation of demand are determined, which are the responsibility of DSO. Observation of the DR is strengthened to determine the estimated demand of customers. This activity is the main concept of demandside management, where DR is regarded as the key parameter of energy management [46], [58], [59]. For managing the demand of each EU, consumption and generation forecasts are developed. Also, the optimal power demand, massive generation of DG, and the anticipated operation of the power generation grid are taken as inputs of the new incoming active DR. Besides, it determines the user condition in the sense that it either contributes as a buyer or a seller. Getting input from the user, DSO expresses flexibility for both the consumer and the energy retailer. The major contributions of this study are as follows: • The proposed SCD classifies the user in extended category and sending their information to the grid control center via DSO. As the DR and the electricity tariff differs from different area, the users' location is also categorized in convenient regions such as residential, commercial, industrial, and institutional.
• The concept of the user is broaden from single role (consumer) to three role (consumer, retailer, and prosumer). The applied algorithm classifies load and phase for knowing the active demand of particular load and phase.
• A new mathematical model is presented for constructing active demand considering the shifting and changing of load conditions with time. Similarly, the generation profile (from DG) and consumption (by load) are developed.
• The SCD based SG model is implemented using the IEEE-30 bus system's data. Furthermore, the model is also implemented in IEEE 13 and 34 distribution test feeder systems, and the performance is evaluated. Section II presents the proposed smart grid architecture for user-defined energy management. Algorithms by which the system collects user's active demand data are proposed in Section III. The mathematical models are explained in Section IV. Section V shows the simulation results along with the impact of applying SCD device in PDN. Finally, Section VI concludes this research study.

II. PROPOSED SMART GRID ARCHITECTURE FOR ENERGY MANAGEMENT
Reliable data and instruments of SG for estimating DR are the indispensable parts in active distribution networks. Since DR provides the opportunity of shifting electricity usage by incentivizing with economic benefits, the users' proclamation will be very significant function for DR programs of the SG. For better perception, the SG architecture is presented in Figure 1, which shows a comprehensive power system network. In the proposed approach, different sections that accelerate the DR programs, such as generation, control and monitoring, transmission, regional grid substation, distribution feeder, EU, and DG are installed. Among these sections, EU and DG are connected to the LV bus bars through SCD. Power, information, and control lines are shown in this figure, where the electrical device of the SG network is connected by conductor lines. Load in this network is considered as an each user directly conducted with it.

A. SIGNIFICANCE OF CONTRIBUTING CUSTOMERS
Effective customer communication is an incontestable matter for user defined DR based SG. The purpose of this study is to address the grid to a adequate users' information by communicating with customers and drive the grid to the desired dynamic behavior. This addressed message and dynamic behavior are affected as a function of sensory data for determining the activity condition of the device in the SG, previously accumulated data, and users' proclamation demand. Now the question arises that why the architecture of SG and the cooperation with the EU are required to be updated. Therefore, we present the following influential reasons succinctly: • In conventional power grid systems, power is generated by a few central generators and carried to a large number of electricity consumers. Therefore, the stabilization between generation and consumption of power in terms of economic justification is mandatory. VOLUME 8, 2020 • The generation volume of a grid in terms of plant use factor and utilization factor according to the dynamic behavior of the customers is a fundamental requirement for the enhancement of smart grid technology. However, it is impossible to be acquainted with the active DR of individual customers for meticulously estimating the demand.
• Because of one-way communication, the information gap between the grid energy management system and customers exist in traditional power systems. Changes in the dynamic behavior of the customers are impossible to acknowledge to the DSO or grid energy management center.
• Despite having the prospect to participate in energy generation by DG, the customers cannot exchange power with existing systems in terms of business persistence due to the lack of coordination with the central production.

B. SCD-BASED SG ARCHITECTURE
For designing a dynamic SCD-based model, power source, dynamic load, and DG are consolidated. The installed SCD replaces conventional energy meter of power generationdistribution network. The paramount roles of the customers are categorized based on their services as follows: electricity a) dealer, b) consumer, and c) prosumer. On the other hand, the authority of power generation-distribution deals with customers by maintaining economic policies for the supply and demand of energy. The consumers who are interested in supplying power to the main grid are called prosumers in our proposed bi-directional system. They rely on electricity dealers to deal with the energy authority for contributing in energy generation. Electricity consumers are engaged in energy consumption from the grid without concerning anything instead of monetary transactions. On the other hand, the prosumer contributes to all interconnected grid systems by producing power for monetary profit. The exchange of power generation varies in accordance with the function of DG setting, load setting, and consumption profile. In Figure 2, the SCD architecture that performs diverse types of works is shown, including programmable feature, demand and DG generation information, getting sensor data, tariff and real-time pricing, storage of users' information, generating a control signal, and collected data from users about their contracted load profile. The LA divides the existing load into different categories to make a list based on the phase information. Customers define load specifications before contacting with the system for updating their load profiles. Under substation, the SCD will inform them to compensate for the percentage of lagging or leading reactive power in each phase.
In this SG architecture, user load and DG are connected to the systems through SCD, which has an access to the cloud server. Finally, the authority of generation and distribution systems will be involved with all participators on the basis of financial policy and will analyze the data given by SCD. However, the principle advantage of the proposed SCD device are, a) it classifies the inputs acquired from the users based on phase and various load specifications, user contributions, and area specifications, b) it aggregates the active demand response and distributed generations to estimate the actual demand response, c) it coordinates the distributed generation and contracted appliance to improve the power factor and voltage regulation, d) it takes input from the user considering a sudden change of contracted load and distributed generation, and e) finally, it sends the user information to the generation authorities via distribution feeder, distribution substation, and grid substation.

III. PROPOSED ALGORITHMS FOR SCD
The proposed SCD algorithm aims to obtain information from the user's demand across the power system network for balancing demand and supply. In this section, the implementation of the load contracted algorithm is elucidated, where users may have many types of load regarding their demand perspective. Moreover, existing and user-defined newly contracted load information are formulated, which are characterized as single-phase and three-phase, respectively. However, it is worth mentioning that Algorithm 3 is nested in Algorithm 2 as a function, and similarly, Algorithm 2 is nested in Algorithm 1 as a function. In Algorithm 1, a file is generated to accumulate user's demand information. Additionally, this algorithm classifies the locations and involvement of users and specifies them in comprehensive categories. Algorithm 2 and Algorithm 3 identify the load specification and calculate the sum with newly demanded load, respectively. Then, the given data are stored in the assured position following the phase details. The intricate problem of determining how LA performs its activity is now considered. Figure 3 demonstrates the data structure of each SCD device stored in the user file. In case of getting the same data structure, the SCD of every user should follow the same algorithm. A fixed location is allocated for storing load information of the user. Therefore, the advantage of the proposed classification algorithm describes as follows: 1) Owing to the consideration of the phase information, the distribution feeder will know about the amount of deployed appliance in each corresponding phase. 2) As we classified the contracted appliance based on the types of load such as inductive, capacitive, and resistive, the grid authority will be informed about the possible amount of active and reactive demand response, therefore, the amount of compensated reactive power in the smart grid will be known. Consequently, the voltage regulation and power quality will be significantly improved.
3) Owing to the consideration of different functions of the user such as consumer, prosumer, and retailer, the grid authority will be informed about the actual demand and generation, which will help the grid authority to control the generation of power. 4) Because of the classification based on the users of different areas such as industrial, commercial, residential, and institutional, the centralized power generation will be extended in several distributed generations.

A. LOCALIZATION AND CLASSIFICATION OF USERS
In the SG model, the integrated SCD updates users' demand profile by classifying the area based on the closest possible information because the demands rarely differ from area to area. To acquire the required information, the notations for the sets of regions in different areas such as residential, commercial, industrial, institutional, and others are separately indicated. Furthermore, SCD can define more regions that can be added to Algorithm 1 depending on the management and application of the grid authority. However, in case of any regions, all users must be declared that they belong to that region. Any commercial or industrial user who remains in a residential area will be considered as a commercial (∀ Com Area ) or industrial (∀ Ind Area ) user instead of a residential user because the per-unit cost of electricity is different. Similarly, it follows the same rule for the residential (∀ Re Area ) and the institutional (∀ Ins Area ) region. On the other hand, others (∀ Oth Area ) refer to any kind of region that is declared by the electric power distribution company, depending on their administration strategy and is denoted as: where ∀ Area is the set of user area on which variable a depends. Generally, a large number of users are expected in any area. Therefore, the proposed model provides the possible role of any user in any particular area. For determining the Algorithm 1 Classification of Users Based on Area and User Type Input: • Creating a file to store load data of the user • User area and user type • Calling function with existing information Output: • Total aggregated load of the user 1: begin 2: create a file 3: define ∀ Area and ∀ type existing in PDN 4: request user area and user type 5: for M number of users do 6: for a = 1 : length(∀ Area ) 7: if ∀ Area (a) == user area then 8: process N a with (1) 9: for m = 1 : length(∀ type ) do 10: if ∀ type (m) == user type then 11: process N m with (2) where ∀ Type stands for the set of user type based on which m is varied. It should be noted that each ∀ Ret User only adds power to the system and integrates single (N m ; m = 1) generation information delivered to the SCD, where m = [1,3] and N m indicates the position of the given and storage array information for the type of the user.
On the other hand, ∀ Con User and ∀ Pro User share the contracted load and DG with contracted load information, respectively.
Consequently, SCD gathers the information about localized position and activities of the customer.

B. GENERATION AND LOAD SPECIFICATION
Since the objective of the SG model is to make compatibility between demand and supply, the properties of DG is included in the algorithm. Moreover, the information of capacitive elements (i.e., power factor improvement (PFI) device) are given by the user to improve power quality, voltage regulation, and power factor (p.f), and to reduce losses. Electrical loads are divided into three categories that belong to every region such as resistive (∀ Re Ld ), inductive (∀ In Ld ), and capacitive (∀ Ca Ld ). We include the DG information of the user in the load-type array.
where ∀ Ld is presented as a set of load information. The proposed bi-directional system's DG information such as how much and which type will be noted to estimate an approximate generation profile by the user.
In the case of ∀ Ret Type , the installed DG information m = 1; l [1] is available to ignore power consumption data. However, for the ∀ Con Type they only provide load details m = 2; l [2,4] based on load specification, whereas ∀ Pro Type updates both m = 3; l [1,4]. The user needs to provide additional information to determine exact load specifications, Algorithm 3 Phase Wise Contracted Load Distribution Input: • Phase information of contracted load • The amount of existing contracted load and newly contracted load of individual users Output: • Total aggregated load per phase 1: begin 2: define phase ∀ ph information 3: ask load (kW/ kVA) and p.f. 4: for every newly contracted load do 5: if ϕ ph = 1 and ϕ ph−n = 1 then 6: for i = 1 : length(∀ ph ) do 7: if ∀ Ld (i) == phase type then 8: compute ϕ ph ← 1 with (9) 9: A ij ← L tc (ph) update the load sum on phase 10: break 11: end if 12: end for 13: else if ϕ ph−n == 3 then 14: compute L tc (ph) with (9) set value n = 3 15: for i = 1 : 3 do

16:
A ij ← L tc (ph) update the load-sum on phase 17: end for 18: end if 19: end for 20: end such as leading, or lagging p.f., and amount of load. Because of the active power rating of the load (L A ) is known by the user, the lag and lead portion will be determined in (8). The data location N l N m for a particular value of a, m, and l is inserted in column position j.

C. PHASE AND LOAD INFORMATION
For accumulating phase-wise load information, it is important to distinguish the contracted and existing demand for every customer. Since, most of users are already connected to the PDN, they already have installed electrical appliances (L Ex ) before. By considering this, now the total contracted load is denoted by L tc (ph). For the phase information of the present and the newly added electrical load (L ncl ), ϕ ph , ϕ ph−n [1] is responsible for the phase specifications. It is worth noting here that the probability of the integrated and segregated electrical load is equal. Accordingly, Eq. (9) matches the user's perspective. The presence of L tc (ph) must be included with phase specification ϕ ph−n . In the case of three-phase load, it will be added to the same portion in each phase. In the first operation, L Ex exists (σ = 1) because the user already has some installed load in the PDN. For new customers and the users who have already defined their existing load, L Ex must be zero (σ = 0).
Electric power distribution systems deal with two kinds of load such as single-phase and three phase. However, most of the EUs do not have three-phase electrical equipment; thus, the phase information is needed to obtain stability in the three-phase systems. In the industrial appliances such as (steel mill and construction factory), most loads (e.g., giant motor, heat furnace) are three-phase with a very heavy and high-power rating. For this purpose, it is organized in different phases, where ∀ Ph ∀ R Ph , ∀ Y Ph , ∀ B Ph is the set of phase information. For allocating data in a certain location, cell information is defined as A ij where i [1,3] and j column and row number. For the fixed phase, the value of i does not need to vary, but j varies according to the arrangement. Under a distribution feeder, the DSO faces many problems for distributing load when a new user assigned. As a result, keeping a consistency between generation and consumption is not possible in the distribution systems. If the amount of load existing in R (∀ R Ph ), Y (∀ Y Ph ), and B (∀ B Ph ) phases are not the same, making decision for DSO can be easy by considering the information. In this regard, an industry can be an example that has a three-phase connection and different types of loads, i.e., single-phase and three-phase. So, what type of information will SCD provide to the grid for the required power generation? In this circumstance, SCD gathers area information, load-type information, and phase and amount details. Subsequently, it sends the information to the LDC. Moreover, LDC plays a vital role in aggregating users' information and reports to the generation station according to the customer's demand.

IV. MATHEMATICAL MODELS
In this section, shifting and changing conditions with time are presented for constructing active demand of users by considering different types of load and their activity status. Additionally, the generation profile (from DG) and consumption (by load) are described mathematically.

A. MODELS WITH CONTRACTED LOAD RESPONSE
The power demand of the SG consists of different profiles of load response such as critical, controllable and shift-able load that governs the SG power generations. Furthermore, linear and non-linear load such as power electronics load and multi-state load also dominate the power supply process. For these reasons, the activity status of every load should be taken into consideration for sharply determining the DR of the each user. In the customer side, feature one deals with connected to every load for detecting activity conditions, i.e., whether it is turned on or not. Based on this information, it calculates the exact load amount actively contracted with the systems. In this case, active demand is determined by defining the active or inactive status of the contracted load in the system.
The time-varying model in a day with the user's response [60] is considered for better illustration. This response consists of the binary process and measures the actual dynamic demand by accumulating the following outcome. Eq. (10) determines active demand ad(t) with a particular time t. The ad(t) is time-varying and also depends on other phenomena and represented as . How frequently the DR can be taken depends on the type and location of the load. For example, the customer's responsiveness in France is different from that in Spain, where it is higher in the morning and noon, respectively, compared with that during the night [61], [62]. The dynamic DR has a finite time duration and ad(t + τ 0 ) is the active demand at a certain time t with interval τ 0 . The total active load at time (t + τ 0 ) is [15,60], every 15 minutes later (11) Depending on the interval of time sample τ the total contracted load response is calculated. In 24 hours, we get 96 samples of ad(t + τ 0 ). Accordingly, the final response of the model for n number of contracted loads with the desired time interval can be determined by (12) . . .

B. DETERMINATION OF COMPLEX POWER OF EU
The complex power comprises the pertaining information of load, which will be provided to the LDC for further analysis. The proposed model needs instruments to measure the individual bus status connected to the DS. Based on the type of loads, voltmeter and ammeter (included in SCD) are installed in the LV bus. Both measurement devices measure data considering the phasor measurement unit because of reactive loads in the systems. In the case of MV distribution, systems are installed with three voltmeters at the primary substation and connected through three potential transformers. In Section IV (A), the DR of individuals is illustrated in accordance with the contracted load activity status. DR is varied with load, indicating the change in admittance ( ) with respect to time. We considered EU (eu = 1, 2, . . . N ) is connected at LV buses and equipped with κ N dynamic load at time t. Since LV buses are linked to a DS (ds N ) of grid substation (gs N ), the admittance of the particular node at any LV buses can be represented in (13).
± gs,ds,eu (t) = ±,t gs,ds,eu,1 (t)ζ t 0 (t) + ±,t gs,ds,eu,2 (t)ζ t 1 (t) where admittance of load of the node (i.e. possible single load) of any users is presented as ±,t gs,ds,eu,κ (t). As we consider every load of the EU, active and inactive cases ζ t ε (t) [0, 1] of the load should also be considered in the calculation, where ε (N − 1) presents the device number. ζ t ε (t) is used for validation of load contracted information of the users. So, for a particular user, the total load admittance ±,t gs,ds,eu (t) should be accounted for completing the operation.
The starting time for each operation should be the same due to matrix analysis. In our proposed analysis, each LV bus voltage V α eu,κ is regarded non-variant with time. The total consumed current I ± gs,ds,eu (t) of any user depends on the summation of all individual load admittance directly connected to the systems and actively operated.
The complex power of the systems is considered to determine the amount of inductive power and capacitive power (installed by users) present in the following buses. The conjugate value of the current (I ± gs,ds,eu (t)) * in the node is presented in (16). The apparent power S t gs,ds,eu (t) of the node at time t is determined by the following (17) and (18).
S t gs,ds,eu (t) = V eu ( I ± gs,ds,eu (t)) * = P ± gs,ds,eu (t) ± jQ ± gs,ds,eu (t) (17) S t gs,ds,eu (t) = V eu where V eu , P ± gs,ds,eu (t), and Q ± gs,ds,eu (t) are the bus voltage and active and reactive powers at the node of the EU, respectively.

C. ALGEBRAIC SUM OF CONSUMPTION AND GENERATION OF EU
As the proposed model involves with the prosumer and retailer, the power generation from DG also accounts for determining the total power consumption level. The total power consumption depends on the generation profile of DG. Because of considering only the power consumption and generation volume, the policy and tariff plan of electricity have not been involved. As a consequence, the algebraic sum of consumption and generation (ASCG) of the power volume of a user is denoted by . Therefore, the ASCG of a user can be represented as follows: where ±,t dg,eu,β (t)ζ t ε (t) is the power generation volume at time t and DG connected at β th bus. For simplification, β is also denoted as the number of DG units in case of having multiple DG of the EU. Therefore, due to the maintenance and separation of DG, ζ t ε (t) prevails the activity status as before. The summation of generated power by DG is calculated to determine the volume of the supplied energy of any EU. Since the type of DG unit such as wind, solar, BMS, and others are not separated, the generation characteristic is not our concern except for the accumulated production. As the dynamic characteristic of load and DG, the consumption and generation profile in 24 hours with a fixed interval is developed to the actual amount of generated power by the grid. For this reason, the demand profile of the day of an individual user can be determined. For example, if the starting time is t with interval t d , the response of generation and demand time will be at (t + t d ).
Therefore, the matrix operation is needed to measure the consumption response of the user. If the interval is 15 min, the number of sample data will be 96. For any customers who are connected to the PDN through SCD, the ASCG can be determined by Eq. (20). In the case of the retailer, the value of ±,τ gs,ds,eu (t) will be negative due to only having power generation that will be added to the grid generation. However, some customers have both characteristics; in that case, if the consumption is less than the generation (i.e., in day time the solar generation is higher), the amount will be negative. As a consequence, the ASGC of the customer in 24 hours can be described as follows: gs,ds,eu (t + τ 0 ) ±,τ 1 ) gs,ds,eu (t + τ 1 ) . . .
It is possible to determine energy consumption in kWh and the electricity bill at any time for the user regarding the generation profile based on bill policy. Besides, an electrical substation in PDN is interconnected with large number of customers. Therefore, the aggregation of their respective ASGC offers the demanded energy of that substation. If the number of user under a DS is eu N and ±,τ 0 gs,ds at time t, ASGC profile is determined by (21).
As DSO concerns all EU consumption and generation profile, it is conceivable to determine the transmission loss of a distribution line. The SCD device located in DS will acknowledge this information and send it to the LDC. We need the total ASGC for all substations defined a particular ID for each DS. If the number of DS is ds N , the ASGC profile of a grid substation can be described as . . .
Eq. (22) provides the generation volume of the GS for all users in this particular PDN.

D. REACTIVE POWER COMPENSATION WITH PFI DEVICE
For improving voltage regulation, reducing losses, and increasing the p.f. as a unity, reactive power compensation is possible based on this data. In addition, we consider the reactive power of EU, either it is lagging or leading because some users, such as industrial users are directly connected to the HV and MV distribution lines, are encouraged to install the PFI device. To reduce the losses and improve voltage regulation, some customers may have installed it in their house or specific area. In that case, Q gs,ds,eu (t) is the algebraic sum of the reactive (i.e., lag or lead) power that has been taken by the EU. The compensation of the reactive power Q c gs,ds,pfi (t) under a DS depends on the number of pfi N in the systems. For the comfort of both users and the grid authority, they will have installed the PFI in the systems. After that, the ASGC of a DS is described as Q c gs,ds,pfi (t + τ 0 ), (24) where τ 0 ,c gs,ds is the updated ASGC of the DS after compensating PFI devices. Similarly, we can determine the response of the DS under a power generation grid by calculating in reverse way. In that case, we consider the generated power by the grid with transmission line losses (i.e., reactive) so that efficient generation, transmission, and distribution will be possible.

V. SIMULATION RESULTS
For clear perception, the given algorithm is subjected to IEEE 30-bus system that is prescribed into the recommended model category. The contracted load data for this analysis has also been taken from the aforementioned bus system. Moreover, we have tested our proposed scheme in two distribution feeders, such as IEEE 13 and IEEE 34 nodes. For analyzing the effect of the method, we classify the area based on the number of users and the amount of load which is shown in Figure 4. This classification is needed for understanding the dynamic effect of demand and supply among them. A Simulink model is designed according to Figure 1, where the generation and control, load with SCD, transmission line, and transformer (i.e., step up and step down) are envisaged.   However, the element that is contemplated to introduce in the residential and industrial region is dissimilar due to application motives such as single-phase and three-phase, respectively. Because of appraising balanced systems, the standing contracted load in the systems is adjusted by allocating identical volume in each phase after accumulation with the number of users. In the Simulink model, the individual user configures the contracted load information in the programmable SCD device in which specification of the region, types of load, and phase are determined.  Thereafter, the data supported by the user is accumulated to the LDC stored in a file and from where it is transmitted to the grid control section. The total existing contracted load of the proposed model given by each user through the SCD at normal condition is shown in Figure 5 and possible to be extended to the region category according to grid requirements. However, it shows four specific regions and one nonspecific region. In the residential area, a large number of users' contracted load information (aggregated by each user) is shown in Figure 6 where the user has only different types of single-phase load. The change of contacted load that is defined by the EU is also included here. From the SCD device, the LDC authority can determine the status of existing, added, and reduced contracted load of each user. The rated value of the installed DG is also given by the user that is accumulated in the given figure. Similarly, the load and DG variations in industrial users considering three phase distribution system are shown in Figure 7.
The response data for this analysis were obtained from the smart meter of a residential house and can be considered as standard active DR on a particular day. In the Simulink model, the time-varying load is designed to calculate the approximate power profile. Based on this DR and contracted load, the power profiles of several residential users are determined. Three different scenarios illustrate the importance of accurate DR of any user. In the same manner, we considered industrial DR with several users to demonstrate the power consumption profile in that area. Energy consumption in both residential and industrial regions at normal, added and removed condi-  tions are P(nc), P(ad), and P(re). The consumption profile is changed owing to users' declaration and supplied energy is accumulated with the respective regions (i.e., the summation of three phases) which is shown in Figure 8 and Figure 9. From those figures, the impact of addition and reduction of demanded energy is conceivable, which has brought a big modification with comparison at normal status. Some possible incidents are considered here for analyzing our proposed model. For example, suppose that a residential area has thousands of users who made slight alteration (i.e., addition and reduction) of their contracted load some watt, then the actual average demand and peak demand of this particular area will be drastically changed. Similarly, a large number of new or existing industrial users change their consumption profiles without consultation; thus, the exhaustive active demand of this area would be more impendent. In both figures, we tried to trace the terrific consequence of changing over the dynamic power consumption scenario. At the time of peak demand, the deviation is significant due to the loss parameter with regard to corresponding bus systems.
Nevertheless, the integration of consumption and generation volume has interpreted in Figure 10 and Figure 11 by deliberating the energy-consumed area. Suppose that the volume of supplied energy P T (G) was adequate to meet the active demand for the whole systems under normal conditions (without the acknowledgment of SCD). Meanwhile, problems arise due to the unrehearsed penetration of power demand of all contemporary users. Because of the concatenation of explicit demand, the power consumption P T (C Ad ) in 24 hours has overlapped the borderline of generation outline of the systems. Consequently, the peak demand must cross the plant rated capacity, and the utilization factor of the power generation plant is exceedingly diminished. Therefore, some plants will be shut down due to excessive generation, or some energy-consumed area must be disconnected from PDN, which is known as the grid controllable load. Since, it is not conceivable to shut down the power plant (i.e. with a very high rated capacity), and the only comprehensible act is to eliminate load that make load shedding of electricity or blacking out of certain area which influence public satisfaction and facilitates the diminution of economic benefits.
Therefore, the control section of the grid must have the perception of coincidental demanded power profile. After intimation of SCD configured by the EU, the overall generated power P T (G Ad ) profile has changed corresponding to energy requirement, considering losses of the systems. Furthermore, the losses are governed by the flowing current to the systems. Thus, the large variation in load is the commencement of extensive losses that are demonstrated expressly in both figures. As a result, the difference between P T (G) and P T (G Ad ) has curtailed distinctly.
Alternatively, the reduction of load/DR is a potential incident in the PDN because of the numerous dynamics that affect the electricity user. The unanticipated change in load curtailment also makes the system indeterminate circumstances due to excessive production of power. Specifically, it is impossible to make adjustments to storage systems because of its limitations (e.g., cost, capacity, and size). In that case, the grid authority must decrease the production for retaining constant frequency and progressing voltage regulation. Moreover, the unit cost of production of electricity sharply rises for running an alternator at a low utilization factor. The energy production (P T (G re )) and consumption (P T (C re )) with and without SCD are described in Figure 11, where the variance is consistently alleviated.
However, the consequences of increasing and decreasing the system load are analyzed for both residential and  industrial users. The deficiency of generation at integrated SCD with respect to the dynamic characteristic of DR is considerably reduced while it was very high at the normal condition as shown in Figure 12. The difference between SCD and SCD* graph denotes the losses portion of the systems as the current and transmission loss are proportional. Here, the curve without and with SCD provides the level of grid production with the change in DR defined by the users' information considering the losses of the systems. From this information, the grid authority will control the generation level by considering the cost and plant capacity factor. Similarly, for the reduction of load, the redundant of generation by the grid is shown in Figure 13.
In addition, in our Simulink model, according to DS information, some PFI devices and DG are installed to improve the p.f and voltage regulation. Table 1 shows the p.f and voltage regulation improvement in the industrial and residential areas in case of IEEE 30-bus system. Moreover, we have implemented and assessed the robustness of our proposed algorithm in two different distribution systems, the IEEE 13 and the IEEE 34 node test feeders. Table 2 shows the performance analysis before and after applying the SCD in those two node feeders. It mentions the comparison in both cases. As the control systems learn from the users' data, the p.f increases impressively. The reduction of voltage regulation shows the improvement of efficiency by using SCD in power system network. In IEEE bus-30, after applying SCD, the p.f. and  the voltage regulation of the system have been significantly improved up to 63% and 67% for the residential area and 57% and 54% for the industrial area, respectively. Similarly, for both the distribution feeders, the p.f, and voltage regulation have been improved. In the case of the IEEE 13 node test feeder system, the p.f and voltage regulation are improved around 77% and 18% considering the residential area, respectively, and 92% and 23% considering the industrial area, respectively. Similarly, for the IEEE 34 node test feeder system, the p.f and voltage regulation taking the residential area into account are improved as 58% and 30%, respectively, where 50% and 46% for industrial area, respectively. The costs of power generation of the systems will be diminished in terms of installed SCD, generation control, p.f, and losses of the systems.

VI. CONCLUSION
The proposed SCD-based SG architecture privileges electricity users to delineate power consumption and local control models assembled by active DR. A MATLAB/Simulink model has been designed based on the load information of IEEE 30-bus system. Moreover, the proposed scheme is also implemented and the performance is assessed in two distribution systems, such as IEEE 13 and IEEE 34 node test feeders. The newly contracted load and demand response are achieved by the SCD where DG and PFI device are also integrated. Accordingly, the generation is controlled based on the EU information. The grid authority generates power in such a way in which the deficiency and the redundancy of generation are mitigated and user's satisfaction level is improved. Consequently, power generation meets the demand and controllable load of the grid is reduced that is responsible for load shedding. In addition, after applying SCD, the p.f. and the voltage regulation of the system have been significantly improved. Furthermore, the system creates an opportunity for energy prosumers and retailers to contribute in power generation for financial rewards.