-
Notifications
You must be signed in to change notification settings - Fork 2
/
RungeKutta.m
53 lines (40 loc) · 2.89 KB
/
RungeKutta.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%---------------------------------------------------------------------------------------------------------------------------
% RUNge Kutta optimizer (RUN)
% RUN Beyond the Metaphor: An Efficient Optimization Algorithm Based on Runge Kutta Method
% Codes of RUN:http://imanahmadianfar.com/codes/
% Website of RUN:http://www.aliasgharheidari.com/RUN.html
% Iman Ahmadianfar, Ali asghar Heidari, Amir H. Gandomi , Xuefeng Chu, and Huiling Chen
% Last update: 04-22-2021
% e-Mail: [email protected],[email protected].
% e-Mail: [email protected], [email protected],
% e-Mail (Singapore): [email protected], [email protected]
%---------------------------------------------------------------------------------------------------------------------------
% Co-author: Ali Asghar Heidari([email protected]),Amir H Gandomi,Xuefeng Chu, Huiling Chen([email protected]),
%---------------------------------------------------------------------------------------------------------------------------
% After use, please refer to the main paper:
% Iman Ahmadianfar, Ali Asghar Heidari,Amir H Gandomi,Xuefeng Chu,Huiling Chen,
% RUN Beyond the Metaphor: An Efficient Optimization Algorithm Based on Runge Kutta Method
% Expert Systems With Applications, 2021, 115079, https://doi.org/10.1016/j.eswa.2021.115079 (Q1, 5-Year Impact Factor: 5.448, H-INDEX: 184)
%---------------------------------------------------------------------------------------------------------------------------
% You can also follow the paper for related updates in researchgate: https://www.researchgate.net/profile/Iman_Ahmadianfar
% Researchgate: https://www.researchgate.net/profile/Ali_Asghar_Heidari.
% Website of RUN:% http://www.aliasgharheidari.com/RUN.html
% You can also use and compare with our other new optimization methods:
%(GBO)-2020-http://www.imanahmadianfar.com/codes.
%(HGS)-2021- http://www.aliasgharheidari.com/HGS.html
%(SMA)-2020- http://www.aliasgharheidari.com/SMA.html
%(HHO)-2019- http://www.aliasgharheidari.com/HHO.html
%---------------------------------------------------------------------------------------------------------------------------
%%
function SM=RungeKutta(XB,XW,DelX)
dim=size(XB,2);
C=randi([1 2])*(1-rand);
r1=rand(1,dim);
r2=rand(1,dim);
K1 = 0.5*(rand*XW-C.*XB);
K2 = 0.5*(rand*(XW+r2.*K1.*DelX/2)-(C*XB+r1.*K1.*DelX/2));
K3 = 0.5*(rand*(XW+r2.*K2.*DelX/2)-(C*XB+r1.*K2.*DelX/2));
K4 = 0.5*(rand*(XW+r2.*K3.*DelX)-(C*XB+r1.*K3.*DelX));
XRK = (K1+2.*K2+2.*K3+K4);
SM=1/6*XRK;
end