Need Urgent Help on PSO to reflect the Mathmatical Function to MATLAB

2 views (last 30 days)
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,

Answers (1)

Alan Weiss
Alan Weiss on 18 Jan 2021
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

Community Treasure Hunt

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

Start Hunting!