How to speed up fmincon when there are too many variables? How many variables can fmincon handle at most?

I need to solve an optimization problem with two nonlinear equality constraints. My function evaluation is very fast (less than a second) and I also provide fmincon with the gradients of my objective and constraint functions. However, when fmincon is slow when there are about 2000 variables, and it is very slow when there are 6000 variables. Considering my function evaluation is super fast, I guess the bottle neck is the speed of fmincon. How can I possibly speed up fmincon? If not, can anyone suggest some other optimization packages?

Answers (1)

Since you are able to provide the gradients of all your functions, perhaps you can also provide Hessians. If so, use the interior-point algorithm, set the Hessian option to 'user-supplied' and the 'HessFcn' option to your Hessian as described here. See this example for a working example.
I would endeavor to ensure that the Hessian is sparse, because with such a large problem you might hit memory or performance problems using dense arithmetic.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Asked:

on 7 Apr 2015

Answered:

on 7 Apr 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!