Download as pdf or txt
Download as pdf or txt
You are on page 1of 90

‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬

‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 2


Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 3


Basic Circuit Simulator Functions
❑ DC
▪ Linear DC analysis of lumped-element LTI circuit.
▪ Non-linear DC analysis.
• The circuit is linearized using Newton-Raphson Algorithm.
❑ AC
▪ AC analysis of lumped-element LTI circuit.
• Complex impedance “DC like” analysis performed at multiple frequencies.
▪ Small-signal AC analysis of non-linear circuit.
• Non-linear circuit replaced by the linear small-signal model.

03: Circuit Simulation [L. Pillage, 1995] 4


Basic Circuit Simulator Functions (cont’d)
❑ Transient
▪ Linear transient analysis.
• Initial condition obtained from linear DC analysis.
• Numerical integration converts the problem to a “DC like” analysis at every time step.
▪ Non-linear transient analysis.
• Numerical integration + Newton-Raphson Algorithm.

❑ Linear circuit solution lies at the core!


▪ The deepest inner loop of any kind of simulation!

03: Circuit Simulation [L. Pillage, 1995] 5


‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 7


Examples of Branch Relations
❑ Also known as: Branch Constitutive
Equations (BCE) or Element Equations.

❑ 𝑃 =𝑣×𝑖
▪ Power = +ve: power delivered to
the element
▪ Power = -ve: power delivered from
the element

03: Circuit Simulation [L. Pillage, 1995] 8


Branch Relations
❑ Also known as: Branch Constitutive Equations (BCE) or Element Equations.
Element Branch Relation Variable parameter
Resistor v = R·i v, i
Capacitor i = C·dv/dt dv/dt, i
Inductor v = L·di/dt v, di/dt
Voltage Source v = vs i=?
Current Source i = is v=?
VCVS vs = AV · vc i=?
VCCS is = GT · vc v=?
CCVS vs = RT · ic i=?
CCCS is = AI · ic v=?
03: Circuit Simulation [C. Cheng, CSE245, 2015] 9
Conservation Laws
❑ Kirchhoff’s Current Law (KCL)
▪ The algebraic sum of all the currents flowing out of (or into) any circuit node is zero.
❑ Kirchhoff’s Voltage Law (KVL)
▪ The algebraic sum of all the voltages around any closed loop in a circuit is equal to zero.
▪ In another form: Every circuit node has a unique voltage with respect to the reference
node (ground node or datum node). The voltage across a branch (v) is equal to the
difference between the positive and negative referenced voltages of the nodes on
which it is incident (𝑣+ − 𝑣− ).

03: Circuit Simulation [C. Cheng, CSE245, 2015] 10


Nodal Analysis
❑ To apply the node voltage method to a circuit with n+1 nodes (with m voltage sources),
perform the following steps
1. Selective a reference node (usually ground).
2. Name the remaining n nodes and label a current through each passive element and
each current source.
3. Apply KCL to each node not connected to a voltage source.
4. Solve the system of n-m unknown voltages.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 11


Nodal Analysis Example (1)

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 12


Nodal Analysis Example (2)
❑ This circuit is the same as the one shown before, with V1 and R1 interchanged.

Setting up equations with a floating


voltage source needs some
cleverness (may also use super-node
concept).
The technique of modified nodal
analysis avoids this difficulty.
03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 13
Mesh (Loop) Analysis
❑ To apply the loop current method to a circuit with n loops (and with m current sources),
perform the following steps.
1. Define each loop current. This is easiest with a consistent method, e.g., all unknown
currents are clockwise, all known currents follow direction of current source.
2. Apply KVL to each loop not containing a current source.
3. Solve the system of n-m unknown currents.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 14


Mesh Analysis Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 15


Nodal or Mesh Analysis?

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 16


‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 18


Equation Formulation
❑ The fundamental principle behind virtually all types of computer simulation is to first
abstract a physical system’s behavior using appropriate mathematical representations.
▪ Next, use algorithms to solve these representations by computer.
❑ We need a systematic and automatic approach for formulating and solving the circuit
mathematical representation (the circuit equations).
▪ The ad hoc approach of solving equations by substitution and similar operations does
not scale well to large circuits.
❑ Two popular approaches for systematic equation formulation exist
▪ STA (sparse tableau analysis)
▪ MNA (modified nodal analysis): Used by most modern circuit simulators

03: Circuit Simulation [F. Najm, 2010] 19


Nodal Analysis Revisited
❑ To apply the node voltage method to a circuit with n+1 nodes (with m voltage sources),
perform the following steps
1. Selective a reference node (usually ground).
2. Name the remaining n nodes and label a current through each passive element and
each current source.
3. Apply KCL to each node not connected to a voltage source.
4. Solve the system of n-m unknown voltages.

❑ We will first consider a special case of nodal analysis


▪ No voltage sources exist!

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 20


Nodal Analysis Example
❑ Circuit with 𝑛 + 1 nodes

❑ 𝑛 equations → solve 𝑛 unkowns


❑ Write equations in matrix form
𝑌𝑣 = 𝐽
❑ 𝑌 𝑛 × 𝑛 : Admittance matrix (known)
❑ 𝑣 𝑛 × 1 : Vector of node voltages (unknown)
❑ 𝐽 𝑛 × 1 : Vector of current source inputs (known)
03: Circuit Simulation [L. Pillage, 1995] 21
Nodal Analysis Example

03: Circuit Simulation [L. Pillage, 1995] 22


Assembling the System of Equations
❑ In practice, in a simulator, the matrix equation is built by inspection, on the fly, as the
circuit description file (netlist) is being read in.
❑ The contribution of every element to the matrix equation is described by means of a
template, which is called an element stamp.
❑ The process starts by initializing the matrix and right-hand side (RHS) vector to zero.
❑ Then, the element stamps are added to the matrix and RHS vector as the elements are read
in.
❑ When all the elements have been read in, the matrix equation is complete and ready to be
solved.

03: Circuit Simulation [F. Najm, 2010] 23


Netlist Representation

❑ The computer doesn’t write KCL for every node!


❑ It parses the netlist and directly builds the
matrices!
❑ Every element has a stamp.
▪ Add the stamps together.

03: Circuit Simulation [L. Pillage, 1995] 24


Resistor Stamp

03: Circuit Simulation [L. Pillage, 1995] 25


Current Source Stamp

03: Circuit Simulation [L. Pillage, 1995] 26


Stamping Procedure

03: Circuit Simulation [L. Pillage, 1995] 27


Stamping Procedure

03: Circuit Simulation [L. Pillage, 1995] 28


Stamping Procedure

03: Circuit Simulation [L. Pillage, 1995] 29


Stamping Procedure

03: Circuit Simulation [L. Pillage, 1995] 30


Stamping Procedure

03: Circuit Simulation [L. Pillage, 1995] 31


Solving the Circuit
𝑌𝑣 = 𝐽
❑ 𝑌 𝑛 × 𝑛 : Admittance matrix (known)
❑ 𝑣 𝑛 × 1 : Vector of node voltages (unknown)
❑ 𝐽 𝑛 × 1 : Vector of current source inputs (known)
𝑣 = 𝑌 −1 𝐽
❑ Solving the circuit is simply calculating the inverse of the admittance matrix!
❑ Practically, circuit simulators use more efficient methods to solve the system of equations
▪ Gaussian elimination
▪ LU factorization
❑ These efficient methods make use of matrix sparsity.
▪ Sparce matrix (opposite to dense matrix) is a matrix that contains lots of zero elements.
• Matrices of large circuits are very sparce: less than 1% non-zero elements!

03: Circuit Simulation [L. Pillage, 1995] 32


‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 34


Non-linear Circuit

03: Circuit Simulation [L. Pillage, 1995] 35


Non-linear Circuit
❑ New branch relation (but non-linear!)

❑ No voltage sources allowed!

❑ Apply KCL: How to solve the non-linear equation?

03: Circuit Simulation [L. Pillage, 1995] 36


Newton-Raphson Algorithm

03: Circuit Simulation [L. Pillage, 1995] 37


Convergence of Newton-Raphson Algorithm

Newton-Raphson iteration will converge provided that:


1. The first derivative of 𝑓(𝑣), 𝑓′(𝑣), is continuous (which presents certain
restrictions on the device models).
2. The initial guess is "sufficiently close" to the final solution (SPICE uses the node-
set concept to allow the user to force this situation).
03: Circuit Simulation [L. Pillage, 1995] 38
Linearization of Diode Model (Companion Model)
❑ The Newton-Raphson algorithm replaces the non-linear device by a tangent-determined
Norton equivalent circuit.

03: Circuit Simulation [L. Pillage, 1995] 39


Linearized Diode Stamp

03: Circuit Simulation [L. Pillage, 1995] 40


Newton-Raphson Algorithm
1. Initialize:
▪ Guess circuit voltages and/or currents.
2. Linearize:
▪ Obtain linearized Norton equivalents for all nonlinear
elements about their presumed operating points.
3. Solve:
▪ Formulate (nodal) equations that characterize the
linearized circuit and solve them for the new
presumed operating points.
4. Convergence:
▪ Return to Step 1 using the new presumed operating
points as the "guesses" unless the change from the
last iteration has been acceptably small.

03: Circuit Simulation [L. Pillage, 1995] 41


‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 43


Small-signal (AC) Analysis
❑ The final step in Newton-Raphson Algorithm is the linearized small-signal model!
❑ Calculate the small-signal parameters and construct the small-signal equivalent circuit.
❑ Construct the complex admittance matrix.
❑ Solve the system of equations.

03: Circuit Simulation [L. Pillage, 1995] 44


Small-signal (AC) Analysis
❑ Increment the frequency and solve the circuit
multiple times.
❑ Make sure the complex 𝑌 matrix elements do not
cause numerical problems at frequency extremes.

03: Circuit Simulation [L. Pillage, 1995] 45


‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 47


Linear Transient Analysis
❑ Handles large signal behavior.
❑ New branch equation:

❑ Circuit described by a set of first-order linear differential equations.

03: Circuit Simulation [L. Pillage, 1995] 48


Numerical Integration: Trapezoidal Approximation
❑ Given solution at time 𝑡 (from DC analysis or initial conditions) find solution at 𝑡 + Δ𝑡.

03: Circuit Simulation [L. Pillage, 1995] 49


Capacitor Companion Model
❑ We don’t know 𝑣 𝑡 + Δ𝑡 and 𝑖 𝑡 + Δ𝑡 .
▪ Implicit equation
▪ Transform to Norton companion
model
▪ Solve “DC like” circuit
▪ The Norton model may have
numerical problems when time step is
too small!
❑ Inductors can be treated similarly!

03: Circuit Simulation [L. Pillage, 1995] 50


Capacitor “DC” Equivalent Circuit

03: Circuit Simulation [L. Pillage, 1995] 51


Linear Transient Analysis Algorithm
1. Start with a known set of capacitance voltages and inductance currents at a specified time
▪ The initial conditions are either user-specified or obtained from a dc bias computation.
2. Increment time by a prescribed amount Δ𝑡 and invoke the appropriate companion models
▪ Δ𝑡 is selected based on stability, accuracy, and efficiency considerations and can be
different at different times.
3. Perform a "dc type" analysis.
4. Return to step (1) with the results and appropriately modify the companion model values
until the specified end time is attained.

03: Circuit Simulation [L. Pillage, 1995] 52


Non-linear Transient Analysis
❑ Solves large signal time domain
behavior of circuits with nonlinear
elements.
❑ Linear DC analysis is the critical
component of every type of analysis!

03: Circuit Simulation [L. Pillage, 1995] 53


‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 55


Systematically Including a VS
❑ How to apply KCL at 𝑘 and 𝑙?
▪ In hand analysis we use the super-node concept → Not a systematic procedure
❑ Add 𝑖𝑘𝑙 as a new independent variable.
▪ For both grounded and floating voltage sources.
▪ That’s why SPICE calculates the current of every VS ☺
❑ Add one more equation to the system:
𝑉𝑘𝑙 = 𝑣𝑘 − 𝑣𝑙

03: Circuit Simulation [L. Pillage, 1995] 56


Modified Nodal Analysis (MNA)
❑ To apply the modified node voltage method to a circuit with n+1 nodes (with m voltage
sources), perform the following steps:
1. Selective a reference node (usually ground)
2. Name the remaining n nodes.
3. Assign a name to the current through each voltage source. We use the convention
that the current flows from the positive node to the negative node of the source.
4. Apply KCL to each node.
5. Write an equation for the voltage of each voltage source.
6. Solve the system of n+m unknowns.
• n voltages and m currents
❑ The number of unknowns is n-m for the traditional nodal analysis!

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 57


MNA System and VS Stamp

𝑉𝑘𝑙 = 𝑣𝑘 − 𝑣𝑙

03: Circuit Simulation [L. Pillage, 1995] 58


MNA Example
❑ 3 nodes + 2 VSs = 5 equations
𝐺1 𝑣1 − 𝑣2 + 𝑖1 = 0
𝐺1 𝑣2 − 𝑣1 + 𝑖2 = 0
𝐺2 𝑣3 + 𝐺3 𝑣3 − 𝑖2 = 𝐼𝑠1
𝑣1 = 𝑉𝑠1
𝑣2 − 𝑣3 = 𝑉𝑠2

❑ Computing ALL currents in a circuits


increases the matrix size considerably!
▪ Was used in STA.

03: Circuit Simulation [L. Pillage, 1995] 59


Why MNA?
❑ Systematic equation formulation for any circuit.
❑ The matrix equation can be assembled directly from the input netlist.
❑ More compact than STA (an older method used by IBM).
❑ Sparce matrix (but not as sparse as STA).
❑ Used by SPICE and gained widespread acceptance.

03: Circuit Simulation 60


VCCS Stamp
❑ Can be handled without MNA.
❑ Stamp similar to resistor but not symmetric about the matrix diagonal.

𝑖𝑝𝑞 = 𝑔𝑚 𝑣𝑘𝑙
= 𝑔𝑚 𝑣𝑘 − 𝑣𝑙

𝑣𝑘𝑙 = 𝑣𝑘 − 𝑣𝑙

03: Circuit Simulation [L. Pillage, 1995] 61


CCCS Stamp
❑ A zero-valued voltage source acts as an ammeter to sense the control current.
❑ MNA used for the sensing VS.

𝑖𝑘𝑙

𝑖𝑝𝑞

𝑉𝑘𝑙 = 𝑣𝑘 − 𝑣𝑙 = 0

03: Circuit Simulation [L. Pillage, 1995] 62


VCVS Stamp
❑ MNA used for the controlled VS.

𝑖𝑝𝑞

𝑣𝑝𝑞 = 𝜇𝑣𝑘𝑙
−𝜇 𝑣𝑘 − 𝑣𝑙 + 𝑣𝑝 − 𝑣𝑞 = 0

03: Circuit Simulation [L. Pillage, 1995] 63


CCVS Stamp
❑ A zero-valued voltage source acts as an ammeter to sense the control current.
❑ MNA used for the sensing voltage source.

𝑖𝑘𝑙

𝑖𝑝𝑞

𝑉𝑘𝑙 = 𝑣𝑘 − 𝑣𝑙 = 0 𝑉𝑝𝑞 = 𝑣𝑝 − 𝑣𝑞 = 𝑟𝑚 𝑖𝑘𝑙


03: Circuit Simulation [L. Pillage, 1995] 64
‫ن ا ْلعِْلِم إِاَّل قَلِ ًيل‬ِ ‫وما أُوتِيتم‬
‫م‬
21 August 2021 1443 ‫ محرم‬13

َ ُْ ََ

Analog/Mixed-Signal Simulation and Modeling

Module 03
How Does a Circuit Simulator Work?

Dr. Hesham A. Omran


Integrated Circuits Laboratory (ICL)
Electronics and Communications Eng. Dept.
Faculty of Engineering
Ain Shams University
Outline
1. Basic Circuit Simulator Functions
2. Review on Circuit Analysis
3. Equation Formulation Using Nodal Analysis
4. Non-linear DC Analysis
5. Small-signal (AC) Analysis
6. Transient Analysis
7. Modified Nodal Analysis (MNA)
8. MNA Examples

03: Circuit Simulation 66


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 67


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 68


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 69


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 70


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 71


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 72


MNA Example

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 73


MNA Example

03: Circuit Simulation [L. Pillage, 1995] 74


MNA Example
❑ Find the mistake + v3 - ES6
1 R3 2 - + 3

R1 R4 Is5 R8
G2v3 - +
0 4
E7v3
1 1  1  
 + G 2 + −  G2 +  0 0 0 0
R
 1 R3  R3  e   0 
 1 1 1  1   
 − + 0 0 − 1 0 e i
R3 R3 R4   
2 s 5 
  e   0 
 1 1
− 1 0   = 
3
0 0 
 R8 R8  e4   0 
 1 1    
 0 0 − 0 1  i6   ES 6
 R8 R8   i7   0 
 0 −1 1 0 0 0
 
 E7 − E7 0 −1 0 0
03: Circuit Simulation [C. Cheng, CSE245, 2015] 75
Thank you!

03: Circuit Simulation 76


References
❑ Mikael Sahrling, Analog Circuit Simulators for Integrated Circuit Designers, 2021
❑ L. T. Pillage, R. A. Rohrer, and C. Visweswariah, Electronic Circuit and System Simulation
Methods, McGraw-Hill, 1995.
❑ C. Cheng, CSE245, UCSD, 2015.
❑ Farid N. Najm, Circuit Simulation, 2010.
❑ http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html
❑ C.-W. Ho, A. E. Ruehli, and P. A. Brennan. The modified nodal approach to network analysis.
IEEE Transactions on Circuits and Systems, 22(6):504–509, June 1975.

03: Circuit Simulation 77


MNA Observations

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 78


The A Matrix
❑ (n+m)x(n+m) in size, and consists only of known quantities.
❑ The nxn part of the matrix in the upper left:
▪ has only passive elements
❑ The rest of the A matrix (not included in the nxn upper left part) contains only 1, -1 and
0 (other values are possible if there are dependent current and voltage sources)

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 79


The A Matrix
❑ The G matrix is nxn and is determined by the interconnections between the passive circuit
elements (resistors)
❑ The B matrix is nxm and is determined by the connection of the voltage sources.
❑ B and C are closely related, particularly when only independent sources are considered.
❑ The D matrix is mxm and is zero if only independent sources are considered.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 80


The G Matrix
❑ Each element in the diagonal matrix is equal to the sum of the conductance of each
element connected to the corresponding node.
❑ The off diagonal elements are the negative conductance of the element connected to the
pair of corresponding node.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 81


The G Matrix
❑ Each element in the diagonal matrix is equal to the sum of the conductance of each
element connected to the corresponding node.
❑ The off diagonal elements are the negative conductance of the element connected to the
pair of corresponding node.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 82


The B Matrix
❑ The B matrix is an nxm matrix with only 0, 1 and -1 elements. Each location in the matrix
corresponds to a particular voltage source (first dimension) and a node (second
dimension).
❑ If the positive terminal of the ith voltage source is connected to node k, then the element
(i,k) in the B matrix is a 1. If the negative terminal of the ith voltage source is connected to
node k, then the element (i,k) in the B matrix is a -1. Otherwise, elements of the B matrix
are zero.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 83


The C Matrix
❑ In other words, the C matrix is the transpose of the B matrix.
▪ This is not the case when dependent sources are present (more on this later).

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 84


The X Vector
❑ (n+m)x1 vector that holds the unknown quantities (node voltages and the currents through
the independent voltage sources).
❑ The top n elements are the n node voltages.
❑ The bottom m elements represent the currents through the m independent voltage
sources in the circuit.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 85


The X Vector

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 86


The Z Vector
❑ (n+m)x1 vector that holds only known quantities
❑ The top n elements are either zero or the sum and difference of independent current
sources in the circuit.
❑ The bottom m elements represent the m independent voltage sources in the circuit.

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 87


The Z Vector

03: Circuit Simulation [http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA_All.html] 88


Network Rules
❑ No current source cutset is allowed!
▪ A cutset is a set of elements whose removal leaves two portions of the
original circuit disconnected
▪ An alternate statement of KCL is that the algebraic sum of currents through
any cutset is zero.
▪ A current source cutset is a cutset whose every element corresponds to a
current source in the network, be it independent or controlled.
▪ KCL may be violated and voltage is undefined.

03: Circuit Simulation 89


Network Rules
❑ No voltage source loop is allowed!
▪ A voltage source loop is a cycle in the graph whose every edge corresponds
to a voltage source, whether independent or controlled.
▪ KVL may be violated and current is undefined.

03: Circuit Simulation 90

You might also like