optimization code with pso

Hello all
please how can i use pso to optimize the following objective functions
MIN f1=sum(x)
MAX f2=1/n *sum(x)
where x is an 1D vector and n is length ot it
thansk you

 Accepted Answer

John D'Errico
John D'Errico on 28 Apr 2019
Edited: John D'Errico on 28 Apr 2019
You can't optimize two things at once, unless they both happen to be optimal at the same location. However, you can try to optimize something like
f3 = f1(x) - f2(x)
minimizing the combination of the two. The result won't be optimal for either of the individual pieces, but as I said, you can't do that.
In some cases, you may need to fine tune the linear combination of objectives, thus weighting one or the other of them more highly, so if they have very different scalings, this will be important.
As far as using PSO, that is your problem. You should already know how to use the PSO tool. If not, then you need to read the documentation.

2 Comments

thanks for your answer , i dont main optimize the tio functions at same time each function alone
i read about it but never understand what number of varibles mean !!
my problem is that i have vector of data one need find min solution second find max, solution
can you give me your email i want to text you ?

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!