Definition of constraints not directly dependent in ga optimization

9 views (last 30 days)
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!

Accepted Answer

Matt J
Matt J on 16 Nov 2018
Edited: Matt J on 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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!