Efficient sensitivity analysis of lumped elements with respect to finite‐element geometry changes

Sensitivity analysis enables powerful gradient‐based mathematical programming techniques in the optimization of electromechanical products with respect to electromagnetic compatibility requirements. We present a sensitivity analysis method based on finite element solutions of both a magnetoquasistatic system in a tree‐cotree gauge and an electrostatic system. A repeated application of the adjoint method ensures a high computational efficiency, which is showcased in a comparison with an earlier approach. Application examples provided are the optimization of a noise filter and the sensitivity computation of a choke with dispersive magnetic core.


| INTRODUCTION
Topology and shape optimizations are well established in state-of-the-art design workflows in mechanical engineering. 1 It is obvious that electromechanical products, especially those where space and performance are key, can also benefit greatly by analogous topology or shape optimizations. Analysis of products with regards to electromagnetic compatibility requirements is often performed in a combination of the electric circuit domain, governed by Kirchhoff's laws, and the electromagnetic field domain, as described by Maxwell's equations. The connection between those domains is established by the extraction of so called parasitic elements from the field domain that can be used as stand-in lumped parameters in circuit simulations.
Efficient gradient-based optimization algorithms can be facilitated by adjoint sensitivity computation methods. A sensitivity analysis method for parasitic lumped elements was developed for applications in electromagnetic compatibility (EMC) by Schuhmacher et al. 2 It utilizes the finite element (FE) method to extract parasitic resistances R, partial inductances L, and capacitances C from a CAD model and computes their sensitivities dR=dp i , dL=dp i , and dC=dp i with respect to a number of parameters p i of the finite element mesh (usually translations of either surface nodes or faces of the mesh). These sensitivities can subsequently be used to calculate sensitivities dQ=dp i of a quantity of interest Q ¼ Q R,L, C ð Þwith the chain rule, An application of the method in the optimization of a pressure sensor 3 attests to its merit. To facilitate the efficient computation of the tens or hundreds of thousands of sensitivities required in industrial applications, Schuhmacher et al. employ the adjoint method. 4 Their approach, however, still suffers from performance issues as it computes the inductive sensitivities dL=dp i in an indirect fashion, using Darwin's approximation to Maxwell's equations and a post-processing step to isolate the inductive from the capacitive behavior. Additionally, the approach exhibits instability and accuracy issues. To resolve these drawbacks, we propose a revised approach for the computation of inductive sensitivities based on the magnetoquasistatic (MQS) approximation in a tree-cotree gauge. It is derived by applying the adjoint method multiple times in succession to the linear systems resulting from a FE discretization of the used systems of differential equations. In addition to resolving the performance, stability, and accuracy problems of the Darwin approximation approach, it can also be used in a complex-valued form that allows for the simultaneous computation of both the resistive and inductive sensitivities at a given frequency point.
Section 2 summarizes a FE-based parasitic resistance and inductance extraction approach, that we introduced in a recent paper, 5 and executes the FE discretization to arrive at the linear equation systems needed for the sensitivity analysis. Section 3 employs the adjoint method to derive efficient expressions for computation of both the inductive sensitivities dL=dp i and resistive sensitivities dR=dp i . Section 4 summarizes the electrostatic capacitance extraction and capacitive sensitivity computation approach of Schuhmacher et al., 6 and extends it to the case of more than two conductors. Section 5 discusses several numerical results: The sensitivity analysis is employed to optimize a noise filter. The complex-valued sensitivity computation is exemplified with the model of a coil that features a magnetic core with a dispersive complex permeability. And finally the advancements of our new MQS-based computation method of inductive sensitivities are highlighted in a comparison with the original method of Schuhmacher et al., before Section 6 concludes the paper.

| Field-theoretical model
A CAD model is given, providing the relative permittivity ε r , relative reluctivity ν r , and electric conductivity σ in the computational domain Ω. The domain is divided into the conducting subdomain Ω c were σ > 0 (and which can consist of multiple disconnected conductors) and the non-conducting subdomain Ω 0 ¼ ΩnΩ c . The boundary ∂Ω of the domain is the unity of an electric boundary Γ el and a magnetic boundary Γ mag , To calculate an N-port impedance matrix Z, N numerical experiments are conducted, in each of which an electric scalar potential ϕ c is calculated for a specific source current density J s. 5 The subscript c of the scalar potential indicates that it is a compensated potential for which any unwanted inductive influence of J s is de-embedded. The field calculations consist of three steps: First the auxiliary field g is calculated by solving the boundary value problem (BVP) Here, divJ s is the given divergence of the source current J s , which injects the current I 0 at one terminal of port i and extracts it again at the other one, and n denotes the normal on the boundary ∂Ω. The scalar field g is used both to produce the source current density with a gradient field ansatz, J s ¼ ε r gradg, and to later eliminate the inductive influence of J s in the computation of ϕ c . In a second step, Maxwell's equations are solved in the MQS approximation in a potential form. The magnetic flux density and electric field strength are expressed with the magnetic vector potential A and the electric scalar potential ϕ as B ¼ curlA and E ¼ ÀjωA À gradϕ, respectively. The potentials can be determined with the BVP Àdivσ Here, (3a) is Ampère's law (in the MQS approximation without displacement current) and (3b) is the divergence of (3a), which is equivalent to the continuity equation in absence of free charges. There are no boundary conditions on ∂Ω provided for ϕ as the electric scalar potential is restricted to the conducting subdomain Ω c . Finally, the compensated scalar potential ϕ c is calculated with Here, μ 0 denotes the vacuum permeability. For an excitation term divJ i ð Þ s causing the current I 0 to flow through port i, the element Z ji of the impedance matrix capturing the response in port j can be calculated from the compensated scalar potential ϕ i ð Þ c with the measurement functional p j , Here, T a and T b are the terminal surfaces of port j, and A T a ð Þ and A T b ð Þ denote their respective surface areas. The resistance and inductance matrices are given by R ¼ Re Z ð Þ and L ¼ Im Z ð Þ=ω, respectively.

| Perfect electric conductor approach for inductance extraction
For many EMC applications, the main focus lies on the inductive (and capacitive) behavior at higher frequencies, and it is sufficient to compute the inductance matrix L and its sensitivities. A very efficient way to compute L directly with a smaller, real-valued BVP is by modeling all conductors as perfect electric conductors (PECs). This approach gives the external inductance, which is the frequency-independent part of the inductance associated with the magnetic vector potential A outside the conductors and the only part that remains in the high frequency limit. 7 In the PEC case, A has to be calculated in the non-conducting domain while the electric scalar potential ϕ vanishes. Hence, (3) collapses to the real-valued BVP The conductors are considered with the boundary condition (6b). A frequency-independent compensated scalar potential ϑ can be calculated from A with The element L ji of the inductance matrix capturing the inductive response at port j to the potential ϑ i ð Þ excited by the current I 0 through port i can be calculated analogously to (5) with the measurement functional p j ,

| Finite element discretization
After generating an FE mesh of the domain Ω, finite-dimensional subspaces of the scalar Hilbert space H 1 Ω ð Þ and the vectorial, curl-conforming Hilbert space H curl, Ω ð Þcan be constructed to discretize the BVPs: The condition of (11) demanding that the elements of V h have a non-vanishing curl can be fulfilled with a tree-cotree splitting, 8 in which a spanning tree is constructed from the graph of nodes and edges of the FE mesh and for which then all first-order basis functions associated with the edges of the tree are disregarded (higher orders p > 1 can also be treated 5 ). This ensures that the operator matrix resulting from a discretization of the curl-curl operator of (3a) has full rank and minimal dimension. The fields of the BVPs (2), (3), and (4) are discretized with the functions with the degrees of freedom (DOFs) g i , a i , ϕ i , and ϕ c i . The scaling ffiffiffi ffi ω p in the discretization of ϕ is needed such that the system matrix of the BVP (3) is symmetric.
Testing the partial differential Equations (2a) and (4a), (3a), and (3b) in a Galerkin approach with the elements of spaces P h , V h , and P σ h , respectively, and integrating over the domain Ω(and using the divergence theorem) transforms the three continuous BVPs into algebraic linear systems of equations, Here, g, a, ϕ, and ϕ c are the DOF vectors (e.g., g ¼ g 1 , g 2 , … ð Þ T ). The elements of the various operator matrices are given by (14) is given by the expression with the test functions ϕ i P h . The elements of the RHS b ϕ of (15) are constructed with an analogous expression using the test functions ψ σ i P σ h . The discretized equivalent of (5) calculating the element Z ji of the impedance matrix is hence with the measurement vector f j ð Þ c . Using a direct solver to solve the linear systems (14)-(16) allows to calculate the full impendace matrix Zat once by using the matrix-valued RHS The discretization of the PEC case BVPs (6) and (7) is analogous to the lossy case (however, the space of vectorial trial and test functions now being e V h instead of V h ). It yields the real-valued linear systems The inductance matrix L (not to be confused with the Laplace operator matrices L ε and L σ ) can be computed analogously to (20) with a matrix-valued RHS B g and solution Θ,

| COMPUTATION OF RESISTIVE AND INDUCTIVE SENSITIVITIES
To enable an efficient calculation of a large number of geometric sensitivities dZ=dp i of the impedance matrix it must be avoided to solve the three BVPs (14), (15), and (16) multiple times. This can be achieved by using the adjoint method, 4 with which an expression for dZ=dp i can be derived that needs the solution vectors g, a, ϕ, and ϕ c only for the original choice of geometric parameters p i . It introduces the derivatives with respect to p i solely through the geometric derivatives of the linear operators of (17), which can, due to their sparsity, easily be assembled with a finite difference scheme.
The following subsection introduces the concept of the adjoint method, and Section 3.2 applies the method to the systems of linear equations introduced in Section 2.3.

| Adjoint solutions in sensitivity computation
A scalar quantity of interest (QOI) y is given as the product of the measurement vector f and solution vector x of a linear system of equations (as in the calculation of the element Z ij of the inductance matrix with (5)), with The superscript H denotes the adjoint (i.e., conjugate transpose) of a vector or matrix, A is a linear operator and b is the right-hand side vector. If many QOIs have to be calculated with the same vector f (but different right-hand sides b), the adjoint method can be used to compute y directly as the scalar product of an adjoint solution λ with the right-hand side b of (25). The adjoint solution λ is calculated solving the adjoint linear system With the adjoint solution λ the QOI y can be expressed as The relevance of the adjoint method for sensitivity computations becomes clear when considering the geometric sensitivities of the QoI y, Differentiating (25) with respect to the geometric parameter p i gives Subtracting the first left-hand side term and inserting the result into (28) yields Hence, if both the primal solution x and the adjoint solution λ are known, only the geometric derivatives of the operator and right-hand side of (25), dA=dp i and db=dp i , respectively, have to be computed to calculate the sensitivity dy=dp i of the QOI. The derivative dA=dp i of the already sparse FEM operator A can be efficiently assembled with a finite difference scheme, which yields a highly sparse result. Furthermore, if A is real and symmetric, as the operators L ε and K ν of the discretized BVPs (14) and (21) are, then A is also self-adjoint, A H ¼ A. In this case A has to be factorized only once to compute both the primal solution x and the adjoint solution λ with a direct solver.

| Efficient calculation of resistive and inductive sensitivities
The considerations of the previous subsection are now applied to the computation of the geometric sensitivities of the scalar impedance Z of a one-port system, as well as to the computation of the sensitivities of a one-port inductance L with the PEC approach. Multi-port systems can be treated analogously by using matrix-valued right-hand sides and solutions as discussed in Section 2.

| Sensitivities of the impedance matrix
Applying the adjoint sensitivity calculation of (30) to the impedance expression (5) yields together with the BVP for ϕ c , (16), the following result for the sensitivity of the impedance is obtained, The adjoint solution λ c is determined by the real-valued linear system L ε λ c ¼ f c (as L ε is symmetric real and hence selfadjoint). The term λ T c db c =dp i ð Þ in (31) must be broken down further using the right-hand side of (16) and the defini- The last two terms in (32) can again be treated with the adjoint method. Using the linear systems for x aϕ and g, (15) and (14), two additional adjoint solutions can be calculated by With these adjoint solutions the terms in question can be expressed as The derivative db g =dp i is zero since geometrical variations of the terminal surfaces are not considered in our method and b g is zero in all elements except those belonging to the terminal surfaces. Thus, only the last term in (35) remains to be treated. Dividing λ aϕ into two parts of the lengths of a and ϕ, λ aϕ ≕ λ a , λ ϕ À Á T , yields The second term on the right-hand side demands again an adjoint solution λ ga , which is calculated analogously to (34): This leads to an equation analogous to (36): With this, all individual terms are treated and the result can be assembled. Firstly inserting (39) into (37) and the resulting equation into (35) gives The final result for dZ=dp i is then produced by inserting (36) and (40) into (32) and the resulting equation into (31), which yields with λ g ≔ λ ga À jωλ gc . The resistive and inductive sensitivities are simply dR=dp i ¼ Re dZ=dp i ð Þ and dL=dp i ¼ Im dZ=dp i ð Þ=ω, respectively.

| Sensitivities of the PEC case inductance matrix
For models that do not include any materials with a strongly dispersive magnetic permeability μ, a frequency-independent approximation of the inductive sensitivities dL=dp i can be sufficient to answer many EMC-driven questions. In this case the PEC approach of Section 2.2 provides a computationally very efficient way to calculate the inductive sensitivities, because it only involves real-valued BVPs, and needs significantly fever DOFs, since its central BVP (6) determines only the magnetic vector potential A in the non-conducting subdomain Ω 0 . The derivation of an expression for the inductive sensitivities is analogous to that of the sensitivities of the impedance matrix, using the BVPs determining ϑ and a (22) and (21), respectively, instead of (16) and (15). We therefore state only the result here, with λ g ≔ λ gϑ þ λ ga . The linear systems determining the adjoint solutions are

| CAPACITANCE EXTRACTION AND CAPACITIVE SENSITIVITY COMPUTATION
The electrostatic (ES) extraction of a capacitance matrix C and computation of capacitive sensitivities dC=dp i presented by Schuhmacher et al. 6 is much less involved than the extraction of resistances and inductances and their sensitivity analysis as discussed in Sections 2 and 3. However, since Schuhmacher et al. do not treat the general case of an arbitrary number of conductors and terminals, a brief discussion of the general method is given here for completeness. A relationship between the ES potential φ and the nodal capacitance matrix C N is established by equating the electric field energy with the capacitive energy Here, φ c is a vector whose elements φ c,i are the potentials on the different conductors in the computational domain, and C N is defined by q ¼ C N φ c with q being the vector of charges on the conductors. Providing a vector φ c of potentials on the conductors, the ES potential is determined in the whole domain Ω by solving Gauss' law in the non-conducting subdomain Ω 0 ¼ Ω ∖ Ω c with Dirichlet boundary conditions on the surfaces ∂Ω c,i of the conductors and a magnetic boundary condition on the outer boundary ∂Ω ¼ Γ mag , The magnetic boundary condition (48c) guarantees a charge-free outer boundary and prevents any capacitive coupling between the boundary and the conductors of the model (i.e., setting the self-capacitances of the conductors to zero). Ultimately, we are not interested in the densely populated nodal capacitance matrix C N but rather in a diagonal branch capacitance matrix C, whose diagonal consists of the mutual capacitances C ij between all conductors iand j. Using the incidence matrix Athat contains a number of Nconductors as nodes and all possible conductor pairings as branches, to relate the nodal and branch capacitance matrices, C N ¼ ACA T , yields the expressions for the main-and off-diagonal elements of C N To calculate the capacitances C ij of an N conductor system, the BVP (48) is solved N times with the FE method, setting the potential to φ 0 on one conductor i and to zero on all other conductors. This yields N FE solution vectors φ i (associated with the function space P h introduced in (9)), that are firstly used to compute the main-diagonal elements of the nodal capacitance matrix C N with (47) The linear operator L ε is defined in (17).
The main-diagonal elements of C N are subsequently used to determine the sought capacitances C ij : Exploiting the linearity of the BVP (48), linear combinations φ ij ¼ φ i À φ j of the FE solution vectors φ i represent the results of experiments where the ES potential is set to φ 0 and Àφ 0 on the conductors i and j, respectively, and to zero on the remaining conductors. The capacitances are then given by To be able to combine the ES capacitances with the extracted MQS resistances and inductances of Section 2, they must share a circuit topology with the same nodes. In the MQS problem, there are typically at least two terminals on each conductor. For the ES problem, it is therefore necessary to divide the conductors into parts closest to each terminal and treat each part as a separate conductor in the capacitance extraction, while ignoring capacitances C ij between two parts of the same conductor.
For the computation of the capacitive sensitivities dC=dp i Schuhmacher et al. 6 show that only the derivative of the linear operator has to be considered as the sensitivities do not depend on the derivatives of the DOF vector φ. For the case of an arbitrary number of conductors this yields 5 | NUMERICAL RESULTS

| Noise filter optimization
Shiraki et al. 9 present a noise filter in a signal line, that consists of a shunt capacitor and a coil for inductance cancelation, which improves the filter performance in the high-frequency regime. Comparing their filter with coil "β" to a filter without coil, the authors report an attenuation of the relevant scattering parameter S 21 of about 20 dB for frequencies f > 30 MHz. While the paper lists the total length and width of the coil, it does not provide the optimal distance d between the inner and outer windings. To showcase how the sensitivity analysis helps to determine optimal design parameters, we created a CAD model of the filter with an initial coil design with d ¼ 0:7 mm. A simulation of S 21 with the commercial tool CST Studio Suite (in which the shunt capacitor was modeled as a lumped element) of both the filter without coil and with the initial coil design suggests that the coil leads to an attenuation of only ≈ 1:8dB for f > 30 MHz. Expressing the scattering parameter with the frequency-independent inductances of Section 2.2 and the capacitances of Section 4, S 21 ¼ S 21 L, C ð Þ, the sensitivities dS 21 =dp i can be calculated from the inductive and capacitive sensitivities with (1). Figure 1 shows a sensitivity map of the scattering parameter, in which shades of blue and red on the conductor's surface indicate that a shift of the colored face in the direction of its normal would decrease and increase S 21 , respectively. The map hence suggests that an optimized coil design must have a smaller distance d between inner and outer winding.
To test this result, we manufactured the filter without coil, with the initial coil design, and with a new coil design with d ¼ 0:4 mm. Figure 2 displays the scattering parameter S 21 of the three designs measured with a vector network analyzer. Whereas the initial coil leads to an attenuation of only 1:3 À 1:8 dB in the frequency interval 30 MHz, 1 GHz ½ , the optimized coil design provides in the same interval an attenuation of 12 À 15 dB. A second iteration of sensitivity analysis can be expected to improve the attenuation even further but was not performed for this example.

| Choke with magnetic core
The ability to consider the resistive and inductive sensitivities frequency-dependently with the expression of (41) is demonstrated with the model of a choke with a cylindrical magnetic core, as shown in Figure 3. The small-signal relative magnetic permeability μ r of the core material is modeled using a first-order Debye model, with μ ∞ ¼ 1, μ s ¼ 2500, and τ ¼ 100 ns. An optimal choke possesses a maximal inductance L and a minimal resistance R. To investigate how the choke can be optimized by changing the core's shape, the sensitivities of the choke's inductance and resistance with respect to shifts of mesh faces on the core's surface are computed at both ends of the relevant frequency interval 100 Hz,1 GHz ½ . The results are displayed as sensitivity maps in Figure 4. Whereas the inductive sensitivities remain largely constant in the frequency interval, the resistive sensitivities at 100 Hz are much smaller than those at 1 GHz, both absolutely and relative to the values of R at these frequencies, R 100 Hz ð Þ¼1:4 mΩ and R 1 GHz ð Þ¼1:2 kΩ. For f ¼ 1 GHz the optimal shape of the core maximizing the inductance while minimizing the resistance cannot be inferred from the sensitivity map directly, as a bone-like shape would maximize both quantities. A sensitivity analysis with respect to Cartesian F I G U R E 1 Sensitivity map of scattering parameter S 21 of the noise filter with respect to shifts p i of the conductor faces in the directions of their normals. Shades of red and blue indicate positive and negative sensitivity dS 21 =dp i , respectively. The added arrows emphasize how the coil design must be changed to minimize the scattering parameter F I G U R E 2 Measured scattering parameter S 21 of filter design without coil, with initial coil design of Figure 1, and with optimized coil. Whereas the initial coil leads to an attenuation of only 1:4 dB compared to a model without coil at f ¼ 100 MHz, the optimized coil suggested by the sensitivity analysis achieves an attenuation of 12:5 dB shifts of the core's mesh nodes can be utilized for a multi-objective gradient-based shape optimization. This is, however, beyond the scope of this work.

| Performance comparison
The performance of the direct inductive sensitivity computation method derived in Section 3.2.2 can be compared to that of the method of Schuhmacher et al., 2 as both methods use PECs to compute frequency-independent inductive sensitivities dL=dp i without considering ohmic losses. The two terminals of each port used to extract the inductance matrix L as described in Section 2 must be galvanically connected (i.e., lie on the same conductor). The arrangement of terminals (nodes of the circuit) into ports (branches of the circuit) can be expressed with an incidence matrix A. In contrast our MQS-based extraction which simulates only the behavior of the galvanically connected branches, Schuhmacher et al. use the Darwin approximation to compute the complete nodal impedance matrix Z N , which also includes F I G U R E 3 Choke consisting of a coil around a magnetic core (total length 34 mm) F I G U R E 4 Maps of the inductive and resistive sensitivities of the choke model with respect to shifts of the magnetic core's faces at frequencies f ¼ 100 Hz and f ¼ 1 GHz. Whereas the inductive sensitivities are almost identical at the two frequencies, the low-and highfrequency resistive sensitivities differ drastically capacitive effects. Their method therefore requires several post-processing steps to arrive at dL=dp i , which are summarized here: 1. Compute the sensitivities dZ N dp i f ð Þ of the nodal impedance matrix at two or three frequencies f . This is necessary to separate the inductive and capacitive contributions to dZ N dp i in a least-squares fit.
2. Invert the impedance sensitivities, dY N dp i N , and extract the nodal (inverse) inductive and capacitive sensitivities with a fit to dY N dp i 3. Use the pseudo-inverse A þ of the incidence matrix for a transition to sensitivities of an inverse branch inductance matrix, dL À1 dp i N dp i A þT , and invert again to arrive at the final result of the inductive sensitivities dL dp i ¼ ÀL dL À1 dp i L.
The two largest drawbacks of this method are the large dimension and hence computation times of the Darwin approximation system (compared to the more efficient MQS system), and the sometimes difficult choice of the frequencies in its first step. The fit requires the frequencies to be below the first resonance of the impedance but also above the low-frequency regime, where the Darwin system used by Schuhmacher et al. exhibits a loss of stability.

| Computation times
To exemplify the increased performance of our new approach, we considered the model of a pressure sensor also used by Benz et al. 3 There are 37 terminals defined on its conductors, leading to a branch inductance matrix L of dimension 26 Â 26. The model is meshed with 250 000 tetrahedra, and 39 000 face sensitivities dL=dp i are computed on a 2.8 GHz Intel Xeon CPU. The computation times listed in Table 1 indicate that our MQS-based approach is 6.5 times faster than Schuhmacher et al.'s original approach.

| Treatment of g-field derivatives
In the derivation of the inductive sensitivities dL=dp i of (42), not only the geometric derivatives of the scalar potential ϑ and magnetic vector potential A are treated with the adjoint method but also the derivatives dg=dp i of the auxiliary field F I G U R E 5 Inductive sensitivities dL=dp i of a wire with square cross section with respect to Cartesian shifts p i of the wire's surface nodes, both excluding terms with derivatives dg=dp i of the auxiliary field g (red) and including these terms via the adjoint method (green). Near the end of the wire (i.e., a terminal surface) the former result features a spurious longitudinal component, which should be avoided especially if the result is to be used for an automated shape optimization g, which appears on the right-hand side of (6a) (since J s ¼ ε r gradg) and (7a). Schuhmacher et al. did not apply the adjoint method to the g derivatives but rather listed the linear system to be solved in order to compute dg=dp i directly. A direct computation of dg=dp i , however, becomes prohibitively expensive for larger models with a high number of geometric parameters p i . The authors note that the dg=dp i terms are significant only for sensitivities associated with mesh nodes or faces near the terminals, and thus can be neglected if necessary. However, treating the terms in our new approach with the adjoint method allows them to be considered also for large models without significant penalty. Figure 5 shows the influence of these terms for inductive sensitivities dL=dp i of a wire with square cross section with respect to Cartesian shifts p i of the mesh nodes on the wire's surface. Especially if the sensitivities are to be used for gradient-based shape optimization, a correct computation of the gradients in all areas is paramount.

| CONCLUSIONS
In this work, we developed a numerically efficient and stable sensitivity analysis method for electromagnetic compatibility applications, that is based on a finite element parasitic extraction method. It uses inductive, capacitive, and resistive sensitivities to compute the sensitivities of arbitrary quantities of interest that can be expressed with the extracted parasitic lumped elements. Expressions for the resistive and inductive sensitivities are derived by applying the adjoint method multiple times to the linear systems that result from the finite element discretization of a set of magnetoquasistatic differential equations. An expression for capacitive sensitivities is found by generalizing an earlier method. Several numerical experiments are discussed: A typical use case is given with the application of the method in the optimization of a noise filter. The ability to consider the frequency dependence of sensitivities is showcased using the model of a choke with magnetic core. Finally, our method's computational efficiency, accuracy and stability are highlighted in a comparison with an earlier method.