Values of NaN or Inf are included in the finite-difference derivatives at the initial point. I cannot continue to calculate with fmincon.

11 ビュー (過去 30 日間)
Hello, I 'm working on the nonlinear programmming with constraints.
>> load('JIRIOT_is3.mat')
>> options = optimoptions(@fmincon, 'Display','iter','Algorithm','interior-point');
>> [x,fval,exitflag,output,lambda] = fmincon(@(x)mindistance_xo(x,x0),x0,A,b,Aeq,beq,lb,[],[],options)
But, matlab replied the error message as follows:
>>Value of NaN or Inf is included in the finite-difference derivatives at the initial point.
I enclosed the data file('JIRIOT_is3.mat') and objective function file(mindistance_xo.m).
Could you please give some advices to me how to solve the above program?
  2 件のコメント
Michiya
Michiya 2014 年 1 月 28 日
I attached the objective function file.
Michiya
Michiya 2014 年 1 月 28 日
error messages are as follows:
>> error: barrier (line 145)
>> error: fmincon (line 905)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...

サインインしてコメントする。

採用された回答

Alan Weiss
Alan Weiss 2014 年 1 月 28 日
Thank you for providing the error message:
Value of NaN or Inf is included in the finite-difference derivatives at the initial point.
This tells you exactly why fmincon cannot continue. You have a few choices:
  1. Try different initial points, to attempt to find one where the estimated derivative at the initial point exists and is finite
  2. Examine your objective and nonlinear constraint functions carefully to see why they are returning NaN or Inf
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  1 件のコメント
Michiya
Michiya 2014 年 1 月 28 日
Hello, Alan,
Thank you for your answer.
I tried the different initial point, especially, to find the estimated derivative
at the initial point is finite as follows:
idx = find(x0 == 0);
x0(idx) = 0.00001;
Then, we can get the solution.
Your answer is the best. Thanks.
Michiya

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurrogate Optimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by