Invalid problem structure error when using GlobalSearch
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alexandra
el 17 de Oct. de 2013
Comentada: Alexandra
el 17 de Oct. de 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)
0 comentarios
Respuesta aceptada
Alan Weiss
el 17 de Oct. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Global or Multiple Starting Point Search en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!