A Genetic Algorithm Approach to
Optimize Dispatching for a
Microgrid Energy System with
Renewable Energy Sources
by Sajib Sen, Kishor Datta Gupta,
Subash Poudyal and Md Manjurul
Ahsan
Objectives:
• Network Optimization(Opening unnecessary line section)
and radial network reduces the line loss and removes the
circulating current throughout the network.
• Matching or opening available energy sources according to
load demand reduces the generation cost, operating cost
and saves the extra power.
• Most of the demand satisfy by the Hydro-electric power if
demand not exceed. [Ref]
[Ref]: 1 megawatt-hour of electricity costs $90.3 in 2011 to generate using hydropower and $144.30
to generate using solar collectors, according to the U.S. Energy Information
10/25/2019 3
Algorithm:
Step 1: Initialize population of size N
for each population Initialize chromosome of size M=24 [24 for hours from 1AM to 12 AM]
for every chromosome initialize two types of genes: [ 2 types for 2 objectives]
Initialize genes for sources of size 3(3 bit) [ for optimizing energy sources]
Initialize genes for fittest network() of size 14 [ for network optimization]
for every chromosome calculate chromosome fitness based on fittest from both genes
Step 2:
For G number of generation
Evolve N population through Crossover & Mutation
Step 3: Output the fittest chromosome
Procedure of fittest network():
Initialize population of power network of size P of Graph G=(V,E)
Initialize chromosome of size Q [ Here 14] by check()
For R number of generation evolve population through crossover and mutation
Output: Fittest network after r generation
end
Procedure of check():
1 Generate Q number of genes of size 1 ( Random number from 1 to 16) by randomly deleting two edges and
checking Strong Connectivity through remaining edges. [Applied DFS to check strongly connectivity]
If not Strongly connected, repeat 1
Otherwise output the network.
end
10/25/2019 4
Run Time:
O(G(N(M(R(P(V+E))))))
V= nodes of load
E= Line section between loads
P= # of Population of power network g =(V+E)
R=# of generation to evolve the power network g =(V+E)
M= 24 # of genes having fittest power network and optimized energy sources
from R generation
N= # of M population
G= # of generation to evolve N population
Nested GA for two objective
optimization
GA for evolve fittest
individual
Initial Chromosome:
7 2 4 5 2 7 4 6 7 1 0 3 7 2 4 5 2 1 4 6 1 4 6 7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 24 hours period
111 010 …. 111 … … … 111
Binary 3 bit representation of initial chromosome. As our system is using 3 power sources.
Randomly selected
number from 0 to 7
for 24 hours period
510/25/2019
Encoding Scheme:
Time (t) Power Demand (𝑫 𝒕)
6 1.5 MW
Time (t) Hydro power
𝑃 𝑇1
Wind power
𝑃 𝑇2
Solar power
𝑃 𝑇3
Total power
6 220 kW 1934 kW 0 kW 2.154 MW
For time t=6-7 am Demand, 𝐷𝑡=1.5 MW
Generated power 𝑗=1
𝑛
𝑃 𝑇𝑗 = 220+1934+0= 2154 kW, where n=3 power sources
111 010 …. 111 … … … 111
t=6, gene= 111
610/25/2019
Encoding Scheme(Genes for Sources): An example
4
1
2 3
5
6 7
8
9
12
11
13
1410
15
Hydro Power Wind Power
Solar Power
Figure : Red numbers are nodes, Blue numbers are line section
16
11
12
13 14
15
16
17
18
19
20
21
22
23
24
25
26
Encoding Scheme(Genes for Fittest Network): Sample network
710/25/2019
Encoding
Scheme(Gen
es for Fittest
Network):
• Figure : Red numbers are nodes, Blue solid/dashed lines are line section
active/opened, Blue numbers are line section number
10/25/2019 8
Crossover Operation between network configuration :
P1:
P2:
O1:
O2:
11 12 19 20 18 16 22 24 17 23 25 14 13
11 12 19 20 18 16 22 24 17 23 26 14 13
11 12 19 20 18 16 21 22 17 23 25 14 13
Sample Example:
910/25/2019
10/25/2019 10
Fitness functions:
𝑝𝑒𝑛𝑎𝑙𝑖𝑧𝑒𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛, 𝑓𝐷 =
1, 𝑖𝑓𝐷𝑡 < 𝑗=1
𝑛
𝑃 𝑇𝑗
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
If Hydro power 𝑃 𝑇1 > 𝐷𝑖 and 𝑃 𝑇2 = 0 and 𝑃 𝑇3 = 0 [To use Hydro-electric power most ]
𝑓𝐻 =0.001 [Award]
If Hydro power & Wind power 𝑃 𝑇1 + 𝑃 𝑇2 > 𝐷𝑖 and 𝑃 𝑇3 = 0 & Hydro power 𝑃 𝑇1 < 𝐷𝑖
𝑓𝐻𝑊 =0.001 [Award]
𝑖=1
𝑅
min 𝑓𝐿 ; R is the number of generation occurred for network reconfiguration
𝐿𝑜𝑠𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛, 𝑓𝐿 = 𝑃𝐿𝑜𝑠𝑠 = 𝑖∈𝑁𝑖 𝐼𝑗
2
𝑅𝑖
where 𝐼𝑗 =
𝑃 𝑗
𝑉
=
𝑃 𝑗
220𝑘𝑉
, 𝑗 = 1,2 𝑎𝑛𝑑 3 and 𝑁𝑖= number of nodes
𝑉min < 𝑉𝑗 < 𝑉m𝑎𝑥
Individual gene fitness 𝑓𝑖 = 𝑓𝐷 * 𝑓𝐻 * 𝑓𝐻𝑊 * 𝑓𝐿
Total chromosome fitness = 𝑖=1
24
𝐹𝑖
Software used:
Eclipse
Library for performance
measures and ploting:
JFrame
Application
10/25/2019 11
Source: https://www.eia.gov/
Typical Daily Load Demand :
1210/25/2019
Figure : Typical Daily Load Demand
Source: https://www.eia.gov/
Hourly Breakdown of Renewable Resources :
13
10/25/2019
Figure : Hourly Breakdown of Renewable Resources
Performance
Measures:
10/25/2019
14
Performance
Measures(con
tinued):
10/25/2019
15
10/25/2019 16
Performance Measures(continued):
Figure : Network Configured for 1AM – 2 AM period with optimized energy sources
10/25/2019 17
Performance Measures(continued):
Figure : Network Configured for 2AM – 3 AM period with optimized energy sources
10/25/2019 18
Performance Measures(continued):
Figure : Network Configured for 3AM – 4 AM period with optimized energy sources
10/25/2019 19
Performance Measures(continued):
Figure : Network Configured for 4AM – 5AM period with optimized energy sources
10/25/2019 20
Performance Measures(continued):
Figure : Network Configured for 5AM – 6AM period with optimized energy sources
10/25/2019 21
Performance Measures(continued):
Figure : Network Configured for 6AM – 7AM period with optimized energy sources
10/25/2019 22
Performance Measures(continued):
Figure : Network Configured for 7AM – 8AM period with optimized energy sources
10/25/2019 23
Performance Measures(continued):
Figure : Network Configured for 8AM – 9AM period with optimized energy sources
10/25/2019 24
Performance Measures(continued):
Figure : Network Configured for 9AM – 10AM period with optimized energy sources
10/25/2019 25
Performance Measures(continued):
Figure : Network Configured for 10AM – 11AM period with optimized energy sources
10/25/2019 26
Performance Measures(continued):
Figure : Network Configured for 11AM – 12AM period with optimized energy sources
10/25/2019 27
Performance Measures(continued):
Figure : Network Configured for 12PM – 1PM period with optimized energy sources
10/25/2019 28
Performance Measures(continued):
Figure : Network Configured for 1PM – 2PM period with optimized energy sources
10/25/2019 29
Performance Measures(continued):
Figure : Network Configured for 2PM – 3PM period with optimized energy sources
10/25/2019 30
Performance Measures(continued):
Figure : Network Configured for 3PM – 4PM period with optimized energy sources
10/25/2019 31
Performance Measures(continued):
Figure : Network Configured for 4PM – 5PM period with optimized energy sources
10/25/2019 32
Performance Measures(continued):
Figure : Network Configured for 5PM – 6PM period with optimized energy sources
10/25/2019 33
Performance Measures(continued):
Figure : Network Configured for 6PM – 7PM period with optimized energy sources
10/25/2019 34
Performance Measures(continued):
Figure : Network Configured for 7PM – 8PM period with optimized energy sources
10/25/2019 35
Performance Measures(continued):
Figure : Network Configured for 8PM – 9PM period with optimized energy sources
10/25/2019 36
Performance Measures(continued):
Figure : Network Configured for 9PM – 10PM period with optimized energy sources
10/25/2019 37
Performance Measures(continued):
Figure : Network Configured for 10PM – 11PM period with optimized energy sources
10/25/2019 38
Performance Measures(continued):
Figure : Network Configured for 11PM – 12PM period with optimized energy sources
10/25/2019 39
Performance Measures(continued):
Figure : Network Configured for 12PM – 1AM period with optimized energy sources

A Genetic Algorithm Approach to Optimize Dispatching for A Micro-grid Energy System with Renewable Energy Sources