1 Introduction

For the development of modern electrical devices, the influence of electromagnetic effects has to be considered in the simulation process very often. In general, this leads to a coupled problem where the subsystems provide a quite different behaviour. In magneto-quasistatic (MQS) problems, the electromagnetic field is described by Maxwell’s equation in the magnetic potential formulation

$$\displaystyle \begin{aligned} \arraycolsep=2pt \begin{array}{rclrl} \displaystyle{\sigma\tfrac{\partial A}{\partial t} + \nabla \times \left(\nu\nabla \times A\right)} & = & J & \quad \mbox{in}& \varOmega\times (0,T) \end{array} {} \end{aligned} $$
(9.1)

with appropriate boundary and initial conditions, where Ω is a bounded two- or three-dimensional domain composed of conducting and nonconducting subdomains, A is the magnetic vector potential, ν is the magnetic reluctivity which may depend nonlinearly on A on the conducting subdomain, σ is the electric conductivity vanishing on the non-conducting subdomain, and J is the current density applied by external sources. Using modified nodal analysis, electric networks with distributed MQS devices can be modelled by a system of differential-algebraic equations (DAEs)

$$\displaystyle \begin{aligned} E(y)\textstyle\frac{\mathrm{d}}{\mathrm{d}\, t} y = f(t, y, i_M), {} \end{aligned} $$
(9.2)

where y contains all node potentials and currents through flux and voltage controlled elements [1]. These equations are coupled to the MQS equation (9.1) via the vector of lumped currents i M through the distributed MQS devices. Taking J = χi M with a divergence-free winding function χ, the coupling equation connecting Maxwell’s equation (9.1) to the network equation (9.2) is given by

$$\displaystyle \begin{aligned} \int_\varOmega \chi^T\tfrac{\partial }{\partial t}A \, d\xi + R\, i_M=u, {} \end{aligned} $$
(9.3)

where R is the resistance matrix and u is the vector of applied voltages.

Often, the network equations provide a faster dynamic behaviour than Maxwell’s equation for the MQS devices. Such coupled systems can be solved efficiently by multirate time integration schemes, where the slow changing components are integrated with large macro-step sizes, while the fast changing components are integrated with small micro-step sizes. For systems of ordinary differential equations (ODEs), there are different approaches how the coupling between the subsystems can be realised, e.g. [2,3,4].

The novelty of the paper is twofold. First we extend the multirate concept of Savcenco et al. [4] to systems consisting of a fast changing subsystem of ODEs and a slow changing subsystem of DAEs. This method can be used for an ODE system describing an electrical circuit (9.2) after an index reduction and a DAE system obtained by a spatial discretisation of Maxwell’s equation (9.1). Such a coupled system has high dimension and is time consuming in simulation. To decrease the computational effort, model order reduction is combined with the multirate time integration scheme. This is the second novelty of the paper. For model reduction of the semidiscretised MQS equations, we use a method which was developed in [5], this method starts with a full-order DAE system and ends up with a reduced-order ODE system.

The outline of the paper is as follows: First, we present a balanced truncation based model order reduction technique for the DAE formulation of a MQS equation which provides a reduced-order model in ODE form. Next, we introduce a multirate time integration scheme for a coupled system that consists of a fast changing ODE subsystem and a slow changing DAE subsystem. Finally, we apply the multirate time integration scheme combined with model reduction to the MQS equation for a single-phase 2D transformer embedded in an electrical circuit and present some results of numerical experiments.

2 Model Order Reduction for Magneto-Quasistatic Equations

In this section, we briefly discuss model order reduction of the MQS equations. For more details, we refer to [5]. Applying the finite element discretisation method to (9.1) and (9.3), we obtain a nonlinear system of DAEs

$$\displaystyle \begin{aligned} \mathfrak{M}\textstyle \frac{d}{dt}\begin{bmatrix} a \\ i_M\end{bmatrix}= \mathfrak{F}(a)\begin{bmatrix} a \\ i_M\end{bmatrix}+\mathfrak{B}\,u,\qquad w=\mathfrak{B}^T\begin{bmatrix} a \\ i_M\end{bmatrix} {} \end{aligned} $$
(9.4)

with a singular mass matrix \(\mathfrak {M}\), a semidiscretized vector of magnetic potentials a, an input u and an output w = i M . The properties of the involved system matrices guarantee that (9.4) is of index one and it can be transformed into a system of ODEs

$$\displaystyle \begin{aligned} M\textstyle \frac{d}{dt} z=F(z)z+Bu,\qquad w=-B^TM^{-1}F(z)z {} \end{aligned} $$
(9.5)

with a nonsingular matrix M and a corresponding vector of unknowns z = z(t). Note that system (9.5) has the same input u and the same output w as the DAE system (9.4) meaning that the input-output relation of (9.4) is preserved in (9.5).

If the magnetic reluctivity is constant on the conducting domain, then F(z) in (9.5) is independent of z resulting in a linear time-invariant system

$$\displaystyle \begin{aligned} M\dot{z}=Fz+Bu,\qquad w=-B^TM^{-1}Fz \vspace{-1mm} {} \end{aligned} $$
(9.6)

with the symmetric, positive definite matrices M and − F [5]. These conditions guarantee that (9.6) is asymptotically stable and passive. For model reduction of (9.6), we use a balanced truncation approach based on the controllability Gramian P which is defined as a unique symmetric and positive semidefinite solution to the generalized Lyapunov equation

$$\displaystyle \begin{aligned} FPM+MPF=-BB^T. {} \end{aligned} $$
(9.7)

Due to the symmetry conditions, the observability Gramian Q satisfies . Let P = SS T be a Cholesky factorization of P. We compute the eigenvalue decomposition

$$\displaystyle \begin{aligned} -S^TFS = \left[\,U_1,\;U_0\,\right]\operatorname{diag}(\varLambda_1,~\varLambda_0) \left[\,U_1, \; U_0\,\right]^T, \end{aligned}$$

where Λ 1 and Λ 0 are diagonal matrices and Λ 1 contains all kept Hankel singular values and Λ 0 all truncated ones. Now, we can determine the reduced-order model by projection

$$\displaystyle \begin{aligned} \tilde{M}\dot{\tilde{z}}=\tilde{F}\tilde{z}+\tilde{B}u,\qquad \tilde{w}=\tilde{C}\tilde{z}, {} \end{aligned} $$
(9.8)

where , , and \(\tilde C=-B^TM^{-1}FV\) with the projection matrices \(V=SU_1^{}\varLambda _1^{-1/2}\) and W = −M −1FV . One can show that the reduced matrices \(\tilde M\) and \(-\tilde F\) are symmetric, positive definite and \(\tilde C=\tilde B^T\) guarantees that system (9.8) is passive. Moreover, we have the L 2-norm error bound for the output

$$\displaystyle \begin{aligned} \|w-\tilde w\|{}_2\leq 2\,\mbox{trace}(\varLambda_0)\,\|u\|{}_2.\end{aligned} $$

For solving the generalized Lyapunov equation (9.7), we can use the low-rank alternating direction implicit method or (rational) Krylov subspace method [6, 7]. In both methods, we need to solve linear systems of the form (τM + F)v = b for a vector v with possibly dense M and F. Exploiting the block structure of these matrices, we can overcome this computational difficulty by solving linear systems \((\tau \mathfrak {M} +\mathfrak {F})\hat {v}=\hat {b}\) with the sparse matrices \(\mathfrak {M}\) and \(\mathfrak {F}\) as in (9.4) instead [5].

For model reduction of the nonlinear system (9.5), we can use the proper orthogonal decomposition technique combined with the discrete empirical interpolation method (DEIM) for efficient evaluation of the nonlinearity g(z) = F(z)z and matrix DEIM for fast computation of the Jacobi matrix J g (z), see [5] for details.

3 Multirate Time Integration for ODE/DAE-Systems

Now, we present an efficient time integration scheme to simulate electromagnetic effects in electrical devices. For the MQS equations, we consider the semidiscretised DAE formulation (9.4) and set \(x=[a^\top ,~i_M^\top ]^\top \). We claim that the surrounding electrical circuit can be described by a system of ODEs and its solution is denoted by y. Then the coupled system of equations reads:

$$\displaystyle \begin{aligned} \dot{y}&=f(t,y,x) \end{aligned} $$
(9.9)
$$\displaystyle \begin{aligned} \mathfrak{M}\dot{x}&=\mathfrak{F}(x)x+\mathfrak{B}u. \end{aligned} $$
(9.10)

The coupling from the ODE to the DAE is realised by the input function u = u(y) in (9.3). The network ODE provides a faster dynamic behaviour than the DAE model of Maxwell’s equations. Since the DAE (9.10) is a result from a finite elements semi-discretisation its dimension is much larger than the dimension of the circuit’s ODE system. However, the coupled system can be written in the form of one DAE

$$\displaystyle \begin{aligned} G(t,~\dot{y},~\dot{x},~y,~x)=0. \end{aligned} $$
(9.11)

For given input u, it was shown in [5] that the DAE (9.10) is of tractability index 1. Thus the DAE (9.11) is also of index 1 and therefore it can be integrated by an implicit Runge-Kutta method [8]. We apply the LobattoIIIC method to this DAE with given consistent initial values y(t 0) = y 0, x(t 0) = x 0. For the first time step t 0 → t 0 + H this reads for the increments \(k_1^y,~k_2^y,~k_1^x,~k_2^x\) as

$$\displaystyle \begin{aligned} \begin{aligned} G(t_0,~k_1^y,~k_1^x,~y_0+\tfrac{H}{2}(k_1^y-k_2^y),~x_0+\tfrac{H}{2}(k_1^x-k_2^x))&=0,\\ G(t_0+H,~k_2^y,~k_2^x,~y_0+\tfrac{H}{2}(k_1^y+k_2^y),~x_0+\tfrac{H}{2}(k_1^x+k_2^x))&=0. \end{aligned} \end{aligned} $$
(9.12)

System (9.12) has to be solved with respect to \(k_1^y,~k_2^y,~k_1^x\) and \(k_2^x\). Then, the approximations for y and x at t 0 + H are given by

$$\displaystyle \begin{aligned} y_H&=y_0+\tfrac{H}{2}(k_1^y+k_2^y), \end{aligned} $$
(9.13)
$$\displaystyle \begin{aligned} x_H&=x_0+\tfrac{H}{2}(k_1^x+k_2^x) \end{aligned} $$
(9.14)

Here, the fast changing ODE subsystem dictates the step size H for the whole coupled DAE (9.11). This leads to a large computational effort since the whole high dimensional system has to be integrated with relatively small step sizes to resolve the network dynamics appropriately and it makes the time domain simulation of the coupled system inefficient.

A multirate time integration scheme decreases the computational effort and preserves the accuracy of the numerical approximation. The slow changing subsystem (9.10) is integrated with a large macro-step size H while the fast changing subsystem (9.9) is integrated with a small micro-step size h ≪ H. The crucial part is how the unknown function values of x at the intermediate time steps are achieved. For coupled systems of ODEs there are several approaches based upon inter- and extrapolation of the unknown values [2] or modified Runge-Kutta methods with inherent time steps for the coupled system [3].

Here we follow the idea of [4] and extend this technique to coupled ODE/DAE systems. First, the system (9.12) is solved for the overall coupled system (9.11) with macro-step size H which is chosen according to the system properties of the slow changing DAE subsystem (9.10). The approximation at t 0 + H is only accepted for the slow changing subsystem according to (9.14) since an approximation with stepsize H for the fast changing ODE subsystem is inaccurate.

Now, the fast changing ODE subsystem (9.9) is integrated with a smaller micro-step size h over the time interval [t 0, t 0 + H]. The system for the increments \(k_1^{y,h}~k_2^{y,h}\) of the first micro step t 0 → t 0 + h reads

$$\displaystyle \begin{aligned} k_1^{y,h}&=f(t_0,~y_0+\tfrac{h}{2}(k_1^{y,h}-k_2^{y,h}),~\bar{x}_1),\\ k_2^{y,h}&=f(t_0+h,~y_0+\tfrac{h}{2}(k_1^{y,h}+k_2^{y,h}),~\bar{x}_2), \end{aligned} $$

where \(\bar {x}_1\) and \(\bar {x}_2\) denote linearly interpolated values of x 0 and x H at time t 0 and t 0 + h, respectively. The approximation of y at t 0 + h is given by

$$\displaystyle \begin{aligned} y_{h}=y_0+\tfrac{h}{2}(k_1^{y,h}+k_2^{y,h}). \end{aligned} $$
(9.15)

The micro-step size h has to be chosen according to the dynamical properties of the solution y (fast circuit subsystem). It is also possible to include a step size control by embedding a lower order method. For LobattoIIIC the lower order approximation \(\bar {y}_h\) can be computed by \(\bar {y}_{h}=y_0+hk_1^{y,h}\). After a certain number of micro-steps, an approximation \(\hat {y}_H\) of y at t 0 + H is achieved and the next macro-step t 0 + H → t 0 + 2H can be computed with corresponding initial values \(\hat {y}_H\) and x H as described above.

In case of a coupled field-circuit system, the fast changing circuit subsystem (9.9) depends on the current i m , which is an algebraic variable of the slow changing MQS subsystem (9.10). To compute the micro-steps of the fast changing subsystem (circuit), an interpolation of i m is needed. However, on the macro-step scale, the LobattoIIIC is stiffly accurate, thus the algebraic constraints will be satisfied.

4 Simulation of a Coupled Electric Field-Circuit System

We simulate the electromagnetic effects of a single-phase 2D transformer in a coupled field-circuit system. Since the transformer does not react immediately on fast changes in the input voltage, this system suits for integration by a multirate scheme. The fast changing subsystem describes the circuit, while the slow subsystem is used to model the electromagnetic effects of the transformer. Figure 9.1 shows a circuit diagram of the coupled system, where the electromagnetic effects are represented by the lumped devices of a transformer in the box.

Fig. 9.1
figure 1

Circuit diagram for no load test of the coupled systems with lumped elements for the electromagnetic effects (box)

MQS-Device Modeling

We consider the linear MQS equations for a single-phase 2D transformer with an iron core and two coils in the form (9.4). The material parameters are σ = 5 ⋅ 105 Ω−1 m−1, ν 1 = 14, 872 Am/(Vs) = 14, 872 m/H on the conducting and ν 2 = 1 Am/(Vs) = 1 m/H on the non-conducting subdomain. The FEM discretisation is done by the free available software FEniCS.Footnote 1 To apply a time domain simulation, the system matrices of the semidiscretised MQS system (9.4) of dimension n L  = 7823 were exported to MATLAB. The input of the subsystem is given by the voltage u at the primary coil, and the output is the current i M through the primary coil. The reduced model was computed by the balanced truncation method as described in Sect. 9.2. The dimension of the reduced model is r = 4.

Circuit Modeling and Coupling

The electric circuit and the transformer are coupled by the source coupling approach [9]. That is, add an additional controlled current source to the circuit subsystem and an additional voltage source to the transformer’s subsystem. In this case, the circuit is described by the following ODE

$$\displaystyle \begin{aligned} C\tfrac{d}{dt}e_1(t)&= G(e_1(t)-U_{in}(t))-i_M(t) \end{aligned} $$

for the node potential e 1, while i M denotes the coupling current (as controlled current source) through the primary coil of the transformer. The circuit parameters are given by C = 1 nF and G = 10−3 S. The input voltage is given by two superposed sine functions \(U_{in}(t)=45.5\cdot 10^3\sin {}(900\pi t)+10^3\sin {}(45000\pi t)\), and the output is e 1.

Simulation Results

We integrate the system by the multirate LobattoIIIC scheme over the time interval [0 s, 0.0055 s] as described in Sect. 9.3. Since we are interested in the influence of the multirate approach, we consider a reference solution that is computed by the LobattoIIIC method with constant global step size using 2500 time steps. We also integrated the coupled system with constant global step size using the double amount of time steps. The maximum relative 2-norm error in the outputs of the subsystems between both solutions was 3.9 ⋅ 10−3. So we accepted the 2500 time step solution as reference solution with a moderate accuracy. The simulation was run on a Intel Core2 Duo P7450 with 2.13 GHz with 4 GB RAM. For the coupled DAE/ODE system of full-order, the computation time was 728.2 s. Figure 9.2 shows the outputs of the two subsystems: (a) the node potentials e 1, which belongs to the fast changing subsystem (basically we see the superposition of the sinusoidal oscillations) and (b) the current through the primary coil of the transformer, which belongs to the slow subsystem.

Fig. 9.2
figure 2

Numerical solution of the subsystems. (a) Node potential of e 1. (b) Current through the primary coil

To investigate the influence of the multirate approach on the full order DAE system, the time interval is discretised into 250 macro-step and each macro-step is refined into 10 micro-steps. 250 macro-steps are sufficient to integrate the slow changing field subsystem and 2500 micro-steps are needed for the fast changing circuit subsystem to reach an adequate approximation. Here the computation ended after 77.4 s. We computed the error between the single-rate reference solution and the multirate approximation separately for both subsystems. For the fast changing subsystem, the error is computed by the absolute value of the difference between the node potential of the reference solution and the node potential achieved by the multirate approximation at each micro-step. For the slow changing subsystem, we computed the absolute value of the difference in the output of the subsystem i M at the macro-steps. Figure 9.3 illustrates these errors. In the fast changing subsystem the error increases during one macro-step since there is an additional error that is caused by interpolating the values of the slow changing subsystem. At the macro-steps the subsystems are integrated together, so that the error at these time points is usually a bit smaller. In the slow subsystem, every second approximation gives better results while the intermediate approximation is worse. Until now, this phenomena is not yet understood completely. Since the size of the error is in total small, the improvement in computation time motivates and justifies the usage of multirate time integration schemes for these DAEs.

Fig. 9.3
figure 3

Absolute error between multirate and singlerate approximations. (a) Circuit subsystem. (b) Electromagnetic subsystem

The reduced-order coupled system is integrated by the same multirate method with the same integration parameters as for the full-order system. The simulation needed 0.20 s to compute. Figure 9.4 shows the absolute error between both multirate approximations. The error here is very small and fits to the error bound results of [5].

Fig. 9.4
figure 4

Absolute errors in the subsystems resulting from model reduction of the MQS subsystem. (a) Circuit subsystem. (b) Electromagnetic subsystem

Finally, we integrated the coupled system with the reduced MQS subsystem (9.8) without multirating, so we used the same integration parameters as for the DAE reference solution. The computation time was 0.13 s, so it was a bit faster than with multirating. This phenomena can be explained by the ratio between the number of fast and slow changing variables. In our case, the full-order system has a ratio of 1 : 7821, while for the reduced-order system, it is 1 : 4.

This ratio is an indicator for the gain of efficiency between the singlerate and multirate approximation. If there is a large number of slow changing variables compared to a small number of fast changing variables, a multirate time integration scheme saves many function evaluation of the large dimensional slow subsystem. However, the implementation of a multirate scheme is more complex than for a classical singlerate scheme. So if the dimension of the slow changing subsystem is only a little bit larger than the dimension of the fast changing subsystem, a multirate scheme can be even less efficient than the corresponding singlerate scheme.

5 Conclusions

We combined two approaches for an efficient simulation of coupled circuit-field systems. By extending multirate time integration to DAE systems, these schemes can be applied to a larger class of problems to reduce the computation time significantly. Model order reduction for MQS equations decreases further the computational effort and the numerical handling is much easier since we only have to deal with a system of ODEs. Both approaches and their combination provide reliable approximations with small errors. We pointed out that the efficiency of multirate time integration schemes strongly depends on the ratio between the number of fast and slow changing variables. The combination of model order reduction and multirate time integration is advisable for systems where the dimension of the reduced order subsystem remains high compared to the dimension of the fast changing subsystem.