fmincon optimization with integral function
Mostrar comentarios más antiguos
I'm trying to minimize the area of a function using fmincon and integral function My function is as given below
func = @(x)integral((@(l)(x(1)-l)),x(2),x(3),'ArrayValued',true);
...
[x, fval] = fmincon(func,x0,A,b,Aeq,beq,lb,ub,nonlcon);
The error I'm seeing is -
Input arguments to function include colon operator. To input the colon character, use ':' instead.
Error in fmincon (line 635) initVals.nceq = ceqtmp(:);
Error in flattop (line 15) [x, fval] = fmincon(func,x0,A,b,Aeq,beq,lb,ub,nonlcon);
Error in Load_Shift_Flat (line 118) [pnew, tstart, tending] = flattop(peak_load,tsta,tend,pmax,e(i-1));
I'm trying to optimize for 3 variables and l is an array which is an input to the flattop function
2 comentarios
Walter Roberson
el 30 de Jul. de 2018
It looks like the problem is in your nonlcon. What have you passed there?
The error would be consistent with your nonlcon returning a function handle when a value is expected.
SG
el 30 de Jul. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Choose a Solver en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!