How do i know the limits for maxfunevals and tolx?

2 views (last 30 days)
How do i know the limits for maxfunevals and tolx? I get an error "fmincon stopped because it exceeded the function evaluation limit, options.MaxFunctionEvaluations = 7000 (the selected value).
x0=[70; 15; 1.2; 10; 100; 70000]; % Initial values for x
lb=[50; 8; 1.0; 5; 50; 50000]; % Lower Bound for variables
ub=[200; 20; 1.25; 20; 120; 130000]; % Upper Bound for variables
options = optimset('Algorithm','interior-point','MaxFunEvals',7000,'TolCon',.01,'TolX',1e-9)
  1 Comment
Walter Roberson
Walter Roberson on 20 Mar 2019
The number of function evaluations required depends upon the complexity of the constraints, for linear and quadratic problems. For nonlinear / nonquadratic problems then the number of function evaluations can be difficult to predict, and in general it can show that the number of evaluations required can be unbounded for some nonlinear problems.

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 20 Mar 2019
You can set them to be whatever you like (within limits). If you want to know the default values, use an optimoptions (link) call:
oldopts = optimoptions(@fmincon);
MFE = oldopts.MaxFunEvals
TX = oldopts.TolX
ALG = oldopts.Algorithm
producing:
MFE =
3000
TX =
1e-10
ALG =
'interior-point'

Community Treasure Hunt

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

Start Hunting!