How to write matlab code for following equation using multiobjective genetic algorithm and get the minimized value of 'd' as output ?
Mostra commenti meno recenti

Using multiobjective optimization solve this function with following:
The initial population is stated as follows:

I am facing problem in executing codes for this question, I have coded as follows:
I made a filness function "fitfu2" as
function y = fitfu2(N)
%N = 12; % element numbers
j = sqrt(-1);
AF = zeros(1,360);
deg2rad=zeros(1,360);
for theta = 60:360
deg2rad(theta) = (theta*pi)/180;
for k = 1:N-1
for d = 0:0.5:0.5*k
for n=1:N-1
AF(theta) = AF(theta) + exp(j*n*2*pi*d*(cos(deg2rad(theta))));
end
AF(theta)=1+AF(theta);
end
end
end
y = abs(AF(theta));
and then I used following codes to use multiobjective genetic optimization toolbox
N=12; % Number of elements
FitnessFunction = @(d) fitfu2(N);
NumberOfVariables = 11;
options = gaoptimset('PopulationSize',20);
[x,f] = gamultiobj(FitnessFunction,NumberOfVariables,[],[],[],[],2,10,options);
This is executing but I am confused about how to get desired output and I am not getting minimized value of 'd'.
Actually I want to Optimize this function taking 'd' as a parameter means to minimize the function as well as minimize 'd' and give the minimized value of 'd' at each iteration as optput.
If there is any Error or wrong coding ,Please Rectify and send me back the rectified codes that will execute and give me desired result.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Genetic Algorithm in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!