Trying to get optimisation to work with maxima.