Genetic algorithm error when running for non-linear function constroined by non-linear non-smooths equalities
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Computations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!