Date: Jan 23, 2013 9:08 PM
Author: Jesse Sipple
Subject: fmincon tolfun tolx and tolcon question/clarification

I've been using fmincon (interior-point, bounded, with no nonlinear constraints, not specifying a gradient) for an optimization problem.  I've had great success with the method and spent much time reading the literature before coming to the final decision to use this algorithm to assist me in solving my optimization problem.

I have setup the problem such that the objective function is normalized by it's initial value so that it starts from 1 with a goal of going to 0. My parameters that I am passing are unitless, and can be thought of as a percent running from 2 (200%) to 0 (0%) and starting at 1 (100%).

Recently, I have needed to push the optimization a bit since as I modify my problem, I encounter parameters that are slightly less sensitive than what I have been dealing with in the past.

Typically, the constraints on the problem I have set are delta(x) (TolX) = 1e-4 which ends up being one hundredth of a percent and delta(f) (TolCon) = 1e-8 (which is TolX^2).

When I was reviewing the literature to see how to make both TolX and TolCon tighter constraints, I ran into this graph:
(found here:

This led me to believe that I have been specifying TolCon wrong all along, what I wanted to specify was a tolerance to constrain the change in the objective function. Looking further into the material online, I found that TolCon was the "tolerance on the constraint violation".

So I thought I have been doing it wrong all along and removed specifying TolCon and specified TolFun as 1e-8 and the optimization stopped even sooner than before, since the default for TolCon is 1e-6.

So my question is, why isn't TolFun seeming to be what it appears to be in the graph (, and what is TolCon doing? I'm nowhere near the bounds of the problem when it stops. And what specifically is the "constraint violation" that TolCon is controlling? The optimization seems to be prematurely stopping due to the TolCon constraint but I don't want to change the value for that without knowing exactly what it's controlling.

Thanks for your help!