The gray wolf algorithm optimizes ICEEMDAN parameters, and four fitness functions can be switched arbitrarily, including minimum envelope entropy, sample entropy, information entropy, and permutation entropy...

Today I bring you an issue ofMATLAB code for optimizing ICEEMDAN parameters using the gray wolf algorithm.

For ideas on optimizing ICEEMDAN parameters, you can refer to this document:

[1] Chen Aiwu, Wang Hongwei. Planetary gearbox fault diagnosis based on HBA-ICEEMDAN and HWPE [J]. Mechanical and Electrical Engineering, 2023, 40(08): 1157-1166.

The original text of the document mentioned: Since the decomposition effect of the ICEEMDAN method depends on the white noise amplitude weight (Nstd) and the number of noise additions (NE), the author uses an intelligent optimization algorithm to optimize the two parameters of ICEEMDAN, and the fitness function uses the package Network entropy, when the fitness value is smaller, it means the decomposition effect is better; through optimization and updating, the final best parameter combination (Nstd, NE) is determined.

This article takes the Western Reserve University data set as an example, selecting 1000 data points in the X105_BA_time.mat data in 105.mat. If you don’t have data, read this article. Western Reserve University bearing diagnostic data processing, matlab free code acquisition

Four fitness functions were selected for optimization, and they could be switched at will. The gray wolf algorithm was used to optimize ICEEMDAN. The optimization was performed 30 times, and the population number was 10. The optimization range of the noise amplitude weight is set to [0.15, 0.6], and the optimization range of the number of noise additions is [50,600], to determine the white noise amplitude weight (Nstd) and the number of noise additions (NE) of ICEEMDAN.

The four fitness functions are: minimum envelope entropy, minimum sample entropy, minimum information entropy, and minimum permutation entropy . They can be switched with one click in the code.

1. Minimum envelope entropy as fitness function

6c6436f5f52bdf4d1925c9fab477653f.png

The optimization process is as follows:

4be331530e00abdebd3453f3b388a733.png

The result is as follows:

144fed6140ea8b7b96e9fc965236a9e1.png

2. Minimum sample entropy as fitness function

42aac5185aa5dd8b026469e35216dfa2.png

a8a382ab57ecf5cfd04648c8728dadfe.png

3. Minimum information entropy as fitness function

78c7ed9370419cd972cd7cc01424aacc.png

8755403b6a75bfef8548b8b6c350ba3f.png

4. Minimum permutation entropy as fitness function

e1b5098973d1ea752800dfb17a168e4b.png

71b5b7b525bb0b5ac33252321279d43a.png

Code:

%% 以最小包络熵、最小样本熵、最小信息熵、最小排列熵为目标函数(任选其一),采用GWO算法优化ICEEMDAN,求取ICEEMDAN最佳的两个参数
clear
clc
close all
xz = 1;  %xz, 选择1,以最小包络熵为适应度函数,
% 选择2,以最小样本熵为适应度函数,
% 选择3,以最小信息熵为适应度函数,
% 选择4,以最小排列熵为适应度函数,
if xz == 1  
    fobj=@EnvelopeEntropyCost;          %最小包络熵
elseif xz == 2
    fobj=@SampleEntropyCost;            %最小样本熵
elseif xz == 3  
    fobj=@infoEntropyCost;              %最小信息熵
elseif xz == 4
    fobj=@PermutationEntropyCost;       %最小排列熵
end


%% 选取数据
load 105.mat
da = X105_DE_time(6001:7000); %这里选取105的DEtime数据,注意这里替换为自己的数据即可,数据形式为n行*1列,列数必须为1。


%% 设置参数
lb = [0.15 50];    %噪声幅值权重的优化范围设置为[0.15,0.6],噪声添加次数的优化范围为[50,600]
ub = [0.6 600];  
dim = 2;            % 优化变量数目
Max_iter=30;       % 最大迭代数目
SearchAgents_no=10;       %种群规模


%% 调用GWO函数
disp('代码运行时间较长,请耐心等待!')
[fMin , bestX, Convergence_curve ] = GWO(SearchAgents_no,Max_iter,lb,ub,dim,fobj,da);


%% 画适应度函数曲线图,并输出最佳参数
figure
plot(Convergence_curve,'Color',[0.9 0.5 0.1],'Marker','>','LineStyle','--','linewidth',1);
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
legend('GWO优化ICEEMDAN')
disp(['The best solution obtained by GWO is : [',num2str(bestX(1)),',',num2str(fix(bestX(2))),']']);  %输出最佳位置
disp(['The best optimal value of the objective funciton found by GWO is : ', num2str(fMin)]);  %输出最佳适应度值

Everyone pays attention to the variable xz. When you choose 1, the minimum envelope entropy is used as the fitness function. When you choose 2, the minimum sample entropy is used as the fitness function. When you choose 3, the minimum information entropy is used as the fitness function. When you choose 4, The minimum permutation entropy is the fitness function. This will make it very convenient for everyone to switch.

The code directory is as follows:

8f3fcb26490c9f06a2a09da887703af3.png


Here is a brief introduction to a MATLAB tip: right-click the "name" of MATLAB, the grouping basis will appear, check this type, MATLAB will automatically group all the files in the current folder according to different types, and you can see clearly at this time To determine which files belong to functions and which files belong to scripts, generally speaking, scripts can be run but functions cannot. This is very friendly to some novice friends!

0a7eb878570c77e8d1d607f93a507cf5.png

Obtain the complete code of this issue and reply with keywords in the background:

TGDM828

Guess you like

Origin blog.csdn.net/woaipythonmeme/article/details/132844092