What does Tolcon, Tolfun and Diffminchange do?

I have read a few questions and comments and I am still quite confused as to what exactly is the effect of tolcon, tolfun and diffminchange on my optimisation.
Say I have a variable t_2 such that it must always be greater (but not too much than) t_1 and this gives
C=t_1-t_2;
For the sake of argument, my t_1 is defined to be about 0.135. For a tolcon of say 0.01, what is the tolerance of the constraint of t_2? between 0.135 to 0.145 and anything outside this is considered to be unfeasible? However, I did notice that that sometimes my t_2 becomes unexplainably high (i.e 0.15 to 0.16).
Similar is the same to be said of tolfun? The objective function is to minimise D where D is expected to be in the magnitude of 0.00823
What then exactly is diffminchange? is it the stepsize for fmincon (the function my script is using) to iterate and find the optimum solution that satisfies tolfun and tolcon? By setting a smaller diffminchange, will fmincon be less susceptible to finding the optimal point more slowly?
Regards, Ben

 Accepted Answer

You might check the documentation of fmincon options. There is more information in the Tolerances and Stopping Criteria documentation.
DiffMinChange is an option for controlling finite difference steps the solver takes to estimate derivatives. It does not directly relate to the step size that the solver takes in its iterations. Usually it is safe to ignore this option, but if you are optimizing a simulation or ODE, consult Optimizaing a Simulation or ODE.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

4 Comments

Dear Alan,
Thank you for your answer. I have read the topic on tolerances and stopping criteria. However, I don't understand how to pick a sensible tolerance for my optimiser. Should I just go by a figure of thumb and go for the default tolerance constraints (i.e 1e-6)? I noticed when I used with Fmincon, my feasibility often much much larger than 1 in the magnitude of 1e+04. Is there any way of making the optimiser use smaller steps. The optimiser occasionally goes into this infinite loop where the feasibility is always much greater than 0.
Any help would be most appreciated. My lecturer seems to not have problem running the code on his Mac but I am having problems getting an apparent optimised result on my windows machine.
Kind Regards, Ben
I don't understand how to help you, sorry. It is difficult for me to understand exactly what your problem and question are.
Rereading your initial question, I just had a thought. Is it possible that you could use a linear inequality constraint instead of a nonlinear constraint for your problem? Maybe two linear inequality constraints, one representing t_1 - t_2 <= 0, the other representing t_2 - t_1 <= 0.05 or something like that?
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
benho
benho on 1 Mar 2016
Edited: benho on 1 Mar 2016
Dear Alan,
Thank you for your reply. I have defined the nonlinear constraint c but the output result of the optimiser does not seems sensible. (I am using fmincon in the optimiser by the way)
Basically my nonlinear constraint is as follows:
C=[wingParameters.tc-t t-wingParameters.tc-0.05]; Ceq=[];
I have earlier defined wingParameters.tc and the optimiser, while optimising the objective function must meet the constraint such that t is larger than wingParamters.tc and the deviation must be within 0.05 from wingParameters.tc. However, when I looked at the output, the values of t were 0.2 greater than wingParameters.tc. I am not sure if it is something wrong with the tolerance (tolcon and/or diffminchange)?
Regards, Ben
I am sorry, but I am afraid that we are not communicating well. I asked if you had tried to use a linear inequality constraint. It seems as if you are continuing to use a nonlinear inequality constraint.
Is there some reason that you did not try to use a linear inequality constraint?
You brought up DiffMinChange again. Did you read what I told you about ignoring DiffMinChange?
I am sorry that we are having trouble communicating. If you continue to have trouble, perhaps you should start a new question, because people might not look for a new question in a question that has an accepted answer.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

More Answers (0)

Asked:

on 29 Feb 2016

Commented:

on 2 Mar 2016

Community Treasure Hunt

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

Start Hunting!