Challenge

Week 5 - Genetic Algorithm

AIM :

to understand the concept of genetic algorithm by referring to varius sources before you attend this challenge. Look out for information regarding stalagmite function and ways to optimise it.Write a code in MATLAB to optimise the stalagmite function and find the global maxima of the function.

DEFENITION :

A Genetic Algorithm is a search experiential that is stimulated by Charles Darwin’s theory of natural evolution. This algorithm reproduces the process of natural selection where the appropriate individuals are selected for reproduction in order to produce offspring of the next generation.

The genetic algorithm is a technique for solving both constrained and unconstrained optimization problems that are based on natural selection, the process that drives biological evolution. The genetic algorithm constantly modifies the population size of individual solutions.

SYNTAX:

[x,fval ,exitflag ,output ,population ,scores]= ga(func,nvars,A,b,Aeq,Beq,lb,ub,nonlcon,Intcon,options)

x = optimum solution

exitflag = reason ga stopped

output= information about optimization process

population=final population

scores= final scores

f=ga(fun,nvars,A,b,[],[],lb,ub,nonlcon,IntCon,options)

fun - fitness function.

nvars- number of variables,

A,b= Linear inequality constraints

Aeq,beq=Linear equality constraints

lb- Lower bound(limit),

ub- Upper bound(limit),

nonlcon : Use for nonlinear constraints

IntCon : to get solution in integer.

options- To set population size minimize with non-default options

CODE EXPLANATION :

  • First create a stalagmite function where we use to call the main function and it is a separate file .
  • next then create a GA function which is a main function of the code .
  • Then we get the local and global maxima of the given function .
  • Then using this program we try for three statistical test cases:
  • with bounded outputs
  • without bounded outputs
  • with increase in bounded outputs
  • Then we get the outputs and plots for all the statistical cases by using the GA program .

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.