optimization: have function return NaN but not at initial point

7 Ansichten (letzte 30 Tage)
SA-W
SA-W am 4 Mär. 2023
Kommentiert: SA-W am 4 Mär. 2023
I use fmincon interior-point algoritm to solve my optimization problem.
Based on Matlab's recommendation, I let my function return NaN if the objective function can not be evaluated for given parameters to indicate fmincon to try a different set of parameters. This works very well at intermediat iterations...
I got the following error:
"Errror using barrier. Objective function is undefined at initial point. Fmincon can not continue."
However, if I do not return NaN, fmincon, for whatever reasons, can solve the optimization problem even if the initial point is not correctly evaluated. Indeed, I observe this for many start vectors.
Anyway, is there a way to return NaN in my function always, except at the evaluation of the initial point? That is, figuring out (somehow) when my function is called with the initial point?

Akzeptierte Antwort

Matt J
Matt J am 4 Mär. 2023
Bearbeitet: Matt J am 4 Mär. 2023
Setting the objective to NaN should not be seen as a substitute for constraints. If there is a region where your objective function cannot be evaluated, you still have to specify appropriate constraints so that the algorithm knows to avoid that region.
  1 Kommentar
SA-W
SA-W am 4 Mär. 2023
I am using MultiStart with a large array of customized start points.
If I get a higher percentage of successful runs by setting f=NaN, I am happy with that. My objective from an engineering perspective is to find the global minimum of my problem for a large family of start vectors. How, does not really matter to me.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by