use nloptr and analytic expression of the gradient to speed up the optimisation
use nloptr and analytic expression of the gradient to speed up the optimisation