1. Mathematical representation of fault information

In the figure above, K stands for circuit breaker, and there is an FTU device on each circuit breaker, which can feed back whether the circuit breaker is overcurrent, and represents the uploaded fault information, which reflects whether the fault current flows through the switch at each section. If the fault current is 1, otherwise, it is 0). That is:

 

Since the information uploaded by FTU can be divided into two types: fault-free information and fault-free information, it can only be fault-free information and fault-free information for segmented interval, so we can use binary code rules to conduct mathematical modeling for distribution network fault location. The radial distribution network shown in the figure above is taken as an example. The system has 12 segmtioned switches. We can use a string of 12-bit binary codes to represent the upload information of FTU as the input of the program, where 1 indicates that the corresponding switch has overcurrent information and 0 indicates that the corresponding switch has no overcurrent information. At the same time, another string of 12-bit binary code is used as the output of the program, which means failure occurs in the corresponding feeder interval and no failure.

Genetic algorithms begin with a population that represents the set of possible solutions to a problem, and a population consists of a given number of individuals encoded by a gene. Each individual is actually a chromosome – bearing entity.

As the main carrier of genetic material, the chromosome is a collection of multiple genes. Its internal expression (genotype) is a combination of genes, which determines the external expression of an individual’s shape. For example, the feature of black hair is determined by a combination of genes controlling this feature in the chromosome. Therefore, the mapping from phenotype to genotype is required at the beginning of the coding. Because of the complexity of copying genetic coding, we tend to simplify it, such as binary coding.

After the generation of the initial population, according to the principle of survival of the fittest and survival of the fittest, the evolution of generation by generation produces better and better approximate solutions. In each generation, individuals are selected according to their fitness size in the problem domain. By means of natural genetic genetic operators, crossover and mutation are combined to generate populations representing new solution sets.

This process will result in the subsequent generation of the population, like the natural evolution, being more adaptable to the environment than the previous generation, and the optimal individual in the last generation of the population, through decoding, can serve as an approximate optimal solution to the problem.

Genetic algorithm process diagram

 

3. Construct distribution network fault location evaluation function

**** Based on the principle that the deviation between the information corresponding to the actual status of each feeder segment and the actual uploaded fault information should be minimal, the following evaluation function is constructed:

 

The value of the expression is the fitness value corresponding to each potential solution. The smaller the value is, the better the solution is. Therefore, the evaluation function should take the minimum value.

Type:Is the fault information uploaded by the JTH switch FTU. If the value is 1, the switch flows through the fault current; if the value is 0, the switch does not flow.Is the expected state of each switch node, if the switch flows through the fault current, the expected state is 1; on the contrary, the expected state is 0, and the expression is a function of the states of each section. N is the total number of feeder segments in the distribution network,Is the status of each device in the distribution network. A value of 1 indicates that the device is faulty; a value of 0 indicates that the device is normal.Represents a weight factor multiplied by the number of failed devices,. Is the weight coefficient set according to the concept of “minimum set” in the fault diagnosis theory. The value range is between and 1, indicating that the fewer fault intervals, the better the solution is to avoid misdiagnosis. In this paper, the weight coefficient is 0.5.

Fourth, find the expectation function

For different networks, the expression of the expected function is different and cannot be expressed in a unified format. Just take the above example as an example to illustrate how to find the expected function.

In radiant distribution network, failure in any interval will lead to fault overcurrent flowing through the upstream switch. That’s the principle for finding the expected function. Assume that there is a fault in feeder section 6 in Figure 1, then there will be an overcurrent in the segment switches K1,K2,K3 and K6. If there is a fault in feeder section 11, there will be an overcurrent in K1,K2,K3,K6 and K10. By analogy, we can obtain the expected function of each segment switch:

% with the improved genetic algorithm, based on the ring network coding, easy to produce feasible solution (meet the constraints of distribution network radial) % for IEEE33 node distribution network fault recovery, fitness is the calculation of network loss and the number of operations is roulette way adopted by % % after the shift operation and mutation operation will not produce infeasible solution, don't need to test the clear; clc; Tic % loop-based coding strategy, the public branch only needs to be placed in one of the loop networks, switch 1 does not need to encode (always closed) loop1=[2,3,4,5,18,19,20,33]; ,23,24,25,26,27,28,37 loop2 = [22]; Loop3 =,9,10,11,21,35 [8]; Loop4 =,7,15,16,17,29,30,31,32,36 [6]; ,13,14,34 loop5 = [12]; % Determine faulty branch (entered as TXT file) % txtPath ='breaker. TXT '; % file path name bb=36; % deposit initial switch set population1 =,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0 [1]; % population size popsize=50; %chromlength=5; % shift probability PC = 0.6; % variation probability PM = 0.001; % pop = initpop(popsize,bb); % initialize x,y (store the optimal solution under each iteration) x=zeros(1,50); y=zeros(50,size(pop,2)); % Calculate fitness value fitValue = cal_FITValue (POP); For I = 1:50% 50 iterations % select newPOP = Selection (pop, fitValue); % newPOP = movePosition (newPOP, PC,bb); % newPOP = mutation(newPOP, PM,bb); % update population pop = newPOP; % Calculate the fitness value and find the optimal solution FITValue = cal_FITValue (POP); [bestindividual,bestfit] = best(pop,fitvalue); %ws(i)=powerflow(transform(bestindividual)); % % to record the actual network loss cz (I) = sum (xor (bestindividual population1)) - 1; % Record the actual number of operations x(I)=bestfit; y(i,:)=bestindividual; end [bestfit1,index]=max(x); % Show initial topology figure show_tuopu(population1); saveas(gca,'tuopu1.jpg'); Figure show_tuopu(y(index,:)); figure show_tuopu(y(index,:)) saveas(gca,'tuopu.jpg'); % Save topology in picture format output % Output the best fitness value x under each iteration number; bestfit1; y(index,:); [openkg,closekg] = judge_kg(y(index,:),bb); % Find the switch fid=fopen('openkg.txt','wt'); % Fprintf (fid,'%g\n',openkg); fclose(fid); fid=fopen('closekg.txt','wt'); % Output fprintf(fid,'%g\n',closekg) as TXT file; fclose(fid); Ws = powerflow(transform(y(index,:)) cz = sum(xor(y(index,:),population1))-1 %result=[ws;cz]; fid=fopen('ws.txt','wt'); % Fprintf (fid,'%g\n',ws); fclose(fid); fid=fopen('cz.txt','wt'); % Output the result as TXT file fprintf(fid,'%g\n',cz); fclose(fid); [node,u,delt]=powerflow_V(transform(y(index,:)); nodevoltage=[node',u',delt']; fid=fopen('nodevoltage.txt','wt'); % Output the calculation result as TXT file [m,n]=size(nodeVOLTAGE); for i=1:m for j=1:n if j==n fprintf(fid,'%g\n',nodevoltage(i,j)); else fprintf(fid,'%g\t',nodevoltage(i,j)); end end end fclose(fid); % branch current [branch,p,q]=powerflow_S(transform(y(index,:)); branchflow=[branch',p',q'] fid=fopen('branchflow.txt','wt'); % Output the calculation result in the form of TXT file [m,n]=size(branchflow); for i=1:m for j=1:n if j==n fprintf(fid,'%g\n',branchflow(i,j)); else fprintf(fid,'%g\t',branchflow(i,j)); end end end fclose(fid); tocCopy the code