Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: fmincon + interior point algorithm + memory problems
Replies: 9   Last Post: Dec 5, 2012 1:00 PM

 Messages: [ Previous | Next ]
Re: fmincon + interior point algorithm + memory problems
Posted: Dec 4, 2012 1:28 PM

"Matt J" wrote in message <k9l1j3\$53o\$1@newscl01ah.mathworks.com>...
> "Saad" wrote in message <k9ku6c\$l3j\$1@newscl01ah.mathworks.com>...
> >
> > Aeq = vertcat(ones(1,n),a') ;
> > lb = zeros(n,1) ;
> > H = eye(n) ;
> > [w,fval, exitflag] = fmincon(@(x)norm(H*x-w0)^2,w0,[],[],Aeq,beq,lb,[],[],options);

> ================
>
> You could use H=speye(n) instead of H=eye(n). Also, lsqnonneg or quadprog might be more efficient than fmincon.

Hi Matt

Thanks a lot for your reply. I did try speye(n) with fmincon but the problem still occurs. Unfortunately I cannot use lsqnonneg because I have constraints. I may be wrong but I don't think my problem can be written in a form of quadprog because I cannot modify "x" in the quadratic optimization function. I could potentially use lsqlin but here again it doesn't work I get a NaN value and it says "Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. "

Alan kindly suggested to use 'Hessian','lbfgs' with the fmincon and this time it works but when I check the optimized variables they all have the same value. Don't get me wrong I am not an expert in optimization, but it is weird to have the same value for the optimized variables? Shall I relax the tolerance? or do you think that it may be a problem inherent to my optimization function?

Thank you

With Regards

S

Date Subject Author