Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: plot genetic algorithm output
Replies: 2   Last Post: Jun 7, 2013 5:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
mado

Posts: 116
Registered: 5/24/12
plot genetic algorithm output
Posted: Jun 7, 2013 2:31 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

how to plot X or Kp against the number of generations on y axis ?

clc
clear
%initialize genetic
%___________________________________
nvar=2;
FitnessFcn = @PID_objfun_ITAE
LB=[4 2 ];UB=[50 80 ];
options = gaoptimset;
options=gaoptimset(options,'populationsize',30,'Generations',6,'SelectionFcn', @selectionroulette)
%options = gaoptimset(options,'InitialPop', final_pop); % to improve search
options = gaoptimset(options,'MutationFcn' ,{ @mutationuniform 0.001 });
options = gaoptimset(options,'CrossoverFcn',@crossoverarithmetic);
options = gaoptimset(options,'PopInitRange' ,[4 2 ;50 80 ]);% bounds for ITAE
%options = gaoptimset(options,'PopInitRange' ,[3 2 0;12 15 5]);%bounds for MSE
options = gaoptimset(options,'PlotFcns', { @gaplotbestf @gaplotbestindiv });

%start algorithm
%______________________________________
[x,fval,exitflag,output,final_pop]=ga(FitnessFcn,nvar,[],[],[],[],LB,UB,[],options)
fprintf('Genetic Algorithm values :KP = %7.5f;KI = %7.4f ',x(1),x(2) )



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.