Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: fmincon problem
Replies: 5   Last Post: Jul 18, 2011 3:22 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Muhammad

Posts: 29
Registered: 3/21/08
Re: fmincon problem
Posted: Jul 18, 2011 2:09 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

<<Then you should turn it on (it's off by default).>>

I am using 'active-set' algorithm. Matlab help shows 'AlwaysHonorConstraints' option is used only by the 'interior-point' algorithm. I put the following line in my code:

options = optimset('Algorithm','Interior-Point','AlwaysHonorConstraints','on');
[W,fval,exitflag] = fmincon(@myfun_direct,W0,[],[],[],[],[0,0,0],[900,900,900],@mycon_direct,options);

Then Matlab showed the following error:

??? Error using ==> optimset at 226
Invalid value for OPTIONS parameter AlwaysHonorConstraints:
must be 'none' or 'bounds'.

Then I used the following code:

options = optimset('Algorithm','Interior-Point','AlwaysHonorConstraints','bounds');

Then Matlab did not find any feasible point ! The exitflag was -2 in this case.

When I use the 'active-set' algorithm and don't specify 'AlwaysHonorConstraints', I find the exitflag to be 0, i.e., the no. of iterations exceeded the max. number.

I don't know if I am making any simple mistake or not :S

Thanks a lot for your help.

Nazmul

"Matt J" wrote in message <j01r6b$sml$1@newscl01ah.mathworks.com>...
> "Nazmul Islam" wrote in message <j01jlq$5dm$1@newscl01ah.mathworks.com>...
> >
> > I have not set the 'AlwaysHonorConstraints' option. It is probably set to the default value.

> =====================
>
> Then you should turn it on (it's off by default).
>
>

> > Some constraints of c(i) are off by as large AS 10 or 2000 ! So, it's not coming from the round-off error, I guess.
> ================
>
> Check the exitflag to see if the algorithm stopped prematurely.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.