The following sections describe, in detail, the models simulated in
Section 4: averaged inverter, inverter with harmonics, and transmission line. The last section explains how the simulation can be more efficiently parallelized in the case of detailed power electronics models. First, the solution process of DPsim is reviewed, including the transmission line method (TLM) for subsystem decoupling. Subsequently, the process is extended with a method to split the network not only between nodes, but also across frequencies to compensate for the increased number of equations when simulating the inverter model with harmonics.
3.1. Averaged Inverter Model with Controls
The averaged model with controls encompasses three kinds of components: electrical components, control components, and interface components connecting the former two. The averaged inverter model is applied in DPsim for both types of simulations DP and EMT, see
Section 4.1. This section is focused on the description of how the inverter’s control, which is modelled in state space, is interfaced with the inverter’s and grid’s electrical components in the case of DP and EMT simulation.
The inverter is modelled as Voltage Source Inverter (VSI), see
Figure 1. Accordingly, a controlled voltage source represents the inverter’s output based on an averaged switching model. Besides, the inverter model includes an LC filter as output filter, which is composed of two resistors, an inductor and a capacitor. The inverter model operates at low voltage (LV) level and the grid operates at medium voltage (MV) level. Therefore, the inverter includes a step-up transformer for connection to the MV grid. The chosen parameters are listed in
Table 1.
As mentioned in
Section 3.4, DPsim follows the modified nodal analysis approach in order to solve the electrical network. Accordingly, the inverter’s electrical components that are mentioned above are integrated into the system solution by stamping their contributions into system matrix and source vector. The dynamic behaviour of the components is taken into account by means of the components’ DC equivalents [
23]. Depending on the type of simulation, the DC equivalents represent the models either in the DP or the EMT domain.
The inverter’s control is modelled in state space and it enables an operation of the inverter in grid feeding mode [
24]. The control aims at injecting active and reactive power according to specified reference values. The actual power feed-in is determined through an average power calculation, including a low-pass filter. The power calculation serves as input to power and current control loop, which are both implemented as PI controllers and that finally provide the voltage set-point for the controlled voltage source. As common in the field of control engineering, the inverter’s control is modelled in state space. The state space model employs quantities represented in the inverter’s local dq reference frame, which rotates with the frequency measured by a phase-locked-loop (PLL). The interface connecting the electrical model with the controller’s model in state space depends on the domain in which the electrical simulation is performed.
In case of an EMT simulation, the quantities are represented with respect to a stationary reference frame. The grid quantities are represented in DPsim as real-valued phase-to-ground peak quantities
. To obtain the quantities in the inverter’s local reference frame rotating with
, they are transformed by means of the power-invariant dq transformation, according to
This means that the inverter’s input variables
and
, see
Figure 1, are transformed to
and
according to
The inverter’s controllers deliver as output the quantities in the local reference frame, which are then transformed back to the grid’s stationary frame by means of the inverse dq transformation
Correspondingly, the controller’s output voltage
is considered in the grid solution after the back transformation of
, according to
In case of a DP simulation, DPsim uses complex phase-to-phase RMS quantities denoted as
following Equation (
2). In contrast to the next section, we consider at this point exclusively the first order DP at center frequency
. The grid quantities have the grid’s synchronous frequency
as center frequency, which is usually equal to 50 or 60 Hz. Thus, the original EMT quantities are related to the DP grid quantities by
with
. Instead, the inverter’s input and output quantities imply the local frequency
as center frequency, which is defined through the PLL’s angle
. Accordingly, the inverter’s quantities are related to the original EMT quantities by
Comparing Equations (
10) and (
11) yields the following relationship between the DPs with two different center frequencies
Thus, the transformation from DPs with the grid’s synchronous frequency
as center frequency to DPs with the inverter’s frequency
as center frequency looks as follows
Accordingly, the inverter’s input quantities can be obtained from
Besides, the inverter’s output voltage is transformed back according to
It can be noted that the transformation matrix in Equation (
8), which links the inverter’s dq variables
with the original EMT variables, is the same as the transformation matrix obtained when resolving Equation (
11), which links the inverter’s DP variables
with the original EMT variables. That is, the described interfaces ensure that, from a theoretical perspective, the inverter model in state space operates on the same quantities for EMT and DP simulation, while from a simulation perspective these quantities can significantly differ in terms of accuracy, as shown in
Section 4.1.
Using these interfaces, other state space controllers can be integrated into DPsim in the same way. Control models operating on dq variables with respect to a local reference frame can be easily integrated into DPsim and applied in both EMT and DP simulations.
3.2. Inverter Model Including Harmonics
Here, harmonic analysis is applied to determine the dynamic phasor quantities injected into the grid by a unipolar single-phase full-bridge voltage source inverter. The harmonic frequency content of power electronics topologies could also be determined by a Fast Fourier Transform (FFT) of the electromagnetic transient waveform, which reduces the mathematical effort, but it requires extra computing capacity. Instead, the harmonic components of the PWM waveform can be computed directly, which is more precise [
12].
In the following, it is assumed that the PWM signal is generated by comparing a triangular carrier signal and a reference signal of the form (
17). The reference signal is defined by the nominal grid frequency
, the modulation index
, and the reference signal phase
.
Applying double Fourier integral analysis, as explained in [
12], the resulting PWM waveform can be expressed in terms of Fourier coefficients (
18). With respect to [
12], the following equations have been reformulated in a way that allows fewer evaluations of the series term, which facilitates efficient implementation. Besides, a phase angle of the reference signal different from zero is considered. In this case, double edge natural sampling is assumed for the PWM signal. This means that the carrier signal is triangular instead of sawtooth (trailing edge), and switching is initiated whenever the carrier and reference signal cross.
is the Bessel function defined as:
The switching frequency is , switching frequency harmonic is m and the nominal grid frequency harmonic is denoted n.
Achieving natural sampling with a digital control system is challenging, because it is difficult to determine the exact point of crossing between reference and carrier signal. Therefore, alternatives such as regular sampling are often implemented. Regular sampling means that the reference signal is sampled and held for each carrier signal interval. Depending on the sample and hold time of the reference signal, double edge regular sampling can be further divided into symmetrical or asymmetrical sampling. In the symmetrical case, the reference is sampled once per carrier interval opposed to twice in the asymmetrical case. The harmonic analysis for a symmetrical regular sampled reference with a double edge carrier is defined by Equation (
20).
If the ratio between the switching frequency of the inverter and the reference signal frequency is an integer, the harmonic analysis can be applied to calculate dynamic phasors for the fundamental and its harmonics. For consistency with the previous Equations (
18) and (
20), the harmonics are still denominated in terms of multiples of the switching frequency and the reference signal frequency, even though they could be expressed as multiples of
n only if the requirement of an integer ratio is fulfilled. Every time that the input variables
and
change, the dynamic phasors must be updated according to (
22) when considering natural sampling and similarly for regular sampling.
Subsequently, the inverter is represented by voltage sources behind the LCL output filter, which is represented by basic components that are stamped into the nodal analysis system matrix. For each dynamic phasor, there is one voltage source representing one harmonic of the reference signal frequency, as depicted in
Figure 2. Therefore, increasing the accuracy of the model by increasing the number of dynamic phasors reduces the simulation performance in terms of minimum computation time per simulation step, because the resulting equation set is larger. A solution to this challenge is described in
Section 3.4.
3.3. Transmission Line
The travelling wave transmission line model has two advantages over the Pi-line model. For long lines, it is more accurate than the Pi-line model and it enables the decoupling of network sections as shown in
Section 3.4.
The most simple transmission line model, the Bergeron model, which is also implemented in the simulator, is based on the telegrapher’s equation. This model is derived from the equations of a lossless line and losses are only approximated in a second step. The model parameters are computed for a fixed frequency, which means that they are inaccurate for deviating frequencies. Actually, the line parameters vary, especially for high frequencies, where the skin effect has a notable impact. Dynamic phasors have an advantage in this regard, because, in the best case, each phasor represents a narrow frequency band signal. Each of these phasors can be treated differently by computing the transmission line parameters for the center frequency of these bands.
The Bergeron model applied to nodal analysis can decouple the two end nodes of a transmission line. This means two network sections that are only connected by transmission lines can be solved separately and in parallel. Instead of having one large system matrix, two smaller system matrices can be computed. These two subsystems are only coupled by their source vectors, which depend on the solution of the other subsystem from the previous time step.
This transmission line model can only be used for lines, where the delay is larger than the simulation time step. Therefore, this model is usually not suitable for simulations with large time steps or networks with very short lines.
First, the commonly used EMT domain model is described. Subsequently, this model is adapted for DP variables. The Bergeron model is derived from the wave propagation Equation (
24) of a lossless line with per line length inductance
and capacitance
[
25].
The lossless line can be represented in nodal analysis by impedances and current sources, as depicted in
Figure 3, with
and the values of the current sources being computed from the currents at time
[
23].
The time constant
and the characteristic impedance
are calculated from the line length
d, as follows:
Line losses can be approximated in the model by adding a resistance at the start and end of each line section and modifying the history current sources. The equivalent impedance becomes
and the history current is calculated as:
with an analogous expression for
.
It is necessary to understand how the time delay in (
26) affects the DP variables in order to develop the dynamic phasor model. A bandpass signal
can be expressed as a baseband signal
shifted by
(
27). The Fourier transform
is given by (
28).
A time shift
becomes a multiplication by
in the frequency domain. Hence, the time shifted signal can be computed from the Fourier transform, as follows:
For
, (
29) becomes
This means that the time shift leads to an additional phase shift
for the DP variables. Therefore, (
26) expressed in terms of dynamic phasors results in (
31).
In a dynamic phasor simulation, the carrier or shifting frequency is only considered after the actual simulation in a post processing step. Without the additional phase shift, the time delay does not affect the carrier signal and the simulation results would be incorrect.
A small example that consists of a voltage source and resistance connected by a transmission line is simulated in order to demonstrate the correctness of the DP model. The parameters of the components can be found in
Table 2.
The comparison of DP to EMT simulation shows that the results are the same if the phase shift is correctly taken into account. At the beginning, transients are visible because the simulation does not start from steady state.
Figure 4 compares the current through the transmission line for the DP and EMT model.
3.4. Parallelization of Subsystems and Frequency Bands
First, the solution process of the DPsim simulator is reviewed, including the decoupling and parallelization implemented before power electronics were added to the simulator. Subsequently, this concept is extended by a method that supports a more efficient computation of networks with many harmonics.
The main idea behind DPsim is to compute the network solution with nodal analysis [
26] applied to DP variables. Therefore, the solution for one simulation step consists of three parts:
calculating component states required for the network solution,
solving the network,
updating remaining component states from the network solution.
Most component related tasks can be executed in parallel as shown in
Figure 5, because the components do not interact with each other directly, but only through the network.
However, the network simulation is often the bottleneck. The TLM is commonly used in EMT real-time simulation in order to decouple the network and compute the subsystems in parallel, as shown in
Figure 6. Because DPsim is computing DP variables, the EMT transmission line model has to be adapted to the DP domain, as described in
Section 3.3.
As mentioned earlier, one of the main disadvantages of the dynamic phasor approach is that the more phasors are used to represent a time domain variable, the larger becomes the number of equations and variables to solve for. This is especially a problem for the network solution, which can be already very large because of the number of network nodes. The idea is to split the network solution into separate solutions for each frequency band, as depicted in
Figure 7. The underlying assumption is that the network is usually composed of linear components. An approach on how to separate nonlinearities from the network model is proposed in [
27]. Nonlinearities are implemented in the components connected to the network and they can be treated separate from the network solution. Hence, the network solution does not feature cross frequency coupling.