I'm using a GlobalSearch (gs) function to find the global minimum for my function. But i get a errors like "PROBLEM structure should have a non-empty X0 field" and "Arguments must occur in name-value pairs".

Here is my code what i'm using opts = optimoptions(@fmincon,'Algorithm','sqp','TolFun',1e-16,'TolX',1e-16,'MaxFunEvals',100000,... 'MaxIter',100000,'Diagnostics','on','Display','iter');
X0 = [1 1 1 0.1593 14.8 1.75 1 0.12 1 0.0027 1.86 0.5]; LB = [1 1 1 0.1593 14.8 1.75 0 0.12 0 0.0027 1.86 0.5]; UB = [1 1 1 1 90 pi/2 1 0.05 0.5 0.05 10 1];
problem = createOptimProblem('fmincon','objective',@(K) Efficiency_new_normal_all(K,[sigmaef,AeffModef,PiTef,NredT,VGT,c,d,mred,etaTSef,... repmat([gamma,R,Din,Dout,Dnut,Dwheel,BladeH,FPosition(i),RendMean,beta,a0,a1],[length(PiTef),1]),z2angle,z3geom],,X0,LB,UB,opts));
gs = GlobalSearch; [xfinal2, f] = run(gs, problem);

1 comentario

For the above function, I want to plot a graph where i can see the iterations of the objective function, starting and ending point, and found global minimum points. please help me out. I'm not able to find anything on this.

Iniciar sesión para comentar.

 Respuesta aceptada

It would have been much easier to read your question if you had marked your code with the {} Code button.
But in any case it is clear what the problem is. You need to include your arguments in the createOptimProblem function in parameter-value pairs. For example, you might want
problem = createOptimProblem('fmincon','objective',fun,'lb',LB,'ub',UB,'x0',X0)
Here I am supposing that you earlier set fun to be your objective function handle @(K)Efficiency...
For details, see Create Problem Structure.
Alan Weiss
MATLAB mathematical toolbox documentation

Más respuestas (0)

Categorías

Más información sobre Entering Commands en Centro de ayuda y File Exchange.

Preguntada:

el 4 de Jun. de 2015

Editada:

el 22 de Jun. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by