A non-intrusive approach to index-aware learning

Peter Förster and
Idoia Cortes Garcia and
Wil Schilders and
Sebastian Schöps


1 Introduction↩︎

Learning the time and parameter dependent solutions of electrical circuits is of interest for various applications in the contexts of design verification, optimization or uncertainty quantification. In the particular case of SPICE-based circuit simulators such as LTspice [1], Xyce [2], ngspice [3], InfineonSpice [4], PSpice [5] or HSPICE [6], electrical circuits are commonly modeled using modified nodal analysis (MNA) [7]. On an abstract level, MNA can be characterized as a differential-algebraic equation (DAE) [8], which can generally be expressed as implicit differential equations of the form \[\begin{align} \mathbf{F}(\mathbf{z}', \mathbf{z}, t, \mathbf{p}) = \mathbf{0}, \quad \det \left( \frac{\partial \mathbf{F}(\mathbf{z}', \mathbf{z}, t, \mathbf{p})}{\partial \mathbf{z}'} \right) = 0 \label{forstereq:dae}, \end{align}\tag{1}\] where we explicitly include the parameters \(\mathbf{p}\) of the system, such as e.g.the values of particular circuit elements. The second equation represents the important property that turns 1 into a DAE, as it implies that the solution adheres to (hidden) constraints. (Think e.g.of Kirchhoff’s laws in the context of electrical circuits.) As such, it becomes important to ensure that these constraints are also fulfilled by the learned solutions, to avoid physically invalid predictions.

While there already exists a family of so-called index-aware model order reduction methods1 that ensure these constraints are upheld, see e.g.[9], they only work well for linear problems. Electrical circuits often exhibit strongly nonlinear behavior however, as the example in 4 will demonstrate. In order to bridge this gap, previous work investigated replacing classical model order reduction methods with machine learning approaches [10], [11]. We now show that, in the case of electrical circuits, one can obtain a non-intrusive version of the index-aware learning approach from [12] at negligible cost.

In the following 2, we first recall the index-aware learning approach from [12], before explaining its non-intrusive version. We then provide some theoretical results in 3, which better explain an aspect of the approach that was only hinted at in [12]. Finally, we showcase the entire workflow using a buck converter in 4, before drawing conclusion in 5.

2 Non-intrusive index-aware learning↩︎

We begin by recalling the workflow of index-aware learning as introduced in [12]. As already mentioned in 1, the core idea is to preserve physical consistency by ensuring that (hidden) constraints of the true solution are also fulfilled by the learned solutions. This is achieved by decoupling the DAE 1 into its differential and algebraic parts, e.g.using the dissection index introduced in [13] \[\tag{2} \begin{align} \frac{\mathrm{d}}{\mathrm{d} t} \mathbf{x} &= \mathbf{f}(\mathbf{x}, \mathbf{y}, t, \mathbf{p}) \tag{3}\\ \mathbf{0} &= \mathbf{g}(\mathbf{x}, \mathbf{y}, t, \mathbf{p}), \quad \det \left( \frac{\partial \mathbf{g}(\mathbf{x}, \mathbf{y}, t, \mathbf{p})}{\partial \mathbf{y}} \right) \neq 0 \tag{4} \end{align}\] Here, the last condition ensures that \(\mathbf{g}\) is uniquely solvable for \(\mathbf{y}\), such that 2 describes a semi-explicit index one DAE, see also [14]. We then call \(\mathbf{x}\) the differential variables and \(\mathbf{y}\) the algebraic variables. In addition to the decoupling, the dissection index also provides a third relation \[\begin{align} \mathbf{z} = \mathbf{G}(\mathbf{x}, \mathbf{y}, t, \mathbf{p}) \end{align}\] for recovering the original variables \(\mathbf{z}\) from the differential and algebraic ones.

This decoupling now enables the prediction of physics-consistent (constraint fulfilling) solutions of the DAE, by only learning the differential variables \(\mathbf{x}\) and reconstructing the algebraic variables \(\mathbf{y}\) using the algebraic part 4 . A flowchart of this approach is given in 1. The flowchart also highlights the two intrusive steps of the approach, namely the decoupling itself and the reconstruction, as the latter requires computational access to 4 , which is often unavailable for commercial circuit simulators.

a

Figure 1: Flowchart of index-aware learning with the two intrusive steps highlighted..

a

Figure 2: Flowchart of non-intrusive index-aware learning with the ideal non-intrusive path highlighted..

Both of these steps can also be carried out in a non-intrusive way however. For electrical circuits that can be modeled by MNA as stated in [14], the differential and algebraic variables can be determined topologically, i.e.by only looking at the graph of the circuit. Thus it suffices to have access to the netlist of the circuit. Furthermore, one can reconstruct the algebraic variables without computational access to 4 by leveraging the result from [15]. There, it was proved that two implicit Euler steps suffice to turn an inconsistent initial condition into a consistent solution state for MNA, while maintaining the same trajectory for the differential variables. Instead of reconstructing the algebraic variables using 4 , one can therefore simply perform two small implicit Euler steps of the original system, while using \(\mathbf{y} = \mathbf{0}\) as an initial condition for the algebraic variables. In order to ensure that this approach is truly non-intrusive in practice, we note that the implicit Euler method is available by setting specific options for all circuit simulators listed in 1.

In total, this yields a non-intrusive version of index-aware learning, as depicted in 2. The same figure also illustrates a third option that allows for a non-intrusive approach even if the decoupling is not available in a non-intrusive fashion, so long as the conditions of [15] are fulfilled. In such cases, one may simply learn the entire solution \(\mathbf{z}\) before performing two implicit Euler steps to ensure that the implicit constraints of the DAE are fulfilled. This then trades extra computational (learning) effort for the benefit of physics-consistent predictions.

3 Identifying purely algebraic parameters↩︎

In addition to the already mentioned benefit of providing physics-consistent predictions, there are two other potential advantages of index-aware learning. First, the computational effort for learning the solution is reduced, since only the differential variables \(\mathbf{x}\) have to be learned. This may in itself be a significant benefit, e.g.when some of the solution variables require considerably more effort to learn than the others, as will also be illustrated in 4 when dealing with the buck converter example. There is another potential benefit however, that was already mentioned in [12], but not rigorously analyzed there. Namely, the differential part may only depend on a subset of the parameters, such that \[\begin{align} \mathbf{f}(\mathbf{x}, \mathbf{y}, t, \mathbf{p}) = \mathbf{f}(\mathbf{x}, \mathbf{y}, t, \mathbf{p_x}) \end{align}\] in 3 , where the differential parameters \(\mathbf{p_x}\) are a subset of all the parameters \(\mathbf{p}\). This then implies that the remaining algebraic parameters \(\mathbf{p_y}\), need not be considered when learning the differential variables \(\mathbf{x}\), as the latter only depend on \(\mathbf{p_x}\). In practice, this may significantly reduce the learning effort, as the overall dimension of the learning problem directly depends on the number of relevant parameters.

In order to better understand when this occurs in the context of MNA, we now provide a topological characterization of when the values of particular circuit elements2 become algebraic parameters \(\mathbf{p_y}\). Analogous to the topological decoupling from [14], the \(\mathbf{p_y}\) may then be identified by only looking at the graph of the circuit. The characterization is split into the following three propositions, that respectively state which capacitors, inductors and resistors only contribute algebraic parameters. The corresponding proofs are provided in the appendix and closely follow the arguments presented in [14].

Capacitors contribute only algebraic parameters if there exists a \(\mathrm{V_s}\)-only path connecting their terminals, i.e.a path that consists of only independent voltage sources.

Inductors contribute only algebraic parameters if they are part of an \(\mathrm{L}\)-\(\mathrm{I_s}\) cutset, i.e.a cutset that consists of only inductors and independent current sources.

Similar to capacitors, resistors contribute only algebraic parameters if there exists a \(\mathrm{V_s}\)-only path connecting their terminals.

The buck converter circuit including an input filter from 3 serves as an example to illustrate [forsterprop:ai]. By comparing with the conditions of [forsterprop:ai], we see that the filter inductor \(\mathrm{L_f}\) becomes an algebraic parameter, as it forms a cutset together with the current source. In practice, one could therefore tune the filter inductor value based only on reconstructions, without needing to learn the dependence of the differential variables on this value.

a

Figure 3: Current source driven buck converter with input filter illustrating [forsterprop:ai]..

4 Example↩︎

a

Figure 4: Buck converter with the transistor (switch) modeled as a time dependent resistor..

We illustrate the approach using a buck converter, see 4. The transistor acting as a switch is modeled by a time dependent resistor \(g_\mathrm{S}(t)\) and the diode is similarly modeled by a nonlinear resistor. We fix the switching frequency at \(500\, \mathrm{kHz}\), the input voltage at \(12\, \mathrm{V}\) and the duty cycle at \(D = 12/5\), while considering varying load resistances \(R \in [5, \dotsc, 10]\, \mathrm{\Omega}\), inductances \(L \in [20, \dotsc, 40]\, \mu\mathrm{H}\) and capacitances \(C \in [0.5, \dotsc, 1.5]\, \mu\mathrm{F}\).

The buck converter is a challenging example for conventional learning approaches such as Gaussian processes (GPs) [16], as the rapid changes in the solution, compare 5, require many training data points to be learned. Thankfully, there exist methods specifically designed to deal with such problems. In our case, we use the approach from [17] for learning \(\varphi_2\) and \(i_\mathrm{V}\) and a conventional GP-based strategy for the other variables. For each variable, we learn the solution using a sequential strategy until the corresponding relative error estimate is around \(1\, \%\), or until the training data set contains a maximum number of samples in total.

We emphasize that the choice of using GPs is arbitrary, as the index-aware learning framework is agnostic to the particular method of learning. Nonetheless we note that, as one might expect from looking at 5, there are significant differences in the convergence behavior of the relative prediction error over a representative set of test data points when comparing the different variables, see 6. In particular \(i_\mathrm{V}\) exhibits very slow convergence, even when using the specialized approach from [17].

Figure 5: Simulation results for R = 8.26\, \mathrm{\Omega}, L = 24.4\, \mu\mathrm{H} and C = 1.05\, \mu\mathrm{F}.
Figure 6: Convergence of relative prediction errors for the different solution variables.

Independent of the convergence behavior, the key quantity needed to evaluate the performance of the index-aware learning approach is the consistency error, defined as \[\begin{align} e(t) \mathrel{\vcenter{:}}= \big\| \mathbf{g}(\mathbf{x}, \mathbf{y}, t, \mathbf{p}) \big\|_2, \end{align}\] compare also 4 . For the true solution we of course have \(e(t) = 0\) for all points in time, however looking at 7, we see that also the simulation contains a (small) consistency error, as is to be expected e.g.due to the tolerance of the nonlinear solver. Taking this simulation error as a baseline, we see that learning all variables directly leads to a much larger consistency error, which is again to be expected. Finally, we see that the reconstructed predictions indeed perform significantly better, matching or even outperforming the consistency error of the simulation. This holds true for both the intrusive approach listed as algebraic in the legend, as well as for the non-intrusive approach based on the implicit Euler method. Lastly, we emphasize that the prediction is generally computed at much fewer points in time than are needed for a full simulation, otherwise learning the solution is of course not a worthwhile approach.

Figure 7: Consistency errors for predictions corresponding to the parameters of 5.
Figure 8: Relative prediction errors corresponding to the parameters of 5.
Figure 9: Prediction corresponding to 5 when learning all solution variables directly.
Figure 10: Prediction corresponding to 5 when reconstructing using implicit Euler.

In addition to the consistency error, we now also look at the prediction error between the simulation and the predictions over time, see 8. Here, we observe that the reconstructed predictions clearly outperform the direct prediction also in this case. While this is not guaranteed in general, it seems likely that ensuring consistency can also improve the overall prediction quality, especially when the direct predictions are not too accurate to begin with. In the particular case of the buck converter however, one can find an even more explicit explanation. Namely, the differential variables turn out to be \(\mathbf{x}^{\!\top}= [\varphi_3^{\!\top}, i_\mathrm{L}^{\!\top}]\). As these two variables are comparatively easy to learn, compare 6, it then appears natural that reconstructing based on them also leads to lower overall prediction errors. This can also be verified visually, by comparing 9 and 10. While \(\varphi_2\) and \(i_\mathrm{V}\) are clearly very badly predicted in 9, their reconstructions in 10 compare much more favorably to the simulation results from 5.

As a final point we note that, running our implementation on a regular laptop (Dell XPS 13 9310), the time taken for the reconstruction is negligible compared to the time it takes to directly predict the solution at a single point in time. For completeness, the reconstruction takes on the order of a millisecond, while the prediction takes around a second, of course depending on the size of the training data set.

5 Conclusion↩︎

We described a non-intrusive extension of the index-aware learning framework introduced in [12]. The extension is based on ideas from [14], [15] and is able to provide physics-consistent predictions for the time and parameter dependent solutions of electrical circuits in a non-intrusive manner, as demonstrated in 7. In addition, the framework may significantly reduce the computational effort required to reach a given prediction accuracy as described in [forstersec:ipap] [forstersec:ex]. Lastly, the framework may also be applied to differential-algebraic equations arising elsewhere, as outlined in 2.

Acknowledgment↩︎

This work is supported by the Graduate School CE within the Centre for Computational Engineering at Technische Universität Darmstadt and the ECSEL Joint Undertaking (JU) under grant No. 101007319.

Appendix↩︎

We now provide proofs for [forsterprop:ac] [forsterprop:ai] [forsterprop:ar]. All proofs closely follow the ideas presented in [14], hence we simply refer to the relevant parts of [14] to avoid reintroducing cumbersome notation.

Proof of [forsterprop:ac]. Recalling the differential part corresponding to 3 that was derived in [14], we observe that the value of a given capacitor does not appear in the differential part if the matrix product \(\mathbf{P}_\mathrm{C}^{\!\top} \mathbf{Q}_\mathrm{V_s}^{\!\top} \mathbf{A}_\mathrm{C}\) contains a zero row at the index corresponding to that capacitor. Here, \(\mathbf{A}_\mathrm{C}\) is the incidence matrix describing capacitors as defined in [14] and \(\mathbf{P}_\mathrm{C}^{\!\top}\) and \(\mathbf{Q}_\mathrm{V_s}^{\!\top}\) are basis matrices as defined in [14] and the proof of [14].

Using insights from the proof of [14], one then sees that it suffices to consider zero rows of \(\mathbf{Q}_\mathrm{V_s}^{\!\top} \mathbf{A}_\mathrm{C}\), as multiplying by \(\mathbf{P}_\mathrm{C}^{\!\top}\) may not introduce additional ones. According to the same proof, such zero rows are generated by capacitors that possess a \(\mathrm{V_s}\)-only path connecting their terminals. As capacitors do not appear in the algebraic part corresponding to 4 , given by [14], this represents the only condition for their values to become algebraic parameters. ◻

Proof of [forsterprop:ai]. For inductors, we observe a similar argument, however this time we require zero rows in \(\mathbf{W}_\mathrm{L}\), compare [14]. Looking at the definition of \(\mathbf{W}_\mathrm{L}\) from [14] together with the proofs of [14], we see that zero rows in \(\mathbf{W}_\mathrm{L}\) correspond to inductors that are not part of any \(\mathrm{L}\)-\(\mathrm{I_s}\) loop in the graph that is created by contracting all circuit elements that are not inductors or independent current sources. This in turn implies that such zero rows correspond to \(\mathrm{L}\)-\(\mathrm{I_s}\) cutsets in the original graph, as the inductors and independent current sources in question would have otherwise formed a loop with elements of different types in the original graph and therefore they would have been contracted away alongside these.

As inductors also do not appear in the algebraic part, this again represents the only condition for their values to become algebraic parameters. Finally, we remark that for multiport or coupled inductors, such as those modeling transformers e.g., all of the relevant inductors need to be part of \(\mathrm{L}\)-\(\mathrm{I_s}\) cutsets for their values to become algebraic parameters in general. ◻

Proof of [forsterprop:ar]. Lastly, we note that the value of a given resistor does not appear in the differential part if that resistor corresponds to a zero row3 in \(\mathbf{Q}_\mathrm{V_s}^{\!\top} \mathbf{A}_\mathrm{R}\), compare again [14]. In fact, such zero rows also suffice for the same resistor to not appear in the algebraic part, as resistors only appear in products of the form \(\bullet \mathbf{Q}_\mathrm{V_s}^{\!\top} \mathbf{A}_\mathrm{R}\) in [14], where \(\bullet\) denotes some matrix of matching dimensions. ◻

References↩︎

[1]
Analog Devices, LTspice.” 2022, Accessed: Aug. 23, 2022. [Online]. Available: https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html.
[2]
Sandia National Laboratories, “Xyce.” 2022, Accessed: Aug. 23, 2022. [Online]. Available: https://xyce.sandia.gov.
[3]
H. Vogt, G. Atkinson, D. Warning, and P. Nenzi, Ngspice user’s manual version 46 (ngspice release version). 2026.
[4]
Infineon Technologies AG, InfineonSpice.” 2026, Accessed: May 12, 2026. [Online]. Available: https://softwaretools.infineon.com/assets/com.ifx.tb.tool.infineonspice.
[5]
Cadence Design Systems, PSpice.” 2022, Accessed: Aug. 23, 2022. [Online]. Available: https://www.pspice.com.
[6]
Synopsis, PrimeSim HSPICE.” 2026, Accessed: Apr. 28, 2026. [Online]. Available: https://www.synopsys.com/implementation-and-signoff/ams-simulation/primesim-hspice.html.
[7]
C.-W. Ho, A. Ruehli, and P. Brennan, “The modified nodal approach to network analysis,” IEEE Transactions on Circuits and Systems, vol. 22, no. 6, pp. 504–509, 1975, doi: 10.1109/TCS.1975.1084079.
[8]
C. Tischendorf, “Topological index calculation of differential-algebraic equations in circuit simulation,” Surveys on Mathematics for Industry, vol. 8, pp. 187–199, 1999, doi: 10.18452/2717.
[9]
G. Alì, N. Banagaaya, W. H. A. Schilders, and C. Tischendorf, “Index-aware model order reduction for differential-algebraic equations,” Mathematical and Computer Modelling of Dynamical Systems, vol. 20, no. 4, pp. 345–373, 2014, doi: 10.1080/13873954.2013.829501.
[10]
P. Benner, S. Grivet-Talocia, A. Quarteroni, G. Rozza, W. Schilders, and L. M. Silveira, Eds., Volume 1 system- and data-driven methods and algorithms. De Gruyter, 2021.
[11]
J. S. Hesthaven and S. Ubbiali, “Non-intrusive reduced order modeling of nonlinear problems using neural networks,” Journal of Computational Physics, vol. 363, pp. 55–78, 2018, doi: 10.1016/j.jcp.2018.02.037.
[12]
I. Cortes Garcia, P. Förster, L. Jansen, W. Schilders, and S. Schöps, “Index-aware learning of circuits,” International Journal of Circuit Theory and Applications, 2023, doi: 10.1002/cta.4024.
[13]
L. Jansen, A dissection concept for DAEs,” PhD thesis, Humboldt-Universität zu Berlin, 2014.
[14]
I. Cortes Garcia, P. Förster, L. Jansen, W. Schilders, and S. Schöps, “A topological decoupling of modified nodal analysis including controlled sources,” 2026, [Online]. Available: https://arxiv.org/abs/2604.20475.
[15]
I. C. Garcia, I. Kulchytska-Ruchka, and S. Schöps, “Parareal for index two differential algebraic equations,” Numerical Algorithms, vol. 91, no. 1, pp. 389–412, 2022, doi: 10.1007/s11075-022-01267-1.
[16]
C. E. Rasmussen and C. K. I. Williams, Gaussian processes for machine learning. The MIT Press, 2006.
[17]
I. Cortes Garcia, P. Förster, W. Schilders, and S. Schöps, “Learning solutions of parameterized stiff ODEs using Gaussian processes,” 2025, [Online]. Available: https://arxiv.org/abs/2511.05990.

  1. These methods also represent the namesake for index-aware learning.↩︎

  2. This includes nonlinear elements and cases where the element model depends on external parameters.↩︎

  3. In principle, zero rows in \(\mathbf{P}_\mathrm{C}^{\!\top} \mathbf{Q}_\mathrm{V_s}^{\!\top} \mathbf{A}_\mathrm{R}\) suffice, however the extra zero rows induced by \(\mathbf{P}_\mathrm{C}^{\!\top}\) will not in general appear in the algebraic part. Thus, only zero rows of \(\mathbf{Q}_\mathrm{V_s}^{\!\top} \mathbf{A}_\mathrm{R}\) are relevant in practice.↩︎