sfreund-DLR / tankoh2

Design and optimization of H2 tanks
4 stars 0 forks source link

Investigate local optimizer failing sometimes #74

Open jacolinu opened 1 year ago

jacolinu commented 1 year ago

In the DOE for D-Light, the local optimizer sometimes fails and raises an error. Issue can be solved by:

sfreund-DLR commented 1 year ago

example: atheat3 resulting in this target function plot after approx 13 iterations

could not find optimal solution

jacolinu commented 1 year ago

What was the optimizer seed for this result? Also, the picture is not visible to me..

sfreund-DLR commented 1 year ago

"optimizerSeed": 1

jacolinu commented 1 year ago

This is the message given by minimize when it fails:

Tit = total number of iterations Tnf = total number of function evaluations Tnint = total number of segments explored during Cauchy searches Skip = number of BFGS updates skipped Nact = number of active bounds at final generalized Cauchy point Projg = norm of the final projected gradient F = final function value


N Tit Tnf Tnint Skip Nact Projg F 1 1 21 1 0 0 8.580D-02 1.784D+02 F = 178.38492335759292
ABNORMAL_TERMINATION_IN_LNSRCH
ERROR 2022-12-19 16:35:03,938: Could not find optimal solution Line search cannot locate an adequate point after 20 function and gradient evaluations. Previous x, f and g restored. Possible causes: 1 error in function or gradient evaluation; 2 rounding error dominate computation.

jacolinu commented 1 year ago

grafik

Very strange failure, the target function should be very easy to optimize. Maybe the function is too flat at the left side, so that the optimizer has problems with the gradient?

jacolinu commented 1 year ago

grafik This seems to be the reason for the failure. The initial value is the left bound. From here, thepuck function slightly rises for a very short distance, which results in a negative jacobian and a line search in the wrong direction. The optimizer cannot find a value better than the initial value and fails.

jacolinu commented 1 year ago

Normally, the global optimizer finds a better value than this, so the failure is ignored.

jacolinu commented 1 year ago

So far i couldn't prevent the problem by playing around with the options. Maybe the best solution is just to check if the local optimizer is successful before using it over the global optimizer. That should prevent error messages ending the run.