how can i create an array constraints in Genetic algorithm for Renewable energy system optimization
3 views (last 30 days)
Show older comments
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
1 Comment
Asvin Kumar
on 10 Apr 2020
Since the rest of the community might be unfamiliar with the equations you're trying to implement, it would help to provide details on that. To begin with, have you had a look at the following page: https://www.mathworks.com/help/gads/examples/constrained-minimization-using-the-genetic-algorithm.html?
Answers (0)
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!