how to set Fmincon function tolerance?
5 views (last 30 days)
Show older comments
excuse me, how can set a tolerance? because I want to solve this:( I mean finding "cc" which satisfies below)
* F(cc)<=min(F(c))+(0.5)^k *
and k k is iteration number. in paper, writer said that tolerance should be set on "(0.5)^k". I've written a az below,but it doesn't work.
objfcn = @(cc) fmp_cmp(cc, Uu, Cc, mm, p);
options = optimset('TolFun', delta^k);
A = [ones(1,24)];
b =[1];
cc0=rand(1,24);
cc0=cc0/sum(cc0);
[cc,fval]=fmincon(objfcn,cc0,[],[],A,b,zeros(1,24),ones(1,24),options);
0 Comments
Accepted Answer
More Answers (1)
Matt J
on 16 Aug 2014
Edited: Matt J
on 16 Aug 2014
There may be a typo in your post. The additive constant (0.5)^k doesn't affect the solution in any way. cc=argmin(F) is a solution for all k. Perhaps you really meant to write an equality,
F(cc)=min(F)+(0.5)^k
If so, the first step is to minimize F() as I think you have done in other posts. If Fmin is this minimum, then the above reduces to
Fmin+(0.5)^k -F(cc)=0
You could indeed use fminsearch to solve this nonlinear equality
cc=fminsearch(@(cc) abs(Fmin+(0.5)^k -F(cc)) ,...)
However, it would be more direct to use fzero
cc = fzero(@(cc) Fmin+(0.5)^k -F(cc) ,...)
4 Comments
Matt J
on 17 Aug 2014
I'me trying to do your advice
Not really sure what "my advice" was. I don't think you've finished explaining what the goal is.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!