I am using fmincon 1.1 in Scilab 2026.1. I need a callback function in fmincon and I had some problems. I have finally discovered that the callback function was sometimes not called.
I have just put a print into the callback function:
I have identified that pattern: each time the “Step Norm” column is zero (except for the iteration 0), the callback function is not called anymore (see iterations 34 and 48). Sometimes during a few iterations, sometimes tens or hundreds iterations (no pattern detected).
I tried to install fmincon 1.0.9, but it is not available:
--> atomsSystemUpdate()
Examen du dépôt https://atoms.scilab.org/2026.1/TOOLBOXES/64 ... Terminé
--> atomsInstall(["fmincon" "1.0.9"])
atomsInstallList: The package "fmincon - 1.0.9" is not registered.
Please check on the ATOMS repository that it is available for Scilab 2026.1 on Linux.
If it is, run atomsSystemUpdate() before trying atomsInstall(..) again.
...
I am afraid that atoms cannot handle this. To test you should first remove fmincon 1.1, then reinstall sci_ipopt and apifun, then download the source of fmincon 1.0.9 and build/load the toolbox from there:
atomsRemove fmincon
// maybe restart Scilab, then
atomsInstall sci_ipopt
atomsInstall apifun
http_get("https://atoms.scilab.org/toolboxes/fmincon/1.0.9/files/fmincont-1.0.9.tar.gz","fmincont109.tgz")
decompress fmincont109.tgz
cd fmincont-109
exec("builder.sce",-1)
exec("loader.sce",-1)
I have executed those instructions successfully, but can not access to optimoptions:
--> exec("loader.sce",-1)
Start Fmincon 1.0.9: loading macros, help, demos.
--> cd ..
--> exec('/run/media/mylogin/USB/generateurs_de_distributions_avec_symetrie/distribution_multihyperuniforme.sce', -1)
à la ligne 131 du fichier exécuté /run/media/mylogin/USB/generateurs_de_distributions_avec_symetrie/distribution_multihyperuniforme.sce
Variable non définie : optimoptions
-->
I have tested all the fmincon demos and examples and didn’t see missed OutputFcn calls. Can you share your code or a small example code having the same problem ? I guess this is due to ipopt not calling the callback during a restoration phase or something like this (see my question on the IPopt github: About intermediate callback during all phases · Issue #864 · coin-or/Ipopt · GitHub).
Thanks a lot @mottelet ! I can confirm that the problem is now fixed in my computation.
I have such instructions in my callback function:
if modulo(optimValues.iteration, 250) == 0 then
Until now I was only using it to make backups with save("variables.dat", "x") ;, so I did not notice the problem. But I am now using the callback function for making things really necessary in my model, and the problem became visible.
Thanks for reporting the problem. There are not that many users of fmincon, additionally solving hard problems making IPopt pass through the restoration phase, so the potential problem was completely hidden…