Matlab实现亨利气体溶解度优化算法

Posted 这是一个很随便的名字

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Matlab实现亨利气体溶解度优化算法相关的知识,希望对你有一定的参考价值。

【Matlab源码】

Henry Gas Solubility Optimization

灵感

HGSO 模仿亨利定律支配的行为来解决具有挑战性的优化问题。亨利定律是一种基本的气体定律,它涉及在固定温度下溶解到给定类型和体积的液体中的给定气体的量。HGSO 算法模仿 gas 的 huddling 行为来平衡搜索空间中的开发和探索,避免局部最优。 

亨利定律

亨利定律于 1800 年由 JW Henry 首次提出,这是一种气体定律,它指出液体中溶解气体的量与其在液体上方的分压成正比。换句话说,在特定温度或压力下,可以溶解在特定量溶剂中的最大溶质量称为溶解度。HGSO 受到亨利定律行为的启发。 

 代码:

function [vec_Xbest, var_Gbest,vec_Gbest_iter] = HGSO(objfunc, dim,var_down,var_up,var_niter,var_n_gases,var_n_types)
if nargin<5
    [var_n_gases,var_n_types,var_niter]=fun_getDefaultOptions();
end
%constants in eq (7)
l1=5E-03;
l2=100;
l3=1E-02;
%constants in eq (10)
alpha=1;
beta=1;
%constant in eq (11)
M1=0.1;
M2=0.2;
%paramters setting in eq. (7)
K=l1*rand(var_n_types,1);
P=l2*rand(var_n_gases,1);
C=l3*rand(var_n_types,1);
%randomly initializes the position of agents in the search space
X=var_down+rand(var_n_gases,dim)*(var_up-var_down);
%The population agents are divided into equal clusters with the same Henry痴 constant value
Group=Create_Groups(var_n_gases,var_n_types,X);
% Compute cost of each agent
for i = 1:var_n_types
    [Group{i},best_fit(i),  best_pos{i}] = Evaluate(objfunc,var_n_types,var_n_gases, Group{i},0,1);
end
[var_Gbest, var_gbest] = min(best_fit);
vec_Xbest = best_pos{var_gbest};
for var_iter = 1:var_niter
    [S]=update_variables(var_iter,var_niter,K,P,C,var_n_types,var_n_gases);
    Groupnew=update_positions(Group,best_pos,vec_Xbest,S,var_n_gases,var_n_types,var_Gbest,alpha,beta,dim);
    Groupnew=fun_checkpoisions(dim,Groupnew,var_n_gases,var_n_types,var_down,var_up);
    for i = 1:var_n_types
        [Group{i},best_fit(i),  best_pos{i}] = Evaluate(objfunc,var_n_types,var_n_gases, Group{i},Groupnew{i},0);
        Group{i}=worst_agents(Group{i},M1,M2,dim,var_up,var_down,var_n_gases,var_n_types);
    end
    [var_Ybest, var_index] = min(best_fit);
    vec_Gbest_iter(var_iter)=var_Ybest;
    if var_Ybest<var_Gbest
        var_Gbest=var_Ybest;
        vec_Xbest = best_pos{var_index};
    end
    
end
end

运行结果:

获取论文和源码:https://ai.52learn.online/code/30

 

 

 

 

 

以上是关于Matlab实现亨利气体溶解度优化算法的主要内容,如果未能解决你的问题,请参考以下文章

优化算法亨利气体溶解度优化算法(HGSO)含Matlab源码 127期

气动学基于matlab改进的遗传和粒子群算法高斯烟羽模型模拟气体扩散含Matlab源码 1061期

运动学基于matlab GUI改进的遗传算法和高斯烟羽模型模拟气体扩散含Matlab源码 1060期

运动学基于matlab改进的遗传和粒子群算法高斯烟羽模型模拟气体扩散含Matlab源码 1061期

基于蝙蝠算法优化BP神经网络的数据分类算法及其MATLAB实现-附代码

二元非洲秃鹫优化算法(Matlab代码实现)