Invalid problem structure error when using GlobalSearch

조회 수: 8 (최근 30일)
Alexandra
Alexandra 2013년 10월 17일
댓글: Alexandra 2013년 10월 17일
When I use lsqcurvefit(problem) & run(multistart,problem) - I get no errors with my problem structure but now that I am attempting GlobalSearch I get an error message:
Error using AbstractGlobalSolver/checkProblem (line 227)
Invalid problem structure: missing required field or invalid field value.
Error in GlobalSearch/run (line 305)
obj.checkProblem(problem, probRequiredFields, probValidValues);
My code is as follows:
xrise = xdata(1:300);
yrise = ydata(1:300);
options = optimoptions('lsqcurvefit');
TolFun_Data = 1e-4;
TolX_Data= 1e-4;
FinDiffRelStep_Data=[0.01];
MaxIter_Data = 1e5
options = optimoptions(options,'Display', 'final');
options = optimoptions(options,'MaxIter', MaxIter_Data);
options = optimoptions(options,'TolFun', TolFun_Data);
options = optimoptions(options,'TolX', TolX_Data);
options = optimoptions(options,'FunValCheck', 'off');
options = optimoptions(options,'Algorithm', 'trust-region-reflective');
options = optimoptions(options,'Diagnostics', 'off');
options = optimoptions(options,'FinDiffRelStep', FinDiffRelStep_Data);
options = optimoptions(options,'FinDiffType', 'central');
options = optimoptions(options,'Jacobian', 'off');
options = optimoptions(options,'JacobPattern', 'sparse(ones(jrows,jcols))');
options = optimoptions(options,'TypicalX', 'ones(numberofvariables,1)');
x0 = [0.05];
lb = [0.05];
ub = [0.3];
problem =createOptimProblem('lsqcurvefit','x0',x0,...
'objective',@myfuncTi,'xdata',xrise,'ydata',...
yrise,'lb',lb,'ub',ub,'options',options);
gs=GlobalSearch;
[TiVal fval exitflag output solutions]=run(gs,problem)

채택된 답변

Alan Weiss
Alan Weiss 2013년 10월 17일
GlobalSearch does not accept lsqcurvefit as a local solver. If you want to use GlobalSearch, your only choice of local solver is fmincon.
I think that error message could be improved. I will look into it.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Alexandra
Alexandra 2013년 10월 17일
Thank you for your response. I agree that can definitely be made clearer.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Global or Multiple Starting Point Search에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by