Uploaded July 2025 | Updated September 2026, 6 hours ago
This animation, created using MATLAB, illustrates (roughly) the Particle Swarm Algorithm (PSO) vs the Steepest Descent Algorithm. The PSO is a useful tool for minimizing a cost (or objective) function by evaluating the function at the locations in red and storing the optimal values (blue) at that iteration.
The steepest descent also uses locations as particles but has each particle move in the direction of the negative gradient (downhill). This gradient is approximated by a center difference formula so that the user does not have to manually compute partial derivatives.
The test case shown here has 100 particles and is minimizing the "peaks" function given by MATLAB.
This animation, created using MATLAB, illustrates (roughly) the Particle Swarm Algorithm (PSO) vs the Steepest Descent Algorithm. The PSO is a useful tool for minimizing a cost (or objective) function by evaluating the function at the locations in red and storing the optimal values (blue) at that iteration.
The steepest descent also uses locations as particles but has each particle move in the direction of the negative gradient (downhill). This gradient is approximated by a center difference formula so that the user does not have to manually compute partial derivatives.
The test case shown here has 100 particles and is minimizing the "peaks" function given by MATLAB.










