Definition of constraints not directly dependent in ga optimization

9 vues (au cours des 30 derniers jours)
Thiago Cavalcante
Thiago Cavalcante le 16 Nov 2018
Modifié(e) : Matt J le 16 Nov 2018
Hi guys, I'm trying the get my constraints defined using ga function.
My prblem is something like:
objective function: obj_func(K), where K in a vector
constraints: 0 <= maxMagEigVal(A) <= 1 and obj_func(K) <= ks and obj_func(K) being positive. A is a squared matrix
Can anyone give me a guidance of how can I define that or if htat is possible to do? I need to find a vector K that satisfies those constraints. If it needs fmore details I can provide the code of those functions.
Thaks in advance!

Réponse acceptée

Matt J
Matt J le 16 Nov 2018
Modifié(e) : Matt J le 16 Nov 2018
function [c,ceq]=nonlcon(K)
ceq=[];
c(1)=-obj_func(K);
c(2)=obj_func(K)-ks;
c(3)=max(abs(eig(A(K))))-1;
end

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by