How can i improve the performance of Genetic algorithm ?

5 vues (au cours des 30 derniers jours)
marian farouk
marian farouk le 28 Août 2013
i have a code using genetic algorithm ,&to get the best performance for 3 anntenas the desired signal at theta =30 & the unwanted signal at=-60 ,my fitness function is to get minimum error,the antenna weights are complex the problem is the error which output from the algorithm is very small but the main desired beam not get on theta=30,i tried to increase the number of iterations & the number of population & put initial point but the performance isn`t good the general algorithm : if true clear clc close all global m m=1; thetaS =30; ObjectiveFunction = @newone1; nvars =6; % Number of variables LB = [0 0 0 0 0 0]; % Lower bound UB = [1 1 1 1 1 1]; % Upper bound d = .5; % element spacing in terms of wavelength d = lambda/2 options = gaoptimset('PopulationSize',300,'CreationFcn', {@gacreationuniform},'FitnessScalingFcn', {@fitscalingprop},'SelectionFcn',@selectionroulette,'MutationFcn',@mutationadaptfeasible,'CrossoverFcn',@crossoverheuristic,'FitnessLimit',0.0001,'Generations',100);%'InitialPopulation',X0);
options = gaoptimset(options,'PlotFcns',{@gaplotbestf,@gaplotstopping,@gaplotbestindiv}, ... 'Display','iter');% Next we run the GA solver.%@gaplotrang
[x,fval,exitFlag,Output, population,scores] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB,[],options) theta = -pi/2:.01:pi/2; AF = zeros(1,length(theta)); x=[x(:,1)+j*x(:,2) x(:,3)+j*x(:,4) x(:,5)+j*x(:,6)];
% Determine the array factor for linear array for i = 1:nvars/2
AF = AF +x(i)'.*exp(1j*(i-1)*2*pi*d*sin(theta));
end
end
the fitness function is called( newone1) & i use least minimum sqaure error : if true % code function abse =newone1(w) d = .5; % element spacing in terms of wavelength d = lambda/2 N =6; % number of elements in array global m
thetaS =30; % input(' What is the desired users AOA (in degrees)? '); thetaI =-60; % input(' What is the interferers AOA(in degrees)? '); %----- Desired Signal & Interferer -----% T=1E-3; t=(1:1000)*T/1000; S=cos(2*pi*t/T); thetaS = thetaS*pi/180; % desired user AOA I = randn(1,1000); thetaI = thetaI*pi/180; % interferer AOA
%----- Create Array Factors for each user's signal for linear array -----%
vS = []; vI = []; i=1:N/2; vS=exp(1j*(i-1)*2*pi*d*sin(thetaS)).'; vI=exp(1j*(i-1)*2*pi*d*sin(thetaI)).';
%----- Solve for Weights using LMS -----%
m=m+1;
b=floor (m/301)+1;
x = S(b).*vS + I(b).*vI;
w;
w1=[ w(:,1)+j*w(:,2) w(:,3)+j*w(:,4) w(:,5)+j*w(:,6) ];
y=w1*x;
e =(S(b))- y;
abse=abs(e);
end
end

Réponses (0)

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by