How i can solve a large size problem through fmincon

3 views (last 30 days)
I am having a large size problem (7000 optimization variables) and i just wanted to use the fmincon to calculate the solution. But fmincon is running very slow infact taking days to solve the problem. H I tried with providing gradient of obj and constraint function as well as provided the hessian also. But still it is running very slow. Hessian is calculated as
H = sparse(GL.dy_location(:,1),GL.dy_location(:,2),GL.dy,GL.dy_size(1),GL.dy_size(2));
H = 1/2*(H + H.');
and then provided this to fmincon. Can i do something further to make fmincon run fast. do providing the sparsity pattern will help?? If yes then how to provide it for such a large matrice if it is represented in the above form.

Answers (1)

Alan Weiss
Alan Weiss on 24 Jul 2014
You need to ensure that your options are set correctly. If you are providing the gradient of the objective function then I assume that you have a nonlinear constraint function. The only fmincon algorithm that can use a Hessian function for nonlinear constraints is the 'interior-point' algorithm.
For that algorithm, you have to provide a Hessian that includes Lagrange multipliers, not just a matrix of second derivatives of the objective function. For details, see this example, or the Hessian portion of the fmincon function reference page.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 Comments
Divyansh
Divyansh on 25 Jul 2014
i am already providing the lagrange multipliers and all...my question is how to make fmincon run fast
Alan Weiss
Alan Weiss on 25 Jul 2014
If you are passing a Hessian correctly to fmincon then there is no need to pass a Hesian sparsity pattern, because fmincon uses this pattern only to aid it in computing the Hessian numerically.
Did you validate your gradient and Hessian with the DerivativeCheck option? If your gradient or Hessian are incorrect then fmincon will be very slow, or may fail.
But, if you did everything correctly, then I do not know what else you can do to speed things along.
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!