Invalid problem structure error when using GlobalSearch

8 vues (au cours des 30 derniers jours)
Alexandra
Alexandra le 17 Oct 2013
Commenté : Alexandra le 17 Oct 2013
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)

Réponse acceptée

Alan Weiss
Alan Weiss le 17 Oct 2013
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 commentaire
Alexandra
Alexandra le 17 Oct 2013
Thank you for your response. I agree that can definitely be made clearer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Global or Multiple Starting Point Search dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by