OPTIMIZATION OF AN INFORMATION SYSTEM MODULE FOR SOLVING A DIRECT GRAVIMETRY PROBLEM USING A GENETIC ALGORITHM

Optimal approaches to solving many problems are required in many areas. One of these areas is the determination of the occurrence of gravity anomalies in oil and gas fields. In this paper is proposed a new approach for determining the source of gravity anomalies in an oil and gas fields by estimating the gravity parameters associated with simple-shaped bodies such as a homogeneous sphere, a horizontal prism, and a vertical step. The approach was implemented in the computational module of the GeoM information system for optimizing the solution of a series of direct gravimetry problems using a genetic algorithm (GA). Approach is based on solving the direct gravimetry problem to minimize the discrepancy of gravity variations by the genetic algorithm. The method allows to select values simultaneously for several parameters of the studied environment. The task is realized through successive approxi-mations based on a given initial approximation of the medium. The paper indicates the initial calculation parameters and criteria for finding optimal solutions for models of the geological environment. The calculations were carried out for such models of the environment as a homogeneous sphere, a horizontal prism and a vertical ledge. For calculations, the results of gravimetric monitoring at one of the Kazakh oil and gas fields were used. The paper demonstrates the operation of the algorithm and presents the results of modeling for three available field profiles. The obtained results of the system showed an acceptable accuracy of the algorithm up to 10 -11 . The genetic algorithm made it possible to significantly increase the reliability of the model and reduce the working time for analyzing the measured gravitational field


Introduction
The solution of the gravity direct problem is the basis in the theory of interpretation of geophysical fields. Due to the peculiarities of solving the gravity direct problem, it seems possible to analyze the occurrence of gravitational anomalies, where the influence of geological bodies with their known physical parameters is taken into account. These parameters can characterize such properties of the investigated medium as density, shape, depth of the source of the anomaly, etc. Thus, solving the gravity direct problem means finding the values of the anomalous field from the given spatial distributions of the physical parameters of the geological environment.
parameters to obtain the minimum discrepancy between the measured and calculated values of the gravitational field [2].
To date, traditional methods for solving the gravity direct problem [3] do not meet the requirements under conditions of a limited amount of initial data, where the speed of decision-making is important. The use of factor analysis to solve a problem is reflected in time resources, and the use of heuristic models implies a constant revision of the problem, taking into account the emergence of new information. Moreover, the limitations in the computer memory are reduced to the use of the minimum number of elementary figures, and the limitations in the computing power of computers significantly slow down the solution of the problem, taking into account a significant number of possible solutions. In this regard, it becomes relevant to use global optimization methods that are able to solve existing problems and meet the above requirements.
Among the methods of global optimization, it is worth highlighting the genetic algorithm (GA), which is effectively capable of solving many problems that cannot be solved by traditional methods. GA is called an optimization method that has arisen as a result of observations of the functioning of biological systems, namely natural selection. The idea of GA was expressed in work [4]. The term "genetic algorithms" was introduced in book [5]. His book describes GA theory and possible areas of their application. Thus, the genetic algorithm is one of the areas of research in the field of artificial intelligence, which is engaged in the creation of simplified models of the evolution of living organisms for solving optimization problems.
The genetic algorithm belongs to an important area in artificial intelligence is machine learning. Genetic algorithm programming allows to effectively solve optimization problems that are "poorly" solved by standard methods (for example, gradient methods). First of all, this is due to the versatility of the algorithm and its ability to optimize the solution of the problem in terms of several parameters. Unlike standard search methods, the GA searches among a set of points using probabilistic rather than deterministic rules. In this regard, the relevance of obtaining operational and reliable information about the geodynamic state of developed oil and gas fields is indisputable.

Literature review and problem statement
Within the framework of stochastic optimization to estimate the distribution of gravity anomalies, the authors of the article previously considered the application of the simulated annealing method [6], which is also implemented in the GeoM IS. The method was also implemented using the example of simple mathematical models of the geological environment: horizontal prism, homogeneous sphere, vertical step. Unambiguously, the method is guaranteed to find the optimal discrepancy between the measured and calculated values of the gravitational field, but it requires significant computational costs. When reducing the resources used to solve the problem, finding the minimum residual is not guaranteed. In this regard, it became necessary to subject an additional solution to the gravity direct problem for simple mathematical models using another method of global optimization.
The GA was chosen as one of the most effective methods of global optimization [7]. The range of the GA applica-tions is wide enough. GA is used in software development, in artificial intelligence systems, network technologies, to calculate the train formation plan, construction, to optimize turning and in many other branches of knowstep. So, let's consider using of the genetic algorithm in various problems and the solution of problems related to the interpretation of the anomalies of the gravitational field of gravity.
In the work [8] in order to reduce routine calculations in the design of machine learning models, a genetic algorithm is used. The use of a genetic algorithm as a way to optimize the architecture of two machine learning models has proven itself on the positive side. The result of the article is the achievement of high accuracy of calculations; moreover, the method can be easily extended to problems of a more complex level. Despite the fact that the method can be extended to problems of a more complex level, there are also difficulties in the operation of the algorithm, thereby requiring additional computing resources.
In the work [9] the object of research is wireless sensor networks, exactly the work considers the possibility of improving the performance of these networks using mobile receivers. Modeling of mobile receivers consisted in using a genetic algorithm, which made it possible to collect the necessary data from statistical nodes. Remarkably, in addition to the initially specified parameters for optimization, it was found that during calculations, additional parameters for parallel optimization can be added to the GA. In this work, the experiments were carried out with a limited amount of data, which may not fully confirm the results of the study.
Another example of the use of GA in network technologies is the work [10]. In this work, the task of minimizing network costs in a wireless mesh network (WMN) was performed. In the article, the authors also solve the problem with the help of another optimization method -the simulated annealing method (SA). The main result of the work is to find the necessary WMN path that minimizes financial costs. The disadvantage of the work is the frequent hit in local minima due to the inhomogeneity of the objective function.
In the article [11] a method for calculating the plan for the formation of one-group freight trains (OGP) was developed, which is based on the use of genetic algorithms. The authors have developed an original method for encoding the solution to the problem of calculating the GLP in the form of chromosomes for use with the GA fitness function. The method uses the concept of partitioning sets into non-empty subsets to represent combinations of car flows passing through sections. The method has demonstrated practical value. However, as in the previous study, the implementation of the genetic algorithm does not always find the global minimum.
In the article [12] the authors propose to reduce the weight of the dam by using genetic programming to find the optimal concrete structure. The genetic programming adaptation procedure has proved to be computationally efficient, since the need for time-consuming structural analysis at each stage of the computation is eliminated. The results showed optimal values of design variables that satisfy all design constraints. However, the work is not provided for possible adaptation to new conditions of the initial parameters. This drawback makes the implementation of the algorithm somewhat limited.
A hybrid implementation of the genetic algorithm and the annealing simulation method was implemented in the work [13]. The work was optimized cutting modes of turning and milling operations. Optimization of cutting conditions is an important step in automated process planning. The proposed optimization approach is used to find the minimum unit cost of a turning operation. The optimization technique compared to other optimization methods has proven its effectiveness. Despite significant limitations in the study, the authors managed to prove the stable operation of the algorithm. Comparison of the hybrid method alone with the genetic algorithm showed the best results. This suggests that using only one of the methods may not show the best results.
Separately, it is worth highlighting the work [14], which is devoted to the interpretation of gravitational anomalies of gravity. The work defines various parameters suitable for a homogeneous sphere, vertical and horizontal cylinders. Optimization occurs by minimizing the function by one of the methods of global optimization -the annealing simulation method. Simultaneously optimizing three environmental parameters, the method showed fast and guaranteed results. This method is especially relevant for solving routine problems related to the analysis of gravitational anomalies. This work shows the importance of assessing the parameters of gravity anomalies in oil and gas fields. There are good examples of the use of simulated annealing.
As can be seen from the analysis of references, using of a genetic algorithm shows stable, reliable and fast results in completely different areas of application. Its further adaptation, taking into account the addition of new data or the complication of the task, is not difficult. For the problems of interpreting gravity anomalies in geophysical fields, the annealing simulation method is used. The simulated annealing method is also one of the examples of using the global optimization method. Interpretation problems are directly related to the solution of the direct gravimetry problem. In the previous paper [6] solved the optimizing problem of the direct gravimetry problem using the simulated annealing method.
Based on the foregoing, it can be argued that it is appropriate to conduct a study on the assessment of the distribution of gravity anomalies in oil and gas fields using an effective global optimization method -a genetic algorithm. The genetic algorithm shows the ability to operate with heterogeneous data for any task, and experiments carried out using the genetic algorithm will also have practical significance. Moreover, this will later allow some comparison between the two methods of global optimization. It is also possible to further implement the hybrid model to optimize the solution of the direct gravimetry problem using two methods of global optimization.

The aim and objectives of the study
The aim of this study is to explore and adapt the genetic algorithm for its application in solving the direct gravimetry problem for a number of simple mathematical models of the geological environment, concluded in a certain depth range in an oil and gas field. The implementation of the presented aim can later be used to prevent the occurrence of anomalous geodynamic events. In particular, significant economic damage can be avoided in the development of oil and gas fields.
To achieve this aim, the following research objectives should be implemented: -to solve a direct gravimetry problem for three models of the geological environment (homogeneous sphere, hori-zontal prism, vertical step) where suitable parameters are selected for given models by minimizing the residual of gravity variations by a genetic algorithm; -to develop a software module for IS GeoM to solve a direct gravimetry problem using the genetic algorithm.

Materials and methods
The logic of the serial computation algorithm for the gravity direct problem is simple: a set of elementary approximating bodies with a simple given geometry inside a homogeneous layered medium is selected. It is assumed that these bodies are contained in a confined layer that contains the sources of the studied gravity anomalies. All layers above and below are assumed to be homogeneous, with a monotonic density distribution, which has a known value constant within each layer. Mathematically, such a distribution is conveniently described by well-known linear functions in Hilbert space. The researcher changes the parameters of the model for the reference layer previously selected from the data of adjacent methods. The direct problem is solved by selecting the optimal parameters to obtain the minimum discrepancy between the measured and calculated values of the gravitational field [2].
In this way, it is necessary to solve the direct gravimetry problem for a set of homogeneous spherical bodies, horizontal prisms and vertical steps, the lower edge of which is fixed at a predetermined reference depth. The direct problem requires finding the elements of the gravity field according to a given distribution of parameters (shape, size, depth h, effective density σ) of its sources.
For this model, the following initial parameters of the algorithm are set: vertical drop x, depth of the lower horizontal plane h 1 , measured value of the gravity field ∆g. The free parameter is the depth of the upper horizontal plane h 2 , and the sought one is the density σ of the step. However, as in other models, free and fixed parameters can be swapped if necessary.
The choice of a probable density model from the set of admissible ones is conditioned by three criteria: maximum simplicity of the model; maximum coincidence of the measured and calculated fields; the values of excess density Δσ do not contradict geological data. Geological interpretation of the obtained models is not included in the objectives of this study.
Let's also note that the elements of the shoulder bedding can be determined from the curve of the second derivative of the gravity force for the shoulder [15]. The derivatives themselves are easily calculated as special cases from formula (2).
A computational algorithm using the method of simple iterations generates a certain compact set of feasible solutions on a preselected class of models of the environment of structural or mixed types. From these solutions, with the help of additional a priori information, the desired optimal solution is extracted. Then it is subjected to adaptive verification with various variations of the original mathematical model of the environment within the framework of the fitting method. The most reliable is the model for which the residual functional (the norm of the difference between the model and the observed gravity field) is minimal. For these purposes, numerical optimization methods are used. Otherwise, the task requires large computational (i. e. time and, as a consequence, financial) costs.

It is known that
M xyz where the elementary point mass is located.
To solve the gravity direct problem for a homogeneous sphere, the well-known formula for determining the gravitational potential of a sphere was used [15]: is the effective mass of a homogeneous spherical body, G is the gravitational constant, h is the depth of the body, x is the center of the spherical body, R is the radius, σ is the density. As can be seen from the formula for solving the gravity direct problem for the sphere of variables, there are more variables than for a point source. These are position coordinates (x, h), radius (R) and sphere density (σ). When solving the GA problem, two parameters of the object (center of the sphere x, radius R) are assumed to be known and fixed, the free parameter is the average depth h of occurrence of anomalous bodies. The desired parameter of the environment to be optimized as a result of iterative improvement is the density σ of the sphere. If necessary (weak convergence, poor initial approximation, large residual), the parameters x and R are released and the iteration cycle is repeated.
A horizontal prism as an elementary approximating body within a layer is a special case of a rectangular parallelepiped. It is based on a regular rectangle, its numerical parameters (length, width, height) are set in the form of the difference between the coordinates of the corresponding points in the Cartesian coordinate system. To calculate the gravitational effect of a horizontal prism bounded by the planes x 1 , x 2 , z 1 , z 2 , use the formula: where G is the gravitational constant, σ is the density of the body.
For the calculation in a horizontal prism, the initial parameters are set: the depths of the upper z 1 and lower z 2 edges of the anomalous body and the value of the gravity field ∆g, the free parameters are the values of the beginning x 1 and end x 2 of the profile, the sought parameter is the optimal value of the density σ.
A vertical step in the theory of interpretation of gravitational anomalies is defined as a body of semi-infinite strike, bounded by two horizontal and rectangular vertical planes. Those, it is a horizontal half-layer, bounded by a vertical edge, infinitely extending along the y-axis to one side from the origin. The vertical scarp model approximates geological objects in the form of faults, parts of vertical faults, sharp flexures, side parts of long intrusive massifs, etc. The difference in the density of the rocks of the bench and the enclosing rocks is a constant nonzero value Δσ. Let the depth of the upper horizontal plane, bounding the half-layer, be equal to h 1 , and the lower -h 2 , and the lateral vertical face is aligned with the Z axis. Then the gravitational field of the step Δg step at points x (along the x axis at z=0 and y=0) is equal to the integral of expressions (1) within the limits of integration specified by the conditions of the problem (a special case of the effect for a rectangular parallelepiped): where G is the gravitational constant, σ is the density, x is the vertical fault coordinate, h 1 is the depth of the lower horizontal plane, h 2 is the depth of the upper horizontal plane. The curve has a number of useful analytical properties. So, at х→±∞, the values of Δg step reach horizontal asymptotes with a maximum amplitude Δg max =2πGΔσΔh. Above the vertical fault (at x=0) let's obtain Δg step =1/2⋅Δgmax=πGΔσΔh, on the map Δg step will be seen as parallel isolines with the maximum concentration of isolines above the vertical edge. From (4), for the abscissas of points with x1/4 and x3/4 (1/4 and 3/4 of Δg max ), let's obtain the average depth of the vertical step h av =(h 1 +h 2 )/2=x1/4=x3/4. From the known excess density Δσ 1 , it is easy to determine the thickness of the vertical step ∆h=Δg max /2πGΔσ and the depth of the upper h 2 =h av -Δh/2 and lower h 1 =h av +Δh/2 edges, and from ∆h it is possible to calculate the value of ∆σ. So, let's postulate the conditions of the problem: let the origin of coordinates be on the day surface at the point of intersection of the vertical edge of the step with the x-axis directed across the strike of the step and simultaneously along the profile of gravity measurements. Those observations are made along the x-axis, (y=0, z=0) and the step itself extends infinitely along the y-axis. Then the formulation of the problem is determined as follows: restore the gravity field according to (2) with a given accuracy ε (depending on the measurement accuracy δ) at a known depth of the lower edge and the thickness of the step, varying the excess density ∆σ of the step at the current point of observation. Fig. 1 shows the DFD-model of the business process "Solving the gravity direct problem by the genetic algorithm". The process consists of the following sub-processes: -selection of a mathematical model; -formation of the initial population; -selection; -crossing; -mutation; -creation of a new population; -checking the result for compliance with the conditions; -obtaining the minimum discrepancy between the calculated and theoretical values of the gravitational field of gravity.
To perform these processes, it is necessary: processed data of gravimetric measurements, geological and lithologi-cal characteristics. At the output, let's obtain the calculated value of the gravitational field of the gravity force, the minimum residual, the time for performing the calculation, the number of iterations performed, and the optimal values of the sought parameters.
In these studies, the authors of the method had to check the efficiency of the method on real field data. For this purpose, gravity observations were drawn from one of the companies of the Republic of Kazakhstan, which has been engaged in this type of research for a long time. The initial data are digital records of the gravity variation measurements from the gravimeter file within the gas-oil field, cleaned of measurement errors and recalculated in the Bouguer reduction (σ≈2.65 g/cm 3 ). The data was stored in the GeoM IS; a sample was extracted from the general catalog, which was necessary to calculate the gravitational effect for a specific area at each of the three studied profiles.
This article proposes a solution to the direct gravitmetry problem using the GA for the three simplest models of the geological environment -a homogeneous sphere, a horizontal prism and a vertical step. As part of these studies, a special GeoM IS was created for storage and processing of gravimetric monitoring data [6,16,17]. Free software was used to create the IS: PostgreSQL DBMS, PostGIS, GeoServer, Java. The IS allows to import source files of records from gravimeters, convert them, filter data, make necessary corrections, extract statistical information, make samples and summary matrices, average data and perform other linear transformations over them. The article [6] describes the functional modeling of the main business processes for carrying out gravimetric monitoring at this field, describes the implementation of the main subsystems of the IS.
The article [16] presents and describes the generalized structure of the GeoM IS, in which there are 3 main subsystems: 1) a subsystem for processing primary data and plotting graphs; 2) subsystem for solving the gravity direct problem; 3) subsystem of spatial data visualization.
At the moment, the first and third subsystems have been fully developed, the second subsystem for solving the gravity direct problem has been developed for such geological bodies as a homogeneous spherical body, a horizontal prism and a vertical step by the method of simulated annealing.
The subsystems of the GeoM IS have been tested on the data of gravimetric measurements carried out at one of the oil and gas fields in the Kyzylkoginsky region in the Atyrau region of the Republic of Kazakhstan. The field is characterized by a high degree of reservoir heterogeneity and lithological inconsistency. The work used data from an observation system with three profiles and 35 measurement points, which cover the entire territory of the field and adjacent areas.

1. Generation of the first generation
Genetic algorithms are search procedures based on natural selection and inheritance mechanisms. They use the evolutionary principle of survival of the fittest individuals. The main idea of this algorithm is the selection of individuals at each stage of the population. The creation of an initial population of possible solutions is the first step in the work of a GA. At this stage, the variables are generated randomly [18]. In this work, an array is created for each variable of the considered geometric bodies, which is filled in randomly. For a homogeneous spherical body, these will be arrays for variables such as x, h, R and σ; for a horizontal prism -z 1 , z 2 , x 1 , x 2 and σ; for a vertical stepσ, x, h 1 and h 2 .
In GA, such an array of random numbers is called chromosomes. Chromosomes are the basic elements on which actions are performed. Each obtained value of a set of chromosomes is called a gene (Fig. 2). Depending on the way of presentation, genes can be represented as binary values, or they may not be integer values. In the work, the authors use the representation of genes in the form of non-integers, which will be the results of values obtained from a set of floating point chromosomes.
The program module for the implementation of the GA is developed in the object-oriented programming language Java. In the Java programming language, the first generation padding is shown in Fig. 3. Thus, the creation of the initial population is the first and important step for making further calculations. At the next stages, operations of chromosome modification take place, namely selection, crossing and mutation.

2. Determine fitness function
To assess the obtained result relative to the initial value, the concept of fitness function (fitness function) is used [19,20]. Its role in the work of GA plays an important role, since it represents the degree of fitness of individual individuals in a given population. The greatest value of the fitness function will speak about the most fit individual in the population. This approach is indeed comparable to the evolutionary principle of survival of the "fittest" borrowed from biology.
For our problem with a point source, the fitness function will determine the discrepancy between the calculated (∆g) and measured (∆g m ) data and looks like this [12]: where ∆g c is the calculated field, ∆g m is the measured field. A fragment of the calculation of the fitness function in the GeoM IS is shown in Fig. 4. The parameters of the original field are set initially, and the parameters of the calculated field are calculated based on (2)-(4). Obtaining the minimum fitness function will tell us about getting the best solution.

3. Selection
After calculating the fitness function for each chromosome, the selection procedure begins, where the parents are selected who have the highest degree of fitness. If the first parent (the best solution) does not meet the stopping criterion (the minimum specified residual), then the cycle of the algorithm returns to the stage of chromosome modification and repeats until the individual with the lowest fitness value is acceptable. Fig. 5 shows an example of the representation of the selection operation in GA.
In view of the large amount of data obtained as a result of the work of the GA, it was decided to select 10 % of the best solutions among all possible ones for further operations on them.

Crossbreeding
When two parents are crossed, new offspring is formed by combining the genes of several individuals. The main idea is to combine the genes of two parents in order to create new offspring by alternating parts of the parental genes. As a result, new offspring with higher fitness values can be obtained [19,21]. Fig. 6 shows an example of the implementation of the "crossbreeding" operation.
As can be seen from Fig. 6 the "crossbreeding" operation is performed among the obtained best solutions of the first generation.

5. Mutation
This operation is necessary for the formation of new individuals with parameters that do not exist in the population. The mutation helps to maintain a variety of solutions and avoid premature falling into the local minimum.
In GA, the mutation works as follows: 1. One of the parameters of the individual is randomly selected and without any regularity changes to a new parameter [22].
2. A check is made whether the parameter has gone beyond the limiting range; if it does, then the individual is marked as not "viable" [16,22] (Fig. 7).
In this work, the frequency of application of this operation ("percentage of mutations") directly depends on the parameter specified by the user in the information system. The larger this parameter, the more often a gene is replaced in the chromosome. Operations will occur as many times as the number of generations specified by the user. Thus, a new unique offspring is created that meet the stated goal.

1. Solving the direct gravimetry problem for three models of the geological environment
When selecting the parameters of simple bodies using GA, it is necessary to take into account the fact that objects have parameters that are different in quantity or property (the sphere has 4 parameters: depth h, radius R, center of the body x and density σ; a step has 4 parameters: depth of the upper and lower edges, position the edges of the step, and density; the horizontal prism has 5 parameters: the depth of the upper and lower edges, the beginning and end of the profile and the density). The same problem can arise when using the same bodies with the same search criteria for dynamic parameters. Due to the high degree of heterogeneity of the reservoirs of the gas-oil field and the limited number of measurements, it is rather difficult to show the real distribution of densities in space with one simple body. In this regard, in this work, when interpreting, many    simple bodies are used, located at different depths, having different densities and other parameters that are unique for each simple body (for example, a sphere has a radius, while a horizontal prism and vertical steps of such parameters does not). For each body, a direct problem is solved, the resulting fields are added and compared with the initial field obtained during field work. Taking into account the above, let's present the simulation results with known initial parameters of the environment.
Taking into account the geological and lithological characteristics of the field with its high degree of heterogeneity, it was decided to start the calculations from the homogeneous sphere depth of 900 m with a step along the profile of 100 m. The problem was solved with a constant step in the interval for the density σ and the depth of the spherical body equal to 0.001. This step is determined for the sake of ensuring the numerical stability of the algorithm: the smaller the iteration step, the more accurate the calculation.
As a result of obtaining feasible solutions, only in some areas the depth parameter was changed. Fig. 8, a-c shows the solutions from the spherical body model, which showed results with good gravity residual along the entire section.
For the horizontal prism model graphs of gravity anomalies were obtained from the model in the form of a series of horizontal prisms along three profiles (Fig. 9, a-c).
Calculations for the vertical step began with a reference depth of 600 m along the profile. At the beginning of profile 11, there was a significant discrepancy in the solution, and this section was subjected to additional calculations. The final solution (gravitational effects from a set of vertical steps) for all three profiles was obtained within the permissible error (Fig. 10, a-c).
These models of the geological environment were chosen due to the possibility of covering a larger number of real cases of the structure of the geological environment. In this case, a homogeneous sphere, a horizontal prism, and a vertical ledge are maximally different in structure and, at the same time, are the most studied using other methods.

2. Development of a software module for IS GeoM for solving a direct problem by a genetic algorithm
The main purpose of this subsection is to integrate the module for solving the direct gravimetry problem with the genetic algorithm into the developed GeoM information system. IS GeoM is intended for collection, processing, monitoring, analysis and visualization of gravity surveys. IS GeoM allows to perform many operations to identify patterns, carry out analysis, accounting, forecast, and graphically display the results of processing. Additionally, there are modules for solving the direct gravimetry problem using global optimization methods (simulated annealing and genetic algorithm). During creating an information database of gravimetric data, preference was given to the free PostgreSQL software. The computational module for solving the direct gravimetry problem with a genetic algorithm was implemented in the Java programming language. Implementation fragments are shown in Fig. 3, 4.
To implement the developed module, an IDEF3 diagram was designed, which allows to display in detail the processes of the genetic algorithm (Fig. 11) within the GeoM information system.
For a homogeneous sphere, the conditions for performing calculations are following: the number of generations is 100, the population size=300, the percentage of mutations=30. It is necessary to select the following dynamic parameters: the depth of the body (h) lying between 500 and 1100 m, the radius (r) is changed in range from 50 to 400 m, the density (σ) of the body should lie in the range from 1 to 2.8 g/cm 3 . The average computation time is 12 s, the number of possible combinations is on average 7,226,560,294,838,206,464 ( Table 1).
As can be seen from Table 1, the relative error of the solution lies within acceptable limits, no more than 0.25 %. The average duration of calculations is 12 s, the number of possible combinations is on average 7,226,560,294,838,206,464.
For a horizontal prism, the number of possible combinations is 85,390,165,616,000,000 under the following conditions: the number of generations is 100, the size of pop-ulations=100, the percentage of mutations=3. It is necessary to select the following dynamic parameters: the depth of the upper (ζ 1 ) and under (ζ 2 ) edges of the body, lying between 500 and 1100 m, the density of the body (σ) should lie in the range from 1 to 2.8 g/cm 3 ( Table 2). According to Table 2, the relative error of the solution is within acceptable limits, no more than 8.61 %. The average duration of calculations is 5 s. Table 3 summarizes the results of measurements of the program for a vertical step.
According to Table 3, the relative measurement error is within acceptable limits, no more than 1.26 %. The calculations were carried out under the following conditions: the number of generations=100, population size=100, mutation percentage=10. It is necessary to select the following dynamic parameters: the depth of the upper horizontal (h 1 ) and lower horizontal (h 2 ) planes of the vertical ledge, lying between 500 and 1100 m, the body density (σ) should lie in the range from 1 to 2.8 g/cm 3 . The average calculation duration is 5 s. The number of possible combinations is 1,440,000,400,000.
When comparing the minimization of residuals of gravity variations, a high accuracy was determined in the results of the study. Fig. 12, a-c shows comparative graphs of the difference anomaly of the gravitational field between the measured and calculated data on three profiles for a homogeneous sphere.
Similar comparative graphs of minimizing the residual of gravity variations for a horizontal prism are shown in Fig. 13, а-с.   The results of the study on the vertical step are shown in Fig. 14, а-с.
The debugged program shows stable results, determining the distributions of optimal parameters for three approximating bodies, close to the given gravity field with an accuracy of 10 -11 . Thus, to solve the problem, the genetic algorithm allows to select the maximum number of possible feasible solutions for a finite number of iterations and calculation time.
As mentioned earlier, the direct gravimetry problem has already been solved by the authors by another optimization method by the simulated annealing method (SA) [6]. The problem was solved under similar conditions. Table 4 summarizes the comparative characteristics of the operation of algorithms for solving the direct gravimetry problem by the SA method and the GA.
When solving the direct gravimetry problem by simulating annealing, stable solutions were also obtained. The comparison was carried out separately for each model of the geological environment separately for such parameters as the relative measurement error, the average execution time and the number of possible combinations. The GeoM IS was originally developed as a program for solving applied problems of processing data from gravimetric monitoring of subsoil at an oil and gas field. In the process of implementing mathematical modeling of the structures of individual sections of an oil and gas field, a need arose to optimize the direct problem of gravimetry, which is a laborious task. In this regard, specialized computing modules have been developed to automate this process. In the GeoM IS, the solution of the direct gravimetry problem is implemented by two methods of global optimization: the simulated annealing method and the genetic algorithm. The implementation of the problem in the first way was described in [5]. The program code of the GeoM IS by the simulated annealing method is protected by copyright No. 13336 [23]. As a result of the need to reduce the computational costs of computers, it became necessary to subject the solution of the direct gravimetry problem to another method of global optimization to an additional analysis.
A new simple and accurate approach is proposed to determine the source of gravity anomalies in oil and gas fields by estimating the gravity parameters associated with simple-shaped bodies such as a homogeneous sphere, a horizontal prism, and a vertical step. The proposed approach is based on solving a direct gravimetry problem to minimize the discrepancy of gravity variations by a genetic algorithm. The proposed approach has a number of advantages: 1. Algorithm can simultaneously optimize several parameters of the studied environment. In all proposed models, three parameters of the geological environment were simultaneously optimized. In the case of a homogeneous sphere the depth (h) of the body, density (σ) and radius (r) were optimized simultaneously. For a horizontal prism the depths of the upper (ζ 1 ) and under (ζ 2 ) edges of the body and the density (σ) of the body were optimized. For a vertical step both the lower horizontal (h 1 ) and upper horizontal (h 2 ) planes and the body density (σ) were optimized simultaneously.
2. The genetic algorithm, as one of the areas of research in the field of artificial intelligence, provided a solution to the direct gravimetry problem for a number of gravitating objects given in the form of elementary approximating bodies, such as a sphere, a horizontal prism and a vertical step with an accuracy of 10 -11 . High accuracy in the experiment was achieved by avoiding local extrema. Thus, the GA showed the best results for solving a multimodal function.
3. The use of the proposed approach is recommended for routine analysis of gravity anomalies in an attempt to determine the solution parameters associated with the structures under study. To this date, the selection of optimal parameters to obtain the minimum discrepancy between the measured and calculated values of the gravitational field is done manually. The use of the proposed approach has significantly reduced the time and financial costs in companies involved in geodynamic monitoring in oil and gas fields.
As part of the sequential selection of parameters, the final models of the studied medium were obtained, which have an acceptable likelihood, the accuracy of the solution for the gravity field reached 10 -11 . According to Fig. 8-10, it can be concluded that a high accuracy of results has been achieved with theoretically specified calculations for given models of the geological environment. Thus, the genetic algorithm allows to quickly select options for suitable solutions for the express analysis of the internal structure of the geological environment within the boundaries of the field under study.  7 9 11 13 15 16 17 18 19 20  When comparing solutions for different bodies with the same amount of initial data, it was found that the calculation time significantly depends on the size of the population, while a change in the percentage of mutations does not entail significant changes. The higher the population size, the longer the calculation took and the greater the number of possible combinations will be obtained. Thus, for a homogeneous sphere, the average computation time was 12 s with a population size of 300 and a mutation rate of 30 %, while for a vertical step and a horizontal prism, the average computation time was 5 s with a population size of 100. Given the number of iterations and the resulting number of possible combinations, the method is relatively fast and finds the optimal parameters for given models. Thus, the acceptable efficiency of using the genetic algorithm for modeling the deep structure of the earth's crust within oil and gas fields with a relatively simple reservoir structure has been proven.
According to the results of the Table 4, it can be concluded that the simulated annealing method gives a smaller number of possible combinations, spending more time on it. The results of the relative measurement error also indicate that the results obtained by the genetic algorithm are more accurate. Both algorithms are implemented in the Java programming language.
While there are significant advantages to using GA, some disadvantages are still present. For example, to solve a given problem, it is necessary to initially develop a representation of a potential solution. Thus, it is impossible to start the optimization process without having a preliminary understanding of the optimization parameters. It was also noted that there are no effective criteria for terminating the algorithm when the algorithm is running. Only when conducting experimental data is it possible to determine the possible parameters of the GA operation.
Experimental calculations were carried out on one of the oil and gas fields in the territory of the Republic of Kazakhstan. Due to the small amount of data, the modeling results are of limited applicability and need to be verified using other geophysical methods or solving the same problems on the example of real data of a much larger dimension. The possibility of further improvement of the method is associated with obtaining additional data on other oil and gas fields. The proposed method is flexible in execution and allows to control changes, so making certain adjustments to the algorithm will be quite accessible.

Conclusion
1. The direct gravimetry problem was solved for three models of the geological environment, they are the homogeneous sphere, the horizontal prism and the vertical step. The solution of the problem is carried out by selecting the optimal parameters to obtain the minimum discrepancy between the measured and calculated values of the gravitational field. The results of the relative error of the minimum discrepancy between the measured and calculated values of the gravitational field for the sphere were 0.25 %, for the horizontal prism -8.61 %, for the vertical step -1.26 %. The accuracy of calculations as a result of the minimum discrepancy reached 10 -11 .
2. The performed calculations were developed and implemented as an additional software module for the GeoM IS to solve the direct problem using a genetic algorithm. The calculation time is from 5-12 s depending on the setting of the parameters of the geological body. IS GeoM currently fully automates the processing of gravimetric monitoring. The resulting gravity variations are minimized with the calculated values by two global optimization methods: simulated annealing and genetic algorithm.