Skip to content

Simulation: DC Operating Point Analysis

Archontis Pantelopoulos edited this page Jul 9, 2023 · 2 revisions

Overview

DC Operating Point Analysis is performed using three mutually recursive main functions and several helper functions. The main functions are:

  1. ModifiedNodalAnalysisDC: Main MNA implementation
  2. transformAllDiodes: Finds the correct operating modes of linearized diodes (see Handling Linearized Diodes)
  3. newtonRaphson: Extends MNA for non-linear components (see Extension for real diodes)

The helper functions are mostly used to help in the required transformations in the CanvasState for MNA to run, and in the creation of the MNA matrix. In all cases, their names are representative of their operation. These are:

  • combineGrounds
  • shortInductorsForDC
  • getDiodeValues
  • findVd
  • calcVectorBElement
  • calcMatrixElementValue
  • findComponentCurrents

Modified Nodal Analysis (MNA)

Modified Nodal Analysis is thoroughly explained (with plethora of examples) on this webpage. Under the same page, in the section Algorithmic MNA the algorithm used by ADDIE to solve the circuits is described.

Pre-processing

A crusial pre-processing step, in order to guarantee a smooth execution of the MNA algorithm is to combine all grounds to 1 main ground. This is done using the combineGrounds function which involves two steps: (i) selecting a random ground component in the circuit (will serve as the main ground), and (ii) traversing through the list of connections and updating any connection that starts or ends at a ground symbol to instead start or end at the chosen main ground

Handling Capacitors/Inductors in DC

As seen in the provided link which analyses MNA, the G matrix of the MNA matrix is calculated using the conductances of the components. The impedance and conductance of an inductor and a capacitor are given by:

Component Impedance Conductance
Capacitor Zc = 1/jwC Gc = jwC
Inductor ZL = jwL GL = 1/jwL

Therefore, in DC (w=0), the conductance of a capacitor is 0, and therefore, doesn't affect the MNA algorithm described above. However, the conductance of an inductor is infinite in DC, and thus, requires some pre-processing, as adding infinite elements in the MNA matrix would make the matrix non-invertible and, by extension, the circuit non-solvable.

To solve this issue, (and many other issues which will follow in this page), the canvas state is transformed before running the simulation into an equivalent circuit with the characteristics that we want.

In this case, all inductors are transformed to 0V Voltage Sources (Voltage Source (DC 0)) using the shortInductorsForDC function.

Handling Linearized Diodes

'Linearized Diodes' refers to the linear equivalent model of a diode with the following characteristics:

Region Condition Equation
Conducting Mode (“on”) I > 0 V = 0.7
Non-conducting Mode (“off”) V < 0.7 I = 0

The algorithm employed to identify the mode of each diode (DiodeL) is identical to the on-paper algorithm, and consists of:

  1. Make a guess about the operating mode of the diode
  2. Using that mode, solve the circuit
  3. If the condition is met, the guess was correct and the correct solution has been obtained. Otherwise, the correct mode is guaranteed to be the not-selected mode

For a circuit with a single diode, for example, the algorithm will initially transform locally the diode to a VoltageSource (DC 0.7). Then, MNA will run (no diode present, run as before) and the condition will be checked (I > 0). If the condition is satisfied, the transformDiodes function returns the transformed circuit (with the VoltageSource (DC 0.7)). However, if the condition is not met, the diode is transformed into a CurrentSource (0.0). This means that the ModifiedNodalAnalysis and transformDiodes functions are mutually recursive, as for the latter to produce a correctly transformed CanvasState, the former must be used to check the conditions.

When dealing with circuits containing multiple diodes, simply checking each diode individually is insufficient to guarantee an accurate solution. This is because the mode of one diode may depend on the state of another diode. To address this challenge, diode circuits are solved using an exhaustive search approach. In other words, all possible combinations of diode modes are checked, resulting in a total of 2n combinations for a circuit with n diodes.

So, essentially, this is what the transformDiodes function does: it searches (exhaustively) for the correct diode modes, checking each compination individually to find the one that satisfies the condition.

To enhance performance in time domain simulations, the previously (at the previous time step) correct modes are the first ones to be checked at the next time step. These are stored as a list of booleans cachedDiodeModes where true represents conducting mode and false non-conducting mode.

Extension for real diodes - Newton-Raphson Implementation

In order to support real diodes, and by extension any other non-linear component, Modified Nodal Analysis must be used with the iterative newton-raphson method. This is done by using the linear companion models of non-linear components. In this section, a circuit with a real diode will be solved step-by-step to help in the understanding of the algorithm.

Starting from the linear companion model of the diode, this is described in the image below. A good starting point for the linear companion models of MOSFETS and transistors is this paper.

linearCompanionDiode

$$ I_d = I_S(e^{V_d/V_t} - 1) $$

$$ G_{eq} = dI_d/dV_d = (I_s/V_d)* e^{V_d/V_t} \\ $$

$$ I_{eq} = I_d - G_{eq}*V_d $$

where:

  1. $I_S$ is the saturation current (set to 3.35 nA in ADDIE)
  2. $V_t$ is the thermal voltage (set to 0.04942V in ADDIE)
  3. $V_d$ is the voltage accross the diode

The two constants ($I_S$ and $V_t$) depend on the specific diode model used and the temperature. Their values can be configured from the Constants section in Simulation.fs (lines 10-20).

The approach which will be followed is the following:

  1. Start from an initial solution $𝑿^0$
  2. Solve the linear companion model by applying MNA and using the initial solution to find the value of 𝑉_𝑑
  3. Obtain $𝑿^1$ and repeat step 2 until convergence $|𝑉_𝑑^{(𝑛+1)}− 𝑉_𝑑^{(𝑛+1)}| &lt; ε$

We will solve the following circuit:

exampleCircuit

We can derive a pseudo-random initial solution $𝑿^0$ by solving the circuit with the linearized equivalent diode, which in this case gives: $𝑿^0 = [0.8, 0.1, -21.3μ]$. Therefore, we will perform our first iteration of newton-raphson using $V_d=0.7$ to calculate $G_{eq}$ and $I_{eq}$. We have:

MNAMatrix

By solving the above system we obtain $𝑿^1 = [0.8, 0.146, -31μ]$. We see that $V_1$ remained to $0.8$ as expected, but, $V_2$ began to converge to each true value, giving an updated solution of $0.146$. Now, we will use this updated value of $V_d = 0.8 - 0.146 = 0.654V$ in the calculation of $G_{eq}$ and $I_{eq}$ for the next iteration. This process is repeated until the solution converges, which in this case happens after 10 iterations, to give $𝑿^{10} = [0.8, 0.383, -72μ]$