Fmincon Error Message please help!

2 views (last 30 days)
Lori
Lori on 7 Aug 2022
Answered: Walter Roberson on 8 Aug 2022
When I try to run
pO = [5350 535 1000 1200 0.00002 30 100 0.912 500 15 120000 800000 0.00004 2.5 0.009263 4.3 1 0.01 0.076 15 0.01 1.27 0.001 0.5 10 18 1.09 0.002 0.001];
lb = [1000 100 500 600 0.00001 20 50 0.5 200 10 100000 500000 0.00001 1.5 0.005263 1.43 0.5 0.008 0.03 5 0.0006 0.5 0.0008 0.3 8 15 1 0.001 0.0008];
ub = [53500 5350 5000 2000 0.00005 100 300 1.5 1000 30 400000 10000000 0.00008 5 0.02 10 2 0.05 0.1 40 0.05 2.7 0.002 1 12 20 1.11 0.005 0.005];
p = fmincon(@Obj_Complex,pO,[],[],[],[],lb,ub);
it gives me this error
Error in fmincon (line 568)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in Fancy (line 8)
p = fmincon(@Obj_Complex,pO,[],[],[],[],lb,ub);
Caused by:
Failure in initial objective function evaluation. FMINCON cannot continue.
  1 Comment
Steven Lord
Steven Lord on 7 Aug 2022
Since the error occurs in your objective function, without seeing the code of Obj_Complex it will be impossible to offer any specific guidance.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 8 Aug 2022
In order to get that error at that line of code, your function Obj_Complex had to have generated an error message when evaluated passing in p0. You can see the error by executing
Obj_Complex(p0)

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!