1 简介 2 部分代码 %--------------------------------------------------------------------------------------------------------------------------- %--------------------------------------------------------------------------------------
1 简介
2 部分代码
%---------------------------------------------------------------------------------------------------------------------------%---------------------------------------------------------------------------------------------------------------------------
clear
close all
clc
nP=50; % Number of Population
Func_name='F2'; % Name of the test function, range from F1-F14
MaxIt=200; % Maximum number of iterations
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=BenchmarkFunctions(Func_name);
[Best_fitness,BestPositions,Convergence_curve] = RUN(nP,MaxIt,lb,ub,dim,fobj);
%% Draw objective space
figure('Position',[269 240 660 290])
%Draw search space
subplot(1,2,1);
func_plot(Func_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([Func_name,'( x_1 , x_2 )'])
%Draw objective space
subplot(1,2,2);
semilogy(Convergence_curve,'Color','r','linewidth',2)
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
3 仿真结果
4 参考文献
[1]郑建东, 牟永强, 李峰,等. 基于龙格库塔算法的航天器变轨发动机安装参数优化方法:, 2018.