**1. Introduction**

Melentiev Energy Systems Institute (ESI SB RAS) actively conducts predictive studies of the energy sector (ES) of a country and its regions, taking into account the requirements of energy security (ESy) [1–4]. Energy experts built an economic and mathematical model of the energy sector for these studies. In a meaningful sense, the model is based on the traditional territorial-production model of the energy sector with blocks of electric power, heat, gas, and coal supplies, as well as oil refining (fuel oil supply). In the mathematical sense, the model is used for solving the general problem of linear programming. Several versions of software packages (SP) were developed to automate the computational experiment using this model. SP "INTEC-A" is a version obtained as a result of the direct reengineering of previous versions of the SP. The need for reengineering was due to the transition of previous versions of the SP into the category of legacy software. SP "INTEC-A" gives the user the ability to create models of the energy sector, set options for the development of the energy sector and their calculation, as well as interpreting the optimization results in the form of balance sheets. Balance tables display the presence or absence of a shortage of a certain fuel and energy resource for each region.

Such studies are multivariate in nature. To work with them, the Department of Artificial Intelligence Systems in the Energy Industry of the Institute of Energy Management and Energy of the Siberian Branch of the Russian Academy of Sciences proposed a two-level technology for studying ES problems. At the first level, using semantic modeling methods, the stage of qualitative analysis is performed. At the second level, a quantitative analysis is performed on the basis of calculations obtained using software systems [5–7].

**Citation:** Massel, L.; Massel, A.; Mamedov, T. Integration of Mathematical and Cognitive Modelling in the Software Package "INTEC-A". *Eng. Proc.* **2023**, *33*, 26. https://doi.org/10.3390/ engproc2023033026

Academic Editors: Askhat Diveev, Ivan Zelinka, Arutun Avetisyan and Alexander Ilin

Published: 14 June 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

The ESI SB RAS designed and developed an intelligent IT environment that supports a two-level research technology and includes semantic modeling tools and the SP "IN-TEC" [8]. The IT support environment for semantic modeling includes tools for ontological, cognitive, event, and Bayesian modeling. Currently, the transition from semantic models to numerical calculations is carried out manually; the authors proposed to automate this process within the framework of the SP "INTEC-A".

#### **2. A Model for Predictive Studies of the Energy Sector, Taking into Account the Requirements of Energy Security**

The model for optimizing the balances of fuel and energy resources with the allocation of territorial entities under conditions of possible disturbances in a meaningful sense is based on the traditional territorial production model of the energy sector with blocks of electric power, heat, gas, and coal supplies, as well as oil refining (fuel oil supply). In the mathematical sense, the model is used for solving the general problem of linear programming. When setting the problem, the constraints are written as a system of linear equations and inequalities. The objective function minimizes the amount of losses and damages from fuel and energy resources deficits among consumers. Figure 1 shows the meta-ontology of the model used.

Energy experts adopted a system of notation for variables and inequalities [9,10] to describe the models. The name of the variable (TRV) consists of seven characters (XXXYYZZ), where XXX is the code of the object (or group of objects) of extraction, production, transport, processing, and consumption of energy resources, YY is the area code, and ZZ is the code of the technology used at a particular object in a certain area. The name of the equation (IR) contains five characters (QQQYY), where QQQ is the code of the energy resource and YY is the code of the region. For example, variable D012101 stands for gas production (D01) in the northwest region (21) using technology 01. Inequality 00122 stands for natural gas surplus in the central region, where 001 is gas and 22 is the central region.

**Figure 1.** Metaontology of the energy sector model.

A computational experiment using this model includes the following steps: preparation of the base version of the model; preparation of options for the development of the scenario by adjusting the constraints of inequalities and variables; optimization with the help of the "solver" of each of the variants of the model; and presentation of the interpretation of the results of the balance sheets. To automate these studies, versions of the SP "INTEC" were developed at different times.

#### **3. Versions of SP "INTEC"**

SP "INTEC" is a complex of computer programs used for researching the directions of development of the energy sector taking into account the requirements of energy security. Versions of this SP have been developed and used since the 1980s on the BESM-6 and unified computer system [11,12]. SP "INTEC-A" is a new version developed on the basis of existing versions of "INTEC" and "INTEC-M' for personal computers [7,13]. A decision was made to reengineer them due to the transition of previously created SP versions into the category of legacy software. The main functionality of the new version of the SP "INTEC-A" includes: formation of energy sector models; optimization of the amount of costs and losses from fuel and energy shortages; and interpretation of optimization results in the form of balance tables. Figure 2 shows the architecture of the SP "INTEC-A".

The information model agent was designed for the convenient formation of an information model. The agent has the following functionality: formation of various patterns of the model; formation of technological dictionaries; formation of sets of variables, linear inequalities and objective functions; and multicriteria adjustments for variables and linear inequalities. The model pattern is understood as a system of notation for variables and inequalities/equations.

The scenario agent was designed to build a computational scenario, the elements of which are variants of the energy sector model. This agent acts as a coordinating agent. Its task is to set various situations and form separate scenarios, call other agents, and provide control over user actions. The agent supports multivariate studies.

The solver agent searches for the optimal solution for each version of the model using the double simplex method, designed to solve the general linear programming problem. The agent is implemented in Python using the PuLP library.

The report generation agent builds various tabular reports containing indicators of the results of a computational experiment that are of interest to the researcher, such as: balances of fuel and energy resources for each region, group of regions, and the country as a whole; interregional flows of various types of fuel; and assessment of the efficiency of energy resources and technological methods.

Integration of the cognitive modeling tool into the SP "INTEC-A" was proposed, to ease the load on the user in multivariate calculations. The following section shows the possibility of forming and correcting the computational scenario and displaying the results of its calculation using cognitive maps.

#### **4. Development and Integration of a Cognitive Modeling Agent in the SP "INTEC-A"**

Traditionally, a combinatorial approach to multivariate calculations has been used in studies of energy security problems, which assigned the expert with the task of choosing suitable solutions from a variety of solutions (up to several million options) [14]. In this regard, a two-level technology was proposed [8], integrating the stages of qualitative analysis (using semantic modeling tools) and quantitative analysis (using linear economic and mathematical models and traditional software systems, in this case, SP "INTEC-A"). It was assumed that using qualitative analysis significantly reduces the number of options that need to be calculated, which will help to significantly reduce the burden on the expert.

The intelligent IT environment integrates semantic and mathematical (INTEC-A) modeling tools and provides support for the proposed two-level research technology. At the first level, for semantic modeling, the use of event, Bayesian, ontological, and the cognitive models and tools supporting them, was proposed.

To support cognitive modeling, the CogMap tool was developed to create, view, edit, and analyze cognitive maps to determine:


At the second level, SP "INTEC-A" is used for quantitative analysis. Nowadays, the transition from cognitive maps to a SP is performed "manually". To automate the transition, it is required to develop a cognitive modeling support agent and implement it in the SP "INTEC-A". The development of a cognitive modeling support agent based on CogMap was proposed, taking into account modern requirements. The integration of the cognitive modeling agent into the SP "INTEC-A" will provide the following features:


#### **5. The Technology of the Computational Experiment after the Integration of the Cognitive Modeling Agent into the SP "INTEC-A"**

The technology of the computational experiment after the integration of the cognitive modeling agent into the SP "INTEC-A" is shown in Figure 3 in the form of an algorithm. Let us consider the algorithm in more detail. An "empty" computational scenario is automatically created when starting SP "INTEC-A'. Next, the user either uploads an existing version of the model or creates it using the information modeling agent. The model variant is considered the base after adding the resulting model variant to an empty computational scenario. The corresponding concepts of the cognitive map are automatically generated for each element of the base version of the model. The user independently generates additional concepts of energy security threat factors or uses previously saved ones. The elements of the model are variables, inequalities, and elements of balance tables. Further, the user selects the concepts necessary for the study and initializes the values of the ES threat concepts, and then establishes links between the concepts to form a cognitive model. The generated basic version of the model is calculated using a solver agent. The values of the concepts of the cognitive model are initialized based on the optimization results. The user selects concepts, makes adjustments to their characteristics, and calculates the resulting version of the model using a solver agent to form a development option for the energy sector. The values of concepts and relationships are updated according to the results of calculations. A

search is also automatically performed after calculating a version of the model for concepts that are not included in the cognitive model, but whose values have been changed as a result of the calculation. As a result, a set of cognitive models is obtained, each of which corresponds to a variant of the model used in the computational scenario.

**Figure 3.** The technology of the computational experiment after the integration of the cognitive modelling agent into the SP "INTEC-A".

#### **6. Development and Integration of a Cognitive Modeling Agent in the SP "INTEC-A"**

Damage to the gas pipeline running from Western Siberia through the Urals to the European part of Russia is a very dangerous threat due to the dominance of natural gas in the production of electricity and heat. To demonstrate the possibilities of calculations, the situation of an accident at a gas pipeline section was considered.

Consider a 28% reduction in natural gas transport from the Urals Federal District (FD) to the Volga Federal District. Significant changes in the consumption of fuel resources should occur in the Central Federal District. Most cogeneration or combined heat and power (CHPPs) in the Central Federal District use gas as a fuel resource, most of the gas is produced in the Urals Federal District, and gas is transported from the Urals Federal District through the Volga Federal District to the Central Federal District.

The required concepts were identified in the model to study the possibilities of gas diversification for CHPPs, condensing power plants (CPPs), and boiler houses in the Central Federal District. The concept of the threat of failure of the gas pipeline threads, external to the model, was also added. The definition and initialization of the weight coefficients of links between concepts were carried out by an expert. Figure 4 shows a cognitive map (a graphic representation of a cognitive model) corresponding to this stage of the algorithm.

**Figure 4.** Cognitive map of the decline in natural gas transport from the Urals Federal District to the Volga Federal District.

The values of the model concepts were initialized in conventional units after using the solver to find the optimal solution for the base version of the model. At this stage, the cognitive map resembled that shown in Figure 5.

**Figure 5.** Map (Figure 4) indicating the values of the concepts of the model in arbitrary units.

It is necessary to identify a certain concept and make adjustments to its characteristics to form a model development option that characterizes an accident on a gas pipeline, using a cognitive model. In the corresponding concept, we indicated that the percentage of disabled gas pipeline threads has increased from zero to twenty-eight percent. As a result of the search for the optimal solution by the solver agent, we obtained the following changes in the values of the concepts presented in Figure 6.

As seen in Figure 6, according to the results of the computational experiment, if 28% of the gas pipeline from the Ural Federal District to the Volga Federal District fails, gas supplies to the Central Federal District can be compensated for by the supply of other coals from the Northwestern Federal District and the supply of Kuznetsk coal from the Siberian Federal District.

**Figure 6.** Map (Figure 5) with changes in the meanings of concepts.

### **7. Conclusions**

This article considered the current state of predictive studies of the fuel and energy complex (FEC) of a country and its regions, taking into account the requirements of energy security (ES). The proposal was to move from a combinatorial approach to a computational experiment to a two-level research technology, where, at the first level, using semantic modeling methods, the stage of qualitative analysis was performed and, at the second level, quantitative analysis was carried out based on calculations obtained using software systems.

Based on the cognitive modeling tool CogMap, the development of a cognitive modeling agent and its integration into the SP "INTEC-A" were proposed. The possibilities of the developed agent were considered and the technology of the computational experiment after the integration of the cognitive modeling agent into the SP "INTEC-A" was proposed. An example of such an experiment was given for the scenario of reducing the transport of natural gas from the Ural Federal District to the Volga Federal District, using the construction of cognitive maps for this scenario.

**Author Contributions:** Conceptualization, L.M.; methodology L.M. and A.M.; software, T.M.; validation, A.M.; writing—original draft, A.M.; writing—review & editing, L.M. All authors have read and agreed to the published version of the manuscript.

**Funding:** The research was funded by Russian Science Foundation, according to the research project No. 22-21-00841.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

### **References**


**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
