Genetic algorithm error when running for non-linear function constroined by non-linear non-smooths equalities
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ramiro Canchucaja
el 20 de Nov. de 2018
Comentada: Ramiro Canchucaja
el 21 de Nov. de 2018
Hello,
I am trying to perform minimization of a non-linear function which depends on 23 variables and constrained by 12 non-linear equalities.
When running "ga" I got the following error message. Hope anyone could come up with a suggestion. Matrix "A" is the result of vertical concatenation of linear equalities. in the function "eqnsolv".
Thank you!
Error using norm
First argument must be single or double.
Error in eqnsolv (line 29)
normRow = norm(A(i,:));
Error in preProcessLinearConstr (line 93)
[XOUT,Aineq,Bineq,Aeq,Beq,msg,how,exitflag]= eqnsolv(XOUT,Aineq,Bineq,Aeq,Beq,LB,UB,tol,verbosity);
Error in gacommon (line 97)
[Iterate.x,Aineq,bineq,Aeq,beq,lb,ub,msg,exitFlag] = preProcessLinearConstr( ...
Error in ga (line 363)
NonconFcn,options,Iterate,type] = gacommon(nvars,fun,Aineq,bineq,Aeq,beq,lb,ub, ...
Error in B57integ (line 155)
[xop,fvalo]=ga(objective,23,A,B,'','',lbo,ubo,nlincon,options2);
Error in run (line 91)
evalin('caller', strcat(script, ';'));
eqnsolv code in which error occurred
A = [Aeq;Aineq];
B = [Beq;Bineq];
% Total number of constraints
ncstr = size(A,1);
% Normalize constraints
for i=1:ncstr
normRow = norm(A(i,:));
if (normRow >= tolDep)
A(i,:) = A(i,:)/normRow;
B(i) = B(i)/normRow;
0 comentarios
Respuesta aceptada
Walter Roberson
el 21 de Nov. de 2018
do not use '' for placeholders for the linear equality . use []
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Computations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!