1 简介

世界杯算法(World Cup Optimization(WCO))是于2016年提出的,一种基于国际足联世界杯比赛的数学函数优化方法。该方法具有收敛速度快,寻优能力强等特点。

This paper presents a new optimization algorithm based on human society’s intelligent contests. FIFA World Cup is an international association football competition competed by the senior men’s national teams. This contest is one of the most significant competitions among the humans in which people/teams try hard to overcome the others to earn the victory. In this competition there is only one winner which has the best position rather than the others. This paper introduces a new technique for optimization of mathematic functions based on FIFA World Cup competitions. The main difficulty of the optimization problems is that each type of them can be interpreted in a specific manner. World Cup Optimization (WCO) algorithm has a number of parameters to solve any type of problems due to defined parameters. For analyzing the system performance, it is applied on some benchmark functions. It is also applied on an optimal control problem as a practical case study to find the optimal parameters of PID controller with considering to the nominal operating points (Kg(Kg, Tg)Tg) changes of the AVR system. The main objective of the proposed system is to minimize the steady-state error and also to improve the transient response of the AVR system by optimal PID controller. Optimal values of the PID controller which are achieved by WCO algorithm are then compared with particle swarm optimization and imperialist competitive algorithm in different situations. Finally for illustrating the system capability against the disturbance, it is applied on a generator with disturbance on it and the results are compared by the other algorithms. The simulation results show the excellence of WCO algorithm performance into the nature base and other competitive algorithms.

2 部分代码

%% ---------------------------Function-------------------------------------
  • 1.
%1.wca
Main Function
%2.my_cost_function Fitness (Cost) Function
  • 1.
  • 2.
  • 3.
%% ------------------INITIALIZATION OF PARAMETERS--------------------------
  • 1.
commandwindow
  • 1.
clear all;
  • 1.
close all;
  • 1.
clc;
  • 1.
disp('************************************** ')
  • 1.
disp(' World Cup Optimization Algorithm ')
  • 1.
disp('************************************** ')
  • 1.
tic
  • 1.
warning('off')
  • 1.
itr=0;
  • 1.
iter=100; %no_competition_periods
  • 1.
no_par=2;
  • 1.
% countries=4;
  • 1.
% continents=5;
  • 1.
% popsize=countries*continents;
  • 1.
le1=length(current_position1);
  • 1.
dle1=popsize-le1;
  • 1.
if dle1>0
  • 1.
current_position1=[current_position1 zeros(no_par,t)]; % in this part, we can utilize the high rating countries instead of zeros
  • 1.
else if dle1<0
  • 1.
current_position1=current_position1(:,1:popsize);
  • 1.
end
  • 1.
end
  • 1.
le2=length(current_position2);
  • 1.
dle2=popsize-le2;
  • 1.
if dle2>0
  • 1.
current_position2=[current_position2 zeros(no_par,t)];
  • 1.
else if dle2<0
  • 1.
current_position2=current_position2(:,1:popsize);
  • 1.
end
  • 1.
end
  • 1.
le3=length(current_position3);
  • 1.
dle3=popsize-le3;
  • 1.
if dle3>0
  • 1.
current_position3=[current_position3 zeros(no_par,t)];
  • 1.
else if dle3<0
  • 1.
current_position3=current_position3(:,1:popsize);
  • 1.
end
  • 1.
end
  • 1.
le4=length(current_position4);
  • 1.
dle4=popsize-le4;
  • 1.
if dle1>0
  • 1.
current_position4=[current_position4 zeros(no_par,t)];
  • 1.
else if dle4<0
  • 1.
current_position4=current_position4(:,1:popsize);
  • 1.
end
  • 1.
end
  • 1.
le5=length(current_position5);
  • 1.
dle5=popsize-le5;
  • 1.
if dle5>0
  • 1.
current_position5=[current_position5 zeros(no_par,t)];
  • 1.
else if dle5<0
  • 1.
current_position5=current_position5(:,1:popsize);
  • 1.
end
  • 1.
end
  • 1.
le6=length(current_position6);
  • 1.
dle6=popsize-le6;
  • 1.
if dle6>0
  • 1.
current_position6=[current_position6 zeros(no_par,t)];
  • 1.
else if dle6<0
  • 1.
current_position6=current_position6(:,1:popsize);
  • 1.
end
  • 1.
end
  • 1.
% l_b_p_n=[current_position1 current_position2 current_position3 current_position4 current_position5 current_position6];
  • 1.
%% plot%%%
  • 1.
grid on
  • 1.
%%% Plot the fitness reaching manner%%%%%%%%%%%%%%%%%%%%%
  • 1.
% whitebg([.2 1 .8])
  • 1.
% set(gcf,'Color',[0.2,0.6,0.8])
  • 1.
% rectangle('Position',[-.1,-.1,.2,.2],'LineWidth',2)
  • 1.
% hold on
  • 1.
% h = stem(zeros(1),(final_best_fitness),'fill','--');
  • 1.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 1.
%%%%%%%%%%%%%%%%%%%% Plot the final_best_fitness manner%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 1.
plot(itr,abs(final_best_fitness),'-bs','LineWidth',2,'MarkerFaceColor','g','MarkerSize',5)
  • 1.
hold on
  • 1.
xlabel('Cup','FontSize',10);
  • 1.
ylabel('Fitness','FontSize',10);
  • 1.
% xlabel('Cup');
  • 1.
% ylabel('Fitness');
  • 1.
title('Mean of Best function values','FontSize',10);
  • 1.
grid on
  • 1.
% title(['min cost is ',num2str(final_best_fitness)]);
  • 1.
% pause(0.05)
  • 1.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 1.
end
  • 1.
toc
  • 1.
disp('-------------------------------------- ')
  • 1.
final_best_position
  • 1.
disp('-------------------------------------- ')
  • 1.
final_best_fitness
  • 1.
disp('-------------------------------------- ')
  • 1.
% End of Algorithm
  • 1.

3 仿真结果

管理博文 【优化求解】基于世界杯算法求解最优目标matlab代码_数学函数

4 参考文献

[1] Navid Razmjooy et al., A New Meta-Heuristic Optimization Algorithm Inspired by FIFA World Cup Competitions: Theory and Its Application in PID Designing for AVR System[J]. J. Control Autom. Electr Syst. 2016.

管理博文 【优化求解】基于世界杯算法求解最优目标matlab代码_数学函数_02