Transient Forward Harmonic Adjoint Sensitivity Analysis

This paper presents a transient forward harmonic adjoint sensitivity analysis (TFHA), which is a combination of a transient forward circuit analysis with a harmonic balance based adjoint sensitivity analysis. TFHA provides sensitivities of quantities of interest from time-periodic problems w.r.t. many design parameters, as used in the design process of power-electronics devices. The TFHA shows advantages in applications where the harmonic balance based adjoint sensitivity analysis or finite difference approaches for sensitivity analysis perform poorly. In contrast to existing methods, the TFHA can be used in combination with arbitrary forward solvers, i.e. general transient solvers.


Introduction
The development cost of devices containing electronic circuits is directly linked to the number of prototyping cycles.A means of reducing the number of prototype cycles is the use of electric circuit analysis tools, such as Spice, that help predict the behavior of the circuits without the need to create any hardware.For time-harmonic systems, the analysis can be performed either in time or frequency domain.Transient circuit analysis treats nonlinear devices by linearizing their behavior at every time step.In frequency domain, nonlinear devices cause a mutual dependence of different spectral components.Thus, frequency domain analyses are not generally possible [1,2].Nonetheless, a nonlinear circuit problem can be solved in frequency domain using the harmonic balance (HB) method [1].The HB method approximates the solution of the steady state for a finite number of harmonics with Newton iteration [3].The HB method avoids the issue of long transients in time domain simulations.However one also has to consider the drawbacks of HB.The more harmonics that are necessary to approximate the nonlinear device behavior, the more degrees of freedom (DoF) the equation system has.Moreover, the convergence of the Newton procedure is suffering in strongly nonlinear systems [3,4].
A systematic approach for circuit analysis is the employment of sensitivity analysis, which aims to reduce optimization cycles in the early stages of development by systematically optimizing certain design parameters [5].A common global sensitivity analysis is performed by computing Sobol indices from a Polynomial Chaos Expansion (PCE) surrogate model.[6].However, PCE and similar methods are limited by the number of design parameters due to the curse of dimensionality [7] that makes this type of analysis unfeasible for large parameter spaces.Another category of sensitivity analysis techniques involves computing the gradient of the Quantity of Interest (QoI) w.r.t.one or more design parameters.Gradient based methods are also referred to as local sensitivity analysis [7].
Adjoint sensitivity analysis is the method of choice for a setting with many design parameters [5,8].Transient adjoint sensitivity analysis [8,9] as well as sensitivity analysis based on HB solvers [10] have been published and used before.Transient adjoint sensitivity analysis is an efficient approach for the analysis of strongly nonlinear systems.However, when dealing with timedependent sensitivities, the inherent part of solving multiple adjoint problems creates a computational bottleneck [5].This issue does not exist for HB based sensitivity analysis.Combining the advantages of transient analysis and HB based adjoint sensitivity analysis, it is possible to utilize an HB based adjoint sensitivity analysis while at the same time avoiding convergence problems and many necessary Newton iterations for strongly nonlinear problems.
This paper proposes the transient forward adjoint harmonic sensitivity analysis (TFHA) as a combination of a nonlinear transient forward analysis with a harmonic adjoint sensitivity analysis.The TFHA is an efficient and robust method for sensitivity analysis in power-electronics applications as demonstrated in practical examples in section 5.This paper is structured as follows: Section 2 gives a brief introduction to the used circuit analysis methods and necessary considerations for the analysis of nonlinear circuits.Section 3 gives an overview over the mentioned sensitivity analysis methods.Section 4 introduces the TFHA as a novel sensitivity analysis method.After that, TFHA is applied to several model problems in section 5. Conclusions on the applicability of the TFHA are drawn in section 6.

Nonlinear Circuit Analysis
To perform the sensitivity analysis, a simulation framework for the considered nonlinear circuits must be introduced first.All presented methods are based on the modified nodal analysis (MNA), which will be introduced first.

Modified Nodal Analysis
MNA has been the method of choice for most circuit problems since its introduction in 1975 [11].MNA extends nodal analysis to accommodate impedance devices such as inductances or voltage sources in addition to the admittance devices.In the static case, the MNA problem reads: The solution vector x contains the nodal voltages u nodes for all nodes and the edge currents i edge for the impedance devices.MNA employs an extended system matrix A, containing the nodal admittance matrix Y , the edge impedance matrix Z of the impedance devices and two incidence matrices B and B T coupling both submatrices: The right hand side i s of the nodal analysis is modified accordingly such that it contains all input nodal currents i nodes and edge voltages u edge for the respective impedance devices:

Nonlinear Transient Circuit Analysis
MNA can be utilized for a transient circuit analysis.The transient MNA is given as a differential algebraic equation (DAE) system where A C contains capacitor and inductor contributions, A G contains conductance contributions and i s contains the independent sources.If the circuit contains nonlinear devices, a linearization of the system is required.This is done by using the Newton method [12] and the introduction of the Jacobian matrix J where i nl denotes the vector of voltage dependent currents for nonlinear admittance devices.For impedance and energy storage devices, the linearization is performed analogously.For transient analyses, the linearization is performed for each time step t.

Harmonic Balance Method
A linear system can directly be transferred to frequency domain [5]: where the underlining indicates the phasors of the corresponding quantities and ω is the circular frequency.The resulting system matrices are combined into a single matrix A = jωA C + A G which gives the consitutive equation for the default MNA in frequency domain: The HB method is a formalism to approximate the solution of a nonlinear system iteratively with a Newton iteration in frequency domain [1].The Jacobian ( 8) is defined at multiple frequencies in order to represent the nonlinear behavior where ω is the vector of all considered frequencies in the system.Approximation with multiple harmonic frequencies increases the number of degrees of freedom (DoF) the stronger the nonlinearities [3].Resultingly, the HB method is very performant in weakly nonlinear systems that exhibit long transient times.This performance advantage is diminished for strongly nonlinear systems due to the exploding number of DoFs.
The holomorphy of the function vector (7) needs to be ensured in the computational domain to define the Jacobian matrix.The Paley-Wiener theorem [13] states that the Fourier transform of a bounded function F ∈ L 2 is holomorphic if the function variable is in the upper half plane, i.e. when t is restricted to ℜ + , which can be assumed in real world applications without the loss of generality.

Sensitivity Analysis
This section summarizes known methods to obtain the sensitivity for a QoI U w.r.t.one or multiple design parameters p.The QoI can be any quantity within the circuit such as an edge voltage or current.Design parameters in our application are components within the circuit, such as inductances, capacitances or resistances.The presented methods are limited to gradient based sensitivities.This limitation is introduced since the applications exhibit very large parameter spaces which makes global sensitivity analysis not well suited [7].

Transient Direct Sensitivity Analysis
U (x) depends on the circuit solution, and hence, indirectly on time.Therefore, the calculation of the sensitivity [8]: involves the calculation of the derivative dx/dp of the circuit solution x w.r.t. the parameter p. ∂U/∂x is a mapping operator that obtains the sensitivity for the QoI from the derivative dx dp .dx dp is obtained by taking the derivative of (4) w.r.t.p.
This approach is referred to as direct sensitivity analysis (DSA) [5].Eq. (10) needs to be solved individually for every design parameter.As a result, DSA is expensive for the sensitivity analysis w.r.t.many design parameters.

Transient Adjoint Sensitivity Analysis
Transient adjoint sensitivity analysis determines sensitivities based on the system solution x and a test function λ.The workflow for transient adjoint sensitivity analysis is outlined in Fig. 1.To obtain the adjoint sensitivity analysis, differential equation ( 10) is multiplied with λ as a test function and integrated over time: (11) Integration by parts eliminates the time derivative of dx/dp [5]: Without loss of generality λ is chosen as the solution of the adjoint system, to eliminate the boundary terms and accommodate the left hand side term: The adjoint solution is calculated backwards in time to ensure the reverse initial condition λ(t = t m ) = 0 for arbitrary t m [8].The term at t = 0 is eliminated due to the initial condition x(t = 0) = 0 in Eq.( 4).Substituting Eq.( 13) into Eq.(12) and multiplication by -1 yields the integration for the sensitivity of the QoI U .
The generalized version of Leibniz integral rule is applied to the right hand side term [14], to obtain the sensitivity for the QoI at a specific time instant t m : There is an adjoint solution for each time instant t m , as computed by solving equation (13).Thus, the task of computing the solution to Eq.( 13) has to be redone for each instant in time where the sensitivity is to be considered.

Harmonic Balance based Direct Sensitivity Analysis
Analogously to the transient case, DSA is derived by symbolic differentiation of the reverse initial condition from Eq.( 7) for the HB method.
From Eq.( 16) we can solve the system for the sensitivity dx/dp: The Jacobian is determined in each Newton iteration when used for the harmonic balance solver.If the goal is to perform sensitivity analysis based on an existing circuit solution, the Jacobian is given as the converged solution from the nonlinear problem [10].If many design parameters p are analyzed, the numerical efficiency of HB based direct sensitivity decreases, because Eq.( 17) contains a matrix multiplication with the dense matrix J −1 .This dense matrix multiplication can be avoided by introducing an HB based adjoint sensitivity analysis.

Harmonic Balance based Adjoint Sensitivity Analysis
The adjoint system for the harmonic balance case ( 16) is given as As the Jacobian does not depend on the adjoint solution λ, the adjoint problem is linear.The sensitivity of the QoI U (p) w.r.t. the design parameter p follows as: In frequency domain, the adjoint solution can be reused for all considered frequencies, which eliminates the issues of the transient analysis but increases the number of DoFs for large frequency spaces.Compared to the HB based direct sensitivity analysis, HB based adjoint sensitivity analysis does not contain any dense matrix multiplications, improving performance.The procedure is outlined as the green dashed box in Fig. 2. The issue that remains is the bad performance for strongly nonlinear systems.This is particularly problematic when the Jacobian has to be approximated along many convergence steps of the HB iteration (Eq.( 7)).A hybrid time-frequency domain method, that eliminates the issue of many Newton iteration steps, is proposed in the following section.

Transient Forward Harmonic Adjoint Sensitivity Analysis
The HB method is well suited for simulating steady-state operation.If strong nonlinearities occur, the harmonics become coupled across a wide range of frequencies.Especially in the context of power electronics, short rise and fall times are present, which requires us to consider a large number of harmonics [3].A procedure consisting of a forward HB solve combined with a harmonic adjoint method for calculating the sensitivities was proposed in [10] and has been recapitulated in section 3.3.Obtaining the forward solution for x with the harmonic balance method is not compulsory for the sensitivity analysis.This motivates the following procedure.The circuit solution is calculated by a transient circuit solver.The adjoint solution is obtained by a harmonic analysis.This procedure extends the HB based adjoint sensitivity analysis (in green) as depicted by the red dotted box in Fig. 2.
The TFHA obtains the circuit solution x through the utilization of an efficient transient solver of choice.Once an approximation to the steady state is found, the Fourier transform x of one period of x is used to calculate the Jacobian J .The approximated Jacobian matrix is then used to obtain the adjoint solution in frequency domain, analogously to the way presented in section 3.4.Subsequently, the adjoint solution is combined with the symbolic derivative of system matrix dA/dp to calculate the sensitivities.Depending on the application, the sensitivity can be illustrated as a frequency spectrum or be transformed back to time.
The TFHA is exposed to information loss which results in a residual error, due to a finite number of harmonics.The Euclidean distance of the solution with fewer harmonics against the solution with more harmonics quantifies the residual.This is based on the idea of the Zienkiewicz-Zhu error estimator [15].The relative error is approximated by the quotient of the absolute error divided by the norm of the fine solution: Without prior considerations of the spectral circuit behavior, the sensitivity is determined by iteratively increasing the number of harmonics.The quantification of the error (Eq.( 20)) is finally used as a termination condition to assess the converged solution.

Results
The TFHA is illustrated for three different examples: A half-wave rectifier as a nonlinear, academic example and two different power electronics circuits serving as industrial examples.

Half-Wave Rectifier
A half-wave rectifier rectifier (Fig. 3) consists of only one nonlinear and two linear components.Fig. 4 displays both the time domain and the frequency domain sensitivity of the output voltage w.r.t. the resistance R. Due to the weak nonlinearities within the circuit, the sensitivity solution converges fastly even for a small number of harmonics.

Boost Converter
A boost converter is a type of DC-DC converter circuit which is used in many power electronic applications.In a circuit model, parasitic effects can be modeled as lumped circuit elements such as resistances, inductances and capacitances.The circuit with parasitic lumped elements is shown in Fig. 5.The sensitivity of the drain voltage V drain w.r.t. the output resistance R 1 is shown in Fig. 6.A significant overshoot is observed for the sensitivity and the drain voltage throughout the switching process.This is attributed to the broadband nature of the system.The overshoot can heavily influence the sensitivities especially close to the switching of the transistor.Hence, this is a relevant test for accuracy and performance of the algorithm.The results in Fig. 6 show that     the algorithm correctly approximates the overshoot while limiting the Gibbs ripples when a frequency domain solution with an insufficient number of harmonics is calculated.The spectral TFHA solution gives a good indication of this behavior (Fig. 7).The spectrum does not decrease steadily for higher harmonics, but rather shows a side lobe, with higher peaks at around 0.8 MHz.

Active Filter Circuit
An active filter circuit that injects a reversed polarity noise signal serves as an example with a larger number of elements.This circuit is nonlinear.Fig. 8 shows a reduced schematic of the entire active filter setup as used in the analysis.The complete circuit consists of 240 linear and nonlinear elements and has 152 degrees of freedom.The circuit contains several specific transistor and diode models.The Xyce [16] circuit simulator is used to assemble the Jacobian in frequency domain.The sensitivity of several QoIs is analyzed w.r.t.several design parameters of the The first QoI is the output potential of the OPAMP V(OP out ). Due to the filter properties of the circuit, the quantity OP out is smoother than other quantities in the circuit (Fig. 8).The sensitivity results for the QoI V(OP out ) w.r.t.the capacitances C 1 and C 2 as well as the resistances R 1 and R 2 are shown in Fig. 9.The capacitances show a large influence on the amplitude of V(OP out ).The resistances strongly influence the pre-filter properties on the input of the OPAMP.As a result, variations of the resistances lead to sensitivities which vary quickly in time.It is conclusive that    The sensitivity analysis is executed for all design parameters in the circuit to benchmark the performance of the TFHA.The adjoint solution is calculated in 20 seconds using the implementation of Eq.( 18).The evaluation of the sensitivity with Eq.(19) takes less than 2 seconds for each design parameter.This is a significant speedup compared to existing methods for the given example.Direct sensitivity analysis with Xyce takes 12 seconds for each design parameter.As a result, a speedup of 85 % can be observed for the considered number of design parameters.The sensitivities for the ten most influential design parameters are listed in table 1.Note here that the design parameters not visible in Fig. 8 are part of the load impedance Z load .The input node of the active filter has more oscillations at high frequencies.As Fig. 10 shows, the V(OP in ) sensitivity w.r.t.C 2 requires more spectral components for a high frequency approximation.To illustrate this, the sensitivity of V(OP in ) w.r.t.element C 2 is calculated with the TFHA and compared to the sensitivity solution of the direct sensitivity solver of Xyce [17].The comparison is shown in Fig. 10.As expected, TFHA can accurately determine the sensitivity in smooth intervals but deviates for sharp peaks.

Conclusions
This paper recapitulated transient adjoint sensitivity analysis methods as well as HB based adjoint sensitivity analysis for nonlinear circuits.Transient forward harmonic adjoint sensitivity analysis (TFHA) which combines transient solvers with harmonic adjoint sensitivity analysis was introduced as a novel method that improves the efficiency of sensitivity computation with regards to a large number of parameters.Results calculated by the TFHA have been presented and compared to results calculated by transient or harmonic adjoint sensitivity analysis.
TFHA is advantageous in applications where purely transient sensitivity analysis is costly, but the HB method itself might need many Newton iterations to converge.This can be the case in fastly oscillating or strongly nonlinear systems [3], such as power electronic applications.The TFHA requires one steady state time domain solution obtained by a solver of choice and only one solution for the adjoint system and therefore one inversion of the Jacobian matrix.The TFHA performs well in weakly nonlinear systems where many design parameters are considered.Additionally, TFHA is particularly performant for sensitivity analysis on time-dependent QoIs, since it requires only one adjoint solution in such scenarios.

Figure 1 :
Figure 1: Workflow of the transient adjoint sensitivity method.

Figure 2 :
Figure 2: Workflow for the harmonic balance based adjoint sensitivity analysis and the TFHA.

Figure 3 :
Figure 3: Schematic of a functional half-wave rectifying circuit.

Figure 4 :
Figure 4: Sensitivity of the output voltage w.r.t. the resistance R for the halfwave rectifying circuit in time and frequency domain.

Figure 5 :Figure 6 :
Figure 5: Boost converter circuit model with parasitics.The elements L 1 , R 1 , C and M model the functional behavior of the boost converter, the elements R 2 , L 2 , R 3 , L 3 , R 4 and L 4 are parasitic elements which model the EMC effects on the circuit board.

− 1 ]Figure 7 :
Figure 7: Sensitivity spectrum dV drain /dR 1 of the boost converter circuit showing a significant spectral content at around 0.8 MHz that must not be neglected.

Figure 8 :
Figure 8: Functional schematic for the nonlinear active filter circuit.

Figure 9 :
Figure 9: Sensitivity results for V(OP out ) of the nonlinear active filter w.r.t.different design parameters.

Figure 10 :
Figure 10: Sensitivity results for V(OP in ) w.r.t.capacitance C 2 of the filter circuit computed by the TFHA compared to the transient direct Xyce [17] sensitivity solution.

Table 1 :
List of the ten most influential design parameters (ten largest normalized sensitivities).