optimization: fix numpy error
The newest version of numpy (1.24.1) causes an error when reading a list of casadi variables into a numpy array. This has been fixed by first converting the casadi variables to floats.
This fixes issue https://issuetracker.deltares.nl/browse/RTCTOOLS-675.
Edited by Sjoerd Geevers