Genetic algorithm error when running for non-linear function constroined by non-linear non-smooths equalities
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ramiro Canchucaja
le 20 Nov 2018
Commenté : Ramiro Canchucaja
le 21 Nov 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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Computations dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!