- Ensure that your objective function always returns finite real values, by carefully debugging it, OR
- Pass an initial swarm where every point returns a real finite value. See the InitialSwarmMatrix option in particleswarm options.
What is the correction of error: Failure in initial user-supplied objective function evaluation. PARTICLESWARM cannot continue?
11 views (last 30 days)
I'm trying to solve an optimization problem using PARTICLESWARM function in MATLAB2014b. with aid of Open Source ECG Toolbox, version 1.0, November 2006 Released under the GNU General Public License.
The main objective of the code is to find the optimal parameters of the ECG model to achieve the minimum model error.
I have used PSO as optimizer to find these optimal parameters.
ends up with error:
Failure in initial user-supplied objective function evaluation. PARTICLESWARM cannot continue
Alan Weiss on 24 Apr 2018
Without reading your code, I can tell you that your initial swarm contained at least one point that led to a NaN or Inf or complex objective function value. To avoid this error,
MATLAB mathematical toolbox documentation