GA optimization with multiple variables and constraints

I have a function named (Kings) that I would like to optimize using GA. So far, I was able to put this problem. However, I'm struggling to construct the linear constraints A·x ≤ b.

Below is what I have done so far to maximize my objective if true % code

nvars = 168;

upbond = [5000 3000 1100 4000 2900 1100 800 2700];

lowbond = [2000 1000 500 1000 1000 300 300 700];

ub = [repmat(upbond, 1,20) 19* ones(1,8)];

lb = [repmat(lowbond,1,20) zeros(1,8)];

[xGA,fvalGA] = ga(@kings,nvars,[],[],[],[],lb,ub);

Kings Function is:

NetPV = kings(xxxx)

Rates = xxxx(1:160);

Rates = vec2mat(Rates,8);

time = floor(xxxx(161:end)); The first 160 variables are the rate of each field at different years and the last 8 defines the time to start these fields. A photo below explains the definitions of these variables. I need help to define the linear constraints; the sum of all rates at a given year should equal the demand year. The lower and upper bonds are the rates each field can run at.

end

Answers (0)

Tags

Asked:

on 19 Apr 2018

Edited:

on 19 Apr 2018

Community Treasure Hunt

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

Start Hunting!