constraint violation in GA toolbox

1 回表示 (過去 30 日間)
alaa zarif
alaa zarif 2019 年 6 月 18 日
コメント済み: alaa zarif 2019 年 6 月 18 日
my code is supposed to calculate the max fundmental with a mass constraint but also having a minimum fundumental freq of 15 hz.
my variables are 0s and 1s the code runs normally however its plotting penalty vs generations instead of best fitness , when i searched i found that this is due to constraint violation. I dont know how to fix this
please note that @Fund_freq is my objective fnc
my nonlinear constraint function:
function [C,C_eq] = myConstraints(q)
c=32
N=sum(q);
Initial_Data
F=Fund_freq(q,N,c,h);
C=[F-15];
C_eq=[];
end
my linear const fnc
function [A,b] = mass_const(c,nvars)
Initial_Data;
A(1,c)=2*LX*LY*rhom;%(Multiplied by 2 for double mass)
A(1,c+1:nvars)=2*LX*LY*rhoG;
b=1.941;
end
  3 件のコメント
alaa zarif
alaa zarif 2019 年 6 月 18 日
the problem is i need a maximum fundumental freq of a plate
the variables are referriing to thickness of the plate
this plate mass shouldnt exceed 1.941 kg and the fund freq cant be lower than 15 hz
is it clearer now?
alaa zarif
alaa zarif 2019 年 6 月 18 日
the plate is assumed to be made of several layers of equal thickness and the code assumes their absence or existence by 0s and 1s

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by