Error using barrier Objective function is undefined at initial point. Fmincon cannot continue. Error fmincon (line 848)
Show older comments
I run my main program Train_PF.m. In my main program Train_PF.m , I have declared the initial point u0 as initial point. But there is error said undefined at initial point.
Steps i= 2
Elapsed time is 1.780754 seconds.
Elapsed time is 0.037505 seconds.
Elapsed time is 0.025071 seconds.
Elapsed time is 0.024210 seconds.
Elapsed time is 0.028659 seconds.
Elapsed time is 0.028935 seconds.
Elapsed time is 0.028281 seconds.
Steps i= 3
Error using barrier
Objective function is undefined at initial point. Fmincon cannot continue.
Error in fmincon (line 848)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in Train_PF (line 115)
[u, Cost(i,1), Exitflg(i,1), output] = fmincon(@(u) Fungsicos( Np, Tim_step, X0 ,u,
Vehicle_Type,Q1,Xdes,R1,F1,Xa,G1,Xnba), ...
9 Comments
Mario Malic
on 9 Nov 2020
Edited: Mario Malic
on 9 Nov 2020
This is too much for anyone here to take a look at. Try debugging , stop it before it enters i = 3 and look what happens step by step, maybe you made a mistake at indexing somewhere.
Matt J
on 9 Nov 2020
But there is error said undefined at initial point.
Do you have some reason to dispute what the error message is telling you? Have you tested the objective function at the initial point u0?
Ivan Dwi Putra
on 9 Nov 2020
Matt J
on 9 Nov 2020
That's not what I asked, though. I asked if you have tested if the objective function gives a reasonable output when input u0
Ivan Dwi Putra
on 9 Nov 2020
Bruno Luong
on 9 Nov 2020
Have you noticed you have NaN in u0 (last element)?
Mario Malic
on 9 Nov 2020
Actually, his objective function works with this NaN.
He has 7 fmincons that run fine for the first step which is i = 2, in the second step i = 3, this happens.
Ivan Dwi Putra
on 9 Nov 2020
Ivan Dwi Putra
on 10 Nov 2020
Edited: Ivan Dwi Putra
on 10 Nov 2020
Answers (0)
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!