The MATLAB PSO Toolbox, within the instructions for use. This is a Matlab toolbox of Particle Swarm Optimization, use more convenient. Only need to define your own functions that need to optimize, function and set the variable range of values, each step of the iteration allows the maximum amount of change to be self-tuning.