Mathematical models and soil fertility management software

. The article presents the results of studies on parametric approximation in spaces R 2 (functions of one variable), R 3 (functions of two variables) and R n (n>3) (functions of three or more variables). Various classes of functions satisfying a priori conditions were studied: f(0, 0, 0)=0 , lim 1 (cid:2) (cid:3) →(cid:5)(cid:6) ((cid:7) (cid:8) , ... ,(cid:7) (cid:9) ) = (cid:10) (cid:11) , (cid:10) (cid:11) = const . Working algorithms and C/C++ software functioning in Microsoft Visual Studio 2019 system in Microsoft Windows 10 environment were developed. The main studies of the authors were aimed at developing effective computational algorithms for constructing approximating functions of two variables from various given classes of three-dimensional data samples (three-dimensional interconnected time series). The article provides a detailed description of the problem statement, introduces classes of approximating functions, provides algorithms for estimating the parameters of approximating functions and a description of the software. The estimation algorithm considered in the article is constructed according to the scheme of the coordinate descent method with optimization of the step length (Gauss-Seidel method).


Introduction
Soil is a source of material well-being of mankind, the greatest gift of nature. Protection and reproduction of soil fertility is the first basis of highly productive agriculture, obtaining high and sustainable crops. An important indicator of high soil fertility is the presence of a sufficient supply of nutrients necessary for plants, which are in a form accessible to crops, due to the mobilization of elements that make up potential fertility and the use of fertilizers.
Soil fertility is the ability of soil to satisfy the need of plants for nutrients, moisture and air, as well as provide conditions for their normal life [1][2][3][4][5].
Currently, science and practice have accumulated considerable experience in solving the problems of increasing crop yields, preserving and improving soil fertility. However, as a rule, this experience is not used comprehensively. It is tested and implemented in individual agricultural enterprises. In Russia, this is largely due to the heterogeneity of soil-climatic and territorial-organizational conditions [6][7].
The construction of dynamic, simulation and other models facilitates the verification of working hypotheses, helps to streamline the source data and to quantify various processes, gives a forecast of various long-term effects without experiments.
However, to build any model, actual results of scientific research are needed: many years of field experiments and soil survey materials using a large amount of information.
Information on the influence of soil agrochemical properties and doses of fertilizers on the productivity of agricultural crops, as a rule, is quite fully characterized by structural relationships in the soil-fertilizer-plant system. In this case, the analysis of changes in the optimum of some soil properties while varying others provides an opportunity of objective evaluation of the dependence of crop yields on various combinations of agrochemical soil properties and fertilizer doses. Therefore, the optimal indicators of the content, for example, of mobile phosphorus and potassium in the soil must be constantly updated taking into account the dynamics of their content in the soil [6][7][8][9].
A real idea of the effect of the complex of agrochemical properties of the soil and doses of fertilizers on the effective feature can be obtained on the basis of mathematical modeling of their relationships using a systematic approach to evaluating the most promising combinations of soil properties and doses of mineral fertilizers, which provide the possibility of obtaining the maximum increase in crop productivity at a fairly high payback of mineral fertilizers by productivity increase.
The results of investigations to a certain extent provide a solution to the problems associated with optimizing plant nutrition, improving soil fertility and the quality of agricultural products, studying the cycle of nutrients in agriculture and protecting the environment. These issues, as a rule, are solved within the framework of models of various forms that take into account the role of the main factors in the formation of crop productivity [6][7][8][9][10].
A more accurate method is the development of mathematical models using a Big Data array, which reflects changes in nutrient content over a certain period on different types of soil when cultivating various crops [11][12][13][14][15][16].

Materials and methods
Investigations were carried out on the basis of field experiments of Federal Research Center "Nemchinovka" to study the effect of fertilizer doses on the productivity of the main agricultural crops of the Central region of Russia on different types (subtypes) of soils using analytical, mathematical and statistical methods. To construct mathematical models, the coordinate descent method with optimization of the step length was used (Gauss-Seidel method). To create a cloud service, C/C++ programming language was used in conjunction with Wt framework to create a web interface, AJAX technology, as well as SQL data query language in conjunction with MariaDB DBMS. All work is performed in Visual Studio 2019 Community environment, to which Boost library version 1.72.0 is additionally connected.
‫ݕ‬ ij = ݂ ൫‫ݔ‬ ଵ ,x ଶ ,...,x nj ൯, ݅ = 1,m; ݆ = 1,n (1) where m is the number of crops for which approximating function f t (·)is constructed. Functions f i (·) and f j (·)i≠j belong to the same class, i.e. the number of function classes is actually fewer than the number of crops.
This article discusses the construction of equations (1) of the dependence of crop yields on two factors, i.e. for n=2. As a result, the observation model has the following form: where N is the number of experimental data, ߃ is random measurement errors with zero expectation ‫ܯ(‬ = ൣ߃ ൧ = 0 ∀ = 1,N) and uncorrelated ‫ܯ(‬ = ൣ߃ ߃ ௦ ൧ = 0 ∀ ≠ ܵ).
The initial experimental data are presented by set L (L>m) of two-dimensional arrays xy (k, j) of size N·13 containing the following experimental data: xy(j, 1) ‫ݕ‬ is crop productivity in the j-th experiment; xy(j, 2) х ଵ is humus content in soil in the j-th experiment; xy(j, 3) х ଶ is Ph content in the j-th experiment; xy(j, 4) х ଷ is phosphorous (P 2 O 5 ) content in the soil in the j-th experiment; xy(j, 5) х ସ is potassium (K 2 O) content in the soil in the j-th experiment; xy(j, 6) х ହ is nitrogen (N) content in the soil in the j-th experiment; xy(j, 7) х is boron content in the soil in the j-th experiment; xy(j, 8) х is copper content in the soil in the j-th experiment; xy(j, 9) х ଼ is manganese content in the soil in the j-th experiment; xy(j, 10) х ଽ is the amount of organic fertilizers introduced into the soil in the j-th experiment; xy(j, 11) х 10 is the amount of nitrogen (N) introduced into the soil in the j-th experiment; xy(j, 12) х 11 is the amount of phosphorous(P 2 O 5 ) introduced into the soil in the j-th experiment; xy(j, 13) х 12 is the amount of potassium (K 2 O) introduced into the soil in the j-th experiment.
Variable x 1 (the humus content in the soil) was the first factor ‫ݔ‬ ଵ , ݆ = 1, ܰin function f i in all constructions. The second factor x 2 in f i (·) had integral character in one series of studies and variable х 2j (Ph content) was factor x 2 in another series.
Integral variable ‫ݔ‬ ଶ was constructed as a linear function of three variables, namely: content of P 2 O 5 (K 2 O, N) in the soil, the amount of organic fertilizers introduced into the soil and the amount of mineral fertilizers introduced into the soil (P 2 O 5 , K 2 O, N). Specifically, the integral variable was as follows: for phosphorus: for potassium: for nitrogen: It was necessary in the task with integral variable ‫ݔ‬ ଶ : to form integral variable ‫ݔ‬ ଶ according to one of formulas (3) -(5); to carry out optimal estimation of parameters a, b, c of approximating function f according to found estimates ‫ݔ‬ ଶ and from equations (3) -(5) estimates of doses of fertilizers are constructed according to the following formulas: for phosphorus: for potassium: for nitrogen: In the second series of studies on experimental data y j , x 2j (humus), x 2j (Ph) it was necessary: to find optimal estimates ܽ, ܾ, ܿof parameters a, b, c of approximating function f (a,b,c,x 1j ,x 2j ) that satisfy condition (6); to find the estimated yield values ‫ݕ‬ = ݂൫ܽ, ܾ, ܿ, ‫ݔ‬ ଵ , ‫ݔ‬ ଶ ൯. Classes of approximating functions are as follows: E3S Web of Conferences 210, 04008 (2020)

ITSE-2020
https://doi.org/10.1051/e3sconf/202021004008 The classes of approximating functions were constructed taking into account the a priori restrictions imposed on the functions, namely: has accordingly slow growth, fast growth, and saturation.
Estimation of parameters of approximating functions in coordinate descent schemes is as follows. The algorithm for the optimal estimation of parameters a, b, c of approximating function ݂(ܽ, ܾ, ܿ, ‫ݔ‬ ଵ , ‫ݔ‬ ଶ ) is considered using the last function as an example (15).
It's necessary to find vector ‫:ܣ‬ and The idea of a coordinate descent method is to change consistently only one parameter at each step, but in such a way that ‫ܣ‪൫‬ܬ‬ () ൯ < ‫ܣ‪൫‬ܬ‬ (ିଵ) ൯.
Let ൫ܽ () , ܾ () , ܿ () ൯ are some initial parameter values. Then triples of numbers are constructed: so that Changing parameters at each step is carried out according to the same rule: One of the problems in gradient methods is the determination of the values of parametersߛ , ߛ , ߛ . The conditions that these parameters must satisfy (the only undefined parameters in (20)) are as follows: at the k-th step: The simplest way to choose coefficient γ is to reduce γ by a factor of 2 (3, 4,...) times, if condition (24) is not satisfied. However, γ can also be chosen in an optimal way, delivering the greatest decrease in the value of functional J(A), for example, at the k-th step: The algorithm of the coordinate descent method with parameter γ optimization at each step is described in detail. In contrast to entries (18), (19), the values of the indices of all parameters will be increased by 1 value, although in reality, as before, only one of them will change.
Let us prove the validity of formula (26). One has By virtue of (25) Using the necessary condition for the extremum of a function differentiate with respect to ߛ , one gets With that said, one has (26).
Solving this equation (non-linear with respect to ߛ ) by numerical methods, ߛ (opt) is found. The half division method was used in the current version of the algorithm to solve equation (29) -the search for quasi-optimal estimate ߛ (opt) .

It is assumed that
The last equation is solved with respect to ߛ by bisection method c) it is considered Step 4.

а) calculating
it is assumed Step 5.

) ߛ (opt) is found from the equation by bisection method
it is assumed it is assumed Step k. Step (k+1).

а) calculating
it is assumed  The integration process is stopped at a certain step k 0 , if one of the conditions is true k mav is the maximum allowed number of steps in an iteration process. Parameter k mav is set from the PC. PОCR program implements an algorithm for constructing an approximating function (15) with a, b, c parameters estimation using the Gauss-Seidel method. POCR program allows one to study yield in a scheme with integral factor ‫ݔ‬ ଶ , defined sequentially by equations (3)+(5) and to find estimates of the doses of mineral fertilizers (P 2 O 5 ,K 2 O, N) using formulas (7) R is a three-dimensional array with estimates of coefficients A, B, C; df is the estimate of the partial derivative corresponding to number k j ; rab is a working variable of type real; fa is the functional value ‫ܣ‪൫‬ܬ‬ () ൯. ZEIDEL subroutine is the main one in the program complex and implements the Gauss-Seidel algorithm.
Calling CALLZEIDEL (n, r, m, kolhag, k) Formal parameters are as follows: n is the number of rows in the source data array; r is a three-dimensional vector with estimates of coefficients a, b, c; m is an integer variable taking values I, 2, 3; kolhag is an integer constant determining value k mav (31); k is the number of the current step of the iteration process. Subroutine TABL 1 forms a table with the source data, TABL 2 forms the header of the table with the results of PОCR program.

The results of testing the algorithm according to the Gauss-Seidel method
The program was tested on real data arrays, differentiated by crops and soil types. Some processing results are presented in Tables 1-4.    The approximating equation for potassium. The coefficients of equation (34) were found by the Gauss-Seidel method in 299 steps: The approximating equation for nitrogen. The coefficients of equation (35) were found by the Gauss-Seidel method in 83 steps:

Conclusion
In this work, a zonal industrial mathematical model of soil nutrition for plants is presented, which takes into account all known sources of nutrients in the soil. Based on this model, an intelligent technology for the formation of a fertilizer system in digital farming based on cloud technologies is being developed.
The application of mineral fertilizers in the doses obtained as a result of the calculations will make it possible to obtain the planned crop yield and maintain a positive balance of nutrients. All this will undoubtedly contribute to the effective solution of problems of optimizing the soil nutrition for plants.