Internal Node Removal

We describe how to produce more compact MNA formulations by building composite models
numerical analysis
efficiency
intermediate
Published

February 7, 2023

In larger circuits, we often encounter sub-circuits that can occur multiple times. If these sub-circuits are included directly in the full MNA problem, the total number of nodes (including “internal nodes”) to solve can become large and makes symbolic analysis and solution slow or even intractable.

In this post we will explore approaches for abstracting away sub-circuits and replacing them with a companion model. We will start by modeling the case of a diode with series resistance \(R\). The Falstad model of this circuit can be found here.

Figure 1: Diode with series resistance of \(10 \Omega\).

We can start by solving this problem without any internal node removal. Here we use the standard companion model for the diode:

\[\begin{aligned} I_d &= I_s \left(e^{V / \eta V_t} - 1\right)\\ g_{eq} &\equiv \frac{\partial I_d}{\partial V} = \frac{I_s}{\eta V_t} e^{V / \eta V_t}\\ I_{eq} &= I_d - V g_{eq} \end{aligned}\]

https://qucs.sourceforge.net/tech/node16.html

netlist = """
V0 1 0 V_in    
R_s 1 2 100
D1 2 0
"""

# make notation consistent with text
d1geq, g_eq, d1ieq, ieq = symbols("d1.geq, g_eq, d1.ieq, I_eq")
assumptions = {d1geq: g_eq, d1ieq: ieq}

rules, (A, x, b) = run_MNA(
    netlist, "ExplicitDiode", force_solve_all=True, assumptions=assumptions
)

display(Eq(MatMul(A, x), b))
display(Eq(Mul(A, x), b))

for sol in rules.solutions:
    display(Eq(sol.lhs, simplify(sol.rhs)))

\(\displaystyle \left[\begin{matrix}\frac{1}{R_{s}} & - \frac{1}{R_{s}} & 1\\- \frac{1}{R_{s}} & g_{eq} + \frac{1}{R_{s}} & 0\\1 & 0 & 0\end{matrix}\right] \left[\begin{matrix}v_{1}\\v_{2}\\i_{v1}\end{matrix}\right] = \left[\begin{matrix}0\\- I_{eq}\\V_{in}\end{matrix}\right]\)

\(\displaystyle \left[\begin{matrix}i_{v1} + \frac{v_{1}}{R_{s}} - \frac{v_{2}}{R_{s}}\\v_{2} \left(g_{eq} + \frac{1}{R_{s}}\right) - \frac{v_{1}}{R_{s}}\\v_{1}\end{matrix}\right] = \left[\begin{matrix}0\\- I_{eq}\\V_{in}\end{matrix}\right]\)

\(\displaystyle v_{0} = 0\)

\(\displaystyle v_{1} = V_{in}\)

\(\displaystyle v_{2} = \frac{- I_{eq} R_{s} + V_{in}}{R_{s} g_{eq} + 1}\)

\(\displaystyle i_{v1} = \frac{- I_{eq} - V_{in} g_{eq}}{R_{s} g_{eq} + 1}\)