フィルターのクリア

How to write matlab code for optimization of this equation ?

2 ビュー (過去 30 日間)
Seshadri Behera
Seshadri Behera 2014 年 8 月 11 日
コメント済み: Seshadri Behera 2014 年 8 月 11 日
Hello, I want to optimize the following equation with particle swarm optimization algorithm. f(x)=(1/(n*xmax))* (summation(xi)) ; where i is the index varying from 1 to n, xmax is the maximum value of x & range of x is (0.003, 316.2).

採用された回答

Johan Löfberg
Johan Löfberg 2014 年 8 月 11 日
編集済み: Johan Löfberg 2014 年 8 月 11 日
Do you absolutely have to use particle swarm optimization?
I would conjecture that the optimal solution is to let all but one element take the value 0.003, and the last element the value 316.2
The following test shows that this is the case for your setup. It uses the MATLAB Toolbox YALMIP to formulate the problem, and assumes you have a mixed-integer solver installed
n = 20;
m = 0.003;
M = 316.2;
x = sdpvar(n,1);
% Conjecture
xbest = [repmat(m,n-1,1);M];
costbest = sum(xbest)/(length(xbest)*max(xbest));
% Recover the conjectured solution by stating problem as mixed-integer problem
solvesdp([m <= x <= M, sum(x) <= length(x)*max(x)*costbest])
% Try to obtain a slightly better solution will fail and lead to
% infeasibility
solvesdp([m <= x <= M, sum(x) <= length(x)*max(x)*costbest*0.9999])
Shouldn't be too hard to prove that the conjecture holds.
  1 件のコメント
Seshadri Behera
Seshadri Behera 2014 年 8 月 11 日
Thank you for the answer. But it's an assignment to use PSO to optimize this equation. So I must write the code using PSO.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParticle Swarm についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by