Demand Side Management and Dynamic Economic Dispatch Using Genetic Algorithms

: The purpose of this work is to ﬁnd the optimal energy management mix in order to maximize the beneﬁt for the client by minimizing the bill and reducing losses by optimizing the energy distribution in the network. There exist two smart grid management problems: demand side management (DSM) and dynamic economic dispatch (DED). DSM consists of modifying electricity consumption patterns with reference to the overall consumption picture, consumption time proﬁle, and contractual supply parameters in order to achieve savings in electricity charges. DED aims at providing the ideal share of electricity produced corresponding to the overall energy request of users and the generated power. Research works in the literature dealt with DSM or DED issues independently. In this work, genetic algorithms will be used to solve DSM and DED problems, considering them as two complementary stages in the optimization process.


Introduction
Smart grid is a modernized electricity network that functions based on a two-way communication link.Smart grids, in addition to supporting utility companies in preserving energy, lowering expenditures, and raising network intelligibility, durability and effectiveness, encourage user involvement.Smart power managing encompasses the plancontrol-optimize energy acts via intelligent responses or sophisticated equipment with the final goal to enhance production and ease, as well as to lessen the electricity price and emissions [1].
Demand side management (DSM) refers to plan and control actions that would in one way or another influence the end customer request in energy.The aim of the DSM plan is to reduce costs of electricity, which in turn restricts the need for building more transmission and distribution networks [2].Various DSM strategies have been suggested and implemented.These include-energy conservation and energy efficiency, energy consumption optimization and scheduling, demand response, distributed generation, and energy storage [3,4].To shape the end used energy consumption profile, a lot of mechanisms exist.Practical approaches are comprised of peak clipping, basin fill up, intentional preservation, consumption transferring, and time-reallocation [5,6].
With the advances in computers, computing techniques have been applied to the DSM problem.These techniques include artificial neural network, fuzzy logic and metaheuristic computation [7].A user-adapted scheme is built up to tune the consumer's altering favorites in [8].An HVAC system has been managed via fuzzy logic concepts with the efficacy contrasted with the traditional on-off counterpart in [9].An intelligent HEMS using fuzzy logic to control storage and demand is proposed in [10].An hourly energy consumption predictor [11] is developed using a multilayer perceptron.Artificial neural networks were deployed to predict DR and electricity request profile to sustain an intelligent house that is energetically efficient [12][13][14].An optimized electricity planner for consumption reliability was studied with the optimization task resolved via PSO [15].An online energy organizer for intelligent house electricity management, considering renewable sources and battery systems, was built up in [16].A consumption prediction for a whole day was assumed prior to optimized planning with a joint Harmony Search-PSO approach via an HMI, inner manager, and various consumption levels [17].A two-stage profound strengthening training strategy for domestic device planning besides incorporating charging and discharging schedules of energy storage and EV has been presented in [18].On the other hand, economic dispatch refers to the share of total energy generation within existing distributed generators.Online active planning refers to online dynamic economic dispatch (DED) of energy and aims at minimizing the overall operating fuel cost and fulfilling the energy request in each time interval.Optimization techniques for solving the DED problem have been applied in the literature.Examples include artificial immune system algorithm [19], genetic algorithms [20], artificial bee colony [21], and particle swarm optimization [22,23].
The purpose of this paper is to illustrate Smart Grid management problems in order to maximize the benefit for the consumer.The aim is to minimize the bill and reduce losses.We will be using genetic algorithms to solve DSM and DED problems by considering them as two complementary stages in the optimization process.

DSM Optimization (First Stage)
Demand side management is one of the main elements in smart grids and has many advantages to both utility and users.Its goal is to wisely employ the existing electricity to enhance the financial matters of the grid.Controlling the energy profile may cut down on the maximum energy request, and hence enhance the efficacy of the power system, lowering hazardous emissions and energy cost for consumers.
Here, a DSM approach utilizing load shifting method considering several kinds of domestic devices at different time slots in order to minimize a cost function, along with the equality and inequality restraints to reach energy bill maximum and decrease the Max to Typical Quotient.The load scheduling problem is formulated as follows: To illustrate the efficacy of the adopted approach, the scheme is applied on two unlike regions: residential and commercial areas.The regions have diverse kinds of controllable appliances, as detailed in Tables 1 and 2. It is clear from Figure 1a that the peak load of the residential area has been reduced by about 21.04%.Residential users schedule their maximum load where the price is low, which leads to minimize the electricity bill, as shown in Figure 1c.Indeed, the electricity bill has been reduced from 311,290 $ to 257,940 $ per day, which accounts for about a 17.1382% reduction.
which leads to minimize the electricity bill, as shown in Figure 1c.Indeed, the electricity bill has been reduced from 311290$ to 257940$ per day, which accounts for about a 17.1382% reduction.For the commercial area, peak load is reduced, where it used to be 1752 kW, it is now 2301 kW, which means a reduction of about 23.85% in max.consumption, as shown in Figure 1c.The electricity bill used to be 380650$ and has been lowered to 297040$ a day, which translates to about a 21.9647% reduction in the electricity bill per day as seen in Figure 1d.

ED Optimization (Second Stage)
This stage will use the best adequate sharing of appliances utilized by consumers at various time intervals obtained from the 1st optimization stage.To keep the price and electricity simultaneously at their minimum values, this second phase considers the following cost function: where: () , is the share of electricity obtained from generator 's' to consumer 'u' during inteval 't'. () is the electricity from source 's' in the interval 'i'(kWh). () is the corresponding price ($/kWh). , is a parameter to account for losses due to the Joule effect and depends on the relative location of consumer and electricity generator.The equality constraint equation is defined by: () , . () = () , . () , . ,  () , . .
where: n is the number of electrical devices. () ,   are the energy consumed by scheduled and nonscheduled appliances, respectively, in (kW). , is the time of use for appliance 'a' utilized by consumer 'u' in the interval multiplied by i'(hours). , can take values smaller or equal to the time length T.
In this section, we took 5 users, 5 devices, 32 total device numbers, 4 slots of time and 3 different energy sources.
Step1 (selection): introducing the required input data randomly, generating the initial population of chromosomes that is called parents that contribute to the population of the next generation.Evaluate the equality constraint, if any chromosome violates the problem's constraints, it will be replaced by another randomly selected one.
Step2 (fitness selection): This step concerns the objective function calculation for the potential solutions in the chosen group.The smallest objective function value with respect to the evaluation obtained in the preceding iterations is regarded as a first best result of the optimization process.More fit individuals are more likely to be selected.
The optimized energy profile for each consumer at each time interval will be fulfilled by three unlike generators: PV, wind and fossil fuel energy, for the sake of establishing in each time interval the best combination with respect to the share of each power generator For the commercial area, peak load is reduced, where it used to be 1752 kW, it is now 2301 kW, which means a reduction of about 23.85% in max.consumption, as shown in Figure 1c.The electricity bill used to be 380,650 $ and has been lowered to 297,040 $ a day, which translates to about a 21.9647% reduction in the electricity bill per day as seen in Figure 1d.

ED Optimization (Second Stage)
This stage will use the best adequate sharing of appliances utilized by consumers at various time intervals obtained from the 1st optimization stage.To keep the price and electricity simultaneously at their minimum values, this second phase considers the following cost function: where: X(s) i,u is the share of electricity obtained from generator 's' to consumer 'u' during inteval 't'.E s (i) is the electricity from source 's' in the interval 'i' (kWh).C s (i) is the corresponding price ($/kWh).d u,s is a parameter to account for losses due to the Joule effect and depends on the relative location of consumer and electricity generator.The equality constraint equation is defined by: where: n is the number of electrical devices.P shi f (i) a,u and P unshi f t are the energy consumed by scheduled and nonscheduled appliances, respectively, in (kW).∆t a,u is the time of use for appliance 'a' utilized by consumer 'u' in the interval multiplied by 'i' (hours).∆t a,u can take values smaller or equal to the time length T.
In this section, we took 5 users, 5 devices, 32 total device numbers, 4 slots of time and 3 different energy sources.
Step 1 (selection): introducing the required input data randomly, generating the initial population of chromosomes that is called parents that contribute to the population of the next generation.Evaluate the equality constraint, if any chromosome violates the problem's constraints, it will be replaced by another randomly selected one.
Step 2 (fitness selection): This step concerns the objective function calculation for the potential solutions in the chosen group.The smallest objective function value with respect to the evaluation obtained in the preceding iterations is regarded as a first best result of the optimization process.More fit individuals are more likely to be selected.
The optimized energy profile for each consumer at each time interval will be fulfilled by three unlike generators: PV, wind and fossil fuel energy, for the sake of establishing in each time interval the best combination with respect to the share of each power generator to fulfill each consumer in the time interval, all at the lowest price with the least electricity losses in the network.
In the foremost time interval, the share of each generator to fulfill each consumer is presented in Figure 2. In this time interval, electricity is delivered to consumers 1, 3, 4 and 5 from the wind generator and the grid, as no electricity is supplied from generator 1 (PV), at a relatively smaller importance for the grid generator, as it is cheaper compared to the wind generation in this time interval.
Eng. Proc.2022, 3, x 5 of 4 to fulfill each consumer in the time interval, all at the lowest price with the least electricity losses in the network.
In the foremost time interval, the share of each generator to fulfill each consumer is presented in Figure 2. In this time interval, electricity is delivered to consumers 1,3, 4 and 5 from the wind generator and the grid, as no electricity is supplied from generator 1 (PV), at a relatively smaller importance for the grid generator, as it is cheaper compared to the wind generation in this time interval.For the second time interval, Figure 3 illustrates the generated electricity for each consumer using the three generators and PV and grid generators show dominance.This is because the electricity generation prices of these generators are at (0.5$/kWh), which makes them cheaper than the cost of electricity generated by wind (0.7$/kWh).In the time interval 3, the price of electricity from the wind generator is lower than that of the PV generator, causing the dominance of the wind and grid generators as shown in Figure 4.For the second time interval, Figure 3 illustrates the generated electricity for each consumer using the three generators and PV and grid generators show dominance.This is because the electricity generation prices of these generators are at (0.5$/kWh), which makes them cheaper than the cost of electricity generated by wind (0.7$/kWh).
Eng. Proc.2022, 3, x 5 of 4 to fulfill each consumer in the time interval, all at the lowest price with the least electricity losses in the network.
In the foremost time interval, the share of each generator to fulfill each consumer is presented in Figure 2. In this time interval, electricity is delivered to consumers 1,3, 4 and 5 from the wind generator and the grid, as no electricity is supplied from generator 1 (PV), at a relatively smaller importance for the grid generator, as it is cheaper compared to the wind generation in this time interval.For the second time interval, Figure 3 illustrates the generated electricity for each consumer using the three generators and PV and grid generators show dominance.This is because the electricity generation prices of these generators are at (0.5$/kWh), which makes them cheaper than the cost of electricity generated by wind (0.7$/kWh).In the time interval 3, the price of electricity from the wind generator is lower than that of the PV generator, causing the dominance of the wind and grid generators as shown in Figure 4.In the time interval 3, the price of electricity from the wind generator is lower than that of the PV generator, causing the dominance of the wind and grid generators as shown in Figure 4.  Finally, the best share for the time interval 4 is related to consumer 5 only, who is fed from the wind and grid generators at a remarkable dominance of the wind generator, as shown in Figure 5.It is worth noting that these findings concern not only the electricity price, but also the cost of electricity losses while transmitting from generators to consumers via the distance parameters as well.

Conclusions
This work considers a set of users in two different regions employing many scheduled electrical appliances and supplied from various electricity generators.These generators exhibit variable electricity and production cost patterns at four daily time intervals.The planned electricity usage pattern for each region is dealt with separately for the sake of obtaining the best share of appliance usage time at various intervals to keep away from excessive consumption situation.At this situation, maximum values for the cost coefficient are adopted.The findings are then blended by computing the share of each power generator at each time interval.The results demonstrate the practicability of the adopted procedure with respect to the traditional non-planned techniques when considering both DSM and DED problems.Finally, the best share for the time interval 4 is related to consumer 5 only, who is fed from the wind and grid generators at a remarkable dominance of the wind generator, as shown in Figure 5.It is worth noting that these findings concern not only the electricity price, but also the cost of electricity losses while transmitting from generators to consumers via the distance parameters as well.Finally, the best share for the time interval 4 is related to consumer 5 only, who is fed from the wind and grid generators at a remarkable dominance of the wind generator, as shown in Figure 5.It is worth noting that these findings concern not only the electricity price, but also the cost of electricity losses while transmitting from generators to consumers via the distance parameters as well.

Conclusions
This work considers a set of users in two different regions employing many scheduled electrical appliances and supplied from various electricity generators.These generators exhibit variable electricity and production cost patterns at four daily time intervals.The planned electricity usage pattern for each region is dealt with separately for the sake of obtaining the best share of appliance usage time at various intervals to keep away from excessive consumption situation.At this situation, maximum values for the cost coefficient are adopted.The findings are then blended by computing the share of each power generator at each time interval.The results demonstrate the practicability of the adopted procedure with respect to the traditional non-planned techniques when considering both DSM and DED problems.

Figure 1 .
Figure 1.Optimization results: (a) Residential area daily energy consumption.(b) Commercial area daily energy.(c) Residential area daily electricity bill.(d) Commercial area daily electricity bill.

Table 1 .
Controllable devices in residential area.

Table 2 .
Controllable devices in commercial area.

Table 1 .
Controllable devices in residential area.

Table 2 .
Controllable devices in commercial area.