Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Fmincon: Impossible values obtained. Solver prematurely stopped due to MaxFunEvals has reached.

4 views (last 30 days)
Observe this formula:
dbc = (db./(sin(180./nb) + (pi./nb))); %Burner circle diameter
db = 1.5 * tf;
nb = (8:20) %Thus, (sin(180./nb) will always be positive
Now, look at the results,
tf =
1.2895
1.2895
nb =
8.0001
8.0001
dbc =
-20.5260
-20.5260
How am I getting a negative value of dbc even though, all the values are positive?
This leads to the following error:
Solver stopped prematurely.
fmincon stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 500 (the default value).
I tried increasing MaxFunEvals (to at the most 2500) but, the error still remains.

Answers (1)

Walter Roberson
Walter Roberson on 22 Mar 2018
Why would sin(180./nb) always be positive? You are requesting sine of 9 radians through sine of 22.5 radians, which spans more than 2*Pi radians and so will pass through every possible value that sin can produce.
  4 Comments
Walter Roberson
Walter Roberson on 22 Mar 2018
For much of the region permitted by your bounds, the qout "Heat leaving" calculated your Lobo function is positive, approaching 10300, which would seem to make sense. However, in the region near the X above, the qout is somewhat negative, approaching -30000. If your starting point were within the "basin of attraction" of that firmly negative region and if that region is ruled out by one of your nonlinear constraints, then fmincon (which is a local minimizer) might not be able to determine a direction that is able to escape from the forbidden region.
In the tracking that I did without considering the nonlinear constraint, I was searching near [0.480032473824172523, 7.45783314076774762, 590.200000000000159, 19.9999999999992468, 0.104986038979125673] before I changed the bounds to focus more towards X you got. The value is positive near that point and the first parameter especially was creeping higher, more towards 1, but the 590.2 (which is one of your lower bounds) was being pretty much stuck to and the 19.9* (upper bound 20) was being pretty much stuck to.
Devdatt Thengdi
Devdatt Thengdi on 23 Mar 2018
Edited: Devdatt Thengdi on 23 Mar 2018
I have been working on R2011b and R2013a (work and home) I got the same results for both the versions, except now. Now, I am having another problem: my d0 is going below zero. But, my lb for d0 is 0.01. That is resulting in imaginary results. This has happened every time I make any changes to the constants. Is it due to the limits (lb and ub)? because the only the solution to this problem (that I could find) is manipulating the limits, (which only works sometimes). All I did was change the value of LHV from 41.05 to 53200. Error:
mfuel =
0.2251
0.2251
d0 =
-0.3239 - 0.0333i
-0.3239 - 0.0333i
h0 =
59.2097 +87.5986i
59.2097 +87.5986i
Lf =
29.4318
29.4318
tf =
45.7742 + 0.0000i
45.7742 + 0.0000i
Error using sind
Argument should be real.
Error in Lobo (line 63)
dbc = (db./(sind(180./nb) + (pi./nb))); %Burner circle diameter
Error in @(x)Lobo(x(1),x(2),x(3),x(4),x(5))
Error in nlconst (line 743)
f = feval(funfcn{3},x,varargin{:});
Error in fmincon (line 794)
[X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN]=...
Error in Lobo_Solution (line 11)
[X, fval] = fmincon(fitnessfcn, x0, [], [], [], [], lb, ub, nonlcon1, options);

This question is closed.

Community Treasure Hunt

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

Start Hunting!