The Optimization Algorithm of the Forced Current Cathodic Protection Base on Simulated Annealing †

The grounding grid of a substation is important for the safety of substation equipment. Especially to address the difficulty of parameter design in the auxiliary anode system of a grounding grid, an algorithm is proposed that is an optimization algorithm for the auxiliary anode system of a grounding grid based on improved simulated annealing. The mathematical model of the auxiliary anode system is inferred from the mathematical model of cathodic protection. On that basis, the parameters of the finite element model are optimized with the improved simulated annealing algorithm, thereby the auxiliary anode system of a grounding grid with optimized parameters is structured. Then the algorithm is proven as valid through experiments. The precision of the optimized parameters is improved by about 1.55% with respect to the Variable Metric Method and the Genetic Algorithm, so it can provide a basis for parameter design in the auxiliary anode system of a grounding grid.


Introduction
A substation grounding grid is an essential facility for working grounding, lightning protection grounding and protective grounding.It is important for ensuring the safety of people, equipment and systems.It acts as a discharge and equalization for lightning protection, static electricity and fault current [1][2][3][4][5].When an accident occurs, if the grounding grid is defective, the short-circuit current cannot be fully diffused in the soil.This will cause the grounding grid to rise in potential and cause the metal housing of the grounding device to carry a high voltage.This jeopardizes personal safety and breaks through the insulation of the secondary protection device.In severe cases, it will damage the equipment, expanding the accident and damaging the stability of the power grid system [6][7][8][9][10][11].Forced current cathodic protection is an effective grounding grid protection system.How to optimize the forced current cathodic protection effect?The parameters of the auxiliary anode system are critical in the grounding grid [12][13][14].
Designing a grounding grid auxiliary anode system parameters has always been a difficult problem and many experts at home and abroad have done a lot of research.In [15], the multi-electrode system was calculated by the finite element method and the reliability of the finite element method in the field of corrosion was verified for the first time.In [16], the finite element method was used to simulate the cathodic protection system and compared with the experimental results.In [17], the forced current cathodic protection system of the ship was modeled, and the influence of the shape and position of the auxiliary anode on the cathodic protection effect was analyzed.In [18], the forced current cathodic protection system of reinforced concrete is modeled and analyzed, and the parameters such as current output and position of the auxiliary anode are optimized.In [19], the forced current cathodic protection system of the offshore platform in seawater was modeled and analyzed to find out the influence of the auxiliary anode output current, anode position, seawater conductivity and biofouling coverage on cathodic protection.
Although scholars have done a lot of research on this aspect, there is little research on the inverse problem of grounding grid cathodic protection, that is, how to optimize the parameters of the grounding grid cathodic protection system.Therefore, an optimization of the parameter of the grounding grid auxiliary anode system is carried out in this paper.A grounding grid auxiliary anode system parameter optimization algorithm (SAOA), based on a simulated annealing finite element, is proposed and verified.

Mathematical Modeling of Auxiliary Anode Optimization Design
The auxiliary anode is an important part of the cathodic protection system and the grounding grid cathodic protection is more complicated.The model diagram is shown in Figure 1.The potential distribution of the protected body is uniform and the design parameters of the anode are very important.the forced current cathodic protection system of the ship was modeled, and the influence of the shape and position of the auxiliary anode on the cathodic protection effect was analyzed.In [18], the forced current cathodic protection system of reinforced concrete is modeled and analyzed, and the parameters such as current output and position of the auxiliary anode are optimized.In [19], the forced current cathodic protection system of the offshore platform in seawater was modeled and analyzed to find out the influence of the auxiliary anode output current, anode position, seawater conductivity and biofouling coverage on cathodic protection.
Although scholars have done a lot of research on this aspect, there is little research on the inverse problem of grounding grid cathodic protection, that is, how to optimize the parameters of the grounding grid cathodic protection system.Therefore, an optimization of the parameter of the grounding grid auxiliary anode system is carried out in this paper.A grounding grid auxiliary anode system parameter optimization algorithm (SAOA), based on a simulated annealing finite element, is proposed and verified.

Mathematical Modeling of Auxiliary Anode Optimization Design
The auxiliary anode is an important part of the cathodic protection system and the grounding grid cathodic protection is more complicated.The model diagram is shown in Figure 1.The potential distribution of the protected body is uniform and the design parameters of the anode are very important.At present, in practical applications, the location of the embedding is determined mainly by experience or field test.In the already operating cathodic protection system, due to improper selection of the position, a protection body at a distance is not protected, and a protection body in the closer vicinity is over protected.The result is relocation and burying of the auxiliary anode, which is neither scientific nor economical.Through theoretical and experimental research on the design parameters of the auxiliary anode, it is found that reasonable anode design parameters should meet potential distribution requirements and ensure a small current density.
According to the purpose of cathodic protection design, all protected bodies reach the protection potential.For the protection of metal parts, the surface potential φ of the protected metal should meet the purpose of corrosion protection p φ is the protection potential, and the value of p φ depends on the characteristics of the metal structure to be protected and the medium is selected with reference to relevant experiments and parameters.
In order to make the surface potential of all protected bodies in the region meet the above requirements, it can be solved in two ways.One is to rationally arrange and adjust the anode position; At present, in practical applications, the location of the embedding is determined mainly by experience or field test.In the already operating cathodic protection system, due to improper selection of the position, a protection body at a distance is not protected, and a protection body in the closer vicinity is over protected.The result is relocation and burying of the auxiliary anode, which is neither scientific nor economical.Through theoretical and experimental research on the design parameters of the auxiliary anode, it is found that reasonable anode design parameters should meet potential distribution requirements and ensure a small current density.
According to the purpose of cathodic protection design, all protected bodies reach the protection potential.For the protection of metal parts, the surface potential φ of the protected metal should meet the purpose of corrosion protection φ ≤ φ p φ p is the protection potential, and the value of φ p depends on the characteristics of the metal structure to be protected and the medium is selected with reference to relevant experiments and parameters.
In order to make the surface potential of all protected bodies in the region meet the above requirements, it can be solved in two ways.One is to rationally arrange and adjust the anode position; the other is to adjust the anode current output.The adjustment of the anode current output is easy to implement in engineering, as long as the current output of the current source is adjusted.The burying of the anode on the project requires a large investment and engineering quantity, such as the excavation of earthwork and laying of carbon beds.Therefore, it is almost impossible to adjust the position once it is fixed.Therefore, the research goal is to determine the optimal anode embedding position during the pre-construction, anti-corrosion design.
The finite element method can usually be used to solve the model.On the selected grid, the potential value at each junction of the cathode surface can be obtained.
Let the grounding net have n nodes and the vector of the potential φ j at each node is φ j , and it is defined as Here, φ e is anode potential, D e (x e , y e , h e ) is the anode position, x e , y e , h e are the projections of the anode on the X, Y and Z axes respectively,L(a, b) is the grounding grid specification to be protected and a, b respectively represent the length and width specifications of the grounding grid; n e is the number of anodes, φ p is the best protection potential.
In the two functions defined above, Ψ 1 represents the degree of uniformity of the potential distribution, and Ψ 2 represents the closeness of the calculated value of the average potential to the theoretical optimal value.
The ).This represents the optimization of anode position, size and quantity as a multi-objective planning problem.
It is significantly different from the inverse problem commonly encountered in cathodic protection.First, it is not a single-objective planning problem but a multi-objective planning with two goals.Second, the functional in the objective function is not defined in terms of the difference between the observed value and the calculated value but is defined only by the calculated value.Since the definition of the two objective functions takes advantage of the concept of mean and variance, we can call this inverse problem model the mean variance model of the inverse problem of partial differential equations.
The idea for solving this inverse problem model is: First, use the weighted average method to turn the multi-objective programming problem into a single-objective programming problem, let: Secondly, in solving this inverse problem, it is necessary to continuously solve the upper model for a given set of [φ e , D e (x e , y e , h e ), L(a, b), n e ], which is actually a process of repeatedly solving the positive problem.
Aiming at the above characteristics, the calculation program for solving this inverse problem is designed by finite element method.The calculation program can be divided into two parts: the core of the program and the processing of the calculated data.
The core part of the program is to solve the mathematical model using finite element.The data processing part of the program uses the potential value of each node on the cathode surface to calculate the value of the objective function Ψ[φ e , D e (x e , y e , h e ), L(a, b), n e ].In the process of solving the inverse problem, it is necessary to frequently change the position and size of the anode and it is necessary to re-distribute the solution area frequently.
In summary, the finite element mathematical model of the auxiliary anode optimization design is equation ( 4), which is the basis of SAOA: here, the limit value of the position of the coordinate source point of the jth anode point of the grounding grid in the model.The objective function Ψ[φ * e , D * e (x e , y e , h e ), L * e (a, b), n * e ] and the variable are indirect implicit function relations, which requires that the selected optimization algorithm not only avoids the derivative of the objective function and the constraint function in the calculation process, but also uses the function values of the objective function and the constraint function.So the simulated annealing algorithm should be used to attempt intelligent optimization.The simulated annealing algorithm is essentially an intelligent optimization method.Directly oriented to optimization problems, it has a number of advantages over traditional optimization methods.The result is a good set of solutions rather than a single solution.This provides an alternative opportunity for users of the solution.Therefore, the algorithm is especially suitable for dealing with complex nonlinear optimization problems in engineering.

Auxiliary Anode Based on Simulated Annealing Optimized Finite Element Method
The following is an analysis of the traditional finite element loop algorithm, followed by the simulated annealing optimization finite element algorithm proposed in this paper and the calculation program for solving the model.

Traditional Finite Element Loop Algorithm Design Analysis
A four-layer cycle is set for n e anode position D e (x e , y e , h e ), anode size φ e , anode number d, and ground grid specification L(a, b) to be protected.
In the first layer of circulation, the number of anodes is increased by a specific rule and gradually increases (for example, the number of anodes can be 1, 2, 3, 4, etc., sequentially increasing); in the second layer of circulation, each anode position D e (x e , y e , h e ) is continuously changed according to specific rules; in the third layer of circulation, the amplitude of the anode size φ e is changed according to a specific law; in the fourth layer of circulation, the ground grid specification L(a, b) is constantly changing.
The advantage of the loop algorithm calculation program is that the variation of Ψ[φ e , D e (x e , y e , h e ), L(a, b), n e ] with anode size, position, number, and grounding grid specifications can be quickly obtained; the disadvantage is that the anode size, position, number, and grounding grid specifications are not flexible enough to determine their specificity.When the value is Ψ[φ e , D e (x e , y e , h e ), L(a, b), n e ] can get the minimum value.
Based on the above reasons, the proposed finite element assisted anode algorithm based on simulated annealing can effectively solve the above problems.

Auxiliary Anode Design of Simulated Annealing Optimization Finite Element Algorithm
Simulated Annealing (SA) is an iterative adaptive heuristic probabilistic search algorithm that can be used to solve different nonlinear problems and optimize non-differentiable or even discontinuous functions [20].Simulated annealing algorithms can have a higher probability.The global optimal solution is obtained, which has strong robustness, global convergence, implicit parallelism and wide adaptability, and can handle different types of optimization design variables without any auxiliary information; on the objective function and there are no requirements for the constraint function.Utilizing the Metropolis algorithm and properly controlling the temperature drop process has great advantages for optimizing problem handling.Simulated annealing is a general optimization algorithm the process of which consists of the following three parts: (1) Heating process.Its purpose is to enhance the thermal motion of the particles from the equilibrium position.When the temperature is high enough, the solid will melt into a liquid, eliminating the non-uniform state that the system originally existed.(2) Isothermal process.For a closed system that exchanges heat with the surrounding environment and the temperature does not change, the spontaneous change of the system state always proceeds in the direction of reduced free energy and when the free energy reaches the minimum, the system reaches equilibrium.(3) Cooling process.The thermal motion of the particles is weakened and the energy of the system is lowered to obtain a crystal structure.
In the algorithm, the heating process corresponds to the initial temperature of the algorithm.The isothermal process corresponds to the Metropolis sampling process of the algorithm.The cooling process corresponds to a drop in control parameters.The change in energy here is the objective function.
The optimal solution we want to get is the lowest energy state.The Metropolis criterion is the key to the convergence of the SA algorithm to the global optimal solution.The Metropolis criterion accepts the worsening solution with a certain probability, which allows the algorithm to jump away from the local optimal trap.
The core idea of the algorithm is to set the calculated values of the k and k+1 times of the objective function in the minimization optimization problem to f k and f k+1 respectively.If f k+1 < f k , the new point x k+1 is accepted, and the algorithm starts the next iteration from x k+1 .Until the given convergence criterion is satisfied; if f k+1 ≥ f k , random processing is performed, and the acceptance of the new point is determined by exp − > r (where r is a uniformly distributed random number on (0,1), and T is a control parameter).If the condition is true, x k+1 is also accepted; otherwise, it is abandoned.The flow chart of the optimization algorithm of the auxiliary anode system based on simulated annealing is shown in Figure 2. It can be seen from Figure 2 that the implementation of the algorithm needs to solve the technical problems such as the discretization processing of continuous variables, generation rules of new points, update mechanism of control parameters, termination rules of algorithms and the selection of algorithm parameters.
(1) Rules for the generation of new points: Let X be the solution at a certain moment, r is a random number between [0, 1], and the new solution is: By adopting the above search strategy, the randomness of the algorithm is satisfied and the ergodicity of the space is achieved.(2) Update mechanism of control parameters: The update mechanism of the control parameters, that is, the falling rule of the control parameters, is used to modify the control parameter values in the outer loop.Currently, the most commonly used control parameter update function is exponential de-warming, i.e., In the middle, 0 < λ < 1.

Initialization
Randomly generate calculate  The steps of the optimization algorithm for the auxiliary anode system based on simulated annealing are as follows: (1) Solve the model (4) for the established finite element method and select S 0 = Ψ[φ e , D e (x e , y e , h e ), L(a, b), n e ] as the initial state.The parameters of the established grounding grid auxiliary anode system are: ϕ e = 20 V, x e = 0, y e = 0, h e = 0, a = 10 cm, b = 10 cm, n e = 1, let S(0) = S 0 , and set the initial temperature T = 100.Let i = 0.The termination condition is (2) Let T = T i , call the Metropolis sampling algorithm with T and S i , return the state S as the current solution of the algorithm, and S i = S (i is the current time).(3) Cool down in a certain way, i.e., T i+1 = 0.9T i , where T i+1 < T i , i = i + 1. (4) Check the termination condition, if yes, go to step (5), otherwise go to step (2).(5) The current solution S i is the optimal solution of the finite element model, and the output result is stopped.
The Metropolis sampling algorithm is described as follows: The SAOA algorithm is used to optimize the calculation and the optimal solution for obtaining the optimal protection effect of the grounding grid cathodic protection system is: anode potential  (200, 200, 64.2).At this time, the distribution of the surface potential of the grounding grid is as shown in Figure 4.The maximum potential of the grounding grid surface is −0.85V and the minimum potential is −1.25V, which meets the engineering requirements.Figure 4 shows the distribution of the surface potential of the grounding grid in a three-dimensional space, which is represented by a different color, from red to blue, indicating that the potential gradually becomes smaller.The SAOA algorithm is used to optimize the calculation and the optimal solution for obtaining the optimal protection effect of the grounding grid cathodic protection system is: anode potential φ e = 93.6V; number of anodes n e = 3; positions of three anodes are A (0, 156.8, 83.7), B (132.6, 0, 78.6), C (200, 200, 64.2).At this time, the distribution of the surface potential of the grounding grid is as shown in Figure 4.The maximum potential of the grounding grid surface is −0.85 V and the minimum potential is −1.25 V, which meets the engineering requirements.Figure 4 shows the distribution of the surface potential of the grounding grid in a three-dimensional space, which is represented by a different color, from red to blue, indicating that the potential gradually becomes smaller.According to the SAOA algorithm, when the anode potential φ e = 90 V, the anode is placed 5 to 50 m below the grounding grid and the grounding grid potential distribution caused by different positions is shown in Figure 5.It can be seen from Figure 5 that as the depth of the anode is increased, the average potential and variance of the surface of the grounding grid become smaller.
The finite element simulated annealing algorithm (SAOA), variable scale method (DFP) and genetic algorithm (GA) are used to solve the above grounding grid, respectively.The optimization calculation results of various algorithms are shown in Table 1.  1 that in the optimization method of the grounding grid cathodic protection system, the design accuracy based on the simulated annealing algorithm is 1.12% higher It can be seen from Figure 5 that as the depth of the anode is increased, the average potential and variance of the surface of the grounding grid become smaller.
The finite element simulated annealing algorithm (SAOA), variable scale method (DFP) and genetic algorithm (GA) are used to solve the above grounding grid, respectively.The optimization calculation results of various algorithms are shown in Table 1.It can be seen from Table 1 that in the optimization method of the grounding grid cathodic protection system, the design accuracy based on the simulated annealing algorithm is 1.12% higher than that based on the genetic algorithm and the design accuracy is 1.64% higher than that based on the variable scale method.

Conclusions
Mathematical modeling is performed according to the physical model of the cathodic protection of the grounding grid.For the model, based on the finite element calculation, a grounding network cathodic protection system optimization algorithm (SAOA) based on a simulated annealing algorithm is proposed.The algorithm subtly transforms the multi-objective optimization problem into a single-objective optimization problem, which reduces the complexity of the problem.In the optimization process, the influence of different positions of the anode on the surface potential of the grounding grid was found.Furthermore, the distribution law of the anode position and the surface potential of the grounding grid is found.Experiments and simulations show that the algorithm is superior to the traditional GA algorithm and DFP method.The SAOA algorithm can obtain the global optimal solution with a large probability and the result is a set of optimization solutions rather than a single solution.This provides the user with an alternative opportunity.The algorithm has strong robustness, global convergence, implicit parallelism and wide adaptability.It can also handle different types of optimized design variables; there is no requirement for the objective function and the constraint

=
, and set the initial temperature T=100.Let

Figure 2 .
Figure 2. Flow chart of optimization algorithm for auxiliary anode system based on simulated annealing.

Figure 2 .
Figure 2. Flow chart of optimization algorithm for auxiliary anode system based on simulated annealing.

Figure 3 .
Figure 3. Finite element splitting diagram of the grounding grid surface.

Figure 3 .
Figure 3. Finite element splitting diagram of the grounding grid surface.

Figure 4 .
Figure 4. Surface potential distribution map of grounding grid based on simulated annealing optimization.

Figure 4 .
Figure 4. Surface potential distribution map of grounding grid based on simulated annealing optimization.
optimization.According to the SAOA algorithm, when the anode potential =90 e V φ , the anode is placed 5 to 50 m below the grounding grid and the grounding grid potential distribution caused by different positions is shown in Figure5.

Figure 5 .
Figure 5. Ground potential distribution caused by different positions when the anode potential is 90V.

Figure 5 .
Figure 5. Ground potential distribution caused by different positions when the anode potential is 90 V.

Table 1 .
Comparison of the results of the three algorithms (%).

Table 1 .
Comparison of the results of the three algorithms (%).