MOSAIK and FMI-Based Co-Simulation Applied to Transient Stability Analysis of Grid-Forming Converter Modulated Wind Power Plants

: The grid integration of renewable energy sources interfaced through power electronic converters is undergoing a signiﬁcant acceleration to meet environmental and political targets. The rapid deployment of converters brings new challenges in ensuring robustness, transient stability, among others. In order to enhance transient stability, transmission system operators established network grid code requirements for converter-based generators to support the primary control task during faults. A critical factor in terms of implementing grid codes is the control strategy of the grid-side converters. Grid-forming converters are a promising solution which could perform properly in a weak-grid condition as well as in an islanded operation. In order to ensure grid code compliance, a wide range of transient stability studies is required. Time-domain simulations are common practice for that purpose. However, performing traditional monolithic time domain simulations (single solver, single domain) on a converter-dominated power system is a very complex and computationally intensive task. In this paper, a co-simulation approach using the MOSAIK framework is applied on a power system with grid-forming converters. A validation workﬂow is proposed to verify the co-simulation framework. The results of comprehensive simulation studies show a proof of concept for the applicability of this co-simulation approach to evaluate the transient stability of a dominant grid-forming converter-based power system.


Introduction
The power system is rapidly transforming from a fossil-fuel dominated generation portfolio towards a system in which renewable energy sources (RESs) are the leading energy source [1].RESs are being connected to the grid via power electronic converters.For example, large wind power plants (WPPs) far offshore are currently deployed through high-voltage direct current (HVDC) transmission.The relatively high level of converters poses challenges to the robustness of transmission systems; low physical inertial response capability and the reduced short circuit power of the grid decrease the transient stability margin [2].
To deal with potential compatibility issues with grid connection of RES, transmission system operators (TSOs) established grid code requirements for converter-based generators [3].Fault ride-through (FRT) and voltage support are prominent regulations contained in RES-specific grid codes for ensuring transient stability and dynamic security [4].A critical factor in terms of implementing network code requirements is the control strategy of converters [5].Grid-following converters are currently used in renewable integration, often necessitating a phase locked loop (PLL) for synchronizing to the grid.In weak grid conditions, a grid following scheme, also referred to as vector control, cannot operate properly [6].For this, direct control mechanisms have been refined and extended towards grid-forming control [7].This emerging control strategy can counteract changes in voltage and frequency, and can be extended/modified to provide standalone and black-start capability.
To ensure grid code compliance of converter-based generators, a wide range of transient stability studies is needed in the planning and development phase of grid extensions [8].For that purpose, the dynamic response of converter-based generators under different network conditions needs to be analyzed, which is traditionally done by time-domain simulation.These type of simulations are commonly dedicated to and numerically optimised for electromagnetic transient analysis or transient stability, which limits the system size and type of the applications.The incorporation of sophisticated power electronic converters and DC transmission into such tools is challenging, and commonly leads to situation-specific workarounds, such as multi-rate simulations or drastic model simplifications of the considered subsystems, often causing the results to be inaccurate or overestimated [9][10][11].In general, traditional monolithic (single solver, single domain) simulation tools face difficulties in handling the increasing complexity (heterogeneity) of cyber-physical energy systems [10,12,13].
A number of solutions exist, among which (1) accepting that the monolithic, simplified simulation takes longer and might be less accurate, (2) real-time simulation of power systems with the possibility to insert hardware-in-the-loop [14], and (3) co-simulations.The latter is the focus of this paper.The co-simulation is a composition of a set of coupled simulators, each modelling a subsystem of the overall system under test, working together in order to assess the system response [10,15].This way, the power system can be modeled in a specialised simulator while power electronic converters and/or their controllers can be modeled with the appropriate level of detail in another simulator.By coupling these independent simulators by a co-simulation framework, the whole system modeling effort will decrease [16,17].There is a large area for the application of co-simulation from grid monitoring to ICT system security [18][19][20][21][22][23].An extensive survey and statistical analysis using smart grid co-simulation application is given in [24][25][26].
There exists a reasonable level of standardisation for co-simulations in terms of interfacing between the subsystems, the synchronisation, and overall simulation coordination.The functional mock-up interface (FMI) is the de facto low-level standard for co-simulator interfacing [27][28][29].FMI components are called functional mock-up units (FMUs).Each simulator or model can be represented as an FMU and, by doing so, the intellectual property is protected as models can be shared without sharing internal information (grey or black box encapsulation) [30][31][32][33][34][35].
Simulation synchronisation and coordination, especially in a distributed fashion, is standardised under the high level architecture (HLA) and related concepts such as HELICS [36].Moreover, a number of co-simulation platforms exist that offer a topdown (server-client) coordination of co-simulation and offer simulation coupling towards proof-of-concept [37].MOSAIK is a tool dedicated to smart-grid scenario development and co-simulation assessment [38].Originally being developed for multi-agent systems, it has been extended for synchronisation between time-domain simulations and FMI support [34,39,40].The interfaces and synchronisation methods have been tested in a small-scale context in [34].This paper will focus on more contemporary controls for power electronics interfaced RES and test their applicability to large-scale assessment in co-simulations.
The objective of this paper is to apply a MOSAIK-based co-simulation to study the transient stability consequences of converter-based RES with grid-forming control, and test the efficacy of the implemented cosimulation toolchain (i.e., Powerfactory, MOSAIK, FMI, FMI++).The scientific contribution is twofold: First, the implementation of a typical droop-based grid-forming converter-based generator within a co-simulation setting.This is novel for this type of controller and this paper proposes a workflow to validate this approach.Second, the extensive transient stability assessment of a converter-dominated power system applying this co-simulation toolchain.
The approach is as follows.First, the co-simulation toolchain and its implementation in MOSAIK are detailed in Section 2. Its application towards transient stability assessment follows in Section 3. Here, a converter-dominated power system is split into (i) the power system modelled in Powerfactory, and (ii) the controller of the converter-based generator modelled in Simulink.Both subsystems are encapsulated into FMUs and are orchestrated by MOSAIK.The behavioural description, mathematical modelling, and implementation of the proposed grid-forming control into the monolithic reference simulation and into the co-simulation are described next; i.e., in Section 4. This framework is used to test the functionality of the controls, to validate their efficacy in a co-simulation setting against a monolithic powerfactory simulation, and to eventually apply this for transient stability analysis.This is performed by various deterministic (i.e., setpoint changes, short circuit response, and islanded operation) case studies in Section 5. Conclusions and recommendations are provided in Section 6.

Transient Stability Assessment by Co-Simulation
This section describes which steps are commonly taken for transient stability assessment using (monolithic) numerical simulations, what additional steps need to be taken to achieve this through co-simulation and how MOSAIK facilitates these preparation, execution, and post-processing efforts.

Transient Stability Assessment Methods for Monolithic and Co-Simulations
Performing a monolithic simulation for transient stability studies consists of different steps, as shown in Figure 1.After preparing the power system model in a typical power system analysis tool, a power flow calculation is performed providing an (possibly optimised) set of nodal voltages and active and reactive power injections.The power flow results are used for calculating the initial conditions for the differential equations.This is usually carried out in reverse order by calculating the algebraic variables and states upstream.After a successful initialisation, a time-domain simulation is executed.Using the appropriate integration method and starting algorithm after events, the resulting system of differential-algebraic equations are solved numerically in time.Finally, the simulation results are exported for post-processing.Since all simulations are performed in one environment, a monolithic simulation has a relatively linear workflow.
The steps that generally need to be taken for co-simulation-based transient stability assessment are shown in Figure 1.As an example, two different simulators are considered for the co-simulation: the power system simulator and the controller simulator.After model preparations, the initial conditions for power system equations are calculated based on its power flow results.Afterward, these initial condition equations are used for calculating the initial conditions for the converter controller.After the successful initialization, the two simulators are ready to be connected.Interfacing and synchronization between two simulators is a significant step, and, as a rule, the interfacing sequence needs to be provided separately by the user.Next, the dynamic simulation is executed and the simulation results are obtained and exported to a common data format.
As can be seen in Figure 1, a transient stability assessment by co-simulation needs more steps, which is commonly manual and error prone engineering work.This adds a level of complexity compared to monolithic simulations.On the other hand, by applying co-simulation, a large converter-dominated power system can be divided into smaller and possibly simplified models, eventually decreasing the computational burden.The flexibility offered by such approach is an important weighing factor in deciding which modelling and simulation approach to take.

Overview of MOSAIK Architecture
MOSAIK is a robust scenario specification framework that can integrate many simulators.It is a flexible Python-based open-source co-simulation framework with the capability of generating a large scale scenario, quantifying uncertainty and developing multi-agent systems [40][41][42].There are several references showing the application of MOSAIK in, for example, cyber-physical energy systems [43], urban energy analysis [44], and grid monitoring [45].A peak-shaving algorithm is implemented to improve the voltage stability of a distribution network in [46].
The system architecture of MOSAIK consists of a core framework and a set of adapters [43], as is shown in Figure 2. The core includes interconnecting modules such as the sim-manager and the scheduler.A scenario script is written by the user that specifies the model parameters and the sequence of the execution of the simulators.The scenario-API establishes the interface between MOSAIK and the scenario script.Based on the scenario, the scheduler defines the data exchange order as the simulations need to be executed and exchange data between each other.Therefore, the scheduler is the synchronization unit of MOSAIK.The situation that one simulator needs data from another simulator and vice versa is called a cyclic data flow.The scheduler applies a directed acyclic schedule graph and handles this situation.The sim-manager is responsible for handling the simulator process and the communication between them.The component-API enables one to interface a wide range of simulators such as the MATLAB-API and the FMI adapter [43].The FMI adapter facilitates the connection of different FMUs with the MOSAIK framework, which is considered a key enabler for modular transient stability simulations.The concept of different components that synchronise with one another is one of the critical characteristics of co-simulations [47].A proper synchronization mechanism ensures the proper progress of the simulation time and data exchange between simulators [46].It can mainly be divided into (i) event-driven synchronization [48], and (ii) time-stepped synchronization [49].The simulation time in the time-stepped synchronization method progresses continuously.Therefore, it is more beneficial for a system consisting of differential equations [50].In the time-stepped method, the time intervals are predefined, and simulators run independently up to the fixed synchronization points.Then, the simulators will wait and exchange information with other simulators.However, this method is not suitable for time-critical applications that require numerous interfacing connections and instants between simulators.Thus far, event-based synchronization is the most common synchronization method [24].The synchronization method in MOSAIK is also based on an event-based method.All time steps and systemic occurrences within the power system simulator and controller are considered as an event in the event list shown in Figure 3a. Figure 3b shows the MOSAIK synchronization steps.After initialisation, first, the power system simulator is advanced from t 1 to t 2 , then pauses.The power system simulation data are transmitted to the converter controller so that it can proceed its steps.The controller simulator advances till t 2 , and then data are exchanged from the controller to the power system simulator.Now, the power system can advance the calculation to t 3 and so forth.This process is repeated until the end of the simulation time defined in the scenario.

Converter controller events
List of events for synchronization Power system simulator events (b) MOSAIK synchronization steps.

MOSAIK Co-Simulation Setup for Transient Stability Assessment
The system under test in this article consists of a converter-based generator, such as a wind turbine, where a full-scale power electronic converter is used as shown in Figure 4.Only the grid-side converter (GSC) is considered.The mechanical and aerodynamic systems, machine-side converter (MSC), permanent magnet synchronous generator, and machine-side converter of the wind turbine are modelled as a constant voltage source, which is common practise for large-scale stability studies.
The test case also consists of a representation of the external grid G ext , a static load L1, and a synchronous generator G1.G1 is represented by the sixth-order model using IEEE standard model of EMAC1T for the automatic voltage regulating exciter dynamics and IEEEG1 for governor dynamics.The main parameters of the test case are listed in Table A1 in Appendix A.
MOSAIK is intended for the coordination between two different continuous-time simulators, representing the power system and the wind turbine controller, respectively.In this section, the various steps towards the implementation of the MOSAIK co-simulation are explained.Furthermore, the workflow to validate the efficacy of the co-simulation setup is presented.

Study Steps to Setup the Co-Simulation Framework
The following design steps have been taken to construct the co-simulation framework as validated in this paper, i.e., Figure 5.

Model a Monolithic Reference Case in Powerfactory
The first step is to model a power system including a wind turbine (Figure 4) in Powerfactory.A common droop-based grid-forming control is considered for the wind turbine controller.Details on grid-forming control will be explained in the next section.After model preparation, a monolithic transient stability simulation is performed.In the monolithic reference case, the wind turbine can successfully ride through a 150 ms selfcleared three-phase short circuit at the busbars of the grid terminal.This is referred to as the reference fault throughout this paper.Under most grid conditions, reactive current provision can support the voltage during fault-induced dips [51,52].According to most present grid codes, wind turbine generators shall remain connected during reduced voltage conditions for up to 150 ms and simultaneously inject 1 p.u. of reactive current ( [53]).

Split the System and Establish Two Different Simulators
The second step is to build the two different simulators that together constitute the system under test in step 1.The wind turbine controller is modelled in Simulink, and is highlighted with a dashed orange line in Figure 4.The second simulator is the monolithic reference case in Powerfactory but without the wind turbine controller (components inside the dashed red line in Figure 4).In this simulator, the wind turbine controller is replaced with an FMI++ adapter according to [54].

Export the Subsystem Models to FMUs
In this step, the subsystem FMUs are obtained.In order to extract an FMU of the power system, FMI++ Python instructions are run to export the FMU of the power system simulator that was built in step 2 [55].Next, the FMU of the wind turbine controller in Simulink is exported by the FMI kit [56].

Develop FMI-Based Co-Simulation Setup
Before simulating the exported FMUs using MOSAIK, an FMI-based co-simulation is implemented in this step to test the FMUs.This setup coordinates between the exported FMUs by a Python script similar to [34] and is shown in Figure 6a.The FMUs are evaluated in a closed-loop control system through this FMI-based co-simulation.After importing FMUs, the power system simulator is initialised by its power flow calculation results.Then the initialised voltage and current at the wind terminal are used to obtain the initial conditions for the integrators and the inputs of the wind turbine controller.The interfaces between the simulators are schematically shown in Figure 6b.
Coordinator between simulators

Develop MOSAIK Co-Simulation Setup
Finally, the MOSAIK co-simulation setup is deployed according to Figure 7. FMI MOSAIK adapters are used for connecting the FMUs and the simulator-API of MOSAIK.After importing and configuring the FMUs, the initial condition equations for the wind turbine controller FMU are calculated based on the initial conditions of the power system FMU, similar to the FMI-based co-simulation.However, in a MOSAIK-based co-simulation, the interfacing sequence between the simulators needs to be defined explicitly in the script.The scheduler in the MOSAIKcore synchronises the two simulators based on this script.The exchange variables between the simulators are the same as for the FMI-based co-simulation shown in Figure 6b.

Workflow to Validate the MOSAIK Co-Simulation Setup
After having set up the framework, a workflow procedure is designed to validate the MOSAIK co-simulation framework [11].The workflow diagram is shown in Figure 8.After applying the reference fault and executing the co-simulation transient stability as explained in Section 2.1, the simulation results are stored in hdf5-files.The behaviour of the co-simulation is analysed by comparing the results of the MOSAIK-based co-simulation with the monolithic reference by invoking the reference fault.
If the co-simulation performance is not satisfactory (i.e., the results of the comparison are substantial), different simulation components such as initial condition equations, the step size of the FMUs, the integration method, and the model parameters need to be checked and modified.After these modifications are realised and the dynamic response of the co-simulation has satisfactory accuracy, the MOSAIK co-simulation setup is ready for further compliance testing of the grid-forming controlled wind turbine generator.

Grid-Forming Control by Wind Turbine Generators
The grid-forming converter is a power converter that controls the voltage magnitude and the angle at the point of common coupling (PCC).Contrary to grid following converters, grid-forming converters do not need the fundamental frequency of the grid voltage as input.Grid-forming converters are mainly beneficial in islanded operation and in weak (i.e., low short circuit power) grids.Moreover, they can also support the grid by injecting an instantaneous active and reactive power.
The required characteristics for the grid-forming controller in this paper are specified as follows:

• It has frequency and voltage regulation; •
The controller needs to be capable of operating in both strong and weak-grid conditions;

•
The controller needs to be able to limit the current during the fault condition while successfully riding through the fault in both grid-connected and islanded operations.
Due to the increasing number of converter-based generators in the grid, several European countries have issued requirements for these generators to support the stability of the power system [8].One of the requirements is for FRT capability: converter-based generators should stay connected to the grid when the voltage drops significantly and sometimes need to inject reactive current into the power system during voltage dips (e.g., the German grid code [53]).
Considering the above-mentioned requirements, a droop-based grid-forming control is implemented [7,8].The high-level schematic of the grid-forming converter is shown in Figure 9.It contains a grid side converter supplied by a DC voltage source.On the AC side, the converter is connected to an AC grid through an l f r f filter and a step-up transformer.The AC grid is modelled by an ideal AC voltage source u g in series with its equivalent impedance z g .The function of the grid-forming control is to modulate the converter internal voltage u * c in such a way that the voltage difference across the filter can produce the desired exchange of active and reactive power with the grid.As this work focuses on the transient stability studies for a generic transmission systems, the switching effect of power electronics is not modelled, which is considered a plausible assumption [5].As the fast phenomena are not involved, root mean square (RMS) models are selected which effectively evaluate the transient stability of the power system in the grid-planning phase [34].As can be seen in Figure 9, the grid-forming control system consists of following blocks:

•
Measurement unit, which transforms the wind turbine terminal current i t and terminal voltage u t from the network oriented frame (i.e., xy) to the dq-frame using wind terminal voltage angle θ GSC coming from the active power control block.Furthermore, the active power p is calculated as • Voltage control, which controls the wind terminal voltage u t with a PI controller and provides current references i * t,dq .

•
Current limiter, which limits the current references and produces limited current references i * * t,dq .
• Voltage reference generation, which generates voltage references u * c,dq based on the limited current reference provided by the current limitation block.Moreover, to ensure adequate damping of the low frequency oscillations especially in the weak-grid and islanded operations, an auxiliary damping signal is added to the voltage references.

•
FRT unit, which generates a discrete FRT signal that is applied to the active power control block for angle correction control as well as to the voltage control block for suspending the integration action during a fault.The FRT signal is set to 1 when the wind terminal's voltage drops below 0.9 p.u.

•
Active power control, which controls active power according to a droop characteristic.
During a fault, it is switched to a fault-mode angle correction control.It generates the transformation angle θ GSC , which is used in the transformation between the real-imaginary frame and the dq frame and vice versa.

•
Modulation unit, which transforms obtained converter internal voltage references u * c,dq from dq-frame into the network oriented frame and generates u * c,xy as inputs for the grid side converter of the wind turbine generator.
For the active power control, the common droop control concept is applied [57].To explain the choice of the droop control, an equivalent electric circuit for a grid-forming converter connected to a grid is shown in Figure 10.It includes a grid-forming converter modelled as a voltage source u c ∠δ in series with the impedance z f connected to the grid u g ∠0 with impedance z g .The active and reactive power flows from converter to the grid are calculated as: (2) where r = r f + r g and x = x f + x g .For the high voltage transmission systems, we can assume that x r, also if the power angle δ is small, so that sin δ ≈ δ and cos δ ≈ 1.Therefore, Equations ( 2) and (3) can be written as: The above analysis shows a correlation between q and u as well as p and δ.Therefore, in such grids, the voltage angle or the frequency can be controlled by active power control; the droop characteristic of which can be defined as: in which ω is the converter output frequency, p is the converter active power, p * is the converter active power set-point, k D is the proportional droop gain and ω g is the rated frequency (all in p.u.).The grid-forming droop control mimics the synchronous generators' self-regulation, which means a PLL or other synchronisation unit is not required.Unlike synchronous generators that have over-current capability during a fault, grid-forming converters should be protected against over-current operation.This issue is illustrated by Figure 10.In the event of grid faults, u pcc dips, but the grid-forming controller tends to maintain its inner voltage u c .As a result, i increases instantaneously (Figure 11 [58]).On the one hand, the grid-forming converter should ride through a fault, and on the other hand, its fault current should be limited by a suitable current limiting strategy.Therefore, a feedback compensator for the active power control is applied here.The active power control block is shown in Figure 12. k cor is the proportional correction gain and f 0 is the base rated frequency of (i.e., 50 Hz).When there is an AC grid fault and the discrete FRT signal is 1, the control mode is changed from droop-control to angle correction control.This control will keep the phase angle of the wind terminal voltage fixed at the pre-fault values.The FRT unit activates the switch when the voltage drops below the threshold.Consequently, the voltage angle is locked to a value dictated by the feedback compensation block.The rest of the controller details are shown in Figure 13.In the proposed control scheme, the reactive power control is not specifically included.The angle of the voltage is controlled by the droop-based active power control as explained before and the magnitude of the voltage is controlled in the voltage control with a PI controller.The voltage vector is aligned with the d-axis, so the d-axis wind terminal voltage set-point u * t,d is equal to the wind turbine nominal voltage in p.u., and the q-axis wind terminal voltage set-point u * t,q is zero.For voltage controlling purposes, a PI controller is applied.For mitigating the integrator wind-up phenomena, a conditional integration technique is implemented [59].This technique stops the integration when the error is high.Consequently, the FRT signal is added to the PI block as shown in Figure 13 to freeze the integrator during faults.After obtaining the current references, as a complimentary current limiting strategy, a hard limiter is applied to limit the amplitude of the current references.In the current limitation block, the maximum current for the d-axis in p.u. is calculated as: where i max is the maximum permitted wind turbine current and assumed 1.1 p.u., and i * t,q is the q-axis current reference in p.u.To comply with reactive current injection requirements, reactive current is given priority over active current.Then a limiter is applied for i * t,d in the range of (−i d,max , i d,max ) and i * t,q in the range of (−i max , i max ) (middle of Figure 13).The next control block is the voltage reference generation block, which supplies the converter internal voltage references of the grid side converter of the wind turbine.As the network elements (i.e., step-up transformer) are represented by complex phasors in the grid simulator, the voltage reference modulation (u t and u c ) can be calculated by the following algebraic entities: where r f is neglected.The converter internal voltage references in d-axis and q-axis can be calculated as: The analysis of weak grid conditions and islanded operation revealed that there are low-frequency oscillations after transient events.Power system stabilizer (PSS) can help in eliminating such oscillations [60].The PSS is extensively applied in power systems dominated by synchronous generators and introduced for converter-based generators as well [61].The auxiliary damping signals are produced based on the difference between the wind turbine currents i t,dq and the limited current references i * * t,dq and they resemble a virtual series resistor.The objective of the PSS is to provide adequate damping of transient responses originating from the interconnected power system.A resistor can play a damping role, which unfortunately comes with losses.Therefore, the voltage drop is emulated by a virtual resistor.Moreover, in order to activate this damping effect only in transient situations, a washout filter is added according to [62].The stabiliser consists of a damping gain k w and a washout filter with time constant T w .The auxiliary damping signals are added to the converter internal voltage references.Finally, a transformation into the network orientation frame is completed, and the converter internal voltage references of u * c,xy are obtained to send to the grid side converter of the wind turbine generator.All the controller parameter values are listed in Table A2 in Appendix A.

Case Studies and Co-Simulation Validation
The system under test of Figure 4 is modelled in PowerFactory 2018 (SP1) to provide the monolithic reference case for validating the co-simulation based on MOSAIK.The share of WPPs is considered as 80 % of the total generation to establish a converter-dominated power system.Afterwards, the MOSAIK co-simulation framework is implemented as discussed in Section 4. The reference fault (a 150 ms self-cleared three-phase short circuit at the grid terminal of the wind turbine) is applied to the monolithic and the MOSAIK cosimulation cases, respectively.The validation algorithm explained in Section 3.2 is carried out on the MOSAIK co-simulation to obtain a reasonable similar dynamic response compared to the monolithic reference case.Next, the performance of the validated MOSAIK cosimulation for the transient stability evaluation of the converter-dominated power system is tested by considering different scenarios.These include different set-points, different types of faults and controller parameter modification.Moreover, the performance of the MOSAIK co-simulation under different grid conditions such as a weak-grid conditions ultimately islanded operation will be investigated.

Response to a Step in the Voltage Set-Point
In the first study case, the dynamic response of wind turbine is examined for a step in the voltage set-point.The simulation results where the voltage set-point of the wind turbine decreased from 0.995 p.u. to 0.965 p.u. at t = 1 s is shown in Figure 14.As can be seen, the grid-forming control exhibits a transient response and reaches steady state conditions in approximately 5 s.The dynamic response of the co-simulation and the monolithic simulation are very similar.The co-simulation successfully reflects a change in the controller set-point on the wind turbine generator.

Response to the Controller Parameter Modification
Next, one of the control parameters of the active power control block, K droop , is changed using MOSAIK scenario-API to investigate how a parameter modification in the controller affects the wind turbine generator performance in the co-simulation framework.The dynamic response of the system is triggered by a step in the active power set-point from 0.85 p.u. to 0.5 p.u.The response of the wind turbine in the monolithic simulation and the MOSAIK co-simulation is shown for different droop parameters in Figure 15.It can be seen that by increasing the value of k droop , the active power control changes more quickly upon a change in the set-point as is expected.The MOSAIK being the coordinator between the grid-forming controller and the power system, can reflect successfully controller parameter modification effects on the dynamic response of the system.

Co-Simulation and Wind Turbine Controller Response during Faults
First, the critical clearing time (CCT) of the power grid is calculated.It is defined as the maximum fault clearing time before transient instability occurs.The "out of step" signal of the synchronous generator model in Powerfactory is applied as the measure for transient instability.After applying the reference fault, the fault clearing time is increased gradually until the "out of step" signal is triggered.The corresponding clearing time equals the CCT of the power system.The CCTs are 207 ms and 203 ms for the monolithic case and the MOSAIK co-simulation case, respectively.The 4 ms discrepancy in CCTs between both simulation approaches is in the order of magniture of the common time step-size for numerical integration for stability type simulations and is considered acceptable.
Next, the effect of a different value of the fault clearing time on the performance of the co-simulation is investigated.Beside the reference fault of 150 ms, a clearing time of 200 ms, so close to the CCT, is selected.The results are shown in Figure 16 for a clearing time of 150 ms and in Figure 17 for 200 ms.From a control perspective, the time-domain responses show that the grid-forming controller could ride through the fault and is capable of providing the dynamic voltage support by reactive current injection.It can be seen from the results that a spike is present in the terminal wind current i t , as well as in the wind turbine reactive power q.The reason the spike is present is the delay in transferring the information between the controller in the Simulink FMU and the power system represented in the Powerfactory FMU.This time delay will have a pronounced effect in the voltage source converter performance in Powerfactory.In order to demonstrate this explanation, a delay block (PT1 PowerFactory STL) is intentionally added to the voltage reference block in the monolithic case in Powerfactory (Figure 18).The simulation results are shown in Figure 19.Clearly, the same spike is present also in the monolithic case with the added delay block.The effect of having a delay in the performance of the controller, response of the wind turbine controller in the monolithic simulation with different delay time constants of T del is further analysed.The results are presented in Figure 20.The deviation in the responses after the fault clearing can be seen.The more delay is introduced in the system, the slower response of the controller is detected.

Dynamic Response of the Wind Turbine in Weak Grids
One of the consequences of increasing the level of power electronic converters in a grid is the decrease of its strength, often reflected in its short circuit capacity (SCC).This is a measure for the strength of the system and it is related to the current flowing to a severe fault (i.e., a fault with very low impedance) at a considered bus in the grid.The SCC is calculated as [63]: Z g (11) in which U g and Z g are the Thévenin equivalent voltage and impedance as seen from the terminal bus, shown in Figure 9.The short circuit ratio (SCR) at the wind terminal is defined as [64]: with S WT the apparent power of the wind turbine.If the SCR is between 2.0 and 3.0, the grid is considered as weak [65].
The objective of this study case is to investigate whether there is a difference in the dynamic response of wind turbine to the reference fault in the co-simulation and the monolithic approach in a weak grid.In order to model a weak grid, the external grid with a short circuit power S k =100 MVA is disconnected.This way, the SCC of the system at the grid terminal is decreased from 104 MVA to 4.8 MVA.Consequently, the SCR is decreased from 44.2 to 2.04.The results after the reference fault at the grid terminal are shown in Figure 21.Additionally, the effect of including an auxiliary damping signal for eliminating the low-frequency oscillations in the MOSAIK co-simulation is presented in Figure 21.It can be observed that the wind terminal voltage is supported by the grid-forming control and that the co-simulation responses shows a good correlation with its monolithic counterpart.However, there is an inherent delay involved when interfacing between PowerFactory and other FMUs, which makes the response of controllers slightly delayed.This delay is assumed proportional with the synhronisation time between the FMUs.It can be seen that in the monolithic case, without a PSS, the dynamic responses after fault clearance reach their steady state level faster compared to the co-simulation.Although adding the PSS bears the benefit of oscillation damping, it introduces a delayed response to the systemic variables.Therefore, the reaction of MOSAIK with PSS is slower than the co-simulation without PSS.Nevertheless, the voltage reaches its steady state within almost 500 ms and it is in compliance with the defined criteria in Section 4.

Response of the Wind Turbine to a Fault in an Islanded Operation
The last experiment is the evaluation of the performance of the grid-forming control in the co-simulation approach in an islanded operation.This is the most severe condition to test the controller and, hence, the operation of its numerical model in a co-simulation setting.First, both the external grid and the synchronous generator are put out of service.In this situation, the wind turbine generator with the grid-forming controller is the only generating unit in the grid to supply power to the load and modulate the grid voltage.Next, the reference fault is applied at t = 1 s on the grid terminal.The dynamic response of the wind turbine is shown in Figure 22.The low-frequency oscillations are larger here, compared to the weak-grid condition, and the effect of the auxiliary damping signal by the PSS to eliminate these oscillations is shown in Figure 22.

Co-Simulation Performance
In order to assess the performance of MOSAIK co-simulation, the root square deviation (RSD) index is used and is defined by where u tmono and u tmoz are the wind terminal voltage p.u. of the monolithic simulation and MOSAIK co-simulation, respectively.T is the end of simulation time.RSD is considered as a measure of the similarity of the responses of both the co-simulation and its monolithic reference simulation.Table 1 shows the RSDs of the responses obtained with the two co-simulation methods (MOSAIK and FMI-based) for the case studies of Sections 5.1-5.5.The wind terminal voltage has been chosen as the performance indicator as it is of particular importance for the efficacy of the grid forming controller.All RSDs are based on 10 s simulation time.As can be seen from Table 1, there is a relatively small difference in performance of two co-simulation approaches.Though, MOSAIK co-simulation has smaller difference with the reference monolithic simulation than the FMI-based co-simulation, especially for the weak grids and islanded operation.Another observation is that for more severe voltage dips, especially in weak grids and islanded operation mode, the difference between co-simulation response and the monolithic response is more prominent.This can be attributed to the inherent synchronisation delay between the the FMUs.Another performance comparison is accomplished by measuring the wall-clock execution time of the above-mentioned cases.These are displayed in Table 2.It illustrates that the simulation duration for the co-simulation takes much more time than for the monolithic case.This had been noticed in [34] as well and is caused by the network license of Power-Factory, which is checked at each synchronisation step and is causing noticeable overhead in simulation time.It can also be observed that the execution time of MOSAIK is slightly faster than the traditional FMI-based co-simulation using the Python code as a scheduler.As MOSAIK uses production-grade (Python) code, this is to be expected and trivial.

Conclusions and Recommendations
Time-domain simulation is an important instrument for ensuring transient stability of a converter-dominated power system in the planning and development phase of wind parks and other renewable energy generation plants.This paper explored the efficacy of a MOSAIK-based co-simulation framework for transient stability evaluation of a gridforming converter-based RES.MOSAIK enables a successful coupling of different FMUbased simulators of power system in Powerfactory and converter controller in Simulink.The efficacy has been shown by triggering different types of dynamic events, control parameters, and systemic boundaries.
The co-simulation results were compared to the results of the monolithic simulation.The impact of the transmission events, such as voltage sags caused by faults on the RES controller operation, was demonstrated.The results show a wide consistency between co-simulation and the monolithic simulation in almost all of the study cases.The exception was during a severe voltage dip close to the converter, which induced spikes in the converter current, on its turn generating reactive power at fault ignition and clearing.It has been investigated and it appears that the spike is due to the inevitable delay in transferring the information between the FMUs and the high sensitivity of the voltage-source converter modelled in PowerFactory to this delay.The master algorithm of MOSAIK is based on a discrete time scheduler that introduces a delay into the data exchange between controller and the power system FMU.Reducing the synchronisation time-step size is a solution to reduce the delay.However, it will decrease the overall (speed) performance of the co-simulation.Another solution is to look for interaction protocols or interfacing techniques that are dedicated to the solver of PowerFactory or to the properties of the wind turbine model.Despite this minor discrepancy, the co-simulation framework is considered widely applicable for transient stability assessment, which was also reflected in the critical clearing times and the root squared differences compared to the reference simulation in PowerFactory.
Additionally, the performance of the co-simulation in different grid conditions was investigated.Two cases, weak-grid conditions and islanded operation, were studied.The low-frequency oscillations observed under these conditions were eliminated by applying a power system stabilizer in the converter controller.This did not impair the efficacy of the MOSAIK-based co-simulation approach.
The coordination between the FMUs has been investigated in two ways: via dedicated Python code that implements a rudimentary scheduler, and via MOSAIK , which boasts a production grade implementation of a discrete event scheduler and offers high usability and flexibility in terms of scenario creation.This will be addressed in future research in which this platform will be applied for assessing transient stability of future power grids using the design of experiment techniques.
The proposed co-simulation approach revolves around the assessment of systemic impacts of wind turbine generators.This commonly involves one grid simulator and multiple component models, which are commonly encapsulated as separate FMUs.This paper limited the assessment to two FMUs, one for the grid simulator and one for the wind park model.Future research will focus on the expected scalability of the approach, including the generic initialisation of co-simulations consisting of multiple FMUs, generic simulation configuration (variable semantics, automated connection of FMUs from within the MOSAIK configuration scripts), and FMU/simulator invocation by the co-simulation engineer.

Figure 4 .
Figure 4. System under test for testing the co-simulation efficacy.

Figure 5 .
Figure 5. Overview of design steps for the proposed co-simulation framework.

Figure 6 .
Figure 6.Overview of the functional mock-up interface (FMI)-based co-simulation using Python code to orchestrate.

Figure 8 .
Figure 8. Workflow diagram of the co-simulation setup using MOSAIK and the FMI.

Figure 9 .
Figure 9. Single line and control block diagram of a grid-forming converter.All variables are in p.u.

Figure 10 .
Figure 10.Power control of a grid-forming converter connected to a grid.

Figure 13 .
Figure 13.Voltage control, current limitation and voltage reference generation.

Figure 14 .
Figure 14.Response of the wind turbine to a step in the voltage set-point.

Figure 15 .
Figure 15.Response of the wind turbine to the step in active power set-point for different k droop for monolithic simulation (solid) and MOSAIK co-simulation (dashed).

Figure 16 .Figure 17 .
Figure 16.Dynamic response of the wind turbine to the fault with FCT = 150 ms.

Figure 18 .
Figure 18.The reference generation block with an intentional delay block in the monolithic simulation.

Figure 19 .
Figure 19.Dynamic short-circuit response of the wind turbine considering a delay of 10 ms in the controls within the monolithic simulation setup.

Figure 20 .
Figure 20.Dynamic response of the wind turbine to the fault considering different delay time constants T del for the monolithic simulation.

Figure 21 .
Figure 21.Dynamic response of the wind turbine to the reference fault (weak-grid condition), with and without PSS for the MOSAIK co-simulation.

Figure 22 .
Figure 22.Time-domain response of the wind turbine to a voltage dip in islanded operation, with and without auxiliary damping signal for the MOSAIK based co-simulation.

Table 1 .
Root square deviation (RSD) [p.u.] for the applied case studies in Section 5.1 to Section 5.5.