Invalid problem structure error when using GlobalSearch
2 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!