particle swarm optimization MATLAB coding for the following function
1 次查看(过去 30 天)
显示 更早的评论
Here the data I have taken n = 500 and m = 24 and Pmax = 6.6
Total number of variables I have taken for PSO, nVar = n*m
the lower bound Ihave taken for PSO LB = 0.1*(1,nVar)
and the upper bound I have taken for PSO UB = Pmax.*(1,nVar)
Assuming deltaT =1 , n =3, m =2 the above function I have expanded as below
F1 = c1*p11+c1*p21+c1*p31+c2*p12+c2*p22+c2*p32
and the objective function I have written as F1 = sum(x). But I have doubt on objective function I have written.
Here if I have considered the the product of c1*p11 as one variable like x1 and c1*p21 as another variable and so on
If I will considered ck and pik as to different variables then how I can write the Lower bound of variables and upper bound of variables.
0 个评论
回答(1 个)
Sandeep
2023-7-24
Hi Bijaya Das,
It is my understanding that you are expecting a suggestion on how to write the Lower bound of variables and Upper bound of variables for the given objective function and assumed values of delta, n and m.
Here is a sample MATLAB implementation of the same that might help.
% Assuming n = 3, m = 2
n = 3;
m = 2;
% Initialize the lower bounds and upper bounds arrays
LB = zeros(n*m, 1); % Lower bounds array
UB = zeros(n*m, 1); % Upper bounds array
% Assign lower and upper bounds for each variable
for i = 1:n
for j = 1:m
var_index = (i-1)*m + j; % Index of the variable
LB(var_index) = 0.1; % Lower bound for the variable
UB(var_index) = Pmax; % Upper bound for the variable
end
end
Hope you find it useful.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle Swarm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!