Computers and Electrical Engineering

This paper proposes a co-simulator that combines OMNeT++ for communication systems with PSS/E for the electrical transmission network. The co-simulator applies an event-driven synchronization method that minimizes errors due to delays in the synchronization between both simulators. The synchronization method pauses the simulation of the power system at each communication event, while a supervisory module in PSS/E returns control to the event simulator if any condition from a pre-specified set is met. The proposed co-simulator is demonstrated on a protection system based on peer-to-peer communication and used to evaluate the effect of communication latency times on an online state estimator.


Introduction
Integration of information and communications technology (ICT) is increasingly relevant in power systems.ICTs affect many aspects of the operation and control of transmission systems such as monitoring, protection, demand response and wide-area control of power electronic resources.ICT systems add functionality to power systems and can improve their reliability and flexibility, but they can also contribute to failures if not thoroughly tested and they bring the threat of cyberattacks.It is therefore necessary to model the combined operation of power and ICT systems to assess its performance during normal operation and under abnormal conditions such as severe disturbances.
The main difficulties of simulating in a single platform the electrical network and communications technology arise from the different nature of both systems.On the one hand, mathematical models representing the dynamics of electrical networks include ordinary differential equations (ODEs) that are discretized and integrated with a constant or variable time step.On the other hand, communication systems are event-driven systems in which ODEs play no part.Computer simulators that integrate both systems must define a synchronization procedure that allows the coordinated progress of the numerical integration time and the event-based time [1].
The problem of interfacing power system and ICT simulators have been extensively studied during the last decade [2,3].Most proposed solutions are centered on distribution systems, applying smart grid concepts to distributed generation, aggregated loads or microgrids.These solutions combine an event-driven simulator for communications with a power system simulator centered on distribution systems such as EPRI's OpenDSS [4][5][6][7][8], or with a power system simulators intended for electromagnetic transients [9,10].It is however difficult to extend these solutions designed for distribution networks to the study of transmission systems for two reasons.Firstly, studies typically performed in transmission systems such as frequency control and rotor angle stability need extensive libraries with models of power plant controls (e.g.turbine governors, excitation systems and power system P. Ledesma et  stabilizers) and protections.These model libraries are currently found only in specialized software tools.Secondly, the sheer scale of modern interconnected systems, that may include hundreds of power plants and thousands of busbars, requires a dedicated, optimized software to solve the power flow equations and the numerical integration of the dynamic models.When power system monitoring, control and security assessment rely on synchrophasors [11], the problem of the computational load is aggravated by the volume of data that must be collected and sent across the system.
There is a number of open source tools to model transmission systems, such as MATPOWER/MatDyn, PYPOWER-Dynamics and GridPack [12].However, currently these projects are small in scale and their model libraries are limited.Two of the main software tools used by the industry to model large-scale transmission systems are PowerFactory by DIgSILENT and PSSE by Siemens.While there has been a number of works on co-simulation platforms that use PowerFactory [13][14][15], there is a lack of alternatives using PSS/E in spite of it being one of the tools most extensively used by transmission system operators (TSOs).Recent versions of PSS/E can be run from a Python interpreter, which facilitates embedding it in other platforms written for example in Python or C++.This opens new possibilities of interaction between PSS/E and event-based simulators.
The main contribution of this paper is a co-simulation platform based on OMNeT++ and PSS/E that coordinates the time-domain simulation of power networks with the event-base simulation of communication networks.The proposed method gives access to the extensive dynamic model library contained in PSS/E and makes it possible to take advantage of user models for specific components and power system cases already developed by TSOs.The platform is compared with other similar works and its performance is demonstrated by showing two basic applications of the co-simulation of transmission and communication systems: a back-up protection system based on peer-to-peer communication and an online state estimator based on an unscented Kalman filter (UKF).Co-simulation studies of communication and dynamic state estimators in transmission systems are scarce [16], and constitute a second contribution of this work.
The structure of the paper is as follows: Section 2 describes the general method adopted in this work; Section 3 puts it in context with other co-simulation studies; Sections 4 and 5 demonstrate the proposed method on two case studies; and Section 6 is the conclusion.

General approach
The simulation of the electrical network and the communication system must be arranged in such a way that they advance together and exchange information at critical points that, generally speaking, cannot be known in advance.To achieve this goal, the proposed co-simulator implements a master-slave architecture, represented in Fig. 1, in which the OMNeT++ simulator works as master and PSS/E as slave.The simulation of the power system is embedded in the Power System OMNeT++ Module that exchanges messages with other modules representing components of the communication system.
The PSS/E skeleton in Fig. 1 contains the model that represents the electrical network together with the most common power system components (synchronous machines, turbine governors, excitation systems, power system stabilizers, etc.).In addition to this basic structure, it is possible to write user models and integrate it with the skeleton.User models are primarily conceived to represent other dynamics present in the power system, but they can also be used for other purposes.In the proposed co-simulator, a new model called Synchronization Supervisor User Model (SSUM) takes charge of the synchronization between both simulators, applying the method described in Section 2.4.

P. Ledesma et al.
The Power System OMNeT++ Module runs together with other OMNeT++ modules representing relays, protection systems, centralized controls, etc.The Power System module is responsible for running the PSS/E simulator and for interacting with any other OMNeT++ modules that need to exchange information with it.For example, an OMNeT++ module representing a relay may send a message to the Power System Module asking for the measurement of a certain voltage or current.Another example is an OMNeT++ model representing a protection sending a message to the Power System Module with an order to open a certain automatic breaker to clear a fault.

Dynamic simulation of the power network
Modern interconnected power systems are represented by complex, nonlinear, discrete-continuous dynamical mathematical models.The equations that define the dynamic behavior of a power system can be formulated as [17]: where  ( ∈ R   ) is the vector of state variables, for example the angle and speed of the synchronous generators;  ( ∈ R   ) is the vector of algebraic variables, for example the magnitude and angle of the bus voltages;  ( ∈ R   ) are the controllable parameters, for example references of voltage and power in power plants;  ( ∈ R   ) are the discrete variables and  represents the time.Function  2).PSS/E is a transmission planning and analysis software used across the globe by many TSOs.It has been used in this work to simulate the electrical transmission network for two reasons: firstly, it contains an extensive model library of power system components such conventional power plants, control systems, non-synchronous power parks, HVDC lines, FACTS, load models and protection systems; secondly, it offers the possibility of using the power system models already developed and maintained by TSOs.
In addition to the standard model library, users can program their own models and include them in the simulation.User models must be developed in Fortran, compiled prior to the simulation and linked with the PSS/E skeleton.User models are usually designed to represent physical devices, but can also be used to retrieve run-time information and control the progress of the simulation.
Simulations in PSS/E perform a numerical integration of the ODEs that define the dynamics of the power system.PSS/E, like all power system dynamic simulators, is discrete time-driven, as opposed to communication simulators that are event-driven.In order to solve Eq. (1), PSS/E applies the explicit, two-step Adams-Bashforth method [18,19]: where  is the time step and subindexes  − 1,  and  + 1 represent the value of the corresponding variables at times  −1 ,   and  +1 , respectively.One feature of PSS/E that is central to the proposed co-simulator is that it is possible to run any PSS/E activity from a Python interpreter, which makes it possible to launch an instance of PSS/E from Python and embed it in a C++ program.

Simulation of communication networks
Communication networks can be modeled as event-driven systems.Following the formalism Discrete Event System Specification (DEVS) [20], event systems can be defined as the following 7-tuple: where  and  are the set of input and output events, respectively;  is the set of partial states;   ∶  → T ∞ is the time between the current event and the next event;   ∶  ×  → is the external transition function, where  = {(,   )| ∈ ,   ∈ (T ∩ [0, ()])} is the set of total states, with   being the elapsed time since the last event;   ∶  → T ∞ is the internal transition function;  ∶  →  is the output function.
In the case of a communication system,  is the state while a discrete event is being processed;   is the time between two consecutive events,   represents the effect of an input on the system state, and   represents the internal change of a state once the lifetime of the state is reached [21].

P. Ledesma et al.
The DEVS formulation can be also applied to the power system simulation, in which case  is the set of state variables,   is the time step , and   represents the change in the state variables after each integration step.
The co-simulation of the power system and the communication system can be described as a coupled DEVS defined by the following 7-tuple: where  and  are the set of input and output events, respectively;  is the set of sub-components, in our case  =  ,  where   represent the power system and  the communication network;   is the set of atomic DEVS models contained in the coupled DEVS, in our case both the DEVS models for the power system and the communication network;   and   are the set of external input couplings and the set of external output couplings, in our case they are both empty; is the set of internal couplings, in our case   = (  ,   ) ∪ (  , );  is the tie-breaker function in the case of simultaneous events.
The DEVS models defined in ( 4) and ( 5) are solved using OMNeT++ [22], which is a well-known event-driven simulator library and framework primarily designed for building network simulators.It is an open source, modular tool in which network components are modeled as separate modules written in C++ that exchange messages.In OMNeT++ the arrivals of new messages are the typical events that drive the simulation.
One of the main advantages of using OMNeT++ is the availability of external simulation models that cover a variety of protocols and technologies.Another important feature is that OMNeT++ facilitates the collection of data over multiple simulations to perform statistical analysis on the results.

Time synchronization
The coordination between the numerical integration of the ODEs defining the dynamics of the power system and the events produced by communication systems is a fundamental issue that all co-simulation platforms need to solve.
One simple method to coordinate time-domain integration and communication events is time-stepped synchronization, in which both simulators run independently and halt at fixed times to exchange information.This method is easy to implement and can be useful in certain cases when the frequency of the communication between both simulators is not critical [23].However, time-stepped synchronization can cause significant and cumulative errors because the exchange of information between simulators must wait until the next synchronization point, and may consume excessive computational resources if the simulation of the power system is forced to stop too frequently to check for relevant events.
This work implements an event-driven synchronization scheme in which the need for synchronization is checked at every time step and at every communication event.Fig. 2 shows the event-driven synchronization process, with the marks on the PSS/E timeline representing the integration time step .The default time step in a PSS/E dynamic simulation is one half of the period, this is 0.01 s at 50 Hz and 0.0083 s at 60 Hz, which is sufficient for the time scale of electromechanical oscillations in power systems [24].
OMNeT++ keeps a record of all future events in a list named List of Future Events (LFE).Every time an OMNeT++ module finishes processing an incoming message, it reads the time at which the next event in the LFE is scheduled and sends an order to the PSS/E simulator to continue its simulation until that time (Fig. 2(a)).Halting PSS/E at every OMNeT++ event ensures a perfect synchronization between both simulators, because each OMNeT++ event may trigger new future events at times that cannot be known in advance.
When PSS/E performs the simulation it checks a set of pause-simulation conditions at every iteration step.Two things may happen: 1. no condition is matched and PSS/E runs the simulation until the time of the next scheduled event (Fig. 2(b)), or 2. while PSS/E is running the simulation, one or more of the conditions is matched.Then PSS/E halts the simulation, inserts a new event and returns the control of the simulation to OMNeT++ (Fig. 2(c)).
This approach minimizes the errors because no delay is introduced in the exchange of information between both simulators.

Implementation
In the proposed architecture calls to PSS/E commands, or activities in the PSS/E terminology, are python commands embedded in the C++ code of the OMNeT++ Power System module.In every simulation there is one and only one Power System module that creates and maintains an instance of a PSS/E case.The rest of the OMNeT++ modules depend on the specific study carried out, and typically represent protections, measurement devices and control systems with their respective communication systems.
A new user model called the Synchronization Supervisor User Model (SSUM) is implemented as the part of the PSS/E executable, as shown in Fig. 1.The SSUM checks at every iteration step whether any condition that requires a pause in the PSS/E simulation is met.The SSUM is written in Fortran as a separate PSS/E user module, compiled before the simulation and linked with the main skeleton of PSS/E.Fig. 3 shows the information exchanged between OMNeT++ and PSS/E within the Power System module: Initialization.OMNeT++ launches an instance of PSS/E and orders the loading of a case and the initialization of the simulation.The initialization includes selecting the variables to be monitored (PSS/E channels), calculating the initial conditions of all the state variables, and calculating the derivatives in the initial state to check that the simulation begins in a steady-state regime.
Run simulation.OMNeT++ orders PSS/E to run a simulation until the time at which the next event is scheduled.
Modify system.OMNeT++ orders a change in the PSS/E simulation.This change can be for example the setting of a fault, a switching operation or a change in a control parameter.

Read variable.
OMNeT++ retrieves the value of a PSS/E variable, for example a bus voltage or a branch current.In typical studies electrical variables are needed by protections and measuring devices.

Pause information.
When the SSUM pauses the numerical integration, the power system OMNeT++ module sends a message with information about the condition that has paused the simulation to all subscribed OMNeT++ modules.This condition can be, for example, a current value that exceeds a setting in a protection modeled in OMNeT++.
P. Ledesma et al.Fig. 4 shows the general flowchart of the co-simulation platform.After the initialization of both simulators OMNeT++ processes its first event, which may trigger more events in the future, and reads the time of the next event in the List of Future Events.Whenever the next event is further down in the time horizon than the current simulation time in the power system, PSS/E is ordered to continue the simulation until it reaches the time of the next scheduled event.After each time step during the numerical integration, the SSUM in PSS/E checks the power system for conditions that must pause the PSS/E simulation.If such a condition is met, PSS/E pauses the simulation and returns control to OMNeT++.
The current PSS/E architecture imposes some constraints to the practical implementation of the proposed scheme: the cosimulator must be built on a Windows platform, a specific commercial Fortran compiler must be used to compile the SSUM, and a 32-bit version of OMNeT++ must be used to link it with the PSS/E dynamic libraries.Ref. [25] contains the basic set of files needed to execute an example of the proposed co-simulation platform.

Related works
Several co-simulation platforms of power systems and communications have been proposed, most of them during the last decade.This work shares some characteristics, and differs in others, with these platforms.Table 1 orders chronologically some of the most relevant co-simulators and summarizes their main characteristics.Given the difficulty of accessing the original data used to represent P. Ledesma et al. power systems in previous works, this section focuses on two main aspects: firstly on the scope of application and scalability of the cosimulator, and secondly on the method of synchronization.Other comparisons between co-simulators of power and communication systems can be found in [21,26,27]

Scope and scalability
A distinction can be made between co-simulators centered on distribution systems and/or microgrids, and co-simulators centered on large interconnected transmission networks.The different characteristics of distribution and transmission networks determines the selection of the power system simulator.The size of large interconnected systems requires specialized mathematical methods to solve the electrical network and a wide range of dynamic models to represent components such as power plants and their controls.As a result the scope and the scalability of each co-simulation platform are closely related, because it is difficult to apply a simulator designed for distribution networks to the transmission level.
A number of co-simulators centered on distribution systems use open-source software OpenDSS with the aim of supporting the integration of distributed resources in smart grids, as is the case of [32,34,27,36].These platforms cannot be extended to the dynamic analysis of power systems for lack of appropriate models and because OpenDSS performs time-driven loadflow analysis; this is, OpenDSS does not perform the numeric integration of the differential equations representing the dynamics of the power system.Li et al. [27] follow a similar approach but use GridLAB-D to simulate the distribution system.The time scale of the studies conducted in these works is frequently hours or even days, which makes the synchronization method less critical compared to transient stability studies.
Mana et al. [37] and Shum et al. [10] are also centered on the distribution level but use power system simulators that do perform dynamic simulations.This makes it possible to analyze the evolution of frequency and voltage in small distribution systems, although these co-simulators are still not applicable to transmission systems because GriLAB-D and PSCAD are not designed to represent large interconnected networks.
EPOCHS [28], ORNL [31], GECO [21], INSPIRE [33] and, more recently, Deng et al. [38] are able to simulate large interconnected systems.From a practical point of view the scalability of ORNL [31] is limited because its power system simulator, open source software THYME, lacks an extensive library model.The rest of these platforms use software tools extensively used by transmission system operators across the globe to represent large interconnected grids: PSLF by GE, DIGSiLENT by PowerFactory and PSS/E by Siemens.The proposed co-simulator shares this approach by using PSS/E, which guarantees the scalability of the simulator to handle large transmission systems.

Method of synchronization
Early co-simulators tend to use time-stepped synchronization, which has the problem of incurring in simulation errors as discussed in Section 2.4.Most recent co-simulators, however, apply event-driven synchronization techniques that pause the power system simulator when a relevant event occurs in the communication system.
Several works such as ORNL [31], GECO [21] and Greenbench [35] apply an event-driven synchronization in which each of the iterations of the power system dynamic simulation is treated as a discrete event, so that the list of future events contains all the power system iteration steps.This approach simplifies the synchronization but can be inefficient when communication events are scarce, as illustrated in Section 4.2.
PowerNet [30] applies a different type of event-driven synchronization in which the simulation only pauses at the times prescribed by the communication system simulator.It is not possible for the power system simulator to trigger a communication  event, for example if as a result of a fault an electrical variable crosses a threshold set in a relay, which can result in a loss of synchronization with the subsequent error.
INSPIRE [33] applies a synchronization method in which different simulators communicate with each other to determine the time frame in which it is safe to advance the simulation without risking the arrival of a new event.This approach is suitable for parallel computing and has the advantage of being easily adapted to new simulators, but it is not time-efficient and can produce errors when applied to simulators with different time steps.
The work by Deng et al. [38] has been included in this comparison because it integrates PSS/E in a co-simulator to perform dynamic studies in a large interconnected system.However, this work combines two power system simulators without any event-driven communication simulator, which makes synchronization easy if both power system simulators apply the same time step.
Compared to other co-simulators for large interconnected transmission systems this work applies an event-driven synchronization method that includes a supervisory module in the power system simulator This supervisor, here called the SSUM, pauses the simulation when it detects a relevant event such as a violation of a voltage or current limit in a protective relay, as described in Sections 2.4 and 2.5.This approach minimizes errors due to synchronization while maximizing the computation speed during periods of scarce communication events.

Description
The aim of this study is to demonstrate the performance of the co-simulation platform in a case that depends on peer-to-peer communication between remote agents.In order to provide a term of comparison with a previous study, the case is based on a distributed protection system described in detail in [21].The protection system consists of main and backup protections that communicate with each other without the intervention of a central control system.When a protection detects a fault in its own zone it trips immediately; when a protection detects a fault in a zone in which it is acting as a backup, it sends a query to the relays responsible for that zone and makes a decision based on the response.If the faults persists after 80 ms the backup protection trips.The breaker opening time is 60 ms.
The protection system is applied to the IEEE 39 Bus Test Case shown in Fig. 5.It consists of two distance relays protecting Line 4-14 at both extremes, and two distance relays connected in lines 3-4 and 4-5 that act as communication-based backup protections.A 3-phase short-circuit is applied in the middle of Line 4-14.The protection at bus 14 detects the fault and opens the line but the protection at bus 4 reports a failure, causing the back-up protections at substations 3 and 5 to trip.
During the simulation, OMNeT++ modules representing the relays subscribe to messages from the power system OMNeT++ Module.The SSUM in PSS/E monitors the impedance seen by the different relays, and when the impedance seen by a relay crosses its setting point the SSUM pauses the PSS/E simulation and the power system OMNeT++ module sends a message to the corresponding relays with the value of their fault impedances.Upon receiving this message each relay acts according to its fault impedance, which may correspond to a fault in the zone where it is acting as the main protection or to a zone where it is acting as a backup protection.
Communication links between protections in different substations are modeled with a 10 ms time delay.The time step in PSS/E is set at 0.01 s.For the purpose of simplicity, no background traffic is considered.

Results
Fig. 6 shows the sequence chart with the messages and events of the simulation.The fault is applied at time  = 0.As soon as the fault is applied, the SSUM detects fault impedances beyond the set points of the protections and sends messages to protections 3, 4, 5 and 14 with their corresponding fault impedances.The modules of the back-up protections at buses 3 and 5 send a QueryStatus message to the module of the protection at bus 4 asking for its current status, receive a failure message and consequently open their circuit breakers.The simulation of the power system in PSS/E is performed in 5 parts, pausing at 10, 20, 60 and 80 ms before continuing to the end of the simulation.Fig. 7 shows the voltage at substations 3, 5 and 14.The circuit breaker at bus 14 opens 60 ms after the fault and causes the voltage at bus 14 to recover from 0.2 to 0.7 p.u. approximately, while the circuit breakers at buses 3 and 5 open 80 ms after the fault occurs.
Fig. 8 shows the speed deviations of the 10 synchronous generators in the system during the first 6 s.The system remains stable after the fault and the frequency increases by 1.5% approximately.
The synchronization method between OMNeT++ and PSS/E proposed in this work eliminates cumulative errors due to synchronization by pausing the PSS/E simulation between OMNeT++ events.This method ensures that the power system simulations pauses whenever the communication system needs to be updated, but it may also increase the wall-clock simulation time compared to other time-stepped or event-driven synchronization methods.The efficiency of the proposed method depends on the frequency of communication events compared to the time-scale of electromechanical oscillations in the power system.If there are many communication events per PSS/E time step and they trigger complex calculations, most of the CPU time is consumed by the simulation of the communication system and the synchronization with PSS/E does not increase significantly the computational effort.Conversely, if there are few communication events then the PSS/E simulation runs uninterrupted for long periods of time and the synchronization process does not increase the computation time either.The least efficient case corresponds to a frequency   of communication events that roughly corresponds to the PSS/E time step, in this case  = 0.01 s, because it pauses PSS/E at every time step to process just one communication event.
To quantify this effect, Table 2 shows the processing times needed to solve a 10-seconds co-simulation depending on the time between communication events.To obtain this table, a series of dummy messages are sent between OMNeT++ modules to force the PSS/E simulation to pause.
Table 2 shows that up to one message each 0.01 s, which is the PSS/E time step, the computation time increases because the PSS/E simulation is forced to pause more often.From one message each 0.01 s onward the simulation time increases very slightly, while the ratio of simulation time per message decreases significantly.
Simulations have been run on a personal computer with a 2.5 GHz processor.The compilation of PSS/E and OMNeT++ prior to the execution of the simulation results in a solution that is faster than simulators based on interpreted languages.In all the cases the computation time is significantly shorter than the 86 s reported in [21] to simulate 0.5 s, while the results obtained are coherent.

Description
The aim of this case is to evaluate the effect of communication latency times on the performance of an online state estimator.The case represents a state estimator running in a control center and using data from phasor measurement units (PMUs) deployed throughout the IEEE 39 Bus Test System.For the purpose of the demonstration, the selected state estimation is based on an unscented Kalman filter (UKF), which is one of the mainstream algorithms used in power systems [39,40].Measurements are sent to the control center through a communication channel and reach the state estimator after a certain latency time.The latency time of the communication channel affects the accuracy of the state estimator because if a measurement is delayed then the last available measurement is used as a best approximation, and it may not be consistent with the rest of the data.
The simulation represents a 3-phase short-circuit at bus 3, cleared after 150 ms.Fig. 9 shows the single-line diagram of the system together with the location of the fault and the measurements.Measurements include the magnitude of the voltage at several buses, the phase of the voltage at certain buses, and the active and reactive power produced by power plants, consumed at certain loads, and flowing through certain branches.
The measurements are modeled with a normally distributed random error.The standard deviation of the power and voltage magnitude and voltage angle measurements is, 3% and 0.7% of the reading value and 0.7 ⋅ 10 −2 rad, respectively.
The power system OMNeT++ module runs the simulation in PSS/E and sends the measurements via a communication channel to the state estimator, that receives each measurement after the corresponding latency time.Every measurement contains a time stamp indicating the time of the measurement, and the state estimator uses always the most recent measurements regardless of the time of their arrival.Each measurement is sent every 10 ms.There are in the literature different stochastic models of latency in wide-area power system signals [41,42]; in this study the communication latency is modeled as a Weibull probability distribution with shape parameter  = 1.2 and scale parameters   ranging from 0.01 to 0.05, as shown in Fig. 10.The equation that defines the probability density function of the latency as a Weibull random variable is The integration time step in PSS/E is set to 0.01 s.

Results
The PSS/E simulation is compared with the output of the online state to evaluate how the latency in the communications affect the estimation.As an example, Figs. 11 and 12 show the voltage and the angle in bus 17.It can be seen that the latency time in the communications cause a delay in the estimation with respect to the real value.The delay is more evident immediately after the set and the clearance of the fault, because these are moments when the measured variables change suddenly.
A second effect, less evident in the figures, is a decrease in the accuracy of the estimation when the latency time increases.This effect can be quantified by calculating the root mean square (RMS) of the residuals of the estimated voltage magnitudes (  ) and voltage angles (  ).Table 3 shows how these values increase with the latency.
Using the estimated complex voltages it is possible to estimate other variables in the power system, for example the power produced by synchronous generators.Fig. 13 shows the active power produced by the generator connected to bus 30 as simulated in PSS/E and as calculated as a function of the results of the state estimator.Active power is calculated as where   and   are the estimated voltage phasors at buses 30 and 2 and  , is the series impedance connecting buses 30 and 2. Fig. 13 shows that the state estimator provides a fair estimation of the active power produced by the power plant.Here again the latency time causes a delay and a decrease in the accuracy the estimated values.

Conclusion
A co-simulator of power and communication systems based on OMNeT++ and PSS/E has been developed and demonstrated.The co-simulation platform makes it possible to integrate the simulation of communication systems with the extensive PSS/E library of component models and with the power system models already developed in PSS/E by TSOs.
From the point view of the accuracy of the results, the proposed co-simulator applies an event-driven synchronization method that minimizes the errors by delays in the synchronization between both simulators.
From the point of view of the speed of the simulation, the total processing time is affected by the time separating communication events.The least efficient case corresponds to a coincidence between the time separating communication events and the power system numerical integration time step.However, even in this case the application of the method to the IEEE 39 Bus Test case shows a good performance.The fact that the co-simulation platform is compiled prior to the simulation, as opposed to simulators based on interpreted languages, results in a high computational speed.
Regarding the scalability of the co-simulator, the IEEE 39 Bus Test system is a relatively small case and the application to larger systems remains to be studied.However, that PSS/E is specifically designed to simulate very large power systems, and that OMNeT++ facilitates performing large experiments, all signs indicate that the co-simulator will be suitable for large systems.

Declaration of competing interest
No author associated with this paper has disclosed any potential or pertinent conflicts which may be perceived to have impending conflict with this work.For full disclosure statements refer to https://doi.org/10.1016/j.compeleceng.2022.108092.
Pablo Ledesma received his Ph.D. in 2001 at University Carlos III of Madrid, where he is currently an Associate Professor.He has worked with the Spanish TSO on several projects on large-scale integration of renewable energy.His areas of research are transient stability and dynamic modeling of power systems.Davide Gotti (S'21) received the B.Sc. and M.Sc.degrees in electrical engineering from Politecnico di Milano, Italy, and the M.Sc.degree in renewable energy in electrical systems from Universidad Carlos III de Madrid 2018.His research interests include state estimation, power system modeling and machine learning algorithms.
Hortensia Amaris (M00-SM19) received the degree from the Technical University of Madrid (UPM), Madrid, in 1995.She is currently a Full Professor of electrical engineering with University Carlos III of Madrid, Spain, where she has been working mainly on operation and control of power networks, power quality, power-electronic converters, renewable energy sources and smart grids.

P
.Ledesma et al.

P
.Ledesma et al.

P
.Ledesma et al.

P. Ledesma et al.Fig. 13 .
Fig. 13.Estimation of active power produced by the power plant at bus 30.
R   represents the algebraic equations.Generally speaking the transmission grid is represented by algebraic equations, while synchronous and nonsynchronous generation, HVDC links, FACTS, control systems and other components whose dynamics are simulated are represented by differential equations.Discrete variables are used to represent discrete controls, protection relays and external disturbances.This work utilizes PSS/E as the simulation tool to implement and solve the model represented by Eqs.(1) and (

Table 3
State estimator residuals.