GlobalSearch and MultiStart Syntax

2 views (last 30 days)
Nath
Nath on 27 Jun 2014
Commented: Nath on 8 Aug 2014
Hi There
I want to use GlobalSearch and MultiStart for a parameter estimation problem using fmincon and lsqnonlin. The question is regarding the syntax. Both GlobalSearch for fmincon and MultiStart for lsqnonlin give the "not enough input argument " error. The objective function "Objective" that returns a value to fmincon has another function nested in it that gives the results of a set of ODEs. How do we add that in the createproblem of globalsearch or multistart, because the error point to that ode output function? Part of the code is written below.
Thanx
options=optimset('Algorithm','sqp','DiffMinChange',5,'MaxIter',7000,'MaxFunEvals',7000,'TolX',1e-10,'TolFun',1e-10,'ObjectiveLimit',1e-12);
lb=[0 0 0 0 0 0 0 0 0 0 0 0 0 0];
ub=[inf inf inf inf inf inf inf inf inf inf inf inf inf inf];
A=[];
b=[];
Aeq=[];
beq=[];
problem=createOptimProblem('fmincon','objective',Objective,'A',A0,'lb',lb,'ub',ub,'Aineq',A,'bineq',b,'Aeq',Aeq,'beq',beq,'options',options);
gs = GlobalSearch;
[xmin,Fmin] = run(gs,problem)
[Parameters,fval,exitflag,output]=fmincon(@(A) Objective (wd,fd,A),A0,A,b,Aeq,beq,lb,ub,nonlcon,options);

Answers (1)

Alan Weiss
Alan Weiss on 30 Jun 2014
Can you run fmincon alone without a syntax error? If not, get that debugged first. If so, then please show us exactly what MATLAB returns as the error when you try to run GlobalSearch or MultiStart, and exactly what Objective is in the createOptimProblem argument.
One other thing. It seems that you use A as both the anonymous function parameter and the linear inequality matrix. Perhaps this is an error, but perhaps not.
Alan Weiss
MATLAB mathematical toolbox documentation
  4 Comments
Nath
Nath on 23 Jul 2014
Edited: Nath on 23 Jul 2014
Then another syntax error shows up for function handle: I'm testing in MATLAB 2013 which version have you tried, any difference?
Undefined function 'createOptimProblem' for input arguments of type 'function_handle'.
Error in kineticsestimateglobfmin (line 49) problem=createOptimProblem('fmincon','objective',@(A)Objective(wd,fd,A),'A',A0,'lb',lb,'ub',ub,'Aineq',Ain,'bineq',b,'Aeq',Aeq,'beq',beq,'options',options);
Nath
Nath on 8 Aug 2014
Do I report a bug on this matter?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!