Modify optimisation problem (functions _bis) and main loop.