Clear Filters
Clear Filters

why the penalty of ga, when all the population violates the nonlinear constraints, is smaller than the penalty of feasible populations?

4 views (last 30 days)
I have integer problem with nonlinear constraints. So, at the beggining there are only few integer options (the problem's boundary increases through time) and sometimes all the populations my violate the non-linear constraint. For example, the penalityt value of the first generation with feasible population is 5, then ga assignes penality value 1 when the entire population in the second generation violates the non-linear constraint.
  4 Comments
Matt J
Matt J on 17 Nov 2022
Edited: Matt J on 17 Nov 2022
How are you observing the population size? How are you observing the penalty values? What code can we run to illustrate what you are seeing?
Emebet Gedlu
Emebet Gedlu on 17 Nov 2022
Well, I have a very complex problem but here is the idea.
f=@(n_Tx)CMPC_vector(n_Tx,u_past,decide,Setup,Hist_temp, plan_OP,trainedNet,Rem_step);
nonlcon=@(x)MaxTorqueLim(x,Setup,Rem_step,decide);
options=optimoptions('ga', 'Display', 'iter','MaxTime',120,...
'PopulationSize',PP_Size,'UseVectorized',true,...
'CrossoverFraction',0.5,'EliteCount',floor(1+PP_Size/3),'MaxStallGenerations',15);
[n_Tx_float,f_val]=ga(f,Setup.NInput*Rem_step,[],[],[],[],lb,ub,nonlcon,1:Setup.NInput*Rem_step,options);
function JJ= CMPC_vector(x,u_past,decide,Setup,Hist, plan_OP,trainedNet,Rem_step)
...
end
I just put a brake point in the first line of the "CMPC_vector" function to obesrve what is in x. Then I give higher penality value if it is empy, but what appear in the display is just 1 all way till the maximum stall.

Sign in to comment.

Answers (1)

Jasvin
Jasvin on 21 Sep 2023
Hi Emebet,
So, this is a problem that exists with all optimization algorithms in MATLAB. The following MATLAB Answers post would help you gain more insight into what is happening and provide helpful links:
Hope this helps!

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!