【优化求解】基于灰狼算法求解重油热解模型的建模matlab代码

149 阅读1分钟

1 简介

2 部分代码

%___________________________________________________________________%
% Grey Wold Optimizer (GWO) source codes version 1.0               %

% You can simply define your cost in a seperate file and load its handle to fobj 
% The initial parameters that you need are:
%__________________________________________
% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of generations
% SearchAgents_no = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers

% To run GWO: [Best_score,Best_pos,GWO_cg_curve]=GWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj)
%__________________________________________
clear all 
clc
for t = 1:1
   SearchAgents_no=30; % Number of search agents
   Max_iteration=100; % Maximum numbef of iterations
   % Load details of the selected benchmark function
%     [lb,ub,dim,fobj]=Get_Functions_details(Function_name);
   fobj = @heavyoilevaluate;
   ub = [10,10,10,1500,4000,4500,5,5];
   lb = [0,0,0,800,1500,1500,0,0];
   dim = size(ub,2);
  [Best_score,Best_pos,GWO_cg_curve]=GWO(SearchAgents_no,Max_iteration,ub,lb,dim,fobj);
    display(['The best solution obtained by GWO is : ', num2str(Best_pos)]);
   display(['Best value by GWO is : ', num2str(Best_score)]);
end
opt=heavyoilevaluate(Best_pos,20);

3 仿真结果

4 参考文献

[1]陈霄. 基于混沌DNA遗传算法的重油热解过程建模方法:, CN108345933A[P]. 2018.

部分理论引用网络文献,若有侵权联系博主删除。

5 MATLAB代码与数据下载地址

见博客主页