Invalid problem structure error when using GlobalSearch
3 ビュー (過去 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!