[Power grid planning] Matlab simulation of optimal planning of power system based on intelligent algorithm

1. Software version

matlab2013b

2. Theoretical knowledge of this algorithm

In a medium and long-term power grid planning, the objective function that needs to be considered can be considered as the minimum value of the sum of the annual investment cost of the new power grid line and the operating cost of the power grid system. To meet the minimum target value and meet the constraints of power grid operation is to solve the problem. optimal solution to the problem. According to this principle, the objective function for any year is given as:

      

         In the formula, it represents the set of new lines; it represents the set of all lines ; W represents the total planning cost; it represents the capital recovery coefficient; it represents the fixed operating rate of the project; Cost coefficient; it represents the cost of expanding a new line of power grid branch i; it represents the number of new lines extended by power grid branch i; it represents the resistance of branch i; it represents the power year of branch i Loss hours; represents the real power delivered by branch i under normal operating conditions.

 

 

 

         In a medium and long-term power grid planning, the cost of each year needs to be considered, then the total cost of the power grid planning is the sum of the total cost of the new line and the operating costs over the years, then the objective function in the formula can be rewritten as:

 

 

        In formula 3.3, X represents the total cost of the entire new line, which is equivalent to the first item of formula 3.1; it represents the operating cost of the power grid system in the first year, which is equivalent to the second item of formula 3.2; i represents the discount rate; K is the capital recovery coefficient coefficient, which can be calculated by . Then the optimization objective function of medium and long-term power grid planning can be defined as:

3. Part of the core code

 

clc;
clear;
close all;
warning off;
addpath 'func\'
addpath 'GA_toolbox\'
rng(1);

%编号
NO    = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]';
%线路首端号
START = [1,1,1,1,1,2,2,2,2,3,3,3,4,4,5]';
%线路末端号
ENDS  = [2,3,4,5,6,3,4,5,6,4,5,6,5,6,6]';
%支路电抗
ZDK   = [40,50,60,20,10,20,20,40,20,20,30,48,30,20,10]';
%容量限制
Vmax  = [100,100,80,100,70,100,100,100,100,82,100,100,75,100,78]';
%线路长度
Len   = [40,38,60,20,68,20,40,31,30,59,20,48,63,30,61]';
%电抗
DZ    = [0.1,0.09,0.15,0.05,0.17,0.05,0.1,0.08,0.08,0.15,0.05,0.12,0.16,0.08,0.15]';
%电抗
DK    = [0.4,0.38,0.6,0.2,0.68,0.2,0.4,0.31,0.3,0.59,0.2,0.48,0.63,0.3,0.61]';

tmps  =[NO,START,ENDS,ZDK,Vmax,Len,DZ,DK]; 
%整理
IEEE6 =[tmps([1,3,4,6,7,11],:);tmps([9,11,14],:)]; 

%初始线路
Nline =[1,1,1,1,1,1,0,0,0];   


%初始邻接矩阵
Connect=[0 1 0 1 1 0;
         1 0 1 1 0 0;
         0 1 0 0 1 0;
         1 1 0 0 0 0;
         1 0 1 0 0 0;
         0 0 0 0 0 0];
%各节点注入功率
P = [-30,-240,125,-160,-240]';             
%节点数 
N = 6;     

tic;
%定义遗传算法参数
%种群规模
NIND   = 1000;                                                                
%迭代次数
MAXGEN = 200;                                                                                                             
Price  = zeros(MAXGEN,1);          
%基向量 
BaseV  = 5*ones(1,length(Nline));
Chrom  = crtbp(20,BaseV); 
gen    = 0;   
%初始种群函数值
ObjV   = func_obj(Chrom,IEEE6,Nline,Connect,P,N); 
df     = 1000;
while gen< MAXGEN
      gen
      if gen == 0
         Pe = 0.92; 
      else
         Pe = 1/(1+exp(-df/10));  
      end
      gen   = gen+1;
      FitnV = ranking(ObjV);           
      %选择
      SelCh = select('sus',Chrom,FitnV);                              
      SelCh = recombin('xovmp',SelCh,Pe);  
      %重组
      f     = [zeros(1,length(Nline));5*ones(1,length(Nline))];      
      %变异
      SelCh        = mutbga(SelCh,f);                                               
      SelCh        = fix(SelCh);   
      ObjV2        = func_obj(SelCh,IEEE6,Nline,Connect,P,N);                                      
      [Chrom,ObjV] = reins(Chrom,SelCh,1,1,ObjV,ObjV2); 
      indx         = find(isnan(ObjV) == 1);
      ObjV3        = ObjV;
      ObjV3(indx)  = [];
      Price(gen)   = min(ObjV3);  
      if gen > 1
         df        = abs(Price(gen) - Price(gen-1));
      end
end

[Y,I]   = min(ObjV);                        
%规划
Net_new = Chrom(I,:);
Net_new
Y   

figure;
plot(Price,'b','linewidth',2);
grid on    
xlabel('Iteration times');
ylabel('Total cost');
toc; 

save R2.mat Price



4. Simulation conclusion

 

 

5. References

[01]Valenzuela  Jorge,  Wang  Jianhui.  A  probabilistic  model  for  assessing  the  long-term economics of wind energy. Electric power systems research, 2011, 81(4): 853~861.

[02]C.W.Fu, T. T.Nguyen. Models for Long-Term Energy Forecasting[J].IEEE Power  Engineering  Society  General  Meeting,2003,13-17  July, Volume  1:235.239.

[03] Gu Jindi, Wu Xupeng, etc. Research on reliability evaluation of transmission network planning scheme[J].East China Electric Power,2010,38(12):184-187.

A06-48

6. How to obtain the complete source code

Method 1: Wechat or QQ to contact the blogger
Method 2: Subscription , free access to the tutorial case code and any 2 complete source code of this blog

 

 

 

Guess you like

Origin blog.csdn.net/ccsss22/article/details/124328646