how can i create an array constraints in Genetic algorithm for Renewable energy system optimization

3 views (last 30 days)
function [c,ceq]=Hconstraint(n)
load('assignment_input_data.mat'); %loading data required for thePV system and wind turbine
%PV calculation-------------------------------------------------------
Npv=0.12; %efficiency of the solar module selected
%n(1) the area of the PV array
Ir=repmat(ir',1,30); %changing the matrix of solar irradiance to 12X720
Ir=Ir(:); %changing the matrix to vector 8640X1
Ppv=Ir*n(1).*Npv; %calculate the output power produced by the pv system
L= repmat(demand',1,30); %converting demand array to 12x720
L=L(:); %Load
P=Ppv; %renewable output power
Pd=P-L; %power defcit
%-------------------------------------------------------------------
cost=100000*n(1)+2000;
%objective
c1=zeros(8640,1);
for i=1:8640
c1(i)=-P(i)+L(i);
end
P=sum(P);
LCOE=cost/P;
c=[c1];
ceq=[];
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!