A robust implementation of a sequential quadratic programming algorithm with successive error restoration