energy enigma-solution through genetic algorithm
TRANSCRIPT
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
1/18
Project Report On
ENERGY
ENIGMA
Anshuman Das Mohapatra
113CS0133
Course Title: Optimization Methods in Engineering
Course ID: CE403
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
2/18
1
With fossil fuels getting exhausted shortly and consequently less number of energy sources to
rely on, a huge energy crisis is expected. However, with a sustainable approach, energy can be
saved, which will reduce the intensity of the significant energy shortage in future. The main
objective of our project is to maximize the energy generation from a particular biogas plant by
locating a feasible region of its construction. The various proposed relationships between
population, economic development and efficiency are taken into account for generation of a
constrained non-linear optimization problem which is then solved through MATLAB. The
results are then compared with the population of various cities as per the Census of India, 2011.
The location of the Gas Pipeline Network of India plays a crucial role in the choosing a
solution among various cities in the feasible list. The approach in this project is however
gradual. We start with small linear optimization problem which can be solved graphically, then
add more variables to demonstrate the significance of other existing algorithms such asSimplex Algorithm, then go for a MATLAB solver to solve the main objective of this project
which cannot be solved by the Simplex approach. Therefore, certain other aspects of social
importance where this project can be used have also been covered.
ABSTRACT
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
3/18
2
I am grateful to Prof. Sarat Kumar Das, without whose guidance and support this compilation
would not have been possible. I could not have a profound approach and solution to real life
problems through effective techniques without him. I am also very thankful to Prof. Anil
Kumar Bangia for inculcating and consolidating Linear Programming concepts possessed by
me.
ACKNOWLEDGMENT
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
4/18
3
Contents
ABSTRACT ................................................................................................................................................... 1
ACKNOWLEDGMENT .................................................................................................................................. 2
INTRODUCTION .......................................................................................................................................... 4
LINEAR PROGRAMMING ............................................................................................................................ 5
GRAPHICAL SOLUTION.................................................................................................................... 5
UNDERSTANDING GRAPHICAL METHODOLOGY...................................................................... 5
FORMULATION OF EQUATIONS..................................................................................................... 6
SOLUTION TO THE PROBLEM......................................................................................................... 6
PROS & CONS TO GRAPHICAL METHOD...................................................................................... 7
PROBLEM STATEMENT.................................................................................................................... 7
ALGORITHM TO SOLVE THE STANDARD PROBLEM................................................................ 7
SIMPLEX METHOD OF SOLVING A LINEAR PROBLEM ............................................................ 8
DEALING WITH THE PROBLEM ................................................................................................................... 9
PROS & CONS TO SIMPLEX METHOD......................................................................................... 11
GENETIC ALGORITHM .............................................................................................................................. 11
FORMULATION OF NON-LINEAR MATHEMATICAL MODEL................................................ 12
GENERALIZED REDUCED GRADIENT ALGORITHM USING MICROSOFT EXCEL ......................................... 14
SOLVING THE MAIN PROBLEM.................................................................................................... 15
CONCLUSION ............................................................................................................................................ 16
BIBLIOGRAPHY ......................................................................................................................................... 17
http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673168http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673169http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673171http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673172http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673172http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673173http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673173http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673174http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673174http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673175http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673175http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673176http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673176http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673176http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673177http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673177http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673180http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673181http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673181http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673183http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673183http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673186http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673186http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673183http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673181http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673180http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673177http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673176http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673175http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673174http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673173http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673172http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673171http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673169http://c/Users/USER/Desktop/113CS0133_Project%20Report.pdf.docx%23_Toc434673168 -
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
5/18
4
INTRODUCTION
Energy statistics of the contemporary period suggest that we rely heavily on fossil energy for
our energy demands. Fossil energy is a non-renewable source of energy. It takes centuries for
the bio forms deep inside the earths crust to be converted into petroleum energy. Recent
statistics suggest that the Fossil Energy Fuel Industry is now entering terminal deadline.Therefore the need of the hour is an efficient energy plan layout to preserve the fossil energy in
the environment and switch over to renewable sources of energy. In the present scenario,
population masses are growing rapidly. Every day the increasing population adds waste
elements in the form of pollutants to the surroundings, which in turn makes the situation worse
with the incident of a lot of communicable and non-communicable diseases. Also, unchecked
sewage treatment leads to pollution of the water bodies there by affecting the aquatic life. We
can use this bio-waste source as a source of energy, which will not only allow sustainable
development but also preserve the environment.
Biogas typically refers to a mixture of differentgasesproduced by the breakdown oforganic
matter in the absence ofoxygen.Biogas can be produced from raw materials such as
agricultural waste,manure,municipal waste,plant material,sewage,green waste orfood
waste.It is a renewable energy source and in many cases exerts a very small carbon footprint.
Biogas can be produced byanaerobic digestion withanaerobic bacteria,which digest material
inside a closed system, orfermentation of biodegradable materials.
Biogas is primarilymethane (CH4) andcarbon dioxide (CO2) and may have small amounts of
hydrogen sulfide (H2S), moisture andsiloxanes.The gasesmethane,hydrogen,andcarbon
monoxide (CO) can be combusted or oxidized with oxygen. This energy release allows biogas
to be used as a fuel; it can be used for any heating purpose, such as cooking. It can also be used
in a gas engine to convert the energy in the gas into electricity and heat.
In this project, we aim to find the optimal location for setting up of a biogas plant in India, that
is, to find a feasible city with the requisite population size for an acceptable profit with
maximum efficiency of the plant as 95%.
https://en.wikipedia.org/wiki/Gashttps://en.wikipedia.org/wiki/Organic_matterhttps://en.wikipedia.org/wiki/Organic_matterhttps://en.wikipedia.org/wiki/Oxygenhttps://en.wikipedia.org/wiki/Manurehttps://en.wikipedia.org/wiki/Municipal_wastehttps://en.wikipedia.org/wiki/Plant_materialhttps://en.wikipedia.org/wiki/Sewagehttps://en.wikipedia.org/wiki/Green_wastehttps://en.wikipedia.org/wiki/Food_wastehttps://en.wikipedia.org/wiki/Food_wastehttps://en.wikipedia.org/wiki/Anaerobic_digestionhttps://en.wikipedia.org/wiki/Anaerobic_organismhttps://en.wikipedia.org/wiki/Fermentation_(biochemistry)https://en.wikipedia.org/wiki/Methanehttps://en.wikipedia.org/wiki/Carbon_dioxidehttps://en.wikipedia.org/wiki/Hydrogen_sulfidehttps://en.wikipedia.org/wiki/Siloxanehttps://en.wikipedia.org/wiki/Methanehttps://en.wikipedia.org/wiki/Hydrogenhttps://en.wikipedia.org/wiki/Carbon_monoxidehttps://en.wikipedia.org/wiki/Carbon_monoxidehttps://en.wikipedia.org/wiki/Carbon_monoxidehttps://en.wikipedia.org/wiki/Carbon_monoxidehttps://en.wikipedia.org/wiki/Hydrogenhttps://en.wikipedia.org/wiki/Methanehttps://en.wikipedia.org/wiki/Siloxanehttps://en.wikipedia.org/wiki/Hydrogen_sulfidehttps://en.wikipedia.org/wiki/Carbon_dioxidehttps://en.wikipedia.org/wiki/Methanehttps://en.wikipedia.org/wiki/Fermentation_(biochemistry)https://en.wikipedia.org/wiki/Anaerobic_organismhttps://en.wikipedia.org/wiki/Anaerobic_digestionhttps://en.wikipedia.org/wiki/Food_wastehttps://en.wikipedia.org/wiki/Food_wastehttps://en.wikipedia.org/wiki/Green_wastehttps://en.wikipedia.org/wiki/Sewagehttps://en.wikipedia.org/wiki/Plant_materialhttps://en.wikipedia.org/wiki/Municipal_wastehttps://en.wikipedia.org/wiki/Manurehttps://en.wikipedia.org/wiki/Oxygenhttps://en.wikipedia.org/wiki/Organic_matterhttps://en.wikipedia.org/wiki/Organic_matterhttps://en.wikipedia.org/wiki/Gas -
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
6/18
5
This is a mathematical technique for determining a way to achieve the best outcome
(such as maximum profit or minimum loss) in a given condition for some requirements
represented as linear relationships.
Linear programming can be solved either through graphical method or by using simplex
method.
Solution is achieved from the following steps:
I.
Formulation of objective equation and constraint equations from the problem
II.
Representing the objective equation and the constraint equations in a graph
III. Finding out the feasible region from the graph
Let a person wants to start a furniture business of tables and chairs. The cost price of each table
is Rs. 100 and that of each chair is Rs. 20. The selling price of the same is Rs. 120 and Rs. 35respectively. The capacity of the shop is 30 articles. The man can invest a maximum of Rs.
2000 for the business. He wants to have chairs more than or equal
to twice the number of tables. We need to find the number of chairs and tables the man should
buy so as to have a maximum profit.
Figure 1 Figure 2
LINEAR PROGRAMMING
GRAPHICAL SOLUTION
UNDERSTANDING GRAPHICAL METHODOLOGY
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
7/18
6
Let the man needs to buy x number of chairs and y number of tables. Our main objective function
is
Maximize p=15x+20y, where p is the profit obtained from the business.
Subject to constraints:
x>=0; y>=0
x+y
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
8/18
7
SOLUTION OBTAINED:
X = 18
Y = 9
P = 450
It is convenient for problems involving two variables. So for the main objective of this project
which is to determine an optimal location for the set up of a bio gas plant this method is not
suitable. Hence, we go
for the simplex method which facilitates the use of two or more variables to easily optimize a
linear programming problem.
To find out: The Grade point (p) of Population (x), Profit (y) and Efficiency (z) of Bio-Gas
Plant to be set up in a city by solving the following linear problem.
P-Grade point scale assigned to respective cities
Problem: To maximize p = x + y + z
Subject to constraints:
x + y + z 200.(i) (Maximum grade point is 200)
2x + yz 180(ii) (Twice the population with profit half of that and reduced
efficiency must yield a maximum grade point of 180)
x + 2y +2z 220(iii) (Reduced population with twice the profit and increased efficiency
by a factor of 2 must yield a maximum gradepoint of 220)
ALGORITHM TO SOLVE THE STANDARD PROBLEM
To generalize the main optimization problem, all the variables x, y & z are brought to left side
i.e.,
xyz + p = 0
Slack variables s, t, & u are introduced in the inequalities (i), (ii) & (iii) above to equate them
with zero as under.
x + y + z + s = 200
2x + yz + t = 180
-x + 2y + 2z + u = 220
Then a spread sheet is generated using Simplex Method.
PROS & CONS TO GRAPHICAL METHOD
PROBLEM STATEMENT
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
9/18
8
SIMPLEX METHOD OF SOLVING A LINEAR PROBLEM
Tableau - 1
x y z s t u p Ans. Ratio
s 1 1 1 1 0 0 0 200 200t 2 1 -1 0 1 0 0 180 90
u -1 2 2 0 0 1 0 220
p -1 -1 -1 0 0 0 1 0
Tableau - 2
x y z s t u p Ans.
s 0 1 3 2 -1 0 0 220 2R1-R2 220
x 2 1 -1 0 1 0 0 180 Pivot Row 180
u 0 5 3 0 1 2 0 620 2R3+R2 124
p 0 -1 -3 0 1 0 2 180 2R4+R2
Tableau - 3
x y z s t u p Ans.
s 0 0 12 10 -6 -2 0 480 5R1-R3 40
x 10 0 -8 0 4 -2 0 280 5R2-R3
y 0 5 3 0 1 2 0 620 Pivot Row 206.67
p 0 0 -12 0 6 2 10 1520 5R4+R3
Tableau - 4
x y z s t u p Ans.
z 0 0 12 10 -6 -2 0 480 Pivot Row
x 30 0 0 20 0 -10 0 1800 2R1+3R2
y 0 20 0 -10 10 10 0 2000 4R3-R1
p 0 0 0 10 0 0 10 2000 R4+R1
Conclusion:
x = 60
y = 100
z = 40
p = 200
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
10/18
9
The above smaller values are taken for a small hypothetical village just to establish the
linear relationships.
Using the same logic a program is compiled in C++ to compute the larger values which
are the integral multiples of the already established relationships.
The above smaller values are taken for a small hypothetical village just to establish the
linear relationships.
Using the QSopt softwareto compute for the larger constraint values which are the
close to the population census data.
MAIN PROBLEM:
Maximize
Objective function: x+y+z
Subject
c1:x+y-z
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
11/18
10
SOLUTION:
Objective:
10000190.00000
Primal Solution Values:
x = 6660095.00000
y = 3340000.00000
z = 95.00000
Both Ahmedabad and Chennai have population close to the above obtained value.
However, since, Ahmedabad is much closer to the Gas Pipeline Network of India, it should
be chosen as the optimal location to facilitate maximum efficiency and profit. The Gas
Pipeline Network would enhance the energy transportation at least cost.
Figure 4
Figure 5
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
12/18
11
The Simplex method can be used to solve Linear Programming Problems quite easily.
However, the real life problems are non-linear in nature. To arrive at a more accurate result we
use the APMonitor Interface in MATLAB and solve the non-linear programming problem as
formed below. The interface uses the Genetic Algorithm approach to arrive at the optimalsolution.
GENETIC ALGORITHM
The genetic algorithm is a method for solving both constrained and unconstrained optimization
problems that is based on natural selection, the process that drives biological evolution. The
genetic algorithm repeatedly modifies a population of individual solutions. At each step, the
genetic algorithm selects individuals at random from the current population to be parents and
uses them to produce the children for the next generation. Over successive generations, the
population "evolves" toward an optimal solution. You can apply the genetic algorithm to solvea variety of optimization problems that are not well suited for standard optimization
algorithms, including problems in which the objective function is discontinuous, non-
differentiable, stochastic, or highly nonlinear. The genetic algorithm can address problems
of mixed integer programming, where some components are restricted to be integer-valued.
The genetic algorithm uses three main types of rules at each step to create the next generation
from the current population:
Selection rulesselect the individuals, calledparents, that contribute to the population at the
next generation.
Crossover rulescombine two parents to form children for the next generation.
Mutation rulesapply random changes to individual parents to form children.
The genetic algorithm differs from a classical, derivative-based, optimization algorithm in two
main ways, as summarized in the following table.
Tableau - 5
Classical Algorithm Genetic Algorithm
Generates a single point at each iteration. The
sequence of points approaches an optimal
solution.
Generates a population of points at each
iteration. The best point in the population
approaches an optimal solution.
Selects the next point in the sequence by a
deterministic computation.
Selects the next population by computation
which uses random number generators.
In order to arrive at a better optimal solution the results of the APMonitor Interface Solver(using Genetic Algorithm) were compared with the Generalised Reduced Gradient Algorithm
of Microsoft Excel.
PROS & CONS TO SIMPLEX METHOD
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
13/18
12
In order to formulate the objective function, we need to consider the hypothesis that we want
squared profit with respect to the consuming population. With the population growing steadily,
the yielded plant efficiency is acceptable. So, the objective function can be given as
maximize p = x1+x22+x3
where, p is the Grade Point of the plant.
Figure 6
Source: U.S. Census Bureau, International Data Base, June 2011 Update
The figure above suggests that GDP growth of the country decreases in exponentially as the
population growth increases every year (this can happen in most of the developing countries
where the population may be a liability). So we use Data Science here to predict one of the
constraints as
-2*x1+x22+x3
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
14/18
13
rate of population growth do not necessarily imply low rates of per capita income if the
population is an asset. This leads us to the third constraint as
x1+x2-x3=0, x1=0
x3>=0, x3
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
15/18
14
The MATLAB solver computed the results in a variable y which had the following values:
Figure 9
Figure 10
The values suggest that, we can construct a biogas plant with 95% efficiency and a profit per
year of Rs. 3.1649e+03where the population is currently 99,96,930.
Figure 11
Although Bangalore has the population necessary for this purpose, however, Delhi must be
chosen as the feasible city, since it is closer to the Gas Pipeline Network of India.
GENERALIZED REDUCED GRADIENT ALGORITHM USING
MICROSOFT EXCEL
The GRG Solving method alonelike virtually all classical nonlinear optimization
algorithmscan find a locally optimalsolution to a reasonably well-scaled, non-convex model.
At times, Solver will stop before finding a locally optimal solution, when it is making very
slow progress (the objective function is changing very little from one trial solution to another)
or for other reasons.
When the message Solver found a solution appears, it means that the GRG method has founda locally optimal solutionthere is no other set of values for the decision variables close to the
current values that yields a better value for the objective function. Figuratively, this
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
16/18
15
means that Solver has found a peak (if maximizing) or valley (if minimizing) but if the
model is non-convex, there may be other taller peaks or deeper valleys far away from the
current solution.
Mathematically, this message means that the Karush - Kuhn - Tucker (KKT) conditions for
local optimality have been satisfied (to within a certain tolerance, related to the Precisionsetting in the Solver Options dialog).
SOLVING THE MAIN PROBLEM
Using the same set of nonlinear constraints, and the objective function, formulae were
incorporated into the Excel spreadsheet to connect the constraints to respective cells. The Excel
Solver Add-in was made active under the File->Options menu and the solver button under the
Data tab was used to insert the Solver Parameters as follows.
Figure 12
The solver solved the nonlinear constraint optimization problem using the GRG nonlinear
method (which was selected under the Solver Parameters dialog) and the respective cells in the
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
17/18
16
Excel spreadsheet were filled up with the optimal values.
Figure 13
Although the solver generates almost identical results to that of APMonitor Interface of
MATLAB, however, it can be easily noted that the GRG Nonlinear Algorithm doesnt
converge to the true values faster than the Genetic Algorithm. It stops with a population
requirement of 9996930.062 because of maximum iterations limit and fails to give the realistic
figure of 9996930 (which is obtained in case of Genetic Algorithm Method).
Three methods yielded two different results. The Simplex Algorithm suggested Ahmedabad as
the most feasible city for the setting up of the Biogas plant whereas the MATLAB solver and
the Excel solver brought Delhi as the feasible city. Since, the input to the solver in the second
case was a Non-Linear Optimization Problem which is more realistic than a LPP, therefore,
Delhi is the most feasible city for the given purpose. In other words, setting up a biogas plant at
Delhi would mean sustainable energy resource for years to come with boost to the GDP of the
country and a means for efficient waste usage. The Gas Pipeline Network in close proximity to
Delhi would mean easy access to the resource for nearby cities. Also we concluded that
Genetic Algorithm converges faster than GRG Nonlinear Algorithm with a maximum limit on
the number of iterations (under the Solver Parameters properties).
CONCLUSION
-
7/25/2019 Energy Enigma-Solution Through Genetic Algorithm
18/18
17
BIBLIOGRAPHY
http://cleantechnica.com/2015/07/20/the-fossil-fuel-energy-industry-is-now-entering-
terminal-decline/
in.mathworks.com
www.apmonitor.com www.wikipedia.org
www.youtube.com/watch?v=Q2zgz0ag0L0 (Mathematical Optimization with
MATLAB)
http://www.excel-easy.com/data-analysis.html
http://www.apmonitor.com/http://www.apmonitor.com/http://www.wikipedia.org/http://www.wikipedia.org/http://www.youtube.com/watch?v=Q2zgz0ag0L0http://www.excel-easy.com/data-analysis.htmlhttp://www.excel-easy.com/data-analysis.htmlhttp://www.excel-easy.com/data-analysis.htmlhttp://www.youtube.com/watch?v=Q2zgz0ag0L0http://www.wikipedia.org/http://www.apmonitor.com/