CMA, which failed, and misc other thing

Some stuff. CMA wasn't much use. However, Nelder-Mead simplex produces
reasonable results eventually. Nothing is much good though. I'll
probably give up on this and do it in JModelica instead. Wish I'd
discovered JModelica earlier though.