Computer research of the controlled models with migration flows Anastasia V. Demidovaa , Olga V. Druzhininab , Olga N. Masinac and Alexey A. Petrovc a Peoples’ Friendship University of Russia (RUDN University), 6, Miklukho-Maklaya St., Moscow, 117198, Russia b Federal Research Center “Computer Science and Control” of Russian Academy of Sciences 44-2, Vavilov St., Moscow, 119333, Russia c Bunin Yelets State University, 28, Communards St., Yelets, 399770, Russia Abstract Nonlinear models of the interconnected communities population dynamics are considered taking into account migration and competition. Formulations of optimal control problems are proposed for models with migration flows. The control quality criterion for a three-dimensional migration-population model is considered in the framework of optimal control problems with phase and mixed constraints. Computer research of nonlinear models with migration flows allowed us to obtain the results of numerical experiments on trajectory search and parameter estimation. To solve optimal control problems, we used numerical optimization methods and intelligent symbolic computing algorithms. These algorithms are based on the application of numerical optimization methods in combination with methods for generating control functions. The transition to the corresponding stochastic model with migration flows and optimal control is performed. In the stochastic case, the method of constructing self-consistent stochastic models is used. A comparative analysis of deterministic and stochastic models is carried out. The effects typical for controlled three-dimensional models with migration flows are revealed. Specialized software packages are used as tools for researching of models and solving of optimal control problems. These software packages implement algorithms for constructing trajectories, parametric optimization algorithms, and generating control functions, as well as numerical solutions of stochastic systems of differential equations. The obtained results can be used in problems of computer modeling of ecological, demographic and socio-economic systems, as well as in the problems of synthesis, optimal control and stability analysis of multidimensional stochastic models describing migration flows. Keywords computer modeling, nonlinear models with migration flows, numerical optimization methods, optimal control, intelligent symbolic computation algorithms, stochastization of one-step processes, symbolic computation libraries Workshop on information technology and scientific computing in the framework of the X International Conference Information and Telecommunication Technologies and Mathematical Modeling of High-Tech Systems (ITTMM-2020), Moscow, Russian, April 13-17, 2020 Envelope-Open demidova-av@rudn.ru (A. V. Demidova); ovdruzh@mail.ru (O. V. Druzhinina); olga121@inbox.ru (O. N. Masina); xeal91@yandex.ru (A. A. Petrov) Orcid 0000-0003-1000-9650 (A. V. Demidova); 0000-0002-9242-9730 (O. V. Druzhinina); 0000-0002-0934-7217 (O. N. Masina); 0000-0002-3011-9278 (A. A. Petrov) © 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org) 117 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 1. Introduction The study of mathematical models of the interacting communities dynamics, taking into account migration flows, is an important area of research [1, 2, 3, 4]. The effects of migration flows in deterministic and stochastic population models are considered in [5, 6, 7, 8] and in other works. For stochastic modeling of various types of dynamic systems, a method for constructing self-consistent one-step models [9] is proposed and a software package [10, 11] is developed. The specified software package allows you to perform computer research of models based on the implementation of algorithms for the numerical solution of stochastic differential equations, as well as algorithms for generating trajectories of multidimensional Wiener processes and multipoint distributions. It should be noted that the study of models of population-migration systems is relevant to the application of applied mathematical packages and general-purpose programming languages [12, 13]. In [14], a comparative analysis of the results of a computer study obtained for three-dimensional and four-dimensional stochastic models with migration flows is carried out. A comparison is made of the qualitative properties of four-dimensional models taking into account changes in migration rates, as well as intraspecific and interspecific interaction coefficients. The paper [15] is devoted to construction of four-dimensional nonlinear models of the interconnected com- munities number dynamics taking into account migration and competition, as well as taking into account migration, competition and mutualism. A qualitative and numerical study of these models is performed. A comparative analysis of the results is carried out. In [16], the construction of multidimensional models is proposed taking into account competition and mutualism, as well as taking into account migration flows. In [15, 16], a number of statements of optimal control problems for models with migration flows using phase and mixed constraints are proposed. A number of control problems for population dynamics models are studied in [17, 18, 19, 20] and in other papers. Some optimal control problems of distributed models of population dynamics are considered in [17]. In [18], the optimality criterion for auto-reproduction systems is formalized and the optimal control problem for the analysis of evolutionarily stable behavior is considered. In [19], the problem of the optimal behavior of a two-species population in the area taking into account migration was set and the equilibria corresponding to the optimal behavior of populations in the sense of maximizing growth rates are determined. For a four-dimensional population model without competition, the problem of control synthesis is considered in [20]. This control provides an approximation to the set of equilibrium states in a finite time. Such scientific directions as the creation of algorithms and the design of programs for solving of global parametric optimization problems are of theoretical and applied interest. Among the features of global parametric optimization problems, one can single out the high dimension of the search space, the complex landscape, and the high computational complexity of the target functions. Algorithms inspired by the nature [21, 22, 23, 24] are quite effective for solving these problems. In [25], a number of algorithms for single-criterion global optimization of the dynamic systems with switching trajectories are developed and the modular structure of a software package for modeling switched systems is described. The modular structure and a combination of formal and heuristic methods allow a universal approach to the study of various classes of models. In [26], the searching problems of optimal parameters of switched models 118 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 taking into account the action of non-stationary forces are considered, and searching algorithms of optimal motion parameters using intelligent control methods are developed. A comparative analysis of the methods of single-criterion global optimization is given and the questions of their application for finding of the coefficients of parametric control functions are considered. In this paper, nonlinear models of the interconnected communities number dynamics are considered taking into account migration and competition. Formulations of optimal control problems for models with migration flows are proposed. The problem of optimal control with phase constraints for a three-dimensional migration-population model is solved. To solve the optimal control problem, numerical optimization methods and intelligent symbolic computation algorithms are used. A computer study of a controlled migration-population model is carried out. A stochastic model with migration flows and optimal control is constructed. To construct this model, we used a method of constructing self-consistent stochastic models. The properties of models in deterministic and stochastic cases are characterized. Specialized software packages are used as tools for researching models and solving optimal control problems. The software packages are intended for conducting numerical experiments based on the implementation of algorithms for constructing motion trajectories, parametric optimization algorithms and generating control functions, as well as for numerically solving systems of differential equations using the modified Runge–Kutta methods. 2. Description of a deterministic model without control One of the basic migration-population models, taking into account competition and migration flows, is a three-dimensional model that describes the dynamics of two interconnected commu- nities, with the first species migrating to another range, and in the first range competing with the second species. The indicated model is defined by a system of differential equations of the form 𝑦1̇ = 𝑎1 𝑦1 − 𝑝11 𝑦12 − 𝑝13 𝑦1 𝑦3 + 𝛽𝑦2 − 𝛾 𝑦1 , 𝑦2̇ = 𝑎2 𝑦2 − 𝑝22 𝑦22 + 𝛾 𝑦1 − 𝛽𝑦2 , (1) 𝑦3̇ = 𝑎3 𝑦3 − 𝑝33 𝑦32 − 𝑝31 𝑦1 𝑦3 , where 𝑦1 and 𝑦3 are the densities of populations of competing species in the first areal, 𝑦2 are the population densities in the second areal, 𝑦2 are the interspecific competition coefficients, 𝑝𝑖𝑗 (𝑖 ≠ 𝑗) are the coefficients of intraspecific competition, 𝑝𝑖𝑖 (𝑖 = 1, 2, 3) are the coefficients of natural growth, 𝑎𝑖 (𝑖 = 1, 2, 3) are the coefficients of migration of the species between two areals, while the second areal is a refuge. For 𝑎𝑖 = 1, 𝑝𝑖𝑖 = 1, 𝛽 ≠ 𝛾 , 𝑝13 = 𝑝31 , the analysis of the model (1) and its generalizations is performed in [5, 6, 7, 14, 15]. The model (1) is a generalization of the model considered in [2] to the case of diverging migration rates. It is important to note that the model (1) serves as the basis for the transition to the construction of multidimensional nonlinear models with migration flows. In the process of model calculations, standard packages of symbolic calculations are used. When considering multidimensional generalizations, difficulties arise in calculations with symbolic parameters, in particular, when finding equilibrium states and constructing phase portraits. In this regard, a series of computer experiments are conducted, during which the most representative sets of numerical values of parameters are considered. A computer study 119 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 made it possible to conduct a comparative analysis of the properties of three-dimensional and four-dimensional models in deterministic and stochastic cases. However, for these models, no computer study is conducted taking into account the control actions. Next, we consider optimal control problems in the dynamics models of interacting communities taking into account migration flows. 3. Optimal control problems We formulate optimal control problems for a three-dimensional model with migration flows. The dynamics of the controlled model is described by a system of differential equations 𝑥1̇ = 𝑎1 𝑥1 − 𝑝11 𝑥12 − 𝑝13 𝑥1 𝑥3 + 𝛽𝑥2 − 𝛾 𝑥1 − 𝑢1 𝑥1 , 𝑥2̇ = 𝑎2 𝑥2 − 𝑝22 𝑥22 + 𝛾 𝑥1 − 𝛽𝑥2 − 𝑢2 𝑥2 , (2) 𝑥3̇ = 𝑎3 𝑥3 − 𝑝33 𝑥32 − 𝑝13 𝑥1 𝑥3 − 𝑢3 𝑥3 , where 𝑢𝑖 = 𝑢𝑖 (𝑡) are control functions. The constraints for the model (2) are set in the form 𝑥1 (0) = 𝑥10 , 𝑥2 (0) = 𝑥20 , 𝑥3 (0) = 𝑥30 , 𝑥1 (𝑇 ) = 𝑥11 , (3) 𝑥2 (𝑇 ) = 𝑥21 , 𝑥3 (𝑇 ) = 𝑥31 , 𝑡 ∈ [0, 𝑇 ], 0 ⩽ 𝑢1 ⩽ 𝑢11 , 0 ⩽ 𝑢2 ⩽ 𝑢21 , 0 ⩽ 𝑢3 ⩽ 𝑢31 , 𝑡 ∈ [0, 𝑇 ]. (4) In relation to the problem (1)–(3) the functional to be maximized is written as 𝑇 3 𝐽 (𝑢) = ∫ ∑ (𝑙𝑖 𝑥𝑖 − 𝑐𝑖 )𝑢𝑖 (𝑡)𝑑𝑡, 0 𝑖=1 or 𝑇 𝐽 (𝑢) = ∫ [(𝑙1 𝑥1 − 𝑐1 ) 𝑢1 (𝑡) + (𝑙2 𝑥2 − 𝑐2 ) 𝑢2 (𝑡) + (𝑙3 𝑥3 − 𝑐3 ) 𝑢3 (𝑡)] 𝑑𝑡. (5) 0 The quality control criterion (5) corresponds to the maximum profit from the using of populations, and 𝑙𝑖 is the cost of the 𝑖-th population, 𝑐𝑖 is the cost of technical equipment corresponding to the 𝑖-th population. The optimal control problem 𝐶1 for the model (1) can be formulated as follows. (𝐶1 ) Find the maximum of the functional (5) under the conditions (3), (4). The following type of restrictions imposed on 𝑢𝑖 (𝑡) is also of interest for study: 0 ⩽ 𝑢1 (𝑡) + 𝑢2 (𝑡) + 𝑢3 (𝑡) ⩽ 𝑀, 𝑢𝑖 (𝑡) ⩾ 0, 𝑖 = 1, 2, 3, 𝑡 ∈ [0, 𝑇 ]. (6) The optimal control problem 𝐶2 for the model (2) is formulated as follows. (𝐶2 ) Find the maximum of the functional (5) under the conditions (3), (6). In problems of population dynamics, restrictions of the form 𝑥𝑖 ⩾ 0 imposed on phase variables are natural. Often, restrictions 𝑥𝑖̇ ⩽ 𝑠𝑖 on the growth of the 𝑖-th populaton are often used, which leads to mixed restrictions. Given these features, along with the problems 𝐶1 , 𝐶2 , optimal 120 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 control problems with phase and mixed constraints are of interest. The traditional direction of research, taking into account the problems 𝐶1 , 𝐶2 , is the search for the conditions of existence and uniqueness of the maximum of the functional (5) based on the application of Pontryagin maximum principle. However, due to the difficulties of the analytical study of multidimensional dynamic models and the characteristics of the control quality criterion, methods of numerical optimization are often used. Next, we consider the application of numerical optimization methods as applied to optimal control problems in models with migration flows. 4. Description of algorithms for solving the parametric optimization problem To find the maximum of the functional (5), it is proposed to use numerical optimization methods using intelligent symbolic computation algorithms to find the control functions 𝑢𝑖 (𝑡). The algorithm for solving the problem 𝐶1 (algorithm 1) contains the following steps. 1. Generation of control functions. 2. Construction of trajectories for the model (2). 3. Search for numerical value of criterion (5). 4. Check for a break condition. If the break condition is reached, the algorithm ends. Otherwise, go to step 1. To generate control functions, the method of symbolic regression is used. Its principle is to present expressions in the form of a tree whose nodes are arithmetic operations or mathematical functions. The main problem with the automatic generation of symbol trees is that a arbitrarily generated tree is not necessarily correct. In addition, an additional problem is that numerical optimization algorithms, as a rule, operate with real numbers. To solve these problems the software package is developed for solving global parametric optimization problems in Python. The software package includes the following algorithms. 1. Arithmetic coding (algorithm 2). This algorithm is used in entropy compression of informa- tion and allows you to convert real numbers (from 0 to 1) into a sequence of characters of any alphabet, and also allows you to control the probability of a character appearing in a message. 2. A node generator based on a finite state machine (algorithm 3). A state machine for generating nodes of a symbol tree can be represented as a cyclic directed graph, transition conditions for which are sequentially read from a symbol message (alphabet “abcd”). On each of the nodes, the automaton returns an operation, operator, variable or number. 3. An algorithm for constructing trees based on linked lists (algorithm 4). The indicated algorithm allows generating a symbolic expression, obtaining its textual representation, and counting by substituting the argument x. The principle of the algorithm is based on the dynamic construction of a linked list by recursive substitution of nodes. 4. Message generation algorithm (algorithm 5). Heuristic algorithms for numerical optimiza- tion are used in combination with algorithms 2–4. The process of encoding a character tree is to find the number 𝛿 ∈ [0, 1]. 121 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 Using algorithms 3–5 it is possible to find the control functions 𝑢𝑖 (𝑡) for functional (5) in symbolic form. The described algorithms can be used to solve a wide class of problems of searching for unknown functions, as well as problems of stability, control, forecasting and clustering. It is important to note that the process of encoding a symbol tree is similar to the selection of weights of a neural network, and the symbol tree is a universal approximator. In this regard, symbol trees can be used to construct artificial neurons (when using several variables), as well as to construct activation functions for the output layer. It should be noted that the proposed algorithms have less computational complexity compared to using a trained neural network. In addition, they can be used in conjunction with symbolic mathematics packages. 5. Results of computer experiments We consider a special case of the implementation of Algorithm 1. As control functions, we use positive polynomials of 𝑛-th degree. In developing Python programs, the following optimization algorithms are used to solve the 𝐶1 problem: the Powell algorithm and differential evolution from the SciPy mathematical library. The problem of maximizing functional (5) can be reduced to the problem: ‖(𝛿, 𝑒 −𝐽 )‖ → min, where 𝛿 is the absolute deviation of the trajectories from 𝑥11 , 𝑥21 , 𝑥31 (see formula (3)), denoted by 𝑒 −𝐽 inverse exponent corresponding to functional (5). Control functions have the form: 𝑢𝑖 (𝑡) = ‖𝑅𝑖 𝑇 ‖, 𝑅𝑖 = (𝑟0 , 𝑟1 , … , 𝑟𝑛 ), 𝑇 = (𝑡 0 , 𝑡 1 , … , 𝑡 𝑛 )𝑇 , where 𝑅𝑖 are the parametric coefficients; 𝑛 is the degree of the polynomial; ‖.‖ is the Cartesian norm of the vector. For model (2), in the framework of solving the problem 𝐶1 , on the base of on the above numerical optimization algorithms, a series of computer experiments is carried out. Exper- imental results and comparative analysis of algorithms for 𝑝𝑖𝑖 = 1, 𝑎𝑖 = 1, 𝛽 = 1, 𝛾 = 1, 𝑥1 (0) = 1, 𝑥2 (0) = 0.5, 𝑥3 (0) = 1, 𝑥𝑖1 = 0.2, 𝑙𝑖 = 10, 𝑐1 = 1, 𝑐2 = 0.5, 𝑐3 = 1 are presented in Table 1. Note that for convenience and simplicity, multiple 3 values of the coefficients are used in accordance with the number of functions 𝑢𝑖 (𝑡). Figure 1 shows the trajectories of system (2) for the case 𝑛 = 0, when 𝑢𝑖 = const. Here and further along the abscissa axis, time is indicated, along the ordinate axis, the population density 𝑥1 , 𝑥2 , 𝑥3 for system (2). It should be noted that for differential evolution with 𝑛 = 0 a similar result is obtained. Figure 2 shows the trajectories of model (2) for 𝑛 = 1 using the Powell algorithm. The use of linear control functions significantly increases the value of criterion (5), while the error decreases (see Table 1). Using the Powell algorithm for 𝑛 = 2 gives trajectories similar to those for 𝑛 = 1. Figure 3 presents the results of constructing the trajectories of system (2) for 𝑛 = 2 using differential evolution. According to the results obtained, the use of quadratic control functions 𝑢 allows one to significantly increase the value of functional (5). 122 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 Table 1 The values of functional (5) for various parameters 𝑅 Algorithm/Degree/Values Accuracy Value of functional (5) Powell Algorithm, 𝑛 = 0 0.012 62.82 𝑅 = (0.01245394, 1.40872792, 0.60580167) Powell Algorithm, 𝑛 = 1 0.003 83.41 𝑅 = (1.12256585, -0.12451127, 0.58076986, 0.08948072 1.73843178, -0.17889372) Powell Algorithm, 𝑛 = 2 0.0035 81.20 𝑅 = (1.19541598e+00, -1.22466930e-01, -2.95037445e-04, 7.18748101e-01, -3.73885949e-02, 1.19110418e-02, 1.26513172e+00, -5.26684882e-02, -5.83741998e-03) Differential evolution, 𝑛 = 0 0.012 62.82 𝑅 = (0.01245681, 1.40872162, 0.60580208) Differential evolution, 𝑛 = 1 0.002 89.936 𝑅 = (-1.79492026, 0.22097301, -1.29949171, 0.31675029, -1.95814565, 0.2512848) Differential evolution, 𝑛 = 2 0.0012 99.921 𝑅 = (-4.22544296, 1.41343107, -0.10137252, 0.36060781, -0.70567989, 0.08886537, 2.55365751, -1.27341688, 0.11120789) Figure 1: The trajectories of system (2) for 𝑢1 = 0.012, 𝑢2 = 1.408, 𝑢3 = 0.606 using Powell algorithm 123 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 Figure 2: The trajectories of system (2) for 𝑢1 = 1.123 − 0.124𝑡, 𝑢2 = 0.58 + 0.089𝑡, 𝑢3 = 1.738 − 0.179𝑡 using the Powell algorithm Figure 3: The trajectories of system (2) for 𝑢1 = −4.225 + 1.413𝑡 − 0.101𝑡 2 , 𝑢2 = 0.3606 − 0.7057𝑡 + 0.0889𝑡 2 , 𝑢3 = 2.554 − 1.273𝑡 + 0.111𝑡 2 using differential evolution 124 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 Based on the results shown in Table 1, we can conclude that the effectiveness of control functions increases with increasing degree of polynomial. However, it should be noted that the computational complexity of the main algorithm 1 is significantly increased. It can be assumed that the largest values of the functional (5) correspond to the oscillating trajectories of the model (2). This assumption is consistent with the results of computer experiments (see Figure 3). Testing this hypothesis for various data sets and parameters is one of the further areas of research. In the next section of the paper, for the analysis of stochastic models, we used the results of a computer experiment conducted for model (2) at 𝑛 = 0, 𝑛 = 1, 𝑛 = 2. The results can be used to search for control functions using symbolic regression and artificial neural networks. 6. Construction and analysis of a stochastic controlled model with migration flows To construct a stochastic population model taking into account competition and migration flows and control, it is proposed to apply the method of constructing self-consistent stochastic models [8, 9, 10]. This method involves recording the system under study in the form of an interaction scheme, i.e. symbolic record of all possible interactions between system elements. For this symbolic record we use the system state operators and the system state change operator. Then we can get the drift and diffusion coefficients for the Fokker–Planck equation. This approach to modeling allows us to write the Fokker–Planck equation and the equivalent stochastic differential equation in the Langevin form. To obtain a stochastic model, it is necessary to write the interaction scheme, which has the following form: 𝑎𝑖 𝑋𝑖 −→ 2𝑋𝑖 , 𝑖 = 1, 3; 𝑝𝑖𝑖 𝑋𝑖 + 𝑋𝑖 −−→ 𝑋𝑖 , 𝑖 = 1, 3; 𝑝13 𝑋1 + 𝑋3 −−−→ 0, (7) 𝛾 𝛽 𝑋1 − → 𝑋2 , 𝑋2 − → 𝑋1 , 𝑢𝑖 𝑋𝑖 −→ 0, 𝑖 = 1, 3. In this interaction scheme (7), the first line corresponds to the natural reproduction of species in the absence of other factors, the 2nd line symbolizes intraspecific competition, and the 3rd line symbolizes interspecific competition. The fourth line is a species migration process description from one range to another. The last line is responsible for control. Further, for this interaction scheme using the developed software package [14] for obtain- ing the coefficients of the Fokker–Planck equation from the interaction schemes using the SymPy [11] symbolic computing system, the following expressions for the coefficients are obtained: 𝑎1 𝑥1 − 𝑝11 𝑥12 − 𝑝13 𝑥1 𝑥3 + 𝛽𝑥2 − 𝛾 𝑥1 − 𝑢1 𝑥1 𝐴(𝑥) = ( 𝑎2 𝑥2 − 𝑝22 𝑥22 − 𝛽𝑥2 + 𝛾 𝑥1 − 𝑢2 𝑥2 ), 𝑎3 𝑥3 − 𝑝33 𝑥32 − 𝑝13| 𝑥1 𝑥3 − 𝑢3 𝑥3 125 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 𝐵11 −𝛽𝑥2 − 𝛾 𝑥1 0 𝐵(𝑥) = (−𝛽𝑥2 − 𝛾 𝑥1 𝐵22 0 ), 0 0 𝐵33 where 𝐵11 = 𝑎1 𝑥1 + 𝑝11 𝑥12 + 𝑝13 𝑥1 𝑥3 + 𝛽𝑥2 + 𝛾 𝑥1 + 𝑢1 𝑥1 , 𝐵22 = 𝑎2 𝑥2 + 𝑝22 𝑥22 + 𝛽𝑥2 + 𝛾 𝑥1 + 𝑢2 𝑥2 , 𝐵33 = 𝑎3 𝑥3 + 𝑝33 𝑥32 + 𝑝13 𝑥1 𝑥3 + 𝑢3 𝑥3 , 𝑥 = (𝑥1 , 𝑥2 , 𝑥3 ) is the vector describing the state of the system. The coefficient 𝐴(𝑥) is the drift vector, the coefficient 𝐵(𝑥) is the diffusion matrix for the Fokker–Planck equation (3), for a model dimension equal to 3: 𝑛 𝑛 1 𝜕𝑡 𝑃(𝑥, 𝑡) = − ∑ [𝐴𝑖 (𝑥)𝑃(𝑥, 𝑡)] + ∑ 𝜕 𝜕 [𝐵 𝑃(𝑥, 𝑡)]. (8) 𝑖=1 2 𝑖,𝑗=1 𝑥𝑖 𝑥𝑗 𝑖𝑗 Further, the obtained coefficients are transferred to another module of the software package for the numerical solution of the resulting stochastic differential equation. For the numerical experiment of the obtained stochastic model, the same parameters are chosen as for the numerical analysis of the deterministic model (2). The results of a nu- merical solution of a stochastic differential solution for two sets of control function values 𝑢1 = 0.012, 𝑢2 = 1.408, 𝑢3 = 0.606 and 𝑢1 = 1.123 − 0.124𝑡, 𝑢2 = 0.58 + 0.089𝑡, 𝑢3 = 1.738 − 0.179𝑡 are shown in Figures 4 and 5. Figure 4: The trajectories of the deterministic and stochastic system (2) for 𝑢1 = 0.012, 𝑢2 = 1.408, 𝑢3 = 0.606 A comparative analysis showed that in the first case, namely, for 𝑢1 = 0.012, 𝑢2 = 1.408, 𝑢3 = 0.606, the introduction of stochastics weakly affects the behavior of the system. The solutions remain close to the boundary conditions 𝑥1𝑖 = 0.2 specified for the model (2). 126 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 Figure 5: The trajectories of the deterministic and stochastic system (2) for 𝑢1 = 1.123 − 0.124𝑡, 𝑢2 = 0.58 + 0.089𝑡, 𝑢3 = 1.738 − 0.179𝑡 In the second case, namely, for 𝑢1 = 1.123 − 0.124𝑡, 𝑢2 = 0.58 + 0.089𝑡, 𝑢3 = 1.738 − 0.179𝑡, the introduction of stochastics greatly changes the behavior of the system. Thus, in this case, to obtain optimal solutions to the stochastic model, it is necessary to use other methods. 7. Conclusion In this paper, we propose methods for the analysis and synthesis of multidimensional nonlinear controlled models of the interconnected communities dynamics, taking into account migration and competition. The statements of optimal control problems for models with migration flows are considered. A computer study of nonlinear models with migration flows made it possible to obtain the results of numerical experiments in searching for trajectories and generating control functions. The case of control functions representability in the form of positive polynomials is studied. To solve optimal control problems, it is proposed to use numerical optimization methods and intelligent symbolic computation algorithms. These algorithms are based on the use of heuristic methods of numerical optimization in combination with methods for generating control functions. The analysis of the generalized stochastic model with migration flows and optimal control demonstrated the effectiveness of the method of constructing self-consistent stochastic models for the controlled case. For a number of parameters sets, it is possible to conduct a series of computer experiments to construct optimal trajectories of the stochastic model. A comparative analysis of the studied deterministic and stochastic models is carried out. The use of the developed instrumental software, symbolic calculations, and generalized numerical methods have demonstrated sufficient efficiency for the computer study of multidi- mensional nonlinear models with migration. The presented results can be used in computer modeling of deterministic and stochastic migration processes taking into account control and optimization requirements. 127 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 References [1] Z. Lu, Y. Takeuchi, Global asymptotic behavior in single-species discrete diffusion systems, Journal of Mathematical Biology 32 (1993) 67–77. doi:1 0 . 1 0 0 7 / B F 0 0 1 6 0 3 7 5 . [2] X.-a. Zhang, L. Chen, The linear and nonlinear diffusion of the competitive Lotka–Volterra model, Nonlinear Analysis 66 (2007) 2767–2776. doi:1 0 . 1 0 1 6 / j . n a . 2 0 0 6 . 0 4 . 0 0 6 . [3] N. Tkachenko, J. D. Weissmann, W. P. Petersen, G. Lake, C. P. E. Zollikofer, S. Callegari, Individual-based modelling of population growth and diffusion in discrete time 2 (2017) e0176101. doi:1 0 . 1 3 7 1 / j o u r n a l . p o n e . 0 1 7 6 1 0 1 . [4] X. Chen, E. S. Daus, A. Jüngel, Global existence analysis of cross-diffusion population systems for multiple species, Archive for Rational Mechanics and Analysis 227 (2018) 715–747. doi:1 0 . 1 0 0 7 / s 0 0 2 0 5 - 0 1 7 - 1 1 7 2 - 6 . [5] I. N. Sinitsyn, O. V. Druzhinina, O. N. Masina, Analytical modeling and stability analysis of nonlinear broadband migration flow, Nonlinear world 16 (2018) 3–16. [6] A. V. Demidova, O. V. Druzhinina, M. Jaćimović, O. N. Masina, Construction and analysis of nondeterministic models of population dynamics, Communications in Computer and Information Science 678 (2016) 498–510. doi:1 0 . 1 0 0 7 / 9 7 8 - 3 - 3 1 9 - 5 1 9 1 7 - 3 _ 4 3 . [7] A. V. Demidova, O. V. Druzhinina, O. N. Masina, Design and stability analysis of non- deterministic multidimensional populations dynamics models, in: Proceedings of the Selected Papers of the 7th International Conference ”Information and Telecommunication Technologies and Mathematical Modeling of High-Tech Systems” (ITTMM-2017), volume 1995, Moscow, Russia, 2017, pp. 14–21. [8] A. V. Demidova, M. N. Gevorkyan, A. D. Egorov, D. S. Kulyabov, A. V. Korolkova, L. Sev- astyanov, Influence of stochastization on one–step models, RUDN Journal of Mathematics, Information Sciences and Physics (2014) 71–85. [9] M. N. Gevorkyan, T. R. Velieva, A. V. Korolkova, D. S. Kulyabov, L. A. Sevastyanov, Stochas- tic Runge–Kutta Software Package for Stochastic Differential Equations, in: W. Zamojski, J. Mazurkiewicz, J. Sugier, T. Walkowiak, J. Kacprzyk (Eds.), Dependability Engineer- ing and Complex Systems, Springer International Publishing, Cham, 2016, pp. 169–179. doi:1 0 . 1 0 0 7 / 9 7 8 - 3 - 3 1 9 - 3 9 6 3 9 - 2 _ 1 5 . [10] M. N. Gevorkyan, A. V. Demidova, T. R. Velieva, A. V. Korol’kova, D. S. Kulyabov, L. A. Sevast’yanov, Implementing a method for stochastization of one-step processes in a computer algebra system, Programming and Computer Software 44 (2018) 86–93. doi:1 0 . 1134/S0361768818020044. [11] R. Lamy, Instant SymPy Starter, Packt Publishing, 2013. [12] T. E. Oliphant, Python for scientific computing, 2007. doi:1 0 . 1 1 0 9 / M C S E . 2 0 0 7 . 5 8 . [13] T. E. Oliphant, Guide to NumPy, 2nd ed., CreateSpace Independent Publishing Platform, USA, 2015. [14] A. V. Demidova, O. V. Druzhinina, O. N. Masina, E. D. Tarova, Computer research of nonlinear stochastic models with migration flows, in: Proceedings of the Selected Papers of the 9th International Conference «Information and Telecommunication Technologies and Mathematical Modeling of High-Tech Systems» (ITTMM-2019), volume 2407, Moscow, Russia, 2019, pp. 26–37. Published at http://CEUR-WS.org. [15] O. V. Druzhinina, O. N. Masina, E. D. Tarova, Analysis and synthesis of nonlinear dynamic 128 Anastasia V. Demidova et al. CEUR Workshop Proceedings 117–129 models taking into account migration flows and control actions, Nonlinear world 17 (2019) 24–37. doi:1 0 . 1 8 1 2 7 / j 2 0 7 0 0 9 7 0 - 2 0 1 9 0 5 - 0 3 . [16] A. V. Demidova, O. V. Druzhinina, M. Jaćimović, O. N. Masina, N. Mijajlovic, Problems of synthesis, analysis and optimization of parameters for multidimensional mathematical models of interconnected populations dynamics, Communications in Computer and Information Science (CCIS) 1145 (2020) 56–71. doi:1 0 . 1 0 0 7 / 9 7 8 - 3 - 0 3 0 - 3 8 6 0 3 - 0 _ 5 . [17] A. I. Moskalenko, Methods of nonlinear mappings in optimal control. Theory and applica- tions to models of natural systems, Nauka, Novosibirsk, 1983. [18] O. A. Kuzenkov, G. V. Kuzenkova, Optimal control of auto-reproduction systems, Bulletin of the Russian Academy of Sciences, Theory and control systems 4 (2012) 26–37. [19] I. V. Danilova, The problem of optimal behavior of the population in the area taking into account intraspecific competition and migration, in: Proceedings of the XIII All-Russian Meeting on Control Problems of the VSPU-2019, ICS of RAS, Moscow, 2019, pp. 1476–1479. [20] I. V. Rublev, T. E. Morozova, About one control problem for a four-dimensional food chain, in: Proceedings of the XIII All-Russian Meeting on Control Problems of VSPU-2019, ICS of RAS, Moscow, 2019, pp. 1500–1505. [21] A. P. Karpenko, Modern search engine optimization algorithms. Algorithms inspired by nature, 2nd ed., N.E. Bauman MSTU, Moscow, 2016. [22] M. Sakharov, A. Karpenko, Meta-optimization of mind evolutionary computation algorithm using design of experiments, Advances in Intelligent Systems and Computing 874 (2018) 473–482. [23] D. Ashlock, Evolutionary Computation for Modeling and Optimization, Springer, 2006. [24] K. Price, R. Storn, J. Lampinen, Differential Evolution: A Practical Approach to Global Optimization, Springer, 2005. [25] A. A. Petrov, The structure of the software package for modeling technical systems under conditions of switching operating modes, Electromagnetic waves and electronic systems 23 (2018) 61–64. [26] O. V. Druzhinina, O. N. Masina, A. A. Petrov, The synthesis of the switching systems optimal parameters search algorithms, Communications in Computer and Information Science (CCIS) 974 (2019) 306–320. doi:1 0 . 1 0 0 7 / 9 7 8 - 3 - 0 3 0 - 1 0 9 3 4 - 9 _ 2 2 . 129