Genetic Algorithm Applying to Calculate the Great Wall Soil Water Electrical Conductivity

In this paper, we report a simple but effective algorithm to estimate the undetermined coefficients in the formula of soil water electrical conductivity value by the soil apparent electrical conductivity method. By doing so, the coefficients can be accurately obtained to further calculate the soil water electrical conductivity. According to the process of calculating the soil solution electrical conductivity based on the apparent conductivity of soil, the error of the calculation equation is effectively calculated by the two order curve fitting method. Meanwhile the genetic algorithm is adopted to reduce the influence of the data error generated by the proposed algorithm, and improve the accuracy of the data as well. The experimental results demonstrate that the solution by the proposed algorithm can be effectively obtained and the error change is in one direction simultaneously. With these advantages, we can use soil water electrical conductivity to calculate the content of soil salt.


Introduction
There are many factors that affect the apparent conductivity of soil, such as soil salt content, water content, temperature, organic matter content and geological structure [1].But the main factors are soil salt content, water content and temperature.By the composition of the soil, the soil apparent conductivity is mainly composed of the soil surface electrical conductivity and the soil water electrical conductivity [2].The soil salinity is directly evaluated by the soil water electrical conductivity, and the relationship in EC a EC w θ is the theoretical basis for the estimation of the soil salinity.According to Ref [3], the analytical relationship between the soil apparent conductivity EC a and the soil water electrical conductivity EC w is as follows:

T
where EC S is the soil surface electrical conductivity (mS/m).θ is volumetric soil water content (m 3 /m 3 ).EC w is the soil water electrical conductivity (mS/m).T is transmission factor which can generally be expressed as: T a b T ( where a and b are undetermined coefficients.This paper mainly rsearches the estimation of the undetermined coefficients in the formula of soil solution conductivity, so that the estimated coefficients can be more accurate to calculate the soil water electrical conductivity.

Common method to estimate the soil water electrical conductivity
The mathematical definition of curve fitting is use continuous curve to approximately describe the function relation between the coordinates represented by a group of discrete points on the plane, and it is a method to approximately fit the discrete data by analytic expression.Curve fitting is usually called 'pulling curve' [4], a method that the existing data is introduced into a mathematical equation through mathematical method Combine the formulas (1) and (2), we can have:

Calculation formula of soil water electrical conductivity based on genetic algorithm 3.1 Genetic algorithm
Genetic algorithm is a global optimization algorithm for random search [5].Basis on the individual gene expression, it simulates the phenomenon of reproduction through genetic operator, crossover and mutation in genetic operator, and then optimal individual [6].Genetic algorithm can deal with multiple individuals in the population at the same time, that is, it can evaluate the multiple solutions in the search space, reduce the risk of falling into the local optimal solution, and be implemented easily [7].Genetic algorithm uses the probability of transition rules not the deterministic rule to guide its search direction, with the property of self-organization, self-adaption and self-learning.The basic flow chart of genetic algorithm [9] is shown in Figure 1.

The genetic algorithm steps
The purposes of introducing the genetic algorithm into apparent soil electrical conductivity method are (1) to optimize the coefficients of the equation, and (2) to more accurately calculate the soil water conductivity.The specific steps of the algorithm are as follows: Step 1: Determining the population size M Random generation of initial population including M individuals W=(S 1 ,S 2 ,…,S M ) determines a range of data, and three coefficients were used as three genes L, P and N, encoded with 8 bit binary number to form a chromosome.The length of each chromosome is:

S L P N
Gene composition of each chromosome is determined randomly, where the initial value of each individual in the population satisfies S i =L m +P n +N l (i=1,2,…,M m=n=l=  where ˆi y denotes training output value, i y denotes desired output.
Step 3: Using Roulette method to select operator.The selection of chromosomes in each generation population is based on the proportion of fitness.And the selection of the probability can be expressed as: Step 4: Using single point crossover method to cross the chromosome.Single individuals S 1 and S 2 are crossed according to crossover probability in the gene of k (k=1,2,3).
Before crossed

S L P N
The value of crossover mainly is 0.25-0.75Select the k Gene (k=1,2,3) of the i individual to operate with the P m probability variation.eg:

S L P N
Range of values P m is 0.01-0.2 Step 5: Decomposing the optimal solution of genetic algorithm into three undetermined coefficients of the equation.Put these into the equation 3 and calculate the soil water electrical conductivity.And the procedure of genetic algorithm is shown in Figure 2. Step one: Determine the population size Step three: Use Roulette method to select operator Step two: Determine the appropriate evaluation function of the individual.
Step four: Use genetic factors for genetic manipulation Step five: Get the optimal solution Several groups of different regions were selected to measure the field, then used the host computer to deal with data.Figure 3 is the common method to estimate the soil water electrical conductivity comparing with standard value.

Experimental analysis
From Figure 3, the accuracy of the two curve fitting is largely dependent on the initial sample size.The gap between the soil water conductivity calculated value and the standard value is obvious, and no change tend can observed.From Figure 4, compared with the standard value curve, the calculated value is suitable, and the change trend is more obvious.This indicates that by using the optimization of genetic algorithm the calculation value of the equation is more accurate.

Figure 5. The error between the standard values and the calculated values by two methods
Figure 5 shows the error between the standard values and the calculated values by two methods.From the picture we can clearly see, soil water electrical conductivity error by using common method to calculate is larger, and there is no law of error variation.But the error fluctuation of the value obtained by genetic algorithm optimization is relatively small, and error change tend is in one direction.

Conclusion
This paper discussed the equations for calculating the soil water electrical conductivity by using soil apparent electrical conductivity.In order to eliminate the defects of common method, the genetic algorithm method was adopted to calculate the equation.According to experimental results, the equation derived from the genetic algorithm method had a significant improvement in terms of accuracy of the calculation, and avoided the calculation falling into the local optimum.So we could get accurate salinity data from the soil solution electrical conductivity.

Figure 1 .
Figure 1.Basic flow chart of genetic algorithm.

Step 2 :
Determining the appropriate evaluation function of the individual.Split chromosomes into three obtained corresponding coefficients equation, inputs reference samples for calculation and gets a training output value ˆi y The fitness function of the population is

Figure 2 .
Figure 2. The genetic algorithm procedure

Figure 3 .
Figure 3.The polynomial curve fitting method estimated value comparing with standard value Figure 4 is based on genetic algorithm to calculate the soil water electrical conductivity comparing with standard value.

Figure 4 .
Figure 4. Genetic algorithm method estimated value comparing with standard value