Modeling and Optimizing Energy Supply and Demand in Home Area Power Network (HAPN)

Internet of energy based smart power grids demonstrate high in-feed from renewable energy resources (RESs) and lofty out-feed to energy consumers. Uncertainties evolved by incorporating RESs and time-varying energy consumption present immense challenges to the optimal control of smart power networks. To deal with these challenges, it is important to make the system deterministic by making time-ahead prediction and scheduling of power supply and demand. The present work confers a model of a co-scheduling framework, organizing cost-efficient activation of energy supply entities (ESEs) and load demands in a home area power network (HAPN). It integrates roof-top photovoltaic (PV) panels, diesel energy generator (DE), energy storage devices (ESDs), and smart load demands (SLDs) along with grid-supplied power. The scheduling model is based on mixed-integer linear programming (MILP) framework, incorporates a “min-max” optimization algorithm that reduces the daily energy bills, maintains high comfort level for the energy consumers, and increases the self-sufficiency of the home. The proposed strategy exploits the flexibility in dynamic energy price signals and SLDs of various classes, providing day-ahead cost-optimal scheduling decisions for incorporated energy entities. A linearized component-based model is developed, considering inefficiencies, taking various power phase modes of the SLDs along with the cost of operation, maintenance, and degradation of the equipment. A case study based on numerical analysis determines the particular features of the proposed HAPN model. Simulation results demonstrate the real prospect of our implemented strategy, utilizing a cost-effective optimal blend of distinct energy entities in a smart home.


R bat
Internal resistance of a battery ( ).

P bat
Battery power (W ). Grid electricity prices at anytime t (e). ξ Panelty price for CO 2 (e/ton). C co2 DE,t Cost for producing CO 2 by the DE (e). ς Operational cost of PV array (e).

C f DE,t
Diesel engine fuel cost (e). β/γ Diesel engine fuel coefficients (e). σ f Fuel price for fossil fuel (e). C su DE,t Start-up cost of diesel engine (e). σ su Diesel engine Start-up price (e). C sd DE,t Shut-down cost of diesel engine (e). σ sd Diesel engine Shut-down price (e). C om DE,t Operation and maintenance cost of DE (e). σ om Diesel engine operational price (e). π k,t Price of (dis)charging storage units k (e).

IC k
Investment cost of a storage device k (e). N k,t Storage (dis)charging cycles of device k at t. C User time preference for ECL unit to be on (t). P GR Minimum power in-feed from grid (W ).

I. INTRODUCTION
According to the 'US' state department of energy, the ratio of utilizing energy is 60% to 40%, for the residential and commercial sectors, respectively. At present, most of the consumable energy is produced by conventional power plants, i.e., fossil fuel and coal generation [1]. However, due to the rapid increase in fuel prices and the elevating emission problems, the World is adopting a better option of utilizing abundantly available natural resources of energy [2]. Renewable energy sources (RESs) (i.e., solar and wind) are clean and cheap sources of energy but are highly intermittent. This intermittency is due to the time-limited sun irradiations and the varying wind speed. Integrating RESs in the conventional grid is an inefficient task because the present grids are incapable of handling the uncertainties produced by these sources [3].
A framework of decentralized Smart grid, also known as distributed grids (DGs) is developed to address the above problem. It integrates the RESs with the conventional power network more effectively by providing the facility of energy storage and control schemes [4]. The smart grid reinvents the conventional power network by making it independent, intelligent, self-controlled and resilient. It also supports the concept of the internet of energy (IoE) by incorporating information and communication technologies (ICTs) [5]. Moreover, it encourages energy savings and energy trading at the consumer level through demand-side management (DSM) and demand response (DR) techniques. Whereas, DR or DSM programs can also be sufficient to mitigate the intermittency of RESs [6].
DSM and DR are the two main elements of the smart grid encourage the energy consumers to use energy efficiently and economically. It has a significant role in developing strategies for flexible operations of energy entities (EEs) keeping the power network stable [7]. Moreover, It includes some monetary incentives, e.g., variable energy prices, low energy usage awards, etc. Applying these incentives, the user can modify its energy usage pattern by deferring, shifting, or curtailing its non-priority load demands [8]. These strategies can be named as peak clipping, valley filling, and critical control of load demands, etc. In support to DR schemes, various types of energy tariffs are introduced including, time-of-use pricing (ToU), day-ahead pricing (DAP), real-time pricing (RTP), critical-peak pricing (CCP), and inclined-block rates (IBR), etc [9].

A. RELATED WORK
Since the motivation of the work is to demonstrate the flexibility at the consumer level, by putting up the idea of a smart home. In a smart home, every power-related entity has an influential role in the overall power network. Introducing home area power network (HAPN), it deals in the smart energy generation and utilization within a home. This concept of smart homes is already discussed in [18]- [25]. The vital component of the HAPN is its self reliability and resiliency, but there are numerous challenges like self-sufficiency, integrating new appliances, communication among various energy entities, etc [26]. These may cause irregularities in energy generation and utilization, resulting in increasing the power load on the generation units and sometimes there is a surplus and costly generation that could not be utilized by the energy consumers [12].
Moreover, the high load demands, especially in peak hours, increase the electricity prices. while, the low demands during abundantly available Photovoltaic (PV) energy also ends in costly energy operations [27]. To address these problems, the well known DSM or DR strategies can be implemented. DSM can optimize the energy generation and utilization brings down the cost of electricity used and reduces the CO2 emissions [7]. The efficient scheduling algorithms for DR problems are a need of time that helps the users to shift their loads intelligently at a low cost operating time of the day in a balanced way [24]. Table 1 summarizes various DSM  strategies and their limitations. Likewise, there are other numerous options to tackle the above mentioned problems. Among these, one is to include a combination of various types of energy resources i.e., electric grid, PV power, diesel engine generator (DE) power, and energy storage devices (ESDs) [27], [28]. PV is the cheapest source of generating electricity as compared to its counterparts but is highly unreliable [22]. It depends on the sun irradiations, that is only available in the day time and even sometimes these are disrupted by the clouds and the neighborhood [8], [13]. Hence, this varying PV energy can be compensated in several ways. For example, the PV output could be made smooth by incorporating ESDs [3], [29], or the grid energy could be utilized, or the DE power could be used if grid energy is unavailable at that time [30], [31].
In contrast, if the PV power is available in abundant, then it can be curtailed to maintain the balance in power flow and keep the voltage levels stable [5]. However, the thermal generators and pumped hydro stations can also be incorporated at a significant scale to handle the uncertainties in power generation [18], [32]. However, there is some tradeoff in costs due to startup and shutdown operations of thermal generators, i.e., DE [28]. Whereas, the other option is to use the controllable flexible smart load devices (SLDs), that could be operated according to the availability of the energy [33]. SLDs are of different types; power flexible and time flexible (i.e., time shiftable and delay-tolerant devices) [8], [15], [34]. Some of the literature takes only HVAC loads as flexible loads [33], [35]. Unlikely, [23] described the incorporation of electric vehicles in the transportation system as a new type of electrical load in the residential area. Many researchers take aggregated power load as a flexible, controllable load [22], [34], and most of them differentiate these  aggregated load as time shiftable and non-shiftable power loads [7], [11], [19], [20], [26]. Table 2 provides a critical analysis of the past work regarding the usage of type of energy sources, various smart load demands, the pricing scheme, and the algorithm working time horizon.
The most favourable flexible load is in the form of electric vehicle storage (EVS), providing a vast range of dynamic charging power [5]. A long term outcome of variable short-term operations and life-time of the battery storage component is discussed in [18], [36]. Where an aggregated battery storage systems are presented, that acts as an energy supplier or energy dissipate entity, helps in reducing ramping provisions while balancing demands with the low-cost energy supply. Moreover, to maximize the life cycle of ESDs, a pseudo cost function for battery storage deterioration is proposed in [22], [24], [27], while the storage loss cost is discussed in [28], [31]. Furthermore, the storage deterioration and battery inefficiency in a certain time of operation are subject to the battery operational limitations and energy trading requirements [4]. To increase the life of the battery, it is recommended to keep the working cycle of the battery in its safe working zone. Since the energy prices and the user's load demands fluctuate over time, the worth capacity of the system and the future power costs, both are dependent on the system states and time of operation [11]. These functions are additionally approximated by fuzzy frameworks, and the ideal (dis)charging activities are observed by the anticipated Newton technique [10]. Additionally, a generalized battery model (GBM) is presented in [17] to portray the adaptability of building energy demand and its storage capability.
Besides, an important aspect of HAPN is its scheduling or controlling polices for the energy generators and the load demands [37]. The cost-optimal operation of the HAPN is based on sophisticated optimization algorithms. Various optimization algorithms have different working models and unique computational complexities. Most popular technique is mixed-integer linear programming (MILP) technique, in which the linear models and linear constraints are integrated with the linear objective function and is discussed in [7], [18], [22], [23], [28], [30], [32], [34], [36], [38]. While, some work dealt with heuristic algorithms [19], [20], especially the population-based particle swarm optimization (PSO) method [8], [25], [26] and genetic algorithms (GA) [3], [9], [39]. Moreover, some researchers have used stochastic programming [6], [24], while some have discussed dynamic programming (DP) [21], and some have worked on decision tree algorithms [27], [31]. In [29], a stochastic network calculus theory is adopted to solve the problem of uncertainties related to supply and demands for long timescales while satisfying the energy balance constraints. A real-time binary back-tracking search algorithm (BBSA) is used to optimally schedule the home devices in order to reduce the energy consumption of the home residents without affecting their comfort level [40]. To address the uncertainties in the generation and the demands, [35] and [13] have discussed model predictive control where the predictions were made before applying the algorithm. Moreover, if the constraints or the objective function are taken as nonlinear equations, then a nonlinear algorithm, i.e., mixed-integer nonlinear programming (MINLP) can be utilized [15]. There is another option of real-time operation for SLDs, where the uncertainties are neglected, and the operations can be carried out using Lyapunov optimization algorithm [4], [11], [33].
Usually, the cost minimization is a primary objective of any energy optimization problem and is discussed in [9], [18]- [20]. Whereas, most of the researches discussed the trade-off between electricity prices and the consumers distress [9], [14], [21], while some have also discussed a connection between cost reduction and peak to average ratio (PAR) of power demand [9], [19]. It is evident, that while minimizing the cost one shall compromise its discomfort or there will be the problem of getting peaks in off-peak times, and it is of colossal disadvantage while considering day-ahead defined dynamic price signals [8]. In the end, the schemes mentioned above need to exchange a bunch of information between various energy entities, e.g., irradiation sensors, home appliances, and grid energy management system. Considering the variety of devices in HAPN, a standardized communication system network approach is fundamental for its fruitful execution [5].

B. OUR CONTRIBUTION
In this paper, we target the cost-effective operations of different energy entities (EEs) installed in a house that has any influence on daily accumulative electricity cost. The EEs include various types of energy generators and electrical appliances. This paper is an extension of our previous work [42], in which we have only analysed the generation side for cost optimal operations i.e., scheduling of energy supply entities (ESEs). These ESEs were limited to grid and PV sources only. In addition, we also did not include DSM strategies which we now have discussed in detail in this work. Hence, we reproduce our problem of cost minimization and consumer satisfaction in the context of internet of energy (IoE), where every energy entity is smartly controlled through HEMS. The ultimate objective is to integrate cheap, clean, and uncertain EEs under a joint framework of supply and demand control. Moreover, the advantage of installing ESDs and DE is investigated in diminishing the cost of electricity in a time horizon of one day, also considering the grid outage and the temperature requirements of the thermal devices. Since there are many EEs involved along with their time coupling constraints, so it is challenging to solve the optimization problem.
The distinctive aspects of this prospective work are as follows: 1) Analyzing in-depth models for PV and ESDs, establishing component level inefficiencies and energy losses. Also, including the storage degradation cost model that interprets the ESDs life cycle. 2) Implementing a constraint-based mathematical model for various SLDs, reflecting an important contribution for DSM strategies. 3) Introducing a reward and penalty factor, guaranteeing the activation of power elastic and delay-tolerant loads at a low price, while determining the desired comfort level for the users. 4) A novel day-ahead ''min-max co-scheduling'' (MMCS) optimization strategy is proposed. It effectively solves the optimization problem of cost minimization and maximizing the consumer's satisfaction within a single optimization framework. The model is solved using a branch and bound method based on mixed-integer linear programming (MILP) framework. 5) Validating the optimal scheduling problem on simulation-based real case study example of a signal 2056 VOLUME 8, 2020 house. Also utilizing the dynamical day-ahead auctioned electricity price information from [43] for the realistic numerical analysis. The rest of the paper is organized as follows: HAPN structure and operating features are discussed in Section II. It includes detailed information about Nano-grid model, PV array model, ESDs model, and home appliance model. While Section III illustrates the optimal scheduling framework for our problem. It comprises of cost formulations subsection, system-level constraints, component level constraints, problem formulation, implementation and algorithm subsections. In Section IV, there is a case study example, while Section V illustrates the simulation results of the proposed optimization model. It concludes the numerical observations as a prediction module output, ESEs utilization, activation of SLDs, ESDs cooperation, power mix, and algorithm computational results. Finally, in Section VI, we make a conclusion statement with future work indication.

II. HAPN STRUCTURE AND OPERATING FEATURES
The proposed operational nano-grid model for the optimal scheduling of EEs is a small scaled HAPN. It acts as a low voltage distribution nano-grid, facilitating ESDs, incorporating energy in-feed from RESs, and supplying energy to the (in)flexible home appliances. The gateway to this HAPN is a smart meter that connects a house to the outer grid.

A. NANO-GRID MODEL
The HAPN acts as an autonomous nano-grid, balancing supply and demands, while considering low-cost energy procurement. Fig. 1 illustrates a proposed structure of a nano-grid. Where, power loads (P L − t ), diesel generator power (P DE + t ) and grid power (P GR + t ) share AC line. While, DC line is shared by the power obtained from PV (P PV + t ) and the ESDs (P B +/− k,t ). To implement a realistic scenario of off-grid operations, we have assumed that this nano-grid is established in a rural area where the power from the grid is not always guaranteed. Hence, a backup diesel generator is incorporated to ensure smooth power supply at any time of the day. The power exchanges between the buses is carried out through a bidirectional converter delivering power to DC line and AC line [12]. However, it is recommended that to minimize the line losses, the nano-grid must distribute the energy through DC lines. We have assumed that most of our electrical appliances are AC operated and converting power at the appliance level is not a cost-effective solution. In contrast, a one time DC to AC conversion exhibits less cost and fewer conversion losses. In this paper, the power convention is set as (+) for power in-feed to the HAPN and (−) power out-feed to the energy-hungry devices.

B. PV ARRAY MODEL
In the proposed HAPN model, a PV array as shown in Fig. 2a, is installed on the rooftop, acting as a cheap and clean source of energy. The PV array output power (P PV + t ) is a collective power produced by all PV subarrays j ∈ [1, 2, . . . , J ] installed at the roof top and is illustrated as [44]; where, η pvcon represents the efficiency of a DC-DC converter attached with the PV arrray. The power output of each subarray (P sa j,t ) is calculated based on the power produced by the individual PV module (P m t ), number of modules (N m ) inserted in the subarray and the electrical loss factor (F sa j ) associated with it [45].
While, F sa j is established on the loss percentage of arrays mismatch loss (L m j ) and dc wire loss (L dc j ).
Since, we assume that each PV module produce the power P m t at its maximum power output (P mp ) incorporating predicted irradiance (G t ) and ambient temperature (T C ) levels.
where, G STC represents standard solar irradiance factor and α indicates the temperature coefficient. Moreover, P mp is dependent on the parameter called fill factor (FF), that estimates the maximum power of PV cell as shown in Fig. 2b.
The short-circuit current (I pvcell sc ) and the open-circuit voltage (V pvcell oc ) are the maximum current and voltage of a PV cell, respectively. Moreover, a PV cell efficiency (η pvcell ) can be VOLUME 8, 2020 defined as; η pvcell = P mp P pv in where, P pv in is the input energy from the sun in terms of spectrum and intensity of the incident sunlight.
Remark 1: The overall power loss associated with PV array is expressed as; P loss pv,t = J j=1 P sa j,t − P PV + t .

C. ESDS MODEL
The primary reason for installing and using ESDs is to make the availability of energy at any time t of the day. Its importance accounts when the RESs are not producing sufficient energy, or the cost of supplying energy from the grid is very high. For HAPN, we have introduced two kinds of ESDs, i.e., home battery (HB) storage and electric vehicle (EV) storage. Both of these storages are of same type (i.e., chemically reacted storage devices). So the working model for these ESDs is the same. The nominal capacity of the storage is defined as; C bat = I bat sc ×V bat oc , where, I bat sc & V bat oc represents short-sircuit current and open-circuit voltage, respectively. However, because of some internal losses, the maximum energy withdrawn (E bat ) from the storage devices is usually lower than the C bat . This limit is known as depth of discharge (DoD) and is calculated as; DoD = 1 − E bat C bat , which is the complement to storage's state of charge (SoC) [10].
Moreover, the storage efficiency is an important parameter that influences the battery capacity and is dependent on the internal resistance (R bat ) [46]. The battery power (P bat ) can be established as; The efficiency during discharging, when I bat ≥ 0 is; where, P cell represents the power input to the battery circuit. Remark 2: So, to decide the cost-optimal action of a storage system, a model is required that describes the efficiency of a storage device analyzing both the battery and converter losses. Fig. 3 shows a block diagram of a battery storage system. It includes the efficiency of a battery (η bcell ) and the converter efficiency (η batcon ). Remark 3: The overall power loss associated with the battery and the converter is illustrated as [46];

D. HOME APPLIANCE MODEL
One of the main contributions of this work is to introduce an automatic operation of smart home appliances. A day-ahead scheduling mechanism incorporates flexible and inflexible smart appliances along with their pre-defined operating conditions. In the considered HAPN model, appliances are divided into two major categories based on their technologies: 1) Traditional appliances (TA) and 2) Smart appliances (SA) [7], [15].

1) TRADITIONAL APPLIANCES
This category of appliances is also known as critical loads. These are manually operated devices, having no or little sense of intelligence, and hence, these should be served immediately. These loads can be interpreted as the base load of a home that includes; consumer electronics (CE), cooking range (CR), and instant water heating (WH). As these loads are uncontrollable so the modelling of these devices is not considered in this work.
Remark 4: A TA = {CE ∪ CR ∪ WH }. In this paper, these loads are taken as deterministic loads that can be predicted a day ahead. The total energy requirement E TA for all of these loads is illustrated as: where, f ∈ [1, 2, . . . , F] is the appliances index and P TA − f ,t is the power dissipated by a device at any time t.

2) SMART APPLIANCES
This category of appliances is usually energy-efficient and self-intelligent devices. These are capable of modifying their power demands and working patterns. The scheduling unit 2058 VOLUME 8, 2020 may decide the energy consumption pattern for these loads. We assume that these devices are connected with the central control unit through personal area wireless communication technologies (i.e., Zig-bee or WiFi). These appliances are further classified into two types: a) Power elastic appliances (PE) and b) Time elastic appliances (TE).

a: POWER ELASTIC APPLIANCES
This class of appliances includes variable powered devices that can alter their power magnitudes. The power for these appliances can also be curtailed, having an impact on the comfort of the users. These appliances can be the lights or fans etc.

Remark 6: A PE = {lights ∪ fans}
The energy requirement E PE a for an individual PE load is illustrated as: where, P PE − a,t is the power dissipated by the device a at any time t. In this paper, these loads are taken as static and deterministic that can be predicted a day ahead.

b: TIME ELASTIC APPLIANCES
There are two types of TE appliances; i) Time shiftable (TS) devices and ii) Delay tolerant (DT) devices. TS loads can be scheduled anywhere on the time scale t based on the optimal decisions. While DT loads can make themselves delayed from a certain time, they are due to serve. Here, TS loads are considered to be dynamic and un-deterministic loads. The users hand over the time preference for the activation of these loads to the HEMS. Whereas, DT loads are static and deterministic and are known in advance. TS loads are further divided into two groups; electric controllable loads (ECL) and b) thermal controllable loads (TCL). . These appliances cannot be interrupted once activated, but the different working phases of the appliance can be delayed based on the current electricity prices and consumer satisfaction preferences. These energy loads can be, washing machine (WM), clothes dryer (CD), and water pumps (WP), etc.
Remark 8: The total energy requirement E ECL b,d of different phases d of device b these loads is illustrated as: where, P ECL − b,d,t is the power required by the particular phase d of device b at any time t.
TCL: These appliances are fixed power appliances [47]. However, the activation of such devices is subjected to certain temperature-dependent optimal decision values of a scheduling unit. It incorporates the thermal constraints of the device and the ambient environmental temperatures. These energy loads can be, air conditioner (AC), water cooler (WC), and refrigerator (RF), etc.
Remark 9: A TCL ∈ {AC ∪ WC ∪ RF} The energy requirement E TCL c for a specific TCL load is illustrated as: where, P TCL − c,t is the power required by the particular device c at any time t.
DT loads: These are fixed power loads, that cannot be curtailed or interrupted in between their working cycles. Moreover, these cannot be shifted on time scale before their actual activation time. However, these can be delayed from the time they are being activated until a certain time threshold. For controlling their time delays, a concept of a loads queue is introduced. These queues are developed with time, account for the amount of power for the loads being delayed and served. With the help of this queue terminology, one can see how big the queue is and for how long a particular device has been waiting in the queue. The load delay timings can be controlled by putting a threshold on queue size and by suggesting some cost factor for these developing queues. These loads may include; kettle and iron, etc.
Remark 10: A DT ∈ {kettle ∪ iron} The total energy requirement E DT for these loads is illustrated as: where, e ∈ [1, 2, . . . , E] is the load index and P DT − e,t is the power required by the particular device e at any time t.
Hence, if assuming a single home, it may have some random occupants U , occupying the home randomly between {1, 2, . . . n u } in a day. Let P L − t be the established total demand requests for HAPN at any time t and it is formulated as:

III. OPTIMAL SCHEDULING FRAMEWORK
In a HAPN, to reduce the cost of daily electricity, it is crucial to develop an optimal scheme. This scheme may incorporates various EEs (i.e., energy sources and electrical appliances), that are scheduled in such a way that at a particular time the VOLUME 8, 2020 energy must be taken from possible cheapest energy source and the amount of the energy used would be minimum. While scheduling different EEs at the time t, it must be ensured that the energy supply and demand are balanced and the consumer satisfaction level would be high. Moreover, to implement such a scheduling model, a problem formulation is normalized to a defined cost function where the amount of energy utilized and the level of consumer satisfaction both are formulated in a cost parameter.

A. COST FORMULATIONS
The cost formulation of various EEs are illustrated as follows: 1) Grid operating cost: The cost of the energy obtained from the grid at any time t is illustrated as: where t is the dynamic electricity price determined by the grid power supplier. While P GR + t is the power in-feed from the grid to the house and x GR t ∈ [0/1] represents the on/off status of grid energy. 2) PV operating cost: As there is no operational cost for PV to produce electricity because it uses free of cost abundantly available solar energy. However, it exhibits some operational and maintenance costs. That also includes the replacement costs of the PV equipment.
where, ς is the fixed cost determined by the operational managers. While, x PV t ∈ [0/1] represents the on/off status of PV energy.
3) DE operating cost: The time intensive running cost C f DE,t of DE unit is dependent on the amount of fuel used for the specific amount of power generated at any time t of the day. However, the fuel consumption model of a DE is usually modeled as a quadratic function given in [32]. But, this function can be approximated to a linear expression by dropping out its quadratic term. Hence, the fuel cost is established as; where, β and γ are the curve fitting parameters given by the manufactures. While, P DE + t is the power generated by the DE unit, x DE t ∈ [0/1] represents the on/off status of generator, and σ f is the fixed fuel cost. Moreover, every time the generator starts or stop working, it exhibits some costs, reflecting in as start-up cost (σ su ) and shutdown cost (σ sd ). These costs are developed due to the crew costs, pre-heating and no-load conditions of the generator [28]. In case of steam power plants, this cost is usually exponential function, while in our case it is fixed, because of a small diesel unit. These costs are illustrated as; where, z DE t ∈ [0/1] and v DE t ∈ [0/1] indicator the start-up and shut-down status of DE. Besides, there are also some operation and maintenance costs σ om reflecting filter or oil change, or the replacement of some components of the DE unit. These costs for any time t is illustrated as: Moreover, DE also produces CO 2 emissions that are toxic to the environment. So, there is a penalty cost of ξ for producing a mass of carbon element. This quantity of carbon increases with the increasing power out-feed of the generator [1]. The total cost of producing CO 2 emissions at any time t is established as 4) ESDs operating cost: The most significant parameter of a battery storage in an energy management system is its lifetime. The cost associated with the degradation of storage is a non-negligible parameter. There are two ways to ensure a good life of a battery. One is to limit the DoD of storage to a certain threshold at which the battery gives its maximum life cycles while ignoring the number of cycles N k,t in a day. The cost of the battery in this scenario is fixed, reflecting the replacement cost of the battery after a fixed duration. However, the second one is to establish a cost function, that calculates the degradation in the storage capacity in terms of cycles and the DoD. In this scenario, a variable cost operator is proposed, which is the ratio of storage total investment cost (IC k ) of the battery k to its total energy throughput [18].
It means a relatively high cost is imposed if the battery is cycled at a high DoD for the number of cycles. Hence, the time intensive cost associated with battery degradation and replacement is established as; where, P B − k,t and P B + k,t represents, charging and discharging power rates of the storage devices k with charging and discharging indicators x B − k,t ∈ [0/1] and x B + t ∈ [0/1], respectively. 5) User discomfort penalty for PE load demands: PE loads are interruptable and their power can be curtailed to lower the energy costs. However, this phenomenon will increase the discomfort for the users. Hence, introducing a discomfort penalty that a HEMS considers while establishing various scheduling strategies. The penalty rate ζ applies to the magnitude of the power curtailed and the total penalty cost at any time t is: 2060 VOLUME 8, 2020 where, L PE a,t is the actual PE load and (L PE a,t − P PE − a,t ) represents the amount of curtailed loads given x PE a,t ∈ [0/1]. 6) DT demand Queue costs: DT loads can be delayed up to a certain time instance so that the total cost of electricity used by these devices could be lowered. The delayed activation of DT loads can be established by integrating DT queues. However, there is some cost for developing these queues and keeping the loads inside the queue for a long time. This cost is increasing with the queue length, indicating the evolving discomfort for the users [2]. This delay cost is illustrated as; where, δ is the delay penalty rate for putting the loads in the queue and Q DT e,t represents the queue length.

B. SYSTEM LEVEL CONSTRAINTS
• Power balancing constraints: For the stability of the power network and to keep the power losses at its minimum, the following equation ensures the balance in supply and demands.
• Operations of ESDs: The following constraints forbid the simultaneous operations of charging x B − k,t ∈ [0/1] and discharging of ESDs x B + k,t ∈ [0/1] at any time t.
• Prohibition of charging ESDs from grid power: The charging of ESDs from grid power is forbidden by the following constraints.
• Prohibiting inter-ESDs energy sharing: The inefficient operation of charging ESDs from each other is denied using the following constraints; • Prohibiting energy export: The following constraint describes the no-export policy for HAPN.
• Time preferences for (dis)charging of EV storage: The following constraint shows the time bounding condition on EV storage charging and discharging.
where, TP EV (+/−) t is the user time preference for discharging and charging of of EV storage.
• ECL user time preference: The ECL demands are dynamic and they can be operated at any time t. A user can set up a time preference (TP ECL b,d,t ) for a specific phase of a particular device.
• Demand response signal: A demand response peak constraint that limits the maximum power assigned to the whole load of a smart home. This is a kind of safety signal from the utility to avoid overloading in the power network.
C. COMPONENT LEVEL CONSTRAINTS 1) GRID CONSTRAINTS • Power in-feed from the grid: The following equation exhibits the range of power that can be obtained from the grid at any time t.

2) PV ARRAY CONSTRAINTS
• Power in-feed from PV panel: The following constraint determines the upper threshold of PV power that can be obtained from the PV array at any time t.

3) DE CONSTRAINTS
• DE power capacity: This constraint determines the range of producing power from minimum to maximum power by a diesel engine generator.
• DE start-up indicator: Whenever, the generator move into the dynamic mode from the static mode the indicator z DE t becomes 1.
However, we assume that the shut-down cost for the DE is zero and so we does not use any indicator for that.

4) ESDs CONSTRAINTS
• ESDs evolving energy states: The equation below shows the difference in energy levels for varying time slots ( t = t −(t −1)) in the ESDs. This difference in energy level is developed due to the charging and discharging power rates induced along with their efficiency factors.
• Maximum (dis)charge rates for ESDs: The given constraints show the upper and lower bounds of charging and discharging rates of the ESDs.

5) POWER ELASTIC (PE) DEMANDS CONSTRAINTS
The power dissipation by these demands are bounded by their maximum energy requirement given as;

6) TIME ELASTIC ECL DEMANDS CONSTRAINTS a: ENERGY CONSTRAINTS
• Appliance phase energy specification: The phase d of any device b has a specific energy requirement.
To ensure this requirement, the total power for a particular phase must qualify the given constraints.
• Appliance phase power limits: For any operational phase, there is a certain limit of power in-feed to a device. This bound is specified in the following constraint. (42) b: TIME CONSTRAINTS • Appliance phase time bounds: Every device phase has a specific time limit in which it has to be operated. This time-bound is illustrated as; • Appliance intra-phase operations: Every phase is uninterrupted and it must complete its cycle. However, the cycle completion is indicated by an auxiliary variable s ECL b,d,t which is 1 when a particular phase is finished [48]. Then it must remain unity for the rest of time the device is on.
• Appliance inter-phase operation: The next phase can only be started once the previous phase of the device is completed and is forced as;

. . , D(47)
• Appliance inter-phase delay: There can be flexibility in the starting time of the next phase, and the following delay constraint ensures this. ,t ), ∀b, t, ∀d = 2, 3, . . . , B (48) where, this delay d ECL b,d,t is adjustable, depending on the cost and comfort trade off already set by the user.

7) TIME ELASTIC TCL DEMANDS CONSTRAINTS
• Appliance power limits: The power range of the specific phase of the operating device is bounded by; • Appliance temperature limits: The allowed temperature range over which the device is operated is set by the user and the variations are bounded by the following constraints.
• Temperature variations in thermal devices: The changing temperature condition inside a thermal cabin (i.e., refrigerate, freezer) is illustrated as [11], [33]; where, P DT − e,t are the loads emptying the queue and L DT e,t are the actual loads that are entering the queue. To keep the above queue stable, the queue backlog must be finite by enforcing the following queue emptying law. Remark 13: P DT − e,t ≥ L DT e,t .

D. PROBLEM FORMULATION
This section presents a mathematical formulation of the problem supposed to be evaluated. The problem is to minimize the overall cost of the electricity, the discomfort to the residents, and to maximize the self-sufficiency of the local power production. Let P G t ∈ R + be the power supplied by the individual power source at time-slot t ∈ T = {τ, . . . , τ + T − 1} and x G t ∈ R + is the sources binary activation set. Similarly, P D t ∈ R + be the power demand of each type of load attached to the HAPN and x G t ∈ R + is the appliances' on/off set. A subset G AC of generators (i.e., Grid, DE) is attached to AC line of HAPN, while a subset G DC of generators (i.e., PV, ESDs) is attached to DC line. However, the demands are assumed to be AC and are attached only to the AC line.
The HEMS evaluates a set of cost function C t : R + → R + , establishing the cost of supplying energy to the households, operation & maintenance cost of ESEs, and penalty costs associated with discomfort of the users at time-slot t.
Remark 14: Given the HAPN's power sources feasible binary schedule sets X G = [x G t , . . . , x G τ +T −1 ] and their activation profile will be x G ∈ X G . Remark 15: Given the HAPN's generators feasible power schedule sets P G = [P G t , . . . , P G τ +T −1 ] and their power supply profile will be P G ∈ P G . Remark 16: Given the HAPN's load demands feasible binary schedule sets X D = [x D t , . . . , x D τ +T −1 ] and their activation profile will be x D ∈ X D . Remark 17: Given the HAPN's load demands feasible power dissipation schedule sets P D = [P D t , . . . , P D τ +T −1 ] and their power demand profile will be P D ∈ P D . The HEMS can minimize the total cost of power used per scheduling horizon T by following the general problem formulation indicated as: Moreover, a modelling scheme is incorporated to exploit the maximum variability in operational costs of the various components of HAPN (e.g., variable prices of grid energy, fuel and maintenance costs of DE, operational costs of DE, PV, and ESDs). The proposed supply and demand ''min-max'' co-scheduling scheme (MMCS) combines the scheduling mechanism of both energy supply sources and energy-hungry devices. It optimizes the supply and load profile of a HAPN using source controlled loads (i.e., SLDs, ESDs) and load driven energy sources (i.e., grid, DE, ESDs), whistle the PV source is usually uncontrollable. Hence, the problem is a MILP problem, that reflects the category of NP-hard problems which are infamous for tending to be unmanageable when they increase in size. The day-ahead accumulative cost minimization problem is mathematically formulated as: Whereas, the intention of maximizing the satisfaction level of the consumers is reflected indirectly as minimizing the penalty cost for curtailed load demands and the queue evolution cost for the delayed load demands. Furthermore, in this paper, we also emphasize on the self-sufficiency of the HAPN by maximizing the self-generation ratio (SGR). This ratio usually deals with the maximum utilization of the PV source and ESDs attached to HAPN and is modeled as: The block diagram of the proposed HEMS is shown in Fig. 5. The solar irradiance, price signals, and electricity demands are established on the historical and climate data. The problem is formulated together with the time horizon T with t time steps.

E. IMPLEMENTATION AND ALGORITHM
The aim is to establish a scheduling policy u t , that controls the in-feed from the grid, PV, DE, and the out-feed to the SLDs. The policy is established on the criterion of; 1) Minimizing the total cost of energy utilized. 2) Maximizing the satisfaction level of the consumers.
3) Maximizing the utilization of PV energy. 4) Optimizing the operations of ESDs. Similarly, it is implemented under the influence of various system and components level constraints. These constraints address system stability by forcing lower and upper bounds on supply and demands, representing physical limitations on influential energy entities of the nano-grid.
At the time the HEMS is triggered, it takes the input of costs related to different energy sources (including forecasted VOLUME 8, 2020 grid price signals, degradation costs of the storage devices, and DE operating costs). It also put in the information of penalty or award prices suggested for the SLDs (curtailed and delayed loads). Moreover, HEMS also takes in the pre-configured information of appliance operating conditions, i.e., consumer setting, time preferences of activating demands, type of use of device, power profile of a load, attaining specific energy requirements, preferred cooling temperature for TCLs. While it also takes in the forecasted indoor temperature information for the next 24 hours for generating an activation profile of TCLs. An optimization algorithm is applied to identify the best schedule sequence for both of the ESEs and SLDs. These scheduling sequences guarantee the minimum cost of electricity for a home consumer along with the considerable satisfaction level across the time horizon T . It includes following workload model; • The preferred time and cost for taking in the energy from the grid.
• The optimal configuration of ESDs charging and discharging to increase the energy cost savings.
• The on-off time for the Diesel engine.
• The curtailed power for power elastic loads.
• The preferable delay time for queuing loads. • The starting time for time elastic ECL loads.
• The temperature and load activation trade-off for TCL devices. The algorithm discussed below encapsulates the iterative process of the optimization formulation.
For the proposed optimization model, the simulation analysis is performed on a laptop equipped with an Intel Core i7, 2.6GHz, 2 Core processor and 20GB of memory. The results are carried out using ''MATLAB'' optimization toolbox. The objective function obtained is linear, so we use Mixed-integer linear programming solver ''intlinprog''. This solver uses a linear programming algorithm ''primal-simplex'', and the method for searching the optimal solution is ''Branch and bound''. A 15-min time slot resolution ( t) has been used to calculate the costs associated with ESEs and to predict the 24-Hr day-ahead power profile of various SLDs. Set parameter values 4: Set consumer preferences 5: Set system bounds 6: while for (t ≤ T − 1) do 8: Initialize system constraints 9: Initialize components constraints 10: Implementing Branch & Bound algorithm 11: Store scheduling variables set (u t ) 12: t ← t + 1 13: Execute problem set: 15: Conclude day-ahead total electricity cost 16: Conclude day-ahead self-sufficiency 17: Conclude SLDs satisfaction level (SL) 18: Conclude ESEs utilization factor (UF) Hence, our scheduling problem is a mixed-integer linear problem tracing already predicted values of day-ahead PV supply and users load demands and generates costoptimal decision vector for obtaining energy from various supply sources and activating different types of users load demands intelligently. To implement the framework of appliance scheduler, the following section introduces a case study example that consists of different types of home appliances having varying energy consumption pattern.

IV. CASE STUDY EXAMPLE
To perform the load management and to schedule the loads optimally, it is essential to have a device power consumption data and the load profile information of a home. Physical modelling of an individual appliance model is out of the scope of this work, so we have used a data driven approach to design the loads for our energy demand model. In this paper, a daily energy demand profile of a single medium-size home is used using the model in [49].
The load profiles of almost all the standard home appliances are obtained with a high resolution of one-second intervals. This model is developed by the Center of Renewable Energy System Technology (CREST). It incorporates the historical data for the number of occupants, their activities and the activation of desired appliances. Since the energy pattern produced for an individual local dwelling is very reliant on the tasks of the inhabitants and their usage of electrical gadgets. The model mentioned below takes historical data from the UK Time Use Survey, generating time using statistical models for residential consumers, providing information about occupants activities and the duration of each activity. Furthermore, it demonstrates an actual appliance operation for a particular activity of an occupant in a dwelling. A transition probability matrix for occupants is used to develop the occupancy model, that realizes the exact number of occupants [49].
Historical data is used to determine each occupant's activity and the relevant appliance associated with it. After appliance identification, a typical day profile for the particular appliance is generated and by aggregating all the appliances profiles, a load profile for a home is obtained. The collected data is composed of average power consumption along with operating modes or the cycles of each appliance. The model covers almost every single electricity device that can be found in the residential habitat. It utilizes these devices as the basic building block, where the device indicates an individual household power load, e.g., TV, clothes washer or vacuum cleaner. It is, therefore, can be called as bottom-up model [6]. The demand model architecture constitutes active occupancy, daily activity profile, and the installed devices, as shown in Fig. 6. Active occupancy model takes stochastically assigned residents (one to five). Whereas, the electricity consumption timing is modelled based on the activities of the individual occupants. The activity profiles generated, reflects the actual activities of occupants at a particular time. For example, around mealtime, the most likely activity is of cooking. Similarly, the activity of watching TV is determined usually in the evening. Likewise, every activity of an occupant has its daily profile.
Moreover, these activity profiles are assigned to the particular appliance. For instance, the activity of cooking involves the oven, microwave, or small cooking appliances. While watching TV needs a TV to be on. Hence, without determining the detailed appliance usage statistics, an activity profile model makes sure the appliance is active at a desired time of usage [49]. This activity profiling is crucial to demand side management, as it establishes a relationship between electricity usage and the occupant activity. It means, if one is dealing with the flexible demands, the activity profile of a user must also be adaptable. The same strategy is adopted in this proposed model of SLDs.
For the case study example, we have extracted six different activities from the established energy demand model of a home with five occupants. There are 22 appliances discussed in Table 3 providing with their average power consumption and the appliance class. We classify these appliances into five different categories, which are already discussed in the ''home appliance model'' section.
For the above-discussed model, the oftenly used parameter that can be used for evaluation or control purposes is the power value of any device. However, in some cases, we may need more than one parameter to control the device. For example, in the case of ECL devices (i.e., washing machine and dishwasher) as shown in Table 4 & 5, these loads have a different number of working cycles and each cycle has its energy usage and time duration limitations [48]. So, we remodel the load profiles of these devices by introducing the power and time constraints, i.e., (41)(42)(43)(44)(45)(46)(47)(48)(49) in their mathematical models. A similar case is with the TCL devices (i.e., refrigerator and freezer). An equivalent thermal parameter (ETP) model is introduced in (52), that includes indoor and outdoor temperature along with the thermal flow mechanism of these devices [47]. The parameters related to various home devices are illustrated in Table 6. As discussed earlier, the load demands taken are AC loads. So, generally, the AC power flow is expressed in terms of nonlinear and complex equations which are not compatible with the proposed scheduling problem equation [50]. Therefore, the equations are approximated into linear real power equations by introducing the terminology of power factor with the power load demands and ignoring the actual characteristics of the power lines. This approximation will not affect the solution of our scheduling model. VOLUME 8, 2020

V. NUMERICAL ANALYSIS
In this paper, power allocation strategies are demonstrated by implementing optimal scheduling algorithm. The scheduling decisions are obtained by exploiting an optimization technique based on MILP framework. An example of a smart home is considered, that behaves as an autonomous nanogrid. We have used a term HAPN to illustrate our energy network model for a single home with a varying number of occupants. The parametric values of various power entities used in our system model are shown in the following table: While the cost parameters associated with various EEs are given as: The task of the proposed HEMS is to exhibit the reaction of the scheduling framework towards dynamic objective function. The optimization algorithm looking for the minimum cost also has an objective of improving self-sufficiency of a HAPN. The whole operation includes the forecasting of grid energy prices, solar irradiance, room temperature, and solving the optimization problem. The effect of indirect linkage of price signal with a peak power indicator is likewise introduced in terms of the daily peak demand. Besides, the minimum and maximum energy limitations are adopted for corresponding energy supply and demand entity to establish a feasible range of operations. In the end, the proposed HEMS is examined for 3 different ESEs profiles and 22 residential SLDs profiles. U.K. insights realistically produced SLDs profiles are used to demonstrate the effectiveness of the adopted scheduling scheme in diminishing the energy bills and peak load demands.

A. PREDICTION MODULE
We have incorporated the predictive energy demands model, realizing the exact amount of power requirements by activating real appliances in a house [49]. This model takes in the account of active occupants, that have an impact in transforming energy demand pattern. A maximum number of occupants U is taken as 5. The account of activating different appliances in a house is done through a probabilistic approach.
Whereas, for our suggested model, on any particular day of the week, the average number of active occupants in a house and their total energy demands at any time instant t are shown in Fig. 7. It shows that the maximum number of occupants is activated usually in the afternoon and the evening with an average rate of 3 occupants for the whole day. While the energy demands are changing rapidly over the whole day. The demand increases drastically in the night due to the activation of high power load, that could probably be the heating load. We have predicted on average app. 1 kWh of energy demands for any particular day as shown in the figure below. Similarly, We have incorporated a predictive PV energy model, that forecasts the exact PV power by putting in the predicted values of solar irradiance, ambient temperature, day of the week in (4) [51]. Hence, the total PV power output can be obtained by evaluating (1). The solar irradiance data is obtained from Meteonorm Irradiation Data software for the any specific area of the United Kingdom [52]. This forecasted PV power is utilized to enhance the planning of energy storage and load scheduling operations for a particular location. Fig. 13 shows the maximum PV power available at any time t.
Moreover, the pricing markets usually have complicated attributes of non-linearity and inconstancy, so price prediction can help the energy producers and purchasers to improve their respective scheduling techniques, that increase their profit benefits and minimize the electricity prices, respectively [53]. A power utility can design this day-ahead electricity price. It may have locally produced RES power, and it can likewise import power from the power grids whenever required. The price of the electricity is varied with time throughout a day depending on the situation of available RESs and the import cost from power grid. The benefit of formulating the electricity cost by a utility is that it can revise the cost of power for each energy user, who needs to take part in DSM strategies. Fig. 8 shows the daily electricity price information. In our case, a day-ahead price is taken from [43] to evaluate the scheduling problem, guaranteeing the scheduling of energy loads at low prices. Furthermore, for the TCL demands as discussed in (50)(51)(52), they need to operate themselves based on the room temperature. Hence, for the proposed TCL device a day-ahead room temperature is forecasted based on the previously available data including home dimension, the thermal conductivity of a house, season, month, day of the week, and time of the day [54]. Fig. 9 shows the predicted in-door temperature for a typical home.

B. ENERGY SUPPLY ENTITIES UTILIZATION
As discussed earlier in section 2 that our model can operate smoothly even in the absence of power from the main grid. A grid shutdown signal shown in Fig. 10 is incorporated to demonstrate the off-grid behaviour of HAPN. Actual power that is obtained from the grid is shown in Fig. 11. Here, the high power load is being served in the early morning around 04:00 that is of 3kW . At this time, the price of electricity is at its lowest and while looking into the predictive load demands in Fig. 7, it shows a minimum amount of loads are forecasted at this time. Hence, it is evident that a shiftable  load is executed at this time. Similarly, on average the high amount of power is utilized in the night after 21:00 and before midnight. It is due to the mid-range price of electricity and because the day is closing. So, it is the only cheap source of energy available for the remaining load demands that are needed to be served in any way.
Moreover, the power procured from the diesel generator is shown in Fig. 12. One of the reason of activating DE power is the grid outage. During grid outage if there is no other option is available then the DE is operated. While it can also be operated if the cost associated with its power production is relatively low as compared to other sources. Similarly, the power procured from the PV arrays is shown in Fig. 13. PV power is meant to serve only home appliances, while the export to the grid is not allowed in our case. However, the power in excess can be used to charge HB storage. Home battery storage is the only component available to store this cheap energy and it also increases the self-sufficiency of the HAPN. While seeing into the figure around 08:00, the actual utilization of PV source is less than the available. The reason is that all the loads are already been served and charging the home battery storage at this time is not a costoptimal solution.   activated at night. So, we see a considerable load in the night that is being served by the ESEs. Here, we see a little glitch in load execution around 14:30 and a considerable load curtailment can be seen around 19:45. Of course, there is some penalty against this action of load curtailment, which is quite bearable according to our cost function. However, the maximum load that can be served is limited to (40).

2) ECL DEMANDS
Moreover, in our prediction module, we have already predicted a count of operating dishwasher and washing machine. Hence, these appliances are supposed to be scheduled once in a whole day. These devices have two types of constraints (energy and time). To execute these loads, we have established a required energy level for each working phase of the device, as shown in (41). While the power limitation for each phase is settled in (42). Furthermore, the phase time requirements are set according to (43). As shown in Fig. 15a the washing machine is active between 04:00 to 06:00. The peak power approaches 3kW is due to the heating element in the washing machine that warms up the water up to the desired temperature before cleaning the clothes. There are total 5 phases of WM operations as discussed in Table 5. There is no delay between different phase operations of the device. While the phase indicator is shown in Fig. 15b, indicates the successful execution of all the working phases of the appliance.
Similarly, the dishwasher is active soon after the washing machine at 06:00, as shown in Fig. 16a. The reason is the availability of relatively low price grid energy and the low power load demands at that time. Hence, providing a better time for executing high power shiftable load demands. Besides, the average power approaches 1kW showing all the two phases require different amount of energy to execute the operation of the device. These phases are discussed in Table 4. Like a washing machine, there is no delay in between different phase operations of dish washer. The phase indicators are shown in Fig.16b, indicates the successful execution of all the working phases of the appliance. By concluding, as discussed earlier that the ECL demands are the only loads that are not deterministic and can be executed on demand.

3) TCL DEMANDS
Only one type of TCL load demands has been used in this work and that is the cooling load. However, two kinds of cooling loads are illustrated as example; i.e, refrigerator and freezer. The working mechanism of both of these devices is the same. The only difference is the operating temperatures. The temperature setting is established through (51), that is around 0 → 4 • C for refrigerator and −16 → −20 • C for freezer. Fig. 17a indicates the activation status of the refrigerator along with its indoor temperature profile changing optimally between its lower and upper bounds. Moreover, the power profile is illustrated in Fig. 17b, showing almost fixed operating power for all of its phases throughout a day.
Similarly, for the freezer, the same phenomenon of the above device is applicable. The power limitations are illustrated in (50), and the temperature variations within the device are controlled through (52). Fig. 18a shows the activation profile and the temperature profile of the freezer. While Fig. 18b shows power profile distribution for the whole day.

4) DT DEMANDS
DT loads are deterministic power demands predicted dayahead using the prediction module. The power limitations of DT loads is illustrated in (53) and the accumulated load demands are established in (54). Fig. 19a describes the rate of actual DT demands predicted, while Fig. 19b shows exact amount of load demands served at any time t. Moreover, Fig. 19c indicates the rate of DT demands entering and leaving the load queue. It is evident from figure that loads are satisfied at the end of day, while the clear difference in the predicted and scheduled load demands represents the working phenomenon of the queue. Fig. 20a indicates the rate at which the ESDs are being charged and discharged. As the storage is of limited capacity, so the rates of charge and discharge are also limited, as shown in (38)(39) which are set according to the data provided by the manufacturer. We have set an initial and final SoC (ε) for our ESDs so that we can get the desired amount of energy available in the storage at the end of each day, as shown  in Fig. 20b&c. Setting SoC may also help in controlling the number of discharge cycles of the storage that have a huge impact on battery life. If we use deep cycle discharge (e.g., 80% of DoD) phenomenon, then the battery life decreases rapidly as compared to the DoD of 20%. In Fig. 20b, it is evident that the home battery is being charged with excess PV energy during day time. In the morning, it uses DE power to charge itself. Moreover, it is being discharged when the electricity price is increasing and PV power is depleting. Similarly, for EV storage, it is being charged in the day somewhere else (probably at the workplace), and a portion of it is utilized back at home when the grid energy price is high as shown in Fig. 20c. These ESDs have some capacity limitations (37), so we can utilize these devices for a limited duration. For these storage systems, we have some hard constraints of charging the HB storage and utilizing EV storage as discussed in (25)(26)(27)(28)(29). Fig. 21, shows day-ahead auctioned electricity price. The energy utilities for their customers usually formulate these energy prices. So that the customers can get an advantage of these volatile prices and can purchase energy at their ease. Moreover, in the same figure, we can also see the activation of different ESEs. Our proposed scheduling scheme is making this activation decision. We have formulated our cost minimization problem, keeping in view the variable energy grid prices and various system constraints. Our scheduling framework tracked down the possible minimum cost of electricity for utilizing the best combination of available ESEs at any time, t. As shown in this figure, that in the night (21:00 to 24:00) and early morning (04:00 to 06:30) the electricity is being provided by the grid because the price of electricity is relatively low at these time durations. While, around morning at 06:30, the energy prices of the grid is increased and the HB storage becomes activated. As soon as the sun rises, the energy is being procured from the PV source instead. Around mid-day, the energy is being shifted among grid, HB storage, DE, and PV sources. However, in the evening, the PV power is depleting, so the HB storage is compensating it. The HB storage SoC is still high enough and be good for discharge. So, most of the time during the availability of PV and DE energy, the HB makes itself charged and becomes discharged in the evening when there is no other option of cheap energy. Soon after 06:30, the charge in HB is getting low, and there is another storage EV is available. So it gets preferred over all other energy sources until the price of grid energy becomes low again.

E. POWER MIX
Likewise, Fig. 22, illustrates the utilization factors and the accumulated energy shares of various ESEs integrated in HAPN. It also depicts that on average the electricity cost for 1kW of power in a whole day is around 310 cents. Whereas, the total power utilized in last 24-hours for operating home appliance is about 73 kW .  Similarly, Fig. 23, illustrates the satisfaction level and the accumulated load demand shares of various SLDs integrated into HAPN.
Moreover, we can see in Fig. 24, that our scheduling technique has successfully balanced the required energy with the generated one as illustrated in (24). There is a clear division in traditional baseload demands and the SLDs. All the loads are satisfied successfully with an optimized power mix. The scheduling of different ESEs is carried out by formulating a cost minimization and SGR maximization problem. Our scheduling algorithm activates those energy sources that are comparable cheaper at any particular time instant t. Finally, in Fig. 25 we can see a definite difference in the load demands before and after establishing a scheduling framework. A reasonable portion of peak load demands is shifted at the off-peak time, mostly in the early morning when the price of electricity is also at its lowest. Hence, the peak load is now limited to 3kW , which was previously above it. Similarly, in early morning between 00:00 and 09:00 the averager predicted load demand was below 500W , which is now near 1kW . Hence, we can conclude that by using our proposed HAPN model and the optimized HEMS, we have lessened the cost of electricity used. Furthermore, we have also observed the phenomenon of peak clipping, valley filling, and load shifting in our day-ahead EEs scheduling results.

F. COMPUTATIONAL RESULTS
The outcomes are established utilizing ''MATLAB'' optimization toolbox. The optimization technique of Mixedinteger linear programming (MILP) is utilized to solve the optimization problem. In the above analysis, the MILP solver ''intlinprog'' is used to find a feasible solution (the minimum requirement of supply and demand scheduling problem). This solver can rashly abort the procedure of searching an optimal solution. It can be stopped when it finds a possible feasible solution of (56-57). Moreover, regardless of a feasible solution is found or not, the ''intlinprog'' enables the operator to indicate a time limit after which the solving must be ended.
Our problem resolution is quite huge, means; • It has 40 optimization variables that take integer values. • It has 9 linear equality constraints.
• It uses 17 linear inequality constraints.
• It uses 20 bounding condition constraints.
Hence, it is suggested that the sub-optimal energy profiles obtained by early stopped solver are adequate substitutes for the genuine ideal profiles which are significantly more tedious to discover. In this case, it takes 21 seconds to take an integer solution to the required level of optimality. The required level of optimality in this problem is ''integer feasible solution'' and relative gap of 360%. It is thus exhibited that reasonable approximate solution can be achieved in an equitable amount of computation time (e.g., in about 30 seconds. The above investigation shows that it is promising to apply the proposed framework in the real-time household appliances scheduling scenario. The speed with which scheduling decisions must be made relies on the number of decision variables.

VI. CONCLUSION
In this work, we have proposed a model for home area power network (HAPN). It integrates time-varying photovoltaic (PV) energy source along with two types of storages (i.e., home battery (HB) and electric vehicle (EV)) with the grid power and assume a diesel energy generator (DE) for a backup. Furthermore, it also incorporates different types of load demands, including baseload and smart load devices (SLDs), i.e., power elastic and time elastic appliances. We have proposed a home energy management system (HEMS), forcing various energy entities (EEs) of HAPN to coordinate with each other and establishes a cost-optimal scheduling framework of drawing power from energy supply entities (ESEs) and serving the SLDs. Moreover, the proposed framework is extended to incorporate the optimization concerning consumers' satisfaction and CO 2 footprints. The proposed ''min-max'' multi-objective optimization problem is based on an optimal strategy of minimizing accumulated electricity cost, maximizing self-sufficiency and the satisfaction level of the consumers. We have implemented an optimization algorithm using mixed-integer linear programming (MILP) approach. Our motive is to obtain cost-effective optimal decision vectors for home integrated energy supply entities and smart load demands for the whole day. We have also exploited the efficiency parameters along with storage degradation model of energy storage devices (ESDs) for the exact realization of storage capacities and costs. The simulation results demonstrate the effectiveness of our operational strategy by scheduling ESEs and SLDs with the least cost option available. We also make ensure the high utilization of locally installed PV energy and the significant satisfaction level of the energy consumers.
In our future work, we may incorporate a 24-Hr rolling time horizon scheduling mechanism. We may use a framework of model predictive control to establish a real-time control strategy for ESEs and SLDs. It will help in handling the uncertainties in the electricity prices and solar irradiance values. It may also further reduces the cost of electricity and dissatisfaction of the consumers by predicting the new load demand arrivals on hourly basis.