Testing-Oriented Development and Open-Source Documentation of Interoperable Benchmark Models for Energy Systems

This article provides novel fundamental tools for the open-source design and documentation of benchmark network models. The procedure for model development is motivated and described in detail in all its different phases: after an initial discussion on the relevance of open-source benchmark models, particularly in the context of an interoperable power system, the general conceptual framework for model documentation, based on the holistic test description and PreCISE paradigms, is presented. Building up on this theoretical basis, the procedure for model development is structured according to a testing-oriented approach, providing clear examples on how to map and translate the proposed conceptual framework into a practical and complete model description. Finally, to demonstrate the applicability and usefulness of the proposed method, a complete example of model documentation for a developed low-voltage network is described and validated in simulation. The complete model description is publicly available online as a guide and reference for the proposed model documentation procedure.


I. INTRODUCTION
As a result of ambitious environmental targets and rapid technological developments, there is substantial effort in delivering decarbonized and digitalized power systems that are at the same time "green," reliable and efficient. In the context of this significant paradigm shift in the electricity grid, it is important that researchers and practitioners have the proper tools to develop and test novel solutions while dealing with increasing levels of complexity and uncertainty. One key aspect in this regard is the availability of versatile benchmark models that can be used to test and evaluate new approaches and techniques.
In the electrical power systems area, there is a long history of contributions on this topic by international technical organizations. By 1991, IEEE had published its first test feeder model [1], managing its updates [2] while also developing alternative models tailored for specific topics ranging from reliability [3] to small signal oscillations [4]. Similarly, the benchmark models developed by CIGRE in 2014 [5] on the basis of real-world grids have been customized and widely utilized by the research community [6], [7], [8], [9].
In recent years, the development and utilization of benchmark models has focused on a wide array of different elements and aspects of the electricity grid. For example, at the high and medium voltage level, [10] combines IEEE and CIGRE models to create a new benchmark network to assess the impact of large PV plants, while [4] provides six different benchmarks for the analysis of small-signal oscillatory dynamics. In the area of low voltage (LV) networks, several studies have developed benchmarks that rely on real networks and data [11], [12], [13] or are tailored on specific topics, such as frequency response analysis [14], reliability studies [15], or power hardware-in-the-Lloop simulations [16], [17]. Microgrids (MG) have also been analyzed in detail, with the development of ad hoc benchmark models aimed at evaluating their operation in LV networks [18], assessing the impact of local generation and storage devices [19], or simulating specific scenarios such as networked MGs [20].
The wide range of available models represents a useful tool for research and development activities in the electricity grid sector. However, the implementation and usage of these models are generally not straightforward, as many technical and operational details are not publicly available and advanced simulation modeling procedures may often be required. Moreover, the different models lack interoperability, as there is no homogeneity in the design principles and in the documentation procedure, which complicates their exchange, interconnection, and tuning.
The necessity to overcome these limitations has been recently highlighted by the establishment of the CRESYM initiative [21], with the objective of accelerating standardized open-source modeling practices. This project follows other recent attempts to improve the existing situation. As an example, a novel methodology is presented in [22] for a more systematic model creation, while [11], [12], and [23], include all the relevant datasets associated with the benchmark models. Moreover, some papers directly provide network model files in RTDS/RSCAD [17] or Simulink [24] for straightforward implementation. Nonetheless, to the best of our knowledge, limited work has been reported in the field of holistic and comprehensive description of the benchmark models, with the objective of promoting their interoperability and facilitating their efficient and flexible replication and utilization in an open-source fashion.
The existing standards providing a codified approach for the documentation of complex architectures, such as the IEC 813469 standard [25], adopt a general purpose perspective that is applicable to a wide range of industrial systems and products, but might be unable to capture some specific features of energy networks, such as their dynamic behavior or the testing and validation procedures of their individual components. When more specific standards are developed, such as the ISO/IEC/IEEE 42010 standard [26] or the framework designed within the arrowhead project [27], these tend to focus mostly on software and on ICT networks and typologies, hence incommoding their application on benchmark energy networks. Moreover, most of the established standards, such as for example, [25] and [26] are not open-source and therefore not directly available to the power system community.
The present work aims at bridging this research gap by introducing a methodology that is specifically tailored to modern energy system benchmarks and that provides a codified and an extensive paradigm for their open-source model documentation. On the basis of a practical testing-oriented framework and through the application of novel paradigms such as the holistic test description and PreCISE, this work provides a new comprehensive approach for the design and implementation of such benchmarks, supporting a simpler implementation and a faster replicability of the developed models. The analysis builds up on the preliminary concrete example benchmark presented in [28], which has been developed with the help of this methodology. In [28], the technical aspects of the example power system model are discussed in detail. In this article, the focus is instead put on the process of its step-by-step open-source characterization and documentation, in order to facilitate its practical implementation by interested external users and practitioners.
The rest of this article is organized as follows. In Section II, the open-source model documentation in the context of systems' interoperability is discussed. The holistic test description and the PreCISE frameworks that are adopted to deliver an open-source modeling approach are discussed in Section III. In Section IV, guidelines for the testing-oriented development and open-source documentation of benchmark networks are given, while a case-study is employed to validate the proposed approach in Section V. Finally, Section VI concludes this article.

II. OPEN-SOURCE MODELING AND DOCUMENTATION IN THE CONTEXT OF INTEROPERABILITY
Over the years, researchers have identified a number of different motivations for companies and individuals to engage with open-source systems and technologies [29], [30]. Opensource systems provide their users with both free access and the ability to modify the content and the source code. A key enabler for the growth of software (but also hardware) industries is interoperability. Interoperability is the property that allows for the unrestricted sharing of resources between different systems. It defines the ability of two or more components or systems to exchange information and to use the information that has been exchanged. Interoperability is a major requirement for industries and governments in a society that increasingly moves toward global collaboration and integration. Open source is perceived as one of the best ways to enable interoperability between different technologies and applications. That is because the best way to build things that work together is when a group of people or companies also work collectively, creating something they can all use.
Undeniably, interoperability is key for technical implementations in many technological areas. Among others, it is very important for the medical and health care industry [31], [32], computer science and software engineering [33], [34], and the energy and power systems [35], [36], [37]. However, it was soon identified that interoperability goes beyond technical implementations. To achieve meaningful interoperability of simulation systems on the technical level, a system design principle that deals with the interrelationships of components is needed, making composability of the underlying conceptual models a necessary requirement.
To cope with the different levels of interoperation of modeling and simulation applications, the levels of conceptual interoperability model (LCIM) [38] has been developed. LCIM introduces technical, semantic, syntactic, dynamic, and conceptual layers of interoperation and demonstrates how the aforementioned layers are associated with the ideas of integratability, interoperability, and composability. The model has been successfully applied in various domains, such as systems engineering in modeling and simulations [39], informatics [40], and cybernetics.
Interoperability in document engineering (i.e., specifying, designing, and implementing the documents and the processes that create and consume them) has been particularly supported by open source and open standards. The authors in [41] look to open source as the best way to enable interoperability between different technologies and applications, analyzing at  [43] examine how the strategic use of open source in company contexts can provide effective support for addressing the fundamental challenges of lock-in, interoperability, and longevity of modeling and associated digital assets. Standardization in documentation as a means to achieve interoperability, has been also investigated in the context of e-Government, digital library services, and scientific (including experimental) applications. For instance, Pankowska [44] examines how interoperability is built into the public administration engineering process, while Walshe [45] discusses the creation of an academic selfdocumentation system through digital interoperability.
In the specific context of energy networks modeling, Widl et al. [46] introduce the PreCISE approach, which aims at improving interoperability in the context of documenting and implementing simulation experiments. This enables experts to exchange models and setups independently from specific simulation tools or modeling languages. For these reasons, the PreCISE paradigm has been selected as the framework of choice for supporting the modeling documentation presented in this work, as discussed in detail in subsequent sections.

III. OVERVIEW OF FORMAL METHODS FOR DEFINING TESTS AND BENCHMARKS
The paradigms and concepts that have been considered for open-source modeling and documentation in this work are presented in this section, highlighting their key methodological and design principles. The application for designing benchmark models is described in the next section.

A. HOLISTIC TEST DESCRIPTION
The process of defining a benchmark model for a modern power or energy system is remarkably similar to describing a laboratory experiment to be replicated in more than one smart grid laboratory. Smart grid laboratories come in many varieties-the available devices, the network size and layout, the control and automation capabilities, and the overall purpose of the labs can vary greatly between two facilities. This is analogous to the differences between simulation tools, where each comes with a specific set of features and component models as well as a specific focus which is reflected for instance in the types of solvers used or the depth of detail. It is therefore no coincidence that the approach for describing benchmark models used in this work is based on the so-called holistic test description (HTD) [47].
The HTD is a procedure for system integration and testing, designed to improve interoperability of power system applications by describing system-level tests in a infrastructureindependent manner. It comprises a set of textual templates [48], which allow to identify and define the essential parameters and procedural steps for conducting a lab test. The HTD also defines a partial processes that may be employed to structure, refine and document the testing procedure. To this end, it introduces three main levels of test definitions, where each references the previous level, leading to an incremental scoping of a concrete lab test: 1) A test case (TC) provides a set of conditions under which a test can determine whether or how well a system, component, or one of its aspects is working given its expected function; 2) A test specification (TS) defines the test system, which parameters of the system will be varied and observed for the evaluation of the test objective, and in what manner the test is to be carried out (test design); 3) The experiment specification (ES) defines by what exact means a given TS is to be realized in a given laboratory infrastructure. A TC formulates key objectives and the context of a test, whereas the TS and the ES provide a concrete foundation for the actual test execution

B. PRECISE APPROACH
While the HTD is directed toward the transfer of experiments between laboratories and the design of multilaboratory experiments, its basic concept can also be applied to simulation experiments. To this end, the PreCISE approach [46]-an approach for preparing concise information for simulation experiments-has been developed on top of the HTD.
The PreCISE approach re-uses the main concepts of the HTD (such as TC, TS, and ES), but additionally provides support for aspects specific to simulation experiments (such as model descriptions, control function definitions, or objective functions). Its main purpose is to improve interoperability in the context of modeling and simulation by facilitating the collaboration among experts using different toolchains and modeling paradigms.
Like the HTD, the PreCISE approach is implemented with the help of textual templates, which describe simulation experiments (and relevant associated data) independently of specific models, tools or methods. When filled adequately, these templates contain all the information required for implementing different types of simulation-based applications (characterization, validation, verification, optimization).
For a modeler implementing a simulation experiment in a specific toolchain, the extraction of relevant information from the PreCISE templates can be formally understood as compiling an ES. Conceptually, an ES describes the implementation of a simulation setup, going into the details of the used models and tools. As such, the PreCISE approach does not provide direct support for compiling an ES, because it is in general closely tied to a specific toolchain or modeling paradigm and therefore out of the scope of the PreCISE approach.

IV. OPEN-SOURCE DOCUMENTATION OF BENCHMARK NETWORKS
As it has already been highlighted, open-source benchmark networks constitute a fundamental tool for improving interoperability and addressing the complexity of modern power and energy systems, which are highly decentralized and digitalized. Constituting the main proposal of this article, in this section, the proposed procedure for the development of open-source documentation of such benchmark networks will be presented, focusing on the applicability of the HTD and PreCISE approaches, which were extensively discussed in the previous section. An overview of the proposed procedure and the corresponding evolution from the testing-oriented benchmark network development to its PreCISE-based documentation is shown in Fig. 1. As discussed in detail in Section IV-A, the model development will be driven and informed by the identification of the test cases of interests (Step I), analyzed with the support of the HTD framework. Section IV-B then describes how, building up on this testingoriented basis, the benchmark model is first designed (Step II) and then documented in detail through the PreCISE paradigm (Step III).

A. TESTING-ORIENTED DEVELOPMENT OF BENCHMARK NETWORKS
In the literature, a variety of benchmark energy networks is available, especially for the electrical domain. Most of these electrical networks correspond to feeders of active distribution networks and microgrids and have been proposed in an effort to investigate the effects of distributed energy resources (DERs) in power systems [10]. Moreover, in some cases, such benchmark networks correspond to modified versions of existing feeders, such as the widely used CIGRE medium voltage (MV) benchmark electrical network. On the other hand, nowadays, the complexity of the energy networks under consideration has substantially increased beyond DERs penetration. In fact, new arising issues have to be investigated, such as the modern lower and higher level controls, multienergy optimization, islanded operation of microgrids, cybersecurity aspects, and black start provision by grid-forming DERs among others. Hence, the benchmark networks suited for studying such integrated networks are themselves an interesting topic for research and development engineers.
Based on the above discussion, it is proposed that the interested party, whether this is a company or a researcher, initiates the development of such benchmark networks by identifying all the test cases that need to be addressed by the benchmark network under consideration. Note that such an approach has been considered in [22] too. In fact, this procedure can be facilitated by the HTD framework through its test cases template form, where the main characteristics and network requirements for each test case can be identified. As showcased in Fig. 2, a representative test case (TC #10) documented through the HTD approach contains all the basic information and components of the case study, before proceeding to the qualification strategy and the test specifications. This is referred to as Step I in Fig. 1.
Having developed the required test cases, the required topology and characteristics of the benchmark network can be identified. Therefore, either a fictional network can be designed based on an one-line diagram, or a real feeder that meets the abovementioned requirements can be selected. This is referred to as Step II in Fig. 1.
Nevertheless, the test cases under consideration (with their HTD documentation) and the one-line diagram of the network topology do not contain all the information required for performing the required investigations in a simulation experiment (see next section). Furthermore, aiming for developing a network which can be easily replicated and used by other interested parties, an open-source modeling approach is required.

B. UTILIZING THE PRECISE DESCRIPTION FOR BENCHMARK ENERGY NETWORKS
The assumption behind the PreCISE approach is that the diversity of challenges and obstacles encountered in energyrelated research must be met with an equal diversity of modeling paradigms and toolchains. The PreCISE approach is

TABLE 1 Overview of the Aspects of Simulation Experiments Covered by the PreCISE Approach
therefore an ideal framework for defining benchmark models, which are usable across the (artificial) boundaries of incompatible toolchains or modeling paradigms. Table 1 gives an overview of the aspects of simulation experiments covered by the PreCISE approach. Based on the description of these aspects, the PreCISE approach supports the following two tasks, which are of equal importance for improving interoperability and defining good benchmark models.
1) Documentation: The PreCISE approach provides the means to describe real-world systems and related simulation setups in a coherent way. It allows to define the context and definition of simulation-based assessments in a way that is independent of specific models or tools. The implementation of the PreCISE concepts as template documents allows to easily share this information with others. 2) Implementation: The PreCISE approach structures information in a way that enables experts to extract the information they need to create their own simulation setups. It also allows to provide sufficient information for comparisons of different simulation setups with a reference, in order to enable a consistency check across toolchains.
Indeed, both these tasks are critical for the development and open-source modeling of benchmark energy networks where a more detailed description than that contained in an one-line diagram of a feeder or a test case description is required. Hence, the template documents of the PreCISE approach can be utilized at this stage in order to describe the benchmark network under development at the component-level via an open-source approach. This is referred to as Step III in Fig. 1.
A nonexhaustive discussion of the modeling of various components that each PreCISE template can facilitate is provided in the following. and implementation of such algorithms can be described through this template. 7) Input data: To improve the fidelity of analysis or simulation, datasets that correspond to, e.g., weather data or devices usage patterns may be also provided to the interested parties, using this template. Following the development of such templates, the benchmark network under consideration can be modeled in the detail required for someone to replicate and employ it in their specific studies. An exemplary electrical benchmark network open-source documentation and replication is showcased in the next section.

V. CASE STUDY: ELECTRICAL BENCHMARK NETWORK
The methodology for open-source model documentation, described analytically in Section IV, is now applied to the concrete example originally introduced in [28]. The considered test case is a benchmark model of an LV electricity grid tailored for dynamical studies of microgrids. After the selection of the system according to the chosen testing objectives, its characterization according to the PreCISE paradigm is described in detail. Specific examples of the PreCISE system configuration and PreCISE model description are provided for particularly relevant system components. Finally, simulation results for the selected test specifications are produced in a MATLAB environment.

A. TESTING-ORIENTED DESIGN OF THE LV GRID
For simplicity and compactness, the benchmark model design presented in this work has been based on a single test case, i.e., the TC #10 "Evaluation of secure transition from grid-connected to islanded operation: Uninterruptible Power Supply" in the Erigrid 2.0 Test Case library [49], which has already been documented through the HTD (Step I). This test case focuses on microgrids and in particular on their capability of disconnecting from the main electricity grid and continuing their operation in islanded-mode in case of critical system conditions. The TC envisages diverse test scenarios to evaluate the behavior of the protection subsystems in response to electrical disturbances and to assess the voltage/frequency response in the microgrid as a result of its disconnection from the main network.
To properly capture these elements, the developed benchmark model envisages a 6-bus LV network connected to an MV grid equivalent voltage source (through an OLTC stepdown transformer) and to a small microgrid (through a circuit breaker), as represented by the network diagram in Fig. 3  (Step II).
The microgrid is composed of the resistive load P3 and the grid-forming inverter I2, i.e., the fundamental component that is responsible for maintaining the microgrid frequency at its nominal value when it operates in islanded mode. In order to test the microgrid disconnection in a wide range of operating conditions, different components have been incorporated in the LV network, including the asynchronous motor M1, a synchronous generator G1 and a grid-following inverter I1. Ad hoc measurement points for frequency and voltage have been placed at the coupling point of the microgrid and at relevant buses of the LV network for monitoring the different test scenarios. Moreover, the possibility of replacing the MV voltage source and the MV/LV transformer with a programmable LV source has been accommodated, so that relevant set points or disturbances for frequency and voltage can directly be introduced in the system.

B. PRECISE SYSTEM CONFIGURATION
Having designed the model, this is documented within the PreCISE framework (Step III) starting from its System Configuration, i.e., a general description of the benchmark system. According to the PreCISE template, this includes a short description of context, with the specification of the purpose of the model and a summary of its key figures (e.g., number of components, rated power and voltage, types of motors and loads). This initial general characterization is accompanied by the system breakdown (SBD) of the network, identifying,  and classifying hierarchically its relevant components. The associated diagram of the SBD is shown in Fig. 4.
In this specific case, the components of the network have been divided in three main categories.
1) Distribution grid: The fundamental components of the electricity network, including the MV equivalent voltage source, the MV/LV transformer, and the LV buses, lines, and circuit breakers. 2) Assets: The active and passive components that are connected to the grid infrastructure. 3) Microgrid: A simple microgrid composed by a static resistive load and a grid-forming inverter.
A brief description of each element in the block diagram is also provided, detailing the general features of the system components in terms of purpose, functionality, physical characteristics, and interfaces. For example, in the case of the grid-forming inverter (component #3.2 in the SBD of Fig. 4), it is specified that its general purpose in the microgrid is to allow the connection of renewable generators (modeled in this case as dc energy sources) by converting currents from dc to ac. Regarding the component functionality, it is clarified that the operation of the inverter is modeled with a Universal 3-Arm Bridge with ideal switches and that the device has the capability to maintain a set frequency within the microgrid when this operates in islanded mode. In terms of physical characteristics and interfaces, the main parameters of the inverter (e.g., snubber resistance/capacitance of the universal bridge and rated voltage) are identified and its electrical/data connections with the rest of the system are clearly defined. The development of a similar description for all blocks in the SBD of Fig. 4 completes the PreCISE system configuration, providing to the interested user a comprehensive overview of the network model in terms of purpose, components and interconnections. The full PreCISE system configuration for the discussed network model is available in [50].

C. PRECISE MODEL DESCRIPTION
The next step in the development of the PreCISE documentation is the preparation of a detailed model description where each network component is analyzed separately and in depth. In the rest of this subsection, the specific example of the grid-forming inverter is utilized to better convey the scope and purpose of the model description in its different parts. The complete documentation, prepared for all the component blocks in Fig. 4, is also available in [50].

1) CLASSIFICATION
The first step in the model description is the classification of the individual components in terms of modeling domain and intended use. In the case of the grid-forming inverter, it is specified that the system component is modeled, through an explicit functional representation, as a single modeling block which envisages time-continuous dynamics coupled with discrete events.

2) MATHEMATICAL MODEL
The core analytical part of the component modeling is presented. After the definition of the relevant physical quantities and parameters of the considered device, the mathematical equations describing its behavior are presented, specifying also their initial and boundary conditions. For clarity and compactness, the reader is referred to relevant sources for the classical equations of standard components and only the more relevant and specific equations are explicitly presented. In the example of the grid-forming inverter, the time-domain equations that describe the behavior of the droop control and of the voltage and current controllers are provided, together with a definition of the associated parameters.

3) TESTING
This last part of the model description is meant to support external users in the validation and utilization of the model components and in their ad hoc tuning for different kinds of applications. In the analyzed example of the grid-forming inverter, the provided information focuses on the validation of the model component. A qualitative description of the typical behavior of the inverter under standard system conditions is accompanied by a graphical representation of the associated power injection, together with instructions to replicate the shown result.

D. MATLAB IMPLEMENTATION AND SIMULATION RESULTS
For the demonstration purposes of the procedure presented in this work, the development of the system configuration and of the model description sections of the PreCISE documentation provide a self-contained and exhaustive characterization of the considered benchmark model. This documentation can then be used as reference for the actual implementation of the network model on a software simulation platform. In the present work, the model implementation has been performed in a MATLAB/Simulink environment. We wish to emphasize that the implementation procedure can be replicated with the same approach on different software, including open-source tools. The testing and validation of the model implementation has been conducted on the Erigrid 2.0 TC #10, considered during the initial design phase. In particular, the simulations have focused on the Test Specification 10.03, which aims at characterizing the capability by the grid-forming inverter to stabilize frequency and voltage in the microgrid after its transition to islanded operation. The test conditions have been replicated by using the ad hoc LV voltage source to replicate the necessary network frequency profile. To test the microgrid in islanded mode, it is envisaged that the synchronous generator in the LV grid begins to operate at t = 0.2 s and the voltage source is set to ramp down its frequency from t = 1 s to t = 2 s, with a slope of −0.5 Hz/s. At time t = 2 s, the network frequency reaches the threshold value of 49.5 Hz, the MG breaker is opened and the microgrid begins to operate in islanded mode. The frequency profile of the LV grid (blue trace) in this scenario is compared in Fig. 5 with the frequency measured in the microgrid (red trace). The two profiles are very similar in the first two seconds of the simulation and exhibit the same oscillations at about t = 0.25 s, due to the connection of the synchronous generator. After the MG disconnection at t = 2 s, it can be seen that the grid-forming inverter is able, after a short transient, to restore the MG frequency to its nominal value of 50 Hz. The power exchanged by the grid-forming inverter is represented in Fig. 6. After the initial oscillations at t = 0.2 s due to the generator connection, there is a clear impact of the gradual network frequency decrease after t = 1 s. Note in fact that the absorption of reactive power (expressed by convention with a positive sign) is gradually reduced until it is almost zero at the time of the MG disconnection. An opposite trend can be seen for the active power flow, which is reversed during the period of frequency increase and then, after the MG disconnection and some subsequent oscillations, reaches the value of −2 kW required to power the resistive load in the islanded MG. The voltage values measured at the grid-forming inverter terminals during the simulation have also been analyzed and their rms values  are reported in Fig. 7. After the transient behavior due to the connection of the generator at about t = 0.2 s, the voltage on the three phases is reduced between t = 1 s and t = 2 s as a result of the decreasing frequency. After the disconnection at t = 2 s, the resulting transient sees a relevant increase of the inverter voltage, which nevertheless returns close to its nominal value in about two seconds.

VI. CONCLUSION
The article presents a novel framework for the development and open-source documentation of benchmark models for power systems. The proposed method combines formal paradigms for testing and benchmark definitions (HTD and PreCISE approach) with a practical testing-oriented approach to deliver a structured procedure for modeling and documenting electrical benchmark networks. The methodology is described in detail in all its different phases, with clear examples and explicit mapping between the theoretical categorization concepts and the actual documentation steps. A complete example of model documentation of an LV network, accompanied by simulation results, is provided to facilitate the understanding and replication of the proposed methodology. Future work will focus on extending the scope of the presented approach, which will be validated over larger and more complex networks and applied to other elements of the energy sector (multivector systems, IT infrastructure, etc.). At the same time, a digital open-source database of benchmark models developed with the presented methodology will be created, in order to support researchers and practitioners of the sector and stimulate the creation of further open-source modeling resources.