From: TS on 30 Apr 2010 12:54 I am trying to optimize 513264 variables (stored in the form of a matrix having 3774 rows , 136 columns), each variable having non-linear constraint : greater than equal to zero. Using fmincon for minimizing an objective function gave the following error:- ??? Maximum variable size allowed by the program is exceeded. Error in ==> fmincon at 615 initVals.gnc = zeros(numberOfVariables,length(initVals.ncineq)); Is there any limit on number of variables to be optimized in MATLAB? I am using Version 7.8.0.347 (R2009a) 32-bit (glnx86). Am new in using optimization toolbox of MATLAB so even after digging for a while I could not understand which parameter changes are required to be made to get this working. Any help on this would be appreciated. Thanks,
From: TS on 30 Apr 2010 13:43 Some more details on the problem: options = optimset(options,'Algorithm','interior-point','TolFun',1.000000e-10,'TolCon',1.000000e-20); [cprofile,fval,exitflag,output] = fmincon(@costfunction,cprofile0,A,b,Aeq,beq,lb,ub,@nlconstraint,options); where 'costfunction' is a non-convex function of 'cprofile'(the matrix containing the variables I am trying to estimate), which I am trying to minimize based on some linear and nonlinear constraints. A,b,Aeq, beq are empty matrices. lb & ub are set to 0 & 1 respectively.
From: Alan Weiss on 3 May 2010 07:49 On 4/30/2010 1:43 PM, TS wrote: > Some more details on the problem: > > options = > optimset(options,'Algorithm','interior-point','TolFun',1.000000e-10,'TolCon',1.000000e-20); > > [cprofile,fval,exitflag,output] = > fmincon(@costfunction,cprofile0,A,b,Aeq,beq,lb,ub,@nlconstraint,options); > > where 'costfunction' is a non-convex function of 'cprofile'(the matrix > containing the variables I am trying to estimate), which I am trying to > minimize based on some linear and nonlinear constraints. A,b,Aeq, beq > are empty matrices. lb & ub are set to 0 & 1 respectively. I do not know exactly what is going wrong here, but I have a few suggestions. 1. lb and ub should be vectors, not scalars. See http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-11.html#brhkghv-13 2. Try using sparse linear algebra. Give your objective and constraints in terms of sparse matrices. 3. Your value of TolCon is way too small. Try 1e-10. If you must use a small tolerance, at least keep it above eps. 4. Did you have an existing value of options before the call you show? If not, remove the first argument of optimset: options = optimset('Algorithm','interior-point','TolFun',1e-10,'TolCon',1e-10); 5. Test your setup on a small problem similar to the one you really want to solve, just to ensure that all your syntax is correct and the solver works as expected. 6. To save memory, try giving a sparse approximate Hessian, or give a Hessian multiply function. See http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/fmincon.html#f186882 (This suggestion is often difficult to effect, but I wanted to point out a way to save memory on large problems that are well-structured.) Good luck, Alan Weiss MATLAB mathematical toolbox documentation
|
Pages: 1 Prev: Resample vector/matrix Next: Binary nonlinear optimization |