Professional Documents
Culture Documents
DC Analysis: and Discuss Solution Techniques
DC Analysis: and Discuss Solution Techniques
DC analysis
1. Problem formulation
2. Solution methods
3. Newton-Raphson scalar case
4. Multivariable Newton-Raphson method
5. Examples - exercises
6. Modifications to Newton-Raphson
7. DC convergence control in SPICE
8. Concluding remarks - suggestions,
9. Handling non-convergence cases.
Supplemental reading: Vladimirescu, The SPICE Book, Chapters: 4, 9.1 - 9.3, 10.3
1
1. Problem formulation
The mathematical form of circuit equations (MNA, traditional variables, Session. 3, sect. 3.3)
dx
C ( x) + G ( x) x = w .
dt
Problem: for given, constant input, find selected circuit variables at equilibrium, i.e. when
d
the time derivatives, , are ignored
dt
G ( x) x = w .
In the circuit terminology this means that for DC analysis the capacitors are open and the
inductors are shorted.
DC analysis is a very fundamental function of all circuit simulators.
It is used in determining: operating point, initial conditions in transients, transfer curves etc.
Presence of nonlinear elements in the network makes the analysis very difficult.
Very often a simulator fails in DC analysis because of numerical complexity.
2
2. Solution methods
1. Newton - Raphson
(basic SPICE method)
2. Relaxation techniques
(Gauss-Seidel, Gauss-Jacobi)
3. Optimization procedures
4. Continuation techniques
• inaccurate transient analysis (IBM ASTAP)
• source stepping (implemented as optional in some SPICE’s)
3
Alternative approaches
Reformulate problem:
G ( x) x − w = f ( x) = 0
Newton
Γ = ∇f ( x )
solve Γδ = − f ( x )
substitute x ← x +δ
and iterate.
The procedure has a local quadratic convergence.
Trust-region Newton’s
same as Newton, with restriction δ ≤∆
k k
4
3.Newton-Raphson scalar case
g( y ) = 0
*
y*---ideal (theoretical) solution.
The iterative process is constructed for the increment, ∆y , defined as
y = y + ∆y
* (k)
∂g
g' =
where
∂y .
y = y( k )
5
or else
g '( y ( ) ) ⋅ y
k ( k +1 )
= g ' ( y ( ) ) ⋅ y − g( y )
k (k) (k)
k = 0,1, 2,
(0)
The iterative process needs: y —starting value.
0
y* y(k+1) y(k) y
6
Convergence
dg
If g is twice differentiable and ≠ 0,
dy y = y*
Then y →y
(k) *
;
(0) *
If y is sufficiently close to y , the convergence is quadratic:
e = y( ) − y
k
k *
and e ≤ ce
k +1
2
k where c—is a constant
In constructing the iterative process we need a derivative. Numerical differentiation is “noisy” and
thus we want to use analytical derivatives and avoid numerical differentiation.
7
4. Multivariable Newton-Raphson algorithm
Problem: find the solution to the vector equation: f(x)=0
where x is a vector and f(x) is a vector function.
∂f
= J ( x) .
∂x
The iterative process is constructed as follows
(k )
J( x )x ( k +1 )
= J(x )x − f (x )
(k) (k ) (k)
8
The Jacobian is defined as follows:
∂f 1
∂f 1
∂x ∂x
∂f
1 n
J(x ) =
(k )
= .
∂x
∂f ∂f
x = xk
n n
∂x 1
∂x n x = x( k )
k = 0,1, 2,
Convergence conditions:
1. J(x) is a LIPSCHITZ function: ∃ L such that if for ∀ x, x’,
J ( x ) − J ( x ') ≤ L x − x '
2. J(x*) is non-singular
3. If x[0] is close enough to x*, then x → x when k → ∞ .
(k) *
9
Observations:
a.) Good estimates of initial (starting) values are important.
10
5. Examples_Exercises
V V
DC
R R
Io
Io
CE: i = I (e − 1) = g(v )
s
Vt
1
KCL: I =
O
V +i
R
11
Equation to be solved (D-C) is non-linear:
V V
I − = I ( e − 1)
O s
Vt
R
(k)
We construct an iterative procedure with V – as a starting value.
Exercise 1:
a.) Derive iterative equation
(k) (k)
1 V
I V
I −
o
V ( k +1 )
= I (e
s
Vt
− 1) + s
e Vt
(V ( k +1 )
−V )
(k )
R Vt
k = 0,1, 2,.....
b.) Assume: I o = 1[mA] , R = 40[k Ω ] , I s = 2.5 ⋅ 10− [ A]; −12
Calculate the first three steps (k=1,2,3) of the iteration process starting at two
different starting points:
1) V[0]=0
2) V[0]=0.5 [V]
12
Example of non-convergence in analysis of an operational amplifier
k =1
V −V = 5
(1) (0)
...........
...........
k = 675
Convergence!
V ( 675 )
−V ( 674 )
= 0.25 ⋅ 10 [V ]
−2
13
6. Modifications to Newton-Raphson algorithm
Limiting equations
V
Example of diode: i = I (e − 1)
s
Vt
V =V Lim
i=i mx
VLim
i =Ie
mx s
Vt
V Lim
>> V tx
i
V = V ln(
Lim t
mx
)
I s
In the iterations:
If V ( k +1 )
>V Lim
then
V ( k +1 )
=V Lim .
14
Modification to an iterative process will be discussed.
Notation:
V --starting point
O
^
2. V − V ≤ 2V
0 1 t
then V = V
1 1
4. V > V
1 0
and V > 10V then V = max{10V ,V + 2V }
1 t 1 t 0 t
15
B) Non-linearly limited departures
Vˆ − V ≈≈≈≈
V = V + 10V ⋅ tanh(
1 0 t
) 1 0
10V t
1 ^
16
Graphical illustration
tanh(x)
1
-3/2 -1/2
1;/2 3/2 x
-1
17
C) Iterating in voltage or current
18
Iteration in current
V
V[0] V[1] V[2]
19
Linearized relations
V( ) V( )
o o
I
Iˆ = I (e s
Vt
− 1) + e (Vˆ − V )
s Vt (1) (o)
(L)
V t
DIODE
LOAD LINE
(L)
I(1)
0
V[ ] V[ ] V̂ [ ]
o 1 1 V
20
Î = I (1)
in (L)
V(1)
(Diode) I = I (e
(1)
s
− 1) Vt
v(1)
(1)
Note: I is defined by the intersection of (L) and load lines
Vˆ − V (1) (0)
V (1 )
=V (0)
+ V ln(1 +
t
)
V t
Vˆ ( k +1 )
<V crit iterate in current
Vˆ ( k +1 )
>V crit iterate in voltage
21
Critical current (arbitrary choice of value is given below).
Critical current is determined as a current caused by the thermal voltage,Vt , applied to the resistor of
2[Ω] .
V
I =
crit
t
this is an arbitrary definition
2
V
I = I (e s
Vt
− 1) V
>> 1
crit
V t
I =Ie
crit s
Vcrit Vt
V
V = V ln(
crit t
t
)
2I s
Exercise:
Calculate the first 3 steps in iteration for D-C analysis (use circuit specified in the exercise 1)
using the following algorithms:
1. fixed departures in voltage.
2. nonlinearly limited departures
3. iteration in current or voltage as necessary (as indicated by Vcrit ).
22
(0)
Assume V =0 as a starting point.
7. DC convergence control in SPICE
Control parameters:
RELTOL default value is 10-3
ABSTOL default value is 1 [pA]
VNTOL default value is 1[ µV ]
Convergence criterion
x ( k +1 )
−x (k )
≤ ε + ε max{ x
a r
(k )
, x ( k +1 )
}
Other parameters:
ITL1-sets the limit for the number of iterations in DC analysis,
the default number is 100,
ITL2-sets the limit for the number of iterations in computing the transfer curve
the default number is 50.
23
Details of convergence control in SPICE
A. circuit variables –convergence criteria
--nodal voltages
v n
( k +1)
−v (k)
n
≤ VNTOL + RELTOL ⋅ max{ v ( k +1)
n
(k )
,v }
n
i ( k +1)
−i (k)
≤ ABSTOL + RELTOL ⋅ max{ i ( k +1) (k)
,i }
B. I-V characteristics (functions like: ID (diode); IB (BJT); IDS (FET))
24
Example of criterion for diode:
Notation: VJ –junction voltage
Current due to the voltage value determined in the previous (kth—iteration)
VJ( k )
I = I (e
D S
Vt
− 1)
Current from the linearized equation (k+1 ---iter.)
VJ( k ) VJ( k )
I I
I = e V
D
S Vt ( k +1 )
J
+I − e V D
S Vt (k )
J
V t
V t
Convergence criteria for circuit variables and I-V relations must be satisfied in:
ITL1 –iterations for D-C analysis
ITL2—iterations for D-C transfer curve.
25
8. Concluding remarks
Sensitivity analysis
26
Help/suggestions for dealing with convergence problems.
1. Nothing helps better than knowledge of circuit and setting good starting values using
NODESET V(node)=value < V(node1)=value1……>
2. Check tolerances (defaults) and possibly relax them.
3. Increase ITL1—limit for the number of iterations in DC analysis.
4. Use source ramping (this is automatically initiated in SPICE3 & PSPICE), in SPICE2 one
must set ITL6=…..(50).
5. Use “off” flag at the end of transistor lines to indicate the transistors that may be turned off.
To learn more about the computing process, use ACCT option, which gives some additional
numerical details.
27