Title: Formulation of Circuit Equations
1Formulation of Circuit Equations
- Lecture 2
- Alessandra Nardi
Thanks to Prof. Sangiovanni-Vincentelli and Prof.
Newton
2219A Course Overview
- Fundamentals of Circuit Simulation
- Approximately 12 lectures
- Analog Circuits SimulationÂ
- Approximately 4 lectures
- Digital Systems VerificationÂ
- Approximately 3 lectures
- Physical Issues VerificationÂ
- Approximately 6 lectures
E.g. SPICE, HSPICE, PSPICE, SPECTRE, ELDO .
3SPICE historyProf. Pederson with a cast of
thousands
- 1969-70 Prof. Roher and a class project
- CANCER Computer Analysis of Nonlinear Circuits,
Excluding Radiation - 1970-72 Prof. Roher and Nagel
- Develop CANCER into a truly public-domain,
general-purpose circuit simulator - 1972 SPICE I released as public domain
- SPICE Simulation Program with Integrated Circuit
Emphasis - 1975 Cohen following Nagel research
- SPICE 2A released as public domain
- 1976 SPICE 2D New MOS Models
- 1979 SPICE 2E Device Levels (R. Newton appears)
- 1980 SPICE 2G Pivoting (ASV appears)
4Circuit Simulation
- Types of analysis
- DC Analysis
- DC Transfer curves
- Transient Analysis
- AC Analysis, Noise, Distorsion, Sensitivity
5Program Structure (a closer look)
Input and setup
Models
- Numerical Techniques
- Formulation of circuit equations
- Solution of linear equations
- Solution of nonlinear equations
- Solution of ordinary differential equations
Output
6Formulation of Circuit Equations
Set of equations
Circuit with B branches N nodes
Simulator
Set of unknowns
7Formulation of Circuit Equations
- Unknowns
- B branch currents (i)
- N node voltages (e)
- B branch voltages (v)
- Equations
- NB Conservation Laws
- B Constitutive Equations
8Branch Constitutive Equations (BCE)
- Determined by the mathematical model of the
electrical behavior of a component - Example VRI
- In most of circuit simulators this mathematical
model is expressed in terms of ideal elements
9Ideal Elements Reference Direction
- Branch voltages and currents are measured
according to the associated reference directions - Also define a reference node (ground)
10Branch Constitutive Equations (BCE)
11Conservation Laws
- Determined by the topology of the circuit
- Kirchhoffs Voltage Law (KVL) Every circuit node
has a unique voltage with respect to the
reference node. The voltage across a branch eb is
equal to the difference between the positive and
negative referenced voltages of the nodes on
which it is incident - Kirchhoffs Current Law (KCL) The algebraic sum
of all the currents flowing out of (or into) any
circuit node is zero.
12Equation Formulation - KCL
A i 0
N equations
Kirchhoffs Current Law (KCL)
13Equation Formulation - KVL
v - AT e 0
B equations
Kirchhoffs Voltage Law (KVL)
14Equation Formulation - BCE
Kvv i is
B equations
15Equation FormulationNode-Branch Incidence Matrix
- PROPERTIES
- A is unimodular
- 2 nonzero entries in each column
16Equation Assembly (Stamping Procedures)
- Different ways of combining Conservation Laws and
Constitutive Equations - Sparse Table Analysis (STA)
- Brayton, Gustavson, Hachtel
- Modified Nodal Analysis (MNA)
- McCalla, Nagel, Roher, Ruehli, Ho
17Sparse Tableau Analysis (STA)
- Write KCL Ai0 (N eqns)
- Write KVL v -ATe0 (B eqns)
- Write BCE Kii KvvS (B eqns)
N2B eqns N2B unknowns
N nodes B branches
Sparse Tableau
18Sparse Tableau Analysis (STA)
- Advantages
- It can be applied to any circuit
- Eqns can be assembled directly from input data
- Coefficient Matrix is very sparse
- Problem
- Sophisticated programming techniques and data
- structures are required for time and memory
- efficiency
19Nodal Analysis (NA)
- 1. Write KCL
- Ai0 (N eqns, B unknowns)
- 2. Use BCE to relate branch currents to branch
voltages - if(v) (B unknowns ? B unknowns)
- Use KVL to relate branch voltages to node
voltages - vh(e) (B unknowns ? N unknowns)
N eqns N unknowns
Yneins
N nodes
Nodal Matrix
20Nodal Analysis - Example
R3
- KCL Ai0
- BCE Kvv i is ? i is - Kvv ? A Kvv A
is - KVL v ATe ? A KvATe A is
Yne ins
21Nodal Analysis
- Example shows NA may be derived from STA
- Better Yn may be obtained by direct inspection
(stamping procedure) - Each element has an associated stamp
- Yn is the composition of all the elements stamps
22Nodal Analysis Resistor Stamp
Spice input format Rk N N- Rkvalue
What if a resistor is connected to
ground? . Only contributes to the diagonal
KCL at node N KCL at node N-
23Nodal Analysis VCCS Stamp
Spice input format Gk N N- NC NC-
Gkvalue
vc -
KCL at node N KCL at node N-
24Nodal Analysis Current source Stamp
Spice input format Ik N N- Ikvalue
N N-
N N-
Ik
25Nodal Analysis (NA)
- Advantages
- Yn is often diagonally dominant and symmetric
- Eqns can be assembled directly from input data
- Yn has non-zero diagonal entries
- Yn is sparse (not as sparse as STA) and smaller
than STA NxN compared to (N2B)x(N2B) - Limitations
- Conserved quantity must be a function of node
variable - Cannot handle floating voltage sources, VCVS,
CCCS, CCVS
26Modified Nodal Analysis (MNA)
How do we deal with independent voltage sources?
Ekl
k l
-
k
l
ikl
- ikl cannot be explicitly expressed in terms of
node voltages ? it has to be added as unknown
(new column) - ek and el are not independent variables anymore ?
a constraint has to be added (new row)
27MNA Voltage Source Stamp
Spice input format ESk N N- Ekvalue
28Modified Nodal Analysis (MNA)
- How do we deal with independent voltage sources?
- Augmented nodal matrix
In general
Some branch currents
29MNA General rules
- A branch current is always introduced as and
additional variable for a voltage source or an
inductor - For current sources, resistors, conductors and
capacitors, the branch current is introduced only
if - Any circuit element depends on that branch
current - That branch current is requested as output
30MNA CCCS and CCVS Stamp
31MNA An example
1
Is5
R4
G2v3
-
0
4
E7v3
Step 1 Write KCL i1 i2 i3 0 (1) -i3
i4 - i5 - i6 0 (2) i6 i8
0 (3) i7 i8 0 (4)
32MNA An example
Step 2 Use branch equations to eliminate as many
branch currents as possible 1/R1v1 G2 v3
1/R3v3 0 (1) - 1/R3v3 1/R4v4 - i6
is5 (2) i6 1/R8v8 0 (3) i7
1/R8v8 0 (4) Step 3 Write down unused
branch equations v6 ES6 (b6) v7 E7v3
0 (b7)
33MNA An example
Step 4 Use KVL to eliminate branch voltages from
previous equations 1/R1e1 G2(e1-e2)
1/R3(e1-e2) 0 (1) - 1/R3(e1-e2) 1/R4e2 -
i6 is5 (2) i6 1/R8(e3-e4) 0 (3) i7
1/R8(e3-e4) 0 (4) (e3-e2)
ES6 (b6) e4 E7(e1-e2) 0 (b7)
34MNA An example
35Modified Nodal Analysis (MNA)
- Advantages
- MNA can be applied to any circuit
- Eqns can be assembled directly from input data
- MNA matrix is close to Yn
- Limitations
- Sometimes we have zeros on the main diagonal and
principle minors may also be singular.