A software platform to support the energy system resilience study A V Edelev1 [0000-0003-2219-9754] and E S Fereferov2 [0000-0002-7316-444X] 1 Melentiev Energy Systems Institute of Siberian Branch of SB RAS, Lermontov Str. 130, Irkutsk, Russia, 664033 2 Matrosov Institute for System Dynamics and Control Theory of SB RAS, Lermontov Str. 134, Irkutsk, Russia, 664033 E-mail: alexedelev@gmail.com, fereferov@icc.ru Abstract. The paper addresses the problem of supporting research of the energy systems resilience. The resilience is concerned with the energy system ability to withstand large disturbances. To reach the goal of creating user-friendly software for decision making support in that field, a software platform is considered. It includes some original frameworks for retrieving, gathering, querying and analysing data, and building thematic maps to produce disturbance scenarios and evaluate consequences of their impact. The main advantage of the proposed platform is its applicability for all the stages of the energy system resilience research starting from risk mitigation assessment and ending with comparing alternative recovering or reconstruction strategies. 1. Introduction The resilience of Energy System (ES) can be understood as the ability of critical infrastructures to prevent damage before disturbance events, mitigate losses during the events, and improve the recovery capability after the events [1, 2]. The main stages of the ES resilience research scheme are presented in Figure 1. The resilience research starts with collecting information about the ES current state and development strategies, choosing the disturbance types and measures to enhance the ES resilience. The central role in the ES resilience research plays the vulnerability analysis [3]. The vulnerability characterizes the scale of negative system consequences caused by a disturbance impact on ES. The vulnerability analysis begins with the generation of a set of the possible ES states that reflect the most representative characteristic combinations of external conditions of the ES development and functioning during the given time period. Also according to the chosen types, the disturbance scenarios are created. Further, the vulnerability analysis is performed from three perspectives: global vulnerability, critical components, and spatial vulnerability. [4, 5]. Each of the perspectives is characterized by its own methods of modelling disturbances and evaluating the consequences of their impact. A disturbance is generally modelled as a deformation of the ES structure and degradation of the functional capabilities of the ES elements. In general, the efficiency assessment of the resilience enhancement measures and checking their acceptability are the same for all vulnerability analysis subclasses. One of the main effects of Copyright © 2020 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). resilience enhancement measures is reducing direct and indirect damage due to the energy resources shortage. Finally, experts choose the most effective measures that are invariant respect to some subset of conditions and disturbance types and makes decisions about their implementation. Energy system Resilience Disturbance types development and enhancement functionality data measures Generation of the possible ES states and disturbance scenarios Global vulnerability Determination of Spatial vulnerability analysis critical elements analysis Effectiveness assessment of the resilience enhancement measures and check of their acceptability The selection of invariant resilience enhancement steps and decision-making on their implementation Figure 1. The main stages of the ES resilience research scheme. In order to accurately represent standalone and integrated ESs when assessing their resilience, some issues have to be taken into account [6]. For example, a particular ES should be considered at the most detailed technological level while an integrated ES can use the more aggregated representation. A software platform (Figure 2) for the ES resilience research should enable accurate and comprehensive scenario of awareness by integrating data from both the surrounding environment and the behaviour and functional state of systems. Also, it should provide scenario analysis to i) assess risks to mitigate impacts, ii) compare repair and reconstruction strategies, iii) support the business case for investing into the ES resilience [7]. The creation of the software platform implies the adoption of the specific and suitable ES models, retrieving geospatial data from multiple sources. Thus, the Geographic Information System (GIS) and Database Management System (DBMS) are the key information technologies to build a visual representation of the disturbances consequences and graphical user interface for the resilience enhancement measures efficiency assessment [8]. The rest of the paper is structured as follows. In Section 2, we give a brief overview of the ES resilience assessment frameworks and the correspondent decision making assistance software. Section 3 presents a framework for preparing and transformation semi-structured data as the first part of the software platform. A framework for automate creation of a database application as the second part of the software platform is proposed in Section 4. Section 5 describes the application of the software platform to develop a workbench to find the ES critical components. Section 6 concludes the paper. Figure 2. The architecture of the software platform providing the ES resilience study. 2. Related work A range of approaches have been proposed in the literature for the resilience assessment [9, 10]. Resilience assessment frameworks are different in objective and scope based on type of the assessment, type of the system, and type of the disruptive event [11]. Ouyang et al. developed a three- stage decision-making framework [12] to protect system components against intentional [13] and spatially localized [14] attacks. Fang and Zio formulated resilience enhancement problem as a robust optimization [15, 16]. Ouyang et al. introduced four mathematical models and their solution algorithms for exactly identifying the optimal protection strategies against worst-case malicious attacks and natural hazards [17]. Sandia National Laboratories have developed a general framework and complex software for assessing the resilience of all types of engineered and economic systems to help developers and policy makers identify critical system vulnerabilities [18-20]. Nowadays there are several efforts to create the software frameworks for the resilience assessment [21]. A software for the systemic seismic vulnerability and risk assessment of complex systems has been developed in the SYNERG-G project [22]. A new concept of decision support system for all phases of the risk and vulnerability analysis capable to work in both the operational and simulation modes has been presented in the CIPCast [23]. The HAZUS platform was developed for estimating risks from natural hazards on the built-environment [24]. Thus the resilience assessment process is quite complicated and particularly a number of challenges for modeling and simulating ES exist [4]. Our proposed approach to deal with them is the software platform that enables the flexible prototyping and fast implementation of applications so-called workbenches. It should be noted that this platform is of a general character and must be adapted to the particular task of the resilience research for example vulnerability analysis. In other words, an application prototype before usage has to be fulfilled with expert knowledge, specific tools and ES models. 3. Framework for extracting and transforming subject data Usually, the initial data for the ES resilience study is the statistical information presented in Microsoft Excel or Comma-Separated Values (CSV) format. The subject data in its form are semi-structured. Despite the machine-readable format, there is no meta-information in the input data describing the roles of the values. It is difficult to identify the headers and data placement and the relationships between data sections. The researcher must make additional efforts to extract, clean and convert the input data into the target format. We developed algorithms and framework for marking up and transforming data from semi- structured sources into target formats of scientific applications. The framework prototype includes a markup tool and transformation modules. The markup tool provides the researcher the ability to visually customize and specify the process of transforming data needed to solve a particular class of problems. Transformation modules provide the creation and transformation of data into target structures of specific types. The general scheme of marking up and transforming is shown in Figure 3. Figure 3. Marking up and data transformation scheme. The markup and transform scheme is as follows: 1. Loading semi-structured data. The framework allows one to load semi-structured files in MS Excel and CSV formats. After that the researcher can view data was a spreadsheet form and visually shape the structural model of the source data. 2. Defining entities names. Using the markup tools the researcher determines the names of entities. Entity names can be selected from the corresponding cells or written by the user. 3. Defining ranges of entities in semi-structured data. The researcher visually sets the position of the beginning (upper left cell) and end (lower right cell) for each entity on the sheet. It is assumed that a semi-structured data sheet can have either one or several tables. Moreover, the user can split one table into several ones by setting boundaries for each table. 4. Defining attributes of entities and domains. The user visually define which cells from the range specified in the step 4 are attribute names. Also domains of attributes can be specified. 5. Defining references between entities. The user can specify the references between some tables defining what attributes implement these references. 6. Setting transformation rules. At this step, transformation rules are configured. For example, user can specify a rule for splitting attributes into several attributes or assign conditional processing of values using the construction «if … then … else …». 7. Creating structural specification. The description of the initial data scheme can be extended with additional structures to provide the formation of complex target structures. For example, such an extension can maintain a hierarchical structure. The knowledge model about the markup and transformation rules are saved to a structure specification file. Next, the specification can be processed by data transformation modules into specific target formats or loaded into a markup tool system for correction. 8. Transforming source data. Transformation modules usually start execution from markup tool. The Application Programming Interface (API) for interacting external modules is implemented in the markup tool. API methods provide access to semi-structured data via the structures of the created model. The API allows us to support interaction with different transformation modules without modification of the markup tool. As of today, we developed translation modules into XML and JSON formats. These modules allows us to create target structures taking access to the generated model and data by means of API. Schemes of target structures for XML and JSON are set using templates in the same file formats. In addition to other constructions, the templates contain specific tags. Values from table fields are associated with tags. The specification created using the markup tool is enough to generate a database. We implemented a module that provides the generation of relational database schemas based on the specifications and filling it with data via API. The structural specifications can be applied many times in solving typical problems of data extraction and transformation, for example, in statistical information processing for different periods are used. 4. Framework for Database Application Develop For ES resilience assessment, an expert needs to be able to interact with source data, prepare ES model data for calculations, configure and run computing modules, and view calculation results. We used the GeoARM [25-26] framework to create an information system for ES resilience study provision. The GeoARM allows one to device a full-featured database application by developing Specifications of Database Applications (SDA). However, such specifications are rather small and do not contain code duplicates. The SDA is to provide the minimum required information in its pure form about database tables, their fields, links between them and their usage in the database application. All the other tasks are performed by general algorithms, controlled by SDA. GeoARM allows us to interactively create specifications for database applications and execute specification-driven algorithms. The general SDA-directed algorithms for generation of user interfaces, interactive query building, report generation, GIS interaction have been implement. Some nonstandard tasks can further be solved by plugin modules, which extend the capabilities of the main application. GeoARM allows programmer to provide access to most modern DBMSs (MS SQL Server, Oracle, Interbase, FireBird, PostgreSQL, MySQL, SQLite, etc.). The Workbenches being created with the help of GeoARM provides interaction with the entities of the database as tables and individual records, and also allows one to build user queries. The composition of controls and the style of working with fields of tables or views is determined automatically based on information from the specification. For example, in tabular mode, lists of values are automatically generated for the lookup fields, and if we work with several fields of the source table, the sequence of their selection can be figured out. In form mode, visual interface elements are automatically created depending on the specified fields types in the SDA. The user can also work with records of details tables if the corresponding relationships of the “master-detail” type were specified for the table in the SDA. The GIS module is integrated into the GeoARM. This module is implemented using the GIS ToolKit package from the GIS Panorama. Standard map viewing mechanisms, such as loading a map, scaling, dragging and dropping a map, drawing, deleting an object, receiving information about an object are implemented in the module. GIS module allows one to create and load digital maps, create objects on maps, view information about objects and bind objects with database records. Each application created using GeoARM has GIS functionality. 5. A workbench to find the ES critical components The applicability of the proposed approach is demonstrated on the example of supporting the critical components perspective of ES vulnerability analysis. An ES sample is the Unified Natural Gas Supply System of Russia. Its network consists of the 382 nodes (including 28 sources, 64 consumers, 24 underground storages, and 266 compressor nodes) and 486 arcs representing main pipelines and branches to distribution networks. The network is represented as a graph G  ( N , E ) , where N is a set of nodes, E  i, j  : i, j  N, i  j is a set of oriented arcs, the arc i, j   E represents energy transport, i and j are the starting and ending nodes of the arc i, j  , respectively. The flow over the arc i, j   E and its capacity (the maximal flow) are denoted by yij and bij , respectively. We consider the minimum cost flow problem that is related to determining the maximum flow z st with lowest cost between a common source (node with the index s ) and sink (node with the index t ). This problem is formulated as follows [27]:  kij yij  min , i , j E (1)  z st , if j s,   yij   y ji  zst , if j t , (2) iN j iN j  0 otherwise ,  0  yij  bij , (3) where kij is the flow cost over i, j   E , N j is the subset of input arcs for node j , N j is the subset   of output arcs of node j . Equation (2) ensures that the input flow and output flow for any node will be equal. The flow constraints in equation (3) ensure that the flow over any arc will be non-negative and will not exceed its capacity. The network configuration is stored in a set of text files, thus the ES model initial data source is semi-structured. We use the Framework for extracting and transforming subject data for import the ES model initial data into a database. The Workbench of researcher (Figure 4) being created with the help of GeoARM provides interaction with the entities of the ES database as tables and individual records, and also allows one to build user queries and display information as digital maps. Researcher can model critical situations by changing the characteristics of the ES objects and calling computational modules. The tables of the solutions data are filled in as a result of the execution of external modules which are launched by means of the plugin engine. Further, the researcher can generate a map with the simulation results if the database has fields with the coordinates of the objects. We can visually build queries on resultant data tables and display the query results in a GIS (Figure 5). In this case, we set the color of objects on the map depending on the values of a specific field of the query result. We also built a view for aggregating solutions data using DBMS tools and implemented access to it using GeoARM (Figure 6). Figure 4. The workbench for the ES resilience assessment. Figure 5. The GIS module. Figure 6. The aggregated view of the solution data. 6. Conclusions In the paper, we considered the problems concerned supporting ES resilience research. Conducting the studies requires a lot of efforts to prepare data, process data, perform calculations and analyze the results. Often the source data are semi-structured and requires conversion into target formats for further calculations and analysis. The amount of data describing ES is quite big and requires the use of modern DBMS. Also, the research support requires user-friendly software that allows one to process data, run calculation modules, analyze and display the results. We have developed a software platform to support ES resilience research. The platform consists of two main information systems: a system for extracting and transforming data from semi-structured sources and a researcher's workbench. Both systems are based on structural specifications that allow standardized solutions to common problems. The developed platform allows us to solve the following tasks: • Extract source data from semi-structured sources and load them into the database, • Interact with the database through a convenient user interface, • Execute external calculation modules, • Conduct data analysis: build queries to the database, build thematic maps in the GIS. An example of the Workbench to support finding the ES critical components was considered. It is shown that the described software platform provides the flexible prototyping and fast implementation of applications. And in comparison with other approaches, the main advantage of proposed platform is that it is applicable for all stages of the ES resilience research starting from risk mitigation assessment and ending with comparing alternative recovering or reconstruction strategies. Acknowledgments The research was supported by the Program of the Fundamental Research of the Siberian Branch of the Russian Academy of Sciences, project no. III.17.5.1 (reg. no. AAAA-A17-117030310451-0). The study in developing the GeoARM framework and creating Researcher workbench was provided within the same program, project no. IV.38.1.2 (reg. no. АААА-А17-117032210079-1). The algorithms and framework for marking and transforming data from semi-structured sources were developed with support by the Russian Foundation for Basic Research, project no. 19-07-00097-a (reg. no. АААА- А19-119062590002-7). References [1] Gasser P, Lustenberger P, Cinelli M, Kim W, Spada M, Burgherr P, Hirschberg S, Stojadinović B and Sun T Y 2019 A review on resilience assessment of energy systems Sustainable and Resilient Infrastructure pp 1–27. [2] Bhusal N, Abdelmalak M, Kamruzzaman M and Benidris M 2020 Power System Resilience: Current Practices, Challenges, and Future Directions IEEE Access 8 pp18064–18086. [3] Zio E 2016 Challenges in the vulnerability and risk analysis of critical infrastructures Reliability Engineering & System Safety 152 pp 137–150. [4] Johansson J and Hassel H 2010 An approach for modeling interdependent infrastructures in the context of vulnerability analysis Reliability Engineering & System Safety, 95(12) pp 1335–1344. [5] Johansson J and Hassel H 2012 Modeling, simulation and vulnerability analysis of interdependent technical infrastructures Risk and Interdependencies in Critical Infrastructures: A Guideline for Analysis.ed P Hokstad, I B Utne and J Vatn (London: Springer-Verlag) pp 49–66. [6] Arteconi A 2018 An Overview about Criticalities in the Modelling of Multi-Sector and Multi- Energy Systems Environments 5 p 130. [7] Taraglio S, Chiesa S, La Porta L, Pollino M, Verdecchia M, Tomassetti B, Colaiuda V and Lombardi A 2019 Decision Support System for smart urban management: Resilience against natural phenomena and aerial environmental assessment Int. J. Sustain. Energy Plan. Manag. 24 pp 135–146. [8] Giovinazzi S, Pollino M, Kongar I, Rossetto T, Caiaffa E, Di Pietro A, La Porta L, Rosato V, and Tofani A 2017 Towards a Decision Support Tool for Assessing, Managing and Mitigating Seismic Risk of Electric Power Networks Proc. of the Int. Conf. Computational Science and Its Applications vol 10406, ed Gervasi O, Murgante B, Misra S, Borruso G, Torre C M, Rocha A M A C, Taniar D, Apduhan B O, Stankova E and Cuzzocrea A (Springer, Cham) pp 399–414. [9] Sharifi A and Yamagata Y 2016 Principles and criteria for assessing urban energy resilience: A literature review Renewable and Sustainable Energy Reviews 60 pp 1654–1677. [10] Kröger W. 2019 Achieving Resilience of Large-Scale Engineered Infrastructure Systems Resilient Structures and Infrastructure ed Noroozinejad Farsangi E, Takewaki I, Yang T, Astaneh-Asl A and Gardoni P (Springer, Singapore) pp 289–313. [11] Moslehi S and Reddy T A 2018 Sustainability of integrated energy systems: A performance- based resilience assessment methodology Appl. Energy 228 pp 487–498. [12] Ouyang M, Dueñas-Osorio L and Min X 2012 A three-stage resilience analysis framework for urban infrastructure systems Structural safety 36 pp 23–31. [13] Ouyang M and Fang Y 2017 A mathematical framework to optimize critical infrastructure resilience against intentional attacks Computer‐Aided Civil and Infrastructure Engineering 32 pp 909–929. [14] Ouyang M 2017 A mathematical framework to optimize resilience of interdependent critical infrastructure systems under spatially localized attacks EUR J OPER RES 262 pp1072–1084 [15] Fang Y and Zio E 2019 Resilience Management of Infrastructure Systems from a Multistage Decision Making Perspective Proc. of the 29th European Safety and Reliability Conference (Hannover, Germany) pp 3382–3389. [16] Fang Y P and Zio E 2019 An adaptive robust framework for the optimization of the resilience of interdependent infrastructures under natural hazards EUR J OPER RES 276 pp 1119–1136. [17] Ouyang M, Liu C and Xu M 2019 Value of resilience-based solutions on critical infrastructure protection: Comparing with robustness-based solutions Reliability Engineering & System Safety 190 p106506. [18] Vugrin E D, Warren D E, Ehlen M A and Camphouse R C 2010 A framework for assessing the resilience of infrastructure and economic systems Sustainable and resilient critical infrastructure systems ed Gopalakrishnan K and Peeta S (New York: Springer) pp 77–116. [19] Vugrin E D, Turnquist M A and Brown N J 2014 Optimal recovery sequencing for enhanced resilience and service restoration in transportation networks IJCIS 10 pp 218–246. [20] Turnquist M and Vugrin E 2013 Design for resilience in infrastructure distribution networks Environment Systems & Decisions 33 pp 104–120. [21] Newman J P, Maier H R, Riddell G A, Zecchin A C, Daniell J E, Schaefer A M, van Delden H, Khazai B, O'Flaherty M J and Newland C P 2017 Review of literature on decision support systems for natural hazard risk reduction: Current status and future research directions Environ. Model. Softw 96 pp 378–409. [22] Franchin P 2014 A Computational Framework for Systemic Seismic Risk Analysis of Civil Infrastructural Systems SYNER-G: Systemic Seismic Vulnerability and Risk Assessment of Complex Urban, Utility, Lifeline Systems and Critical Facilities vol 31., ed Pitilakis K, Franchin P, Khazai B and Wenzel H (Springer, Dordrecht) pp 23–56. [23] Di Pietro A, Lavalle L, La Porta L, Pollino M, Tofani A and Rosato V 2016 Design of DSS for Supporting Preparedness to and Management of Anomalous Situations in Complex Scenarios Managing the Complexity of Critical Infrastructures: A Modelling and Simulation Approach ed Setola R, Rosato V, Kyriakides E and Rome E (Springer International Publishing, Cham) pp 195–232. [24] Durham S D, Johari P and Bausch D 2008 Strategic directions in seismic modeling: HAZUS® development and current applications for catastrophe planning Risk Assessment Modeling and Decision Support. ed Bostrom A, French S P and Gottlieb S J (Springer Verlag) pp 101–116. [25] Bychkov I V, Hmelnov A E, Fereferov E S, Rugnikov G M and Gachenko A S 2018 Methods and Tools for Automation of Development of Information Systems Using Specifications of Database Applications Proc. of the 3rd Russian-Pacific Conf. on Computer Technology and Applications (RPC) pp 1–6. [26] Hmelnov A and Fereferov E 2019 Development of cross-platform problem-oriented systems using specifications of database applications CEUR Workshop Proceedings: Proc. of the 2nd Scientific-Practical Workshop Information Technologies: Algorithms, Models, Systems (ITAMS'2019) vol 2463 pp 59–69. [27] Ford L R and Fulkerson D R 1962 Flows in networks (Princeton: Princeton University Press).