• No results found

Modeling of high frequency dynamics

4.5 Impact of feed-forward in DC voltage control

5.1.1 Modeling of high frequency dynamics

Differences in produced dynamics

Close inspection of fig. 4.1 reveals that the produced dynamics of the two software are not identical. Considering the ripple on the zoomed part of fig. 4.1, it can be seen that the ripple in the OpenModelica model is larger than in the MATLAB model. One explanation for this is that the modeling of switches is different. The "IGBT/diode"-block used in MATLAB does not instantly reduce the current through the component to 0, but instead linearly decreases it over two periods using two different rates of change [116].

Moreover, the "IGBT/diode"-block uses a snubber resistance together with an infinitely large snubber capacitor. This RC snubber affects the voltage over the "IGBT/diode"

component which, in turn, affectsv123c . Lastly, an inspection of the IGBT block from the same library revealed that a snubber inductor is used to limit the rise of the current in the IGBT model [116]. The "IGBT/diode" states that it uses a simplified version of the IGBT block, with no forward voltage, but does not address the inductor [117]. If that inductance is not forced to zero by default in the "IGBT/diode"-block, that would also contribute to the smaller current ripple.

The modeling differences of the switches are, therefore, presumed to cause the differences seen in the dynamics produced by the models. Hence, these differences are not

con-5.1 OpenModelica’s suitability to model HVDC systems sidered evidence that OpenModelica cannot capture relatively high-frequency dynamics adequately.

Software resilience to discontinuities

As mentioned in section 3.1, MATLAB was not able to simulate the system unless a delay was added to every measured signal, because of the presence of an algebraic loop.

Furthermore, MATLAB was not able to simulate the system dynamics using a fixed step-time solver, only when using a variable step-step-time solver when the delay was a memory block. A potential reason for why MATLAB produces different dynamics when using a fixed step time solver is that the fixed step solvers used in MATLAB expect every state to be continuous during each step. However, the memory block produces discrete signal outputs [118]. Two attempts were made to mitigate this. Firstly, changing the time-step of the model was tested, but even reducing it down to 10 ns did not result in correct dynamics produced by the fixed time-step solvers. The second mitigation attempt was to replace the memory block with a continuous delay. When this replacement was introduced, the fixed step time solvers in MATLAB accurately produced the correct dynamics. Introducing the same delay in the OpenModelica had only one noticeable consequence: the run-time almost doubled when a variable step solver was used.

This would indicate that MATLAB’s fixed time-step solvers are not able to correctly calculate the states of the system when discontinuities like these are introduced. Inter-estingly, the fixed time-step solvers in OpenModelica did produce the correct dynamics, although the model of the switches produces discontinuities in the states.

Handling of Algebraic loops

Another observation is that OpenModelica did not require any mitigation to algebraic loops in the model, unlike MATLAB. This might speak to a difference in how the two software compile models. This is challenging to confidently say since MATLAB is not as

Chapter 5. Discussion

transparent regarding their inner workings as OpenModelica. However, analyzing how OpenModelica sorts its equations and variables presents some insight into this. Since OpenModelica is equation based, the compiler must go through each equation and de-cide which variable it should solve for to produce an assignment statement. Moreover, the sorting algorithm groups sets of equations that are cyclically dependent together into blocks which are solved simultaneously [119]. Subsequently, further optimization is conducted on the system of equations. One specific example of this relates to algebraic loops [120]. This includes tearing, i.e., restructuring algebraic loops (see fig. 5.1), and generating symbolic jacobians, i.e., taking a nonlinear set of equations and producing a set of linear equations for each nonlinear equation by differentiating each equation with respect to the state [121].

This is an indication that OpenModelica handles an extensive system of equations, alge-braic loops, and discontinuities differently than MATLAB in a way that appears more resilient to these aspects.

(a) Algebraic Loops before tearing (b) Algebraic Loop after tearing Figure 5.1: Tearing of algebraic Loop[122]

Run-times

The run-times of the two software were substantially different. During the initial simu-lation, OpenModelica ran about 40 times slower per simulated second. When simulated in OpenModelica, the simulation time was approximately 1317 seconds per simulated half-second, while MATLAB used about 33 seconds. The most probable reason for this is that the components used in MATLAB and OpenModelica to model the switches are different. This is somewhat challenging to investigate in depth because MATLAB does not provide detailed descriptions of their IGBT models. However, an interesting obser-vation is that the turn off characteristics of the IGBT model in Simulink is modeled in

5.1 OpenModelica’s suitability to model HVDC systems two steps with linear current descend [116]. This allows MATLAB to model the system without needing to introduce discontinuities in the flow and potential variables of the system. Thus, if future efforts are to be made of building converter models containing switches in OpenModelica, this thesis recommends constructing IGBT with continuous characteristics, to see if this improves the run-time of the simulation.

The reason the run-time difference is presumed attributable to the model of the switches is that when similar verification attempts were made in [68], no significant difference in run-time was detected. Furthermore, in [68], the voltages applied at the converter ac-terminals were not produced by connecting the phases to the DC-side in an alternating manner using switches, but rather by alternating the reference of controllable voltage sources betweenvDC/2and−vDC/2.

In general, it has been demonstrated that OpenModelica can capture relatively high-frequency dynamics based on a comparison with MATLAB Simulink. Since all the dy-namics of interest in the simulations investigating HVDC power dydy-namics are of lower frequency than the ones studied here, OpenModelica is considered reliable for these inves-tigations. Furthermore, OpenModelica proved more versatile and resilient to modeling problems such as discontinuities and algebraic loops, requiring no modeling effort to miti-gate these issues. Moreover, whereas MATLAB produces different dynamics depending on the solver and the presence of discontinuities, OpenModelica produced the same dynam-ics irrespective of the solver. Lastly, the differences in run-time and produced dynamdynam-ics are not presumed to be because of differences between OpenModelica and MATLAB Simulink but is more likely attributable to modeling differences of the switches. Some research has already been done that supports this [68], but future research is needed to affirmatively state the only contributing factor to this difference is the modeling of the switches.

Chapter 5. Discussion

5.1.2 Integration of OpenModelica models with real-time