Welcome to the world of Optimizations

In this blog concepts of conventional and unconventional optimization techniques are discussed.

Monday, November 8, 2010

Solving Optimization Problems Using MATLAB GA toolbox-Part 2

Now let us learn how to use the GA in command line mode.
the basic syntax to run the GA in command mode is
x = ga(@fitnessfunction,nvar,options)

fitnessfunction:Function file relating the control variables(x) with function value(F).

nvar: no of  control variables

options: Genetic algorithm parameters setting.


GA Options



PopulationType: [ 'bitstring'      | 'custom'    | {'doubleVector'} ]:-Type of the population 'custom' :  :binary,'double vector': real values

PopInitRange: [ matrix           | {[0;1]} ]: Initial value range default is [0 to 1] you can change this by giving two column vectors .For the example problem discussed for the GUI mode the limits can be like this
l=[0 0]'; u=[10 10]';

        
PopulationSize: [ positive scalar  | {20} ]-Size of the population

            
EliteCount: [ positive scalar  | {2} ]:The number best solution in each generation to be saved.

    
CrossoverFraction: [ positive scalar  | {0.8} ]: cross over value between 0 to 1

    
MigrationDirection: [ 'both'           | {'forward'} ]  The solution vector is moved in both direction.(increase or decrease)
    
MigrationInterval: [ positive scalar  | {20} ]
    
MigrationFraction: [ positive scalar  | {0.2} ]

          
Generations: [ positive scalar  | {100} ]: no of iterations
            
TimeLimit: [ positive scalar  | {Inf} ]: Time Limit for the algorithm

          
FitnessLimit: [ scalar           | {-Inf} ]:;Set value or a typical known fitness value

        
 StallGenLimit: [ positive scalar  | {50} ]: If Solution is not changing for certain number of generation stop the algorithm
        
StallTimeLimit: [ positive scalar  | {20} ]: If Solution is not changing for certain time, stop the algorithm
    
 InitialPopulation: [ matrix           | {[]} ]:You can specify initial feasible solution if already known.

  InitialScores: [ column vector    | {[]} ]: Known function values

 CreationFcn: [ function_handle  | {@gacreationuniform} ]; random function for creating initial population

 FitnessScalingFcn: [ function_handle  | @fitscalingshiftlinear  | @fitscalingprop  | :testing the fitness
                             @fitscalingtop   | {@fitscalingrank} ]
SelectionFcn: [ function_handle  | @selectionremainder    | @selectionrandom |
                            @selectionroulette | @selectiontournament   | {@selectionstochunif} ]
          
CrossoverFcn: [ function_handle  | @crossoverheuristic  | @crossoverintermediate |
@crossoversinglepoint | @crossovertwopoint | {@crossoverscattered} ]:Different crossovers
          
MutationFcn: [ function_handle  | @mutationuniform | {@mutationgaussian} ]:  Mutation function
            
HybridFcn: [ @fminsearch | @patternsearch | @fminunc | {[]} ]: After GA run another local minimizing function is run

Display: [ off | iter | diagnose | {final} ]: the results are displayed
            
OutputFcns: [ function_handle  | @gaoutputgen | {[]} ]:the output producing function
            
 PlotFcns: [ function_handle  | @gaplotbestf | @gaplotbestindiv | @gaplotdistance | @gaplotexpectation | @gaplotgeneology | @gaplotselection | @gaplotrange | @gaplotscorediversity  | @gaplotscores | @gaplotstopping  | {[]} ]: Choose the graphs you want
          
PlotInterval: [ positive scalar  | {1} ]: The plotting interval

            
Vectorized: [ 'on'  | {'off'} ]

Program in command mode.


This file  and the function file should be in the same folder which should be default.

the options can be set by the following commands

% setting the genetic algorithm parameters.
options = gaoptimset;
options = gaoptimset('PopulationSize', 50,'Generations', 500,'TimeLimit', 200,'StallTimeLimit',100,
'PlotFcns',  {@gaplotbestf,@gaplotbestindiv});
  [x ff]=ga(@ex1,2,options)

.

26 comments:

Anonymous said...

thnks

Anonymous said...

thanks a lot

Anantha Raman said...

sir,please post optimal power flow using differential evolution algorithm

Anantha Raman said...

sir please post transient stability constrained optimal power flow using differential evolution

Anonymous said...

sir please help me in optimal power flow using genetic algorithm. can u please email me codes on my email id deepanshu.nimal@gmail.com

Anonymous said...

Hello! I know this is somewhat off topic but I was wondering which blog platform are you using for this
site? I'm getting tired of Wordpress because I've
had problems with hackers and I'm looking at options for another platform. I would be fantastic if you could point me in the direction of a good platform.

My weblog: binary options broker

Anonymous said...

Thanks for sharing such a good opinion, post is pleasant,
thats why i have read it completely

Here is my weblog ... forex binary options

Anonymous said...

My developer is trying to persuade me to move to .net from
PHP. I have always disliked the idea because of the costs.
But he's tryiong none the less. I've been using Movable-type on various websites for about a year and
am concerned about switching to another platform.
I have heard very good things about blogengine.
net. Is there a way I can import all my wordpress posts into
it? Any help would be greatly appreciated!

Have a look at my web page; hcg diet

Anonymous said...

Hi colleagues, its great post about educationand completely explained, keep it
up all the time.

Here is my web blog - este usuario

Anonymous said...

Great blog! Is your theme custom made or did you
download it from somewhere? A design like yours with a few simple adjustements would really make my blog stand out.
Please let me know where you got your theme. Thanks a lot

Feel free to surf to my web page ... pregnancyhelper.in

Anonymous said...

Hello, I would like to subscribe for this blog to obtain newest updates, therefore where can i do it please help out.


Feel free to visit my webpage: klimatyzacja samsung warszawa

Anonymous said...

What's up mates, good article and fastidious arguments commented at this place, I am in fact enjoying by these.

Also visit my homepage; klimatyzacja

Anonymous said...

Remarkable issues here. I am very glad to peer your article.
Thanks so much and I'm having a look ahead to contact you. Will you please drop me a mail?

my web blog; klimatyzacja

Anonymous said...

Wonderful web site. Lots of helpful info here. I'm sending it to some pals ans additionally sharing in delicious. And naturally, thanks for your sweat!

Here is my web blog ... klimatyzacja

Anonymous said...

This info is priceless. Where can I find out more?

Feel free to surf to my web-site ... http://www.teengirlsporn.net

Anonymous said...

Hmm it appears like your blog ate my first comment (it was super long) so I guess I'll just sum it up what I wrote and say, I'm thoroughly
enjoying your blog. I as well am an aspiring blog writer but I'm still new to everything. Do you have any helpful hints for first-time blog writers? I'd certainly appreciate it.


my web blog: binary options trading systems :: :
:

Anonymous said...

Excellent blog right here! Additionally your website lots up very fast!
What web host are you the use of? Can I get your associate link in
your host? I want my site loaded up as quickly as yours
lol

Also visit my website: Asian Teens Sex :: sn.im ::

Anonymous said...

Nice blog! I need to take fitness difference between generations and calculate the bit difference between individuals. I can't able to get the replaced population after subsequent runs in GAtoolbox. If any one knows kindly post it!

Anonymous said...

These might even be honey, smooth peanut butter, jam or marmalade, curry source, crab
paste, tomato puree, liquidised fruits or liquidised liver;
look into why you are doing this and why you are choosing
these substances (see my ebooks. To make your own baby shampoo at home, you'll need:.
) In this regard you might think that nutritional de-hulled hemp seed bars or hemp oil would be a good
thing for everyone - but this is far from being the truth.



Here is my site juicer raw food recipes for beginners

Anonymous said...

ll end uρ being encouraged to provide fɑr
more brand new terms tо аll yokur vocabulary οnly to Ьe capable
of accomplish tɦat kind օf transfer оnce аgain.
Thе apprval maҡes most dictionaries accessible սsed іn any crossword bіll, supplying
a goߋd amount oof latest resսlts fօr thе granted word
design. Alsο connecting event which offers а loot of
time fօr youu tο chat, bring аlοng ecologically-pleasant green fluids canisters to
deliver аs gifts observing tҺe morning of yоur reception occasion.

Αlso visit my webpage :: scrabble free download full version

Anonymous said...

It's not my first time to pay a quick visit this website, i am
visiting this site dailly and obtain good information from here
all the time.

Also visit my webpage fotograf ślubny opole

Anonymous said...

Enjoy youг "Azines" and in addition еmpty tile.
I mightt saay which is enjoying scraabble nedver was
verƴ easy, ennjoyable ɑnd also educative ahead οf the creation οf thiѕ wonderful scrabble phrase person. А lot of us poѕsibly never forget ɑn occasion or еven a couple of
if ԝe anticipated we wll creep ɑny lоοk in tҺе book to manage tto аrea ѕomething on tthe aboard.


mƴ web ρage ... Scrabble Free Download

Anonymous said...

Fine wway off explaining, and fastidious paragraph to take information regarding my presentation focus,
which i am going to convey in college.

Have a look at my website: first time buyers ()

Anonymous said...

e cigarette health, e cigarettes, e cig forum, best electronic cigarette, smokeless cigarettes, electronic cigarettes

Karthika Shree said...

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
Matlab Training in Chennai

sunitha vishnu said...

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Post a Comment