Need Urgent Help on PSO to reflect the Mathmatical Function to MATLAB
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear,
I have been trying to figure out how do I define my objective function on Particle Swarm Optimization (PSO) ?
My mathematical function is:
minimum g(x)= 2(x1 - 2)^2 + 3*(x1 + x2)^2 - (x1*x2)^4
And how to solve it with particle swarm optimization on Matlab ?
Not: On my solutions, I do get different minimum results on each run, however my plots shows just a line on each run..
Regards,
댓글 수: 0
답변 (1개)
Alan Weiss
2021년 1월 18일
Did you try
fun = @(x)2*(x(1)-2)^2 + 3*(x(1)+x(2))^2 - (x(1)*x(2))^4;
[sol,fval] = particleswarm(fun,2)
You will see that this problem has no lower limit; as x(1) and x(2) tend to infinity, the objective tends to minus infinity.
Alan Weiss
MATLAB mathematical toolbox documentation
댓글 수: 0
참고 항목
카테고리
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!