Você está na página 1de 41

A!

Aalto University
School of Electrical
Engineering

S-55.3240 Numerical Methods in Circuit Simulation


Lecture 6: Harmonic Balance (Steady-State Analysis)
Jarmo Virtanen

Page 1 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Introduction to Harmonic Balance (Steady-State Analysis)


Harmonic Balance (HB) is an analysis method that solves the
steady state of a circuit in the frequency domain. It is assumed
that voltages and currents behave like periodic or quasi-periodic
waveforms, i.e.,
v(t) =

N h
X

V C (i ) cos(i t) + V S (i ) sin(i t)

i=0

The fundamental frequencies in the analysis are j s, j = 1, ..., m,


and i s represent all possible mixing frequencies computed using
j s as follows:
i =

m
X

i,j j ,

0 = 0, i = i

j=1

Parameter m is the number of independent excitation frequencies

A!

Aalto University
School of Electrical
Engineering

Page 2 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Properties of HB Analysis

Frequency-domain method: arbitrary frequency-dependent


linear elements can be used directly in the analysis. In RF
simulations, typical linear devices are microstrip/stripline
elements, measured scattering parameters, data from
electromagnetic (EM) simulation, ...

Due to the periodic or quasi-periodic requirement, the


excitation or response cannot be an arbitrary waveform
Harmonic Balance

Harmonic Balance

APLAC 8.50 User: AALTO/RAD/CT Mon Jan 31 2011

8.50

U/V

6.38

6.88

4.25

5.25

2.12

3.62

0.00
-10k

2.00
0

10k

20k

30k

40k

50k

60k

f/Hz

A!

APLAC 8.50 User: AALTO/RAD/CT Mon Jan 31 2011

8.50

U/V

Aalto University
School of Electrical
Engineering

50

100

150

t/s

Page 3 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

200

Properties of HB Analysis

Harmonic Balance solves the Fourier coefficients, V C s and V S s,


of each node at all frequencies (0, 1 , ..., N )
The total size of the equation is the number of nodes times the
number of frequencies. Example: 100 nodes and 50 non-zero
frequencies results in matrix size of 100 (1 + 2 50) = 10100
The matrix equation is structurally diagonally dominant

A!

linear circuit: only diagonal blocks, i.e., each frequency can be


solved independently
nonlinear circuit: off-diagonal-blocks are non-zero, and the
stronger the nonlinearity the larger the influence of the
off-diagonal blocks

Due to the large matrix size and blockwise structure, iterative


solvers such as GMRES are used to solve the equations. Iterative
solvers are superior to LU-based sparse matrix solvers even for
medium-sized circuits
Aalto University
School of Electrical
Engineering

Page 4 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

HB Analysis Equations
Nonlinear circuit equations written in the time domain:
q(v(t))
t

+ i(v(t)) +

Zt

y(t )v( )d i s (t) = 0,

where q(v), i(v), y, and i s (t) represent nonlinear charge,


nonlinear current, admittance (impulse response), and excitation
terms, respectively. The unknowns, v(t), are the node voltages.
The harmonic balance form of the circuit equations is
Q(V ) + I (V ) + Y V I s = 0
where the unknowns in vector V are the DC, cosine and sine
coefficients (V C s and V S s) of the generalized Fourier series of
each node. Q and I result from nonlinear dynamic and static
elements, Y is the admittance matrix of linear elements, and I s is
the excitation

A!

Aalto University
School of Electrical
Engineering

Page 5 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

HB Analysis Equations
If the number of nodes in the circuit is K and the number of nonzero
frequencies is N , vector V is

V =

V (0)
V (1 )
V (2 )
..
.
V (N )
{z

V C (0)

1C

V (0)
,
, V (0) = 2 .

..

C
}

(2N +1)K1

{z

all unknowns

VK (0)
{z

K1

{z

DC unknowns

V1C (i )
V2C (i )
..
.

V C (i )
K

V (i ) =
S

V1 (i )

S
V2 (i )

..

S ( )
VK
i

{z

{z

2K1

non-zero frequencies

The order of unknowns is DC (all nodes), cosine/sine coefficients of


1 , ..., cosine/sine coefficients of N

A!

Aalto University
School of Electrical
Engineering

Page 6 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Selecting HB Analysis Frequencies

Single-tone, or 1-tone HB analysis, m = 1:


All frequencies are integer multiples of the fundamental
frequency, i.e., i = i1 = i1 . In this case all waveforms
are periodic

Two-tone, or 2-tone HB analysis, m = 2:


All mixing frequencies have the form i = i,1 1 + i,2 2 ,
fundamental excitation frequencies are 1 and 2 . There are
many choices for coefficients i,j . The most common, the
diamond and box methods, are listed in the table below
Method
Diamond
Box

A!

mixing formula
|i,1 | + |i,2 | D
|i,1 | <= B1
|i,2 | <= B2

N (# frequencies)
D(D + 1)
B1 (2B2 + 1) + B2

m-tone HB analysis: frequencies are selected as in the 2-tone


case
Aalto University
School of Electrical
Engineering

Page 7 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Diamond Frequency Selection, D=4


i,1 i,2
i
order
0
0
0
0
1
0
1
1
0
1
2
1
2
0
21
2
1
1
| 1 + 2 |
2
0
2
22
2
3
0
31
3
2
1
| 21 + 2 |
3
1
2
| 1 + 22 |
3
0
3
32
3
4
0
41
4
3
1
| 31 + 2 |
4
2
2
| 21 + 22 |
4
1
3
| 1 + 32 |
4
0
4
42
4

A!

Aalto University
School of Electrical
Engineering

The figure below shows all


positive frequencies (i )
marked as red dots. The
name diamond comes from
the 2D shape if negative
frequencies are taken into
account (blue dots)

i,2





i,1

Page 8 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Discrete Fourier Transform (DFT and IDFT)


The time-domain waveform, v(t), is expressed as
v(t) =

N h
X

V C (i ) cos(i t) + V S (i ) sin(i t)

i=0

In the single-tone case 1 T = 2 and i = i1 , and equations

ZT

2 (i)

v(t) cos(i t)dt


V (i ) =

T
0

ZT

v(t) sin(i t)dt


V (i ) =

T
0

can be used to compute the Fourier coefficients V C and V S . The


function (i) is defined as (i = 0) = 1, (i 6= 0) = 0

A!

Aalto University
School of Electrical
Engineering

Page 9 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

A more suitable method for numerical computation is to write the


definition of the Fourier series in matrix form. Taking S time
samples t0 , t1 , ..., tS1 gives the inverse discrete Fourier
transform, or IDFT,

1
1
..
.

v(t0 )
v(t1 )
..
.

V C (0)
V C (1 )
V S (1 )
..
.

V C (N )
v(tS1 )
V S (N )

cos(1 t0 )
cos(1 t1 )
..
.

sin(1 t0 )
sin(1 t1 )
..
.

...
...

, where

cos(N t0 )
cos(N t1 )
..
.

1 cos(1 tS1 ) sin(1 tS1 ) ... cos(N tS1 )

The DFT
(inverse of IDFT) is obtained directly from
1 v,
if S = 2N + 1

1
V =

v, if S > 2N + 1

A!

Aalto University
School of Electrical
Engineering

sin(N t0 )
sin(N t1 )
..
.
sin(N tS1 )

Page 10 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Instead of the cos / sin form of the Fourier series, we can also use
the complex form
v(t) =

N h
P

V C (i ) cos(i t) + V S (i ) sin(i t)

i=0

N h
X

Re [V C (i ) jV S (i )] exp(ji t)

i=0

N
X

oi

[V R (i ) + jV I (i )] exp(ji t)

i=N

where
V C (0)

= V R (0)

V I (0)
= V S (0) = 0
V C (i ) = 2V R (i ),

when i 6= 0

V S (

when i 6= 0

i)

2V I (

i ),

Note that V R is an even and V I is an odd function w.r.t. , i.e.,


V R (i ) = V R (i ) and V I (i ) = V I (i ) because
v(t) is a real signal

A!

Aalto University
School of Electrical
Engineering

Page 11 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Fast Fourier Transform (FFT)


A computationally effective method to evaluate a one-dimensional
DFT is called fast Fourier transform, or FFT. The original FFT
method requires that the number of time-domain samples is a
power of 2 (means that S must be rounded up to the next power
of 2), the time domain sampling is done with a constant time step
h, and the frequencies are equally spaced (i = i1 ). FFT
reduces the computational work from S 2 to O(S log S).
The FFT algorithm gives directly the coefficients of the complex
Fourier-series, i.e., V R (0), V R (i ), and V I (i ) when the
time-domain values of v(t) are known.
The FFTW package developed at MIT by Matteo Frigo and Steven
G. Johnson transforms arrays of arbitrary size and dimension in
O(S log S) time, i.e., does not require that S is a power of 2

A!

Aalto University
School of Electrical
Engineering

Page 12 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Analysis (Linear Circuit)


HB equations for linear circuit simplify to Y TOT V = I s , i.e.,

Y (0)

Y (1 )
..

.
Y (N )

{z

TOT

}|

V (0)
V (1 )
..
.
V (N )
{z
V

I s (0)
I s (1 )
..
.
I s (N )
{z
Is

Here Y () is the admittance matrix of the circuit at angular


frequency . Note, that the equation above is not usually used as
is. Instead voltages at all frequencies (0, 1 , ..., N ) are solved
using a single-frequency AC-like equation Y ()V () = I s ().

Conversion between v(t) and the complex phasor V C jV S :


V C jV S v(t) = V C cos(t) + V S sin(t)
Note that the conversion above uses the "peak value + Re" method
v(t) = Re{[V C jV S ] exp(jt)}

A!

Aalto University
School of Electrical
Engineering

Page 13 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance: Linear Circuit Example 1


Solve the waveform v(t), when
j(t) = J0 + J1 cos(1 t) + J2 sin(2 t),
J0 = 0.2 A, J1 = 0.3 A,
j(t)
J2 = 0.4 A, R = 2 , C = 1 mF,
3
3
1 = 10 rad/s, 2 = 3 10 rad/s

v(t)

We must solve the nodal equation [(1/R) + jC ]V () = J ()


at all frequencies, i.e., = 0, 1 , and 2 .
Using the conversion J C cos(t) + J S sin(t) J C jJ S
the valuesfor the complex phasor J () are

when = 0
J0 = 0.2,
J () =
J1 = 0.3,
when = 1

(j)J = j0.4, when =


2
2
because j(t) = J0 + J1 cos(1 t) + J2 sin(2 t)

A!

Aalto University
School of Electrical
Engineering

Page 14 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance: Linear Circuit Example 1


Next we solve voltage V
V (0)

V (1) =
V (2) =

J (0)

= 0.4 V
(1/R)
J (1 )
(1/R) + j1 C
J (2 )
(1/R) + j2 C

=
=

0.3
0.5 + j
j0.4

= 0.12 j0.24 V

0.5 + j3

= 0.1297 + j0.02162 V

The waveform is
v(t) = {0.4 + 0.12 cos(1 t) + 0.24 sin(1 t)
+0.1297 cos(2 t) 0.02162 sin(2 t)} V

A!

Aalto University
School of Electrical
Engineering

Page 15 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance: Linear Circuit Example 1


This example could have been solved using real arithmetic. Complex
or real arithmetic can be used in the linear case, but the nonlinear case
requires that the equation is written in the real form, i.e., separately for
V C s and V S s. Next we write equation Y V = J using V C and V S .
Because
Y = Y R + jY I , V = V C jV S , and J = J C jJ S
we get
(Y R + jY I )(V C jV S ) = J C jJ S ,
and after separating the real and imaginary parts
"

#"

"

(1/R) C
C (1/R)

"

VC
JC
YR YI
=
I
R
S
Y
Y
V
JS
The real form of the circuit equations of the previous example are
#"

V C ()
V S ()

"

J C ()
J S ()

Solving this 2 2 equation gives the same results as the previous


complex computation

A!

Aalto University
School of Electrical
Engineering

Page 16 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance: Linear Circuit Example 2


Compute the Fourier series coefficients of periodic function
e(t) =

sin(1 t), when sin(1 t) 0, 1 = 2000 rad/s


0,
otherwise

The exact formula (1 T = 2):


VnC

VnS

T
Z /2

sin(1 t) cos(n t)dt =

0
T
Z /2

2
=
T

sin(1 t) sin(n t)dt =

0,
2
(1 n 2 )

n odd
, n even

0
, when n 6= 1
1/2 , when n = 1

Numerically using FFT: number of samples S = 32, time-domain


signal sampled at time points 0, T/32, 2T/32, ..., 31T/32.

A!

Aalto University
School of Electrical
Engineering

Page 17 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance: Linear Circuit Example 2


n
0
1
2
4
6

V C (exact)
V C (FFT)
0.31831
0.317287
0
0
0.212207 0.214269
0.042441 0.044553
0.018189 0.020386

V S (exact) V S (FFT)
0
0
0.500
0.500
0
0
0
0
0
0

waveform, samples=32
APLAC Simulator User: AALTO/RAD Circuit Theory Group

1.05

FFT waveform
oscillates at
t [500 , 1 m]

U/V

0.78

0.50

0.23

-0.05
0

500

1m

1.5m

2m

t/s
waveform/fft

A!

Aalto University
School of Electrical
Engineering

e(t)

Page 18 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance Equations of Nonlinear Circuit


Nonlinear HB equations are written as follows:
F(V ) = Q(V ) + I (V ) + Y V I s = 0, where
V

Q
I
Y
Is

A!

= unknowns V C , V S at all frequencies 0, 1 , ..., N


= j matrix, multiplies the charge with j current
= spectrum of nonlinear charge (nonlinear capacitor)
= spectrum of nonlinear static current
= admittance matrix of linear elements
= excitation
If the number of nodes is K and the number of non-zero
frequencies is N , then the total matrix size is K (2N + 1)
The nonlinear equation is written using real arithmetic, i.e.,
unknowns are both V C s and V S s. Why ? The derivative of
F(V ) is not an analytic function of V C jV S , but an
analytic function of V C and V S . Linear equation the
derivative is exactly Y (because I = Q = 0)

Aalto University
School of Electrical
Engineering

Page 19 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Matrix (Derivative w.r.t. Time)


Matrix is constructed as follows:

linear capacitor at single frequency i

current of the capacitor is (V C = V C (i ), V S = V S (i ))


I (i ) = Y V =
=

A!

"
|

0
i
{z

"

0
i C

i
0

i C
0

#"

CV C
CV S

}|

{z

#"

VC
VS
"

0
i

i
0

#"

Matrix in case of frequencies 0, 1 , and 2 is

0
1

all other elements

1 0
=
,

in are zero

0
2
2 0
Aalto University
School of Electrical
Engineering

Page 20 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

QC
QS

Nonlinear Current and Charge


Nonlinear static current is expressed as a Fourier series
N h
P

I C (i ) cos(i t) + I S (i ) sin(i t) ,

i(v(t)) =

i=0

where I C , and I S are the cosine, and sine coefficients of i(v(t)),


respectively. Single-tone (i = i1 ) formulas are

ZT

2 (i)

i(v(t)) cos(i t)dt


I (i ) =

T
0

ZT

I
i(v(t)) sin(i t)dt
(
)
=
i

T
0

The charge coefficients are computed using the same formula,


i(v(t)) is replaced with q(v(t)). Multiplication of Q with is
done when the values of the coefficients are known.
In practice, FFT is used to compute I C and I S i(v(t)) and
q(v(t)) are sampled, and the result is Fourier-transformed

A!

Aalto University
School of Electrical
Engineering

Page 21 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Solving Nonlinear Equation


The solution to
F(V ) = Q(V ) + I (V ) + Y V I s = 0
is searched using Newton iteration, i.e.,
V (i+1) = V (i) (J (i) )1 F(V (i) ),
where
J (i) =

Q(V )
F(V )
I (V )
=
+
+Y
V
V
V

V (i) is the voltage at the ith iteration step or initial guess,


all derivatives are computed at V = V (i)
The derivatives of I and Q at all frequencies (k ) are computed
w.r.t. all frequencies (l ), i.e., all combinations of k = 0, 1, ...
and l = 0, 1, ... AND cosine/sine coefficients must be taken into
account

A!

Aalto University
School of Electrical
Engineering

Page 22 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Computing the Derivatives


Assuming i(v(t)) depends only on one voltage, the derivatives of
I C (k ) w.r.t. V C (l ) and V S (l ) are
IkC
VlC
IkC
VlS

2
T
2
T

ZT "
0

ZT "
0

i(v(t))
v(t)

i(v(t))
v(t)

#"

#"

cos(k t)dt

cos(k t)dt

v(t)
VlC

v(t)
VlS

As v(t)/VlC = cos(l t) and v(t)/VlS = sin(l t) we get


2
IkC
=
VlC
T
IkC
VlS

A!

Aalto University
School of Electrical
Engineering

2
T
|

ZT

0
ZT
0

i(v(t))
cos(l t) cos(k t)dt
v(t)
i(v(t))
v(t)

sin(l t) cos(k t)dt

Page 23 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Applying trigonometric identities for cos() cos() and


cos() sin() and using the Fourier series of the derivative
(G C and G S ), we get the following expressions:

l=
6 k:
IkC
VlC
IkC
VlS
IkS
VlC
IkS
VlS

A!

1


G C (k l ) + G C (k + l )


1
G S (k l ) + G S (k + l )
2

1 S
G (k l ) + G S (k + l )
=
2

1 C
G (k l ) G C (k + l )
=
2
=

k = 0, l 6= 0:

l = 0:

Aalto University
School of Electrical
Engineering

IkC
V0C
|

I0C
I0C
1 C
1
G
(
),
=
= G S (l )
l
VlC
2
VlS
2

= G C (k ),

IkS
V0C

= G S (k )

Page 24 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Computing the Derivatives


The derivative matrix of i(v(t)) w.r.t. up to the second harmonic
is shown below

2G0C

G1C

G1S

G2C

G2S

2G1C
2G1S

2G0C + G2C
G2S

G2S
2G0C G2C

G1C + G3C
G3S G1S

G3S + G1S
G1C G3C

2G2C
2G2S

G1C + G3C
G3S + G1S

G3S G1S
G1C G3C

2G0C + G4C
G4S

G4S
2G0C G4C

is done similarly, i.e., the same formulas


V
apply if I is replaced by Q and G is replaced by C . The current
of the dynamic (charge) elements are obtained by multiplying the
Q and C with .
The computation of

A!

Aalto University
School of Electrical
Engineering

Page 25 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance Iteration Algorithm


1)
2)
3)
4)

Set i = 0, initial guess is V (0) (from DC analysis)


Compute linear elements at all harmonic frequencies,
linear elements = admittances and excitations
Sample nonlinear elements using V (i) I , G, Q, C
Solve linearized equation

(J (i) )V = F(V (i) )

6)

V (i+1) = V (i) + V
F(V )

V |V =V (i)
Use norm reduction if needed, (0, 1]
Check convergence
If kV k < 1 and kF(V (i+1) )k < 2 , goto 7)
Set i = i + 1, goto 3)

7)

Solution is V (i+1)

J (i) =

5)

A!

Aalto University
School of Electrical
Engineering

Page 26 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance Nonlinear Example


Write HB equations for the
circuit on the right. G = 2 S,
C = 0.5 F, 1 = 2 rad/s
(single-tone/2 harmonics),
j0 = 0.1 A, j1 = 0.05 A,
i(v1 ) = (v1 )2 A,
j(t) = j0 + j1 cos(1 t) A

1
j(t)

v1

i(v1 )

Check the equations by computing F(V ). The solution is

V1 =

A!

V1C (0)
V1C (1 )
V1S (1 )
V1C (21 )
V1S (21 )

Aalto University
School of Electrical
Engineering

0.1
0.05
0
0
0

, V2 =

V2C (0)
V2C (1 )
V2S (1 )
V2C (21 )
V2S (21 )

Page 27 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

5.625m
4.0m
2.0m
312.5
312.5

Harmonic Balance Nonlinear Example


Linear Y-matrix: Y =

1 C

V =

C
V1 (0)
V C (0)
2

1 C
1
G
1
G
21 C

21 C

Above V1C (1) means V1C (1 ), V1S (2) = V1S (21 ), ...
Numerical values: G = 2, 1 C = 1, 21 C = 2

A!

Aalto University
School of Electrical
Engineering

Page 28 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

C
V1 (2)

V2C (2)

V1S (2)

V1C (1)
V2C (1)
V1S (1)
V2S (1)

V2S (2)

Harmonic Balance Nonlinear Example

Source vector I s =

j0
0
j1
0
0
0
0
0
0
0

0.1
0
0.05
0
0
0
0
0
0
0

Nonlinear current I (V ):
i(v1 ) = v12 , where v1 = V1C (0) + V1C (1) cos(1 t)
Expanding i(v1 ) = (V1C (0) + V1C (1) cos(1 t))2 gives the
spectrum of i(v1 )
Note: the direction of I (V ) is from node to the ground

A!

Aalto University
School of Electrical
Engineering

Page 29 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance Nonlinear Example


i(v1 ) = [V1C (0) + V1C (1) cos(1 t)]2
= [V1C (0)]2 + (1/2)[V1C (1)]2
+2V1C (0)V1C (1) cos(1 t)
+(1/2)[V1C (1)]2 cos(21 t)

I (V ) =

A!

Aalto University
School of Electrical
Engineering

0
2
C
[V1 (0)] + (1/2)[V1C (1)]2
0
C
2V1 (0)V1C (1)
0
0
0
(1/2)[V1C (1)]2
0
0

0
11.25m
0
10m
0
0
0
1.25m
0
0

Page 30 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Harmonic Balance Nonlinear Example


F(V ) = Y V + I (V ) I s

=0

A!

Aalto University
School of Electrical
Engineering

0.1
11.25m
0.05
10m
0
0
0
1.25m
0
0

{z

YV

0
11.25m
0
10m
0
0
0
1.25m
0
0

0.1
0
0.05
0
0
0
0
0
0
0

{z

{z

I (V )

Is

Page 31 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

HB Simulations: 1-dB compresssion (1-tone)


1dB compression
APLAC 8.50 User: AALTO/RAD/CT Mon Jan 31 2011

20.00

26
Gain

Pout
Pout/dBm

3.33

25
dB

dBm

-13.33

24

-30.00

23
1dB

-46.67

22

-63.33

1 dB compression
occurs at
Pin=25 dBm

21
Gain/dB

-80.00
-100

20
-90

-80

-70

-60

-50

-40

-30

-20

-10

Pin/dBm
Linear gain

Gain

Pout

1dB

1-dB compression point is defined as the level of the input power


when the gain has dropped 1 dB from the gain extrapolated at low
power levels.

A!

Aalto University
School of Electrical
Engineering

Page 32 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

HB Simulations: 3rd order intercept (2-tone)


2-tone simulation: IM3 (2f1-f2)
20.00

APLAC 8.50 User: AALTO/RAD/CT Mon Jan 31 2011

Pout

IM3 -->

3.33
dBm

-13.33
-30.00

IM3 is at
Pin=12 dBm

-46.67
-63.33
-80.00
-100

-72.5

-45

-17.5

10

Pin/dBm
Linear[fund]

Linear[3rd]

Pout[fund]

Pout[3rd]

IM3: determine the power level at which the extrapolated


fundamental (f1 ) and third harmonic (2f1 f2 or f1 2f2 )
intersect.

A!

Aalto University
School of Electrical
Engineering

Page 33 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Oscillator analysis

An oscillator is an autonomous circuit, no periodic excitation

Transient analysis of an oscillator

May converge to the DC solution (no periodic excitation!)


Either the HB equation needs to be modifed to be solved, or
apply an artificial excitation
The oscillation frequency, i.e, fundamental HB frequency, is
unknown

Why use HB instead of transient analysis ?

A!

Oscillation starts by itself due to noise or unstability


Long start-up time long simulation time
Suitable for highly nonlinear oscillators

HB analysis of an oscillator

Only DC bias sources connected to the circuit

HB is needed for (phase) noise simulations


Frequency dependent linear devices (S parameters, ...)

Aalto University
School of Electrical
Engineering

Page 34 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Transient and HB simulation of a VCO oscillator


vcoBi Oscillator: TRAN/start-up
APLAC 8.50 User: AALTO/RAD/CT Mon May 10 2010

4.00
u(t)
V

2.75

1.50

0.25

-1.00
0

3.75n

7.5n

11.25n

15n

t/s
vtran(outn)

vtran(outp)

vcoBi Oscillator: HB waveform


APLAC 8.50 User: AALTO/RAD/CT Mon May 10 2010

4.00
U/V

2.75

VCO: fosc=1.23 GHz


Reaches steady state in 7 periods

1.50

0.25

-1.00
0

3n

6n

9n

t/s
HB(outp)

A!

Aalto University
School of Electrical
Engineering

HB(outn)

Page 35 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

12n

HB Oscillator Analysis in the APLAC Simulator

HB Oscillator analysis is done using optimization; variables are


the oscillation frequency, fosc, and oscillation amplitude, vosc

Artificial excitation OscAProbe: voltage source in series with


a non-zero resistor is connected to the circuit. Optimization
goal is to have zero current through the probe element

Oscillator analysis algorithm


1) Change optimization variables fosc, vosc
2)
3)

HB analysis (incl. nonlinear iteration)


Compute optimization goal

4)

A!

Terminate optimization if in specs,


otherwise goto 1)
Preliminary step before optimization: Run, for example,
transient simulation and extract from the data better initial
values for fosc and vosc and nodal spectral voltages

Aalto University
School of Electrical
Engineering

Page 36 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Initial guess for HB Oscillator analysis1

Run transient simulation for a predefined interval and store


the voltage waveform data across the OscAProbe element
Use algorithm named "FFT" or "Zero-crossing" to find better
approximation of the oscillation frequency and amplitude:

"FFT": do FFT on the waveform data and search for the


maximum peak. Apply parabolic interpolation to improve
accuracy. Location and value of the maximum peak give an
approximation of fosc and vosc
"Zero-crossing": search for successive zero crossings after
removing the average from the data. Estimate vosc from the
maximum swing and fosc from the distance between zero
crossings

Optionally inject a short pulse for faster start-up


Optionally initialize node voltages to the spectral data
obtained from the transient simulation

1
The results shown here were obtained in EU/FP7/ICT/ICESTARS/214911
project (http://www.icestars.eu)

A!

Aalto University
School of Electrical
Engineering

Page 37 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

HB Divider analysis
A divider (ratio P) is usually driven by a signal at frequency P f0
and the circuit generates the signal at frequency f0 . HB divider
analysis is done as follows:
Use artificial excitation (voltage source in series with a
non-zero resistor R0 ) at frequency f0 to generate a signal at
the lowest harmonics (f0 , 2f0 , ...)
The value of the resistor R0 is swept from small (k) to
large (G) values, i.e., gradually disconnect the artificial
element from the circuit
Divider by 4 (f0=1G)
APLAC 8.50 User: AALTO/RAD/CT Mon Jan 31 2011

2.50

The figure on the right shows the


result of the HB simulation of a
div-by-4 circuit. Final value of
R0 = 10 G

1.25

0.00

-1.25

-2.50
0

1n

2n

3n

t/s
clk

A!

Aalto University
School of Electrical
Engineering

Page 38 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

div

4n

Harmonic Balance Analysis in the APLAC Simulator

Supports single- and multi-tone analyses

Multi-tone analysis: frequency selection methods are diamond,


box, and the combination of these, box_and_diamond
Several FFT algorithms

Iterative solver: GMRES


Two approaches in the equation formulation:

A!

Classical FFT: used in single-tone analysis, samples = 2k


Multidimensional FFT: used in multi-tone analysis
Onedim FFT: single- or multitone frequencies are mapped into one
dimension, fast, requires much less memory

Piecewise HB: linear elements are "compressed" into one (possibly


large) linear multi-port, the dimension of the matrix is proportional
to the number of nonlinear device nodes. Supports Classical and
Multidimensional FFT
Nodal HB: the whole equation is solved as is, the equation
formulation is matrix-implicit. Supports all FFT algorithms and
threading. Suitable for large circuits

Aalto University
School of Electrical
Engineering

Page 39 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Using HB Analysis

Define tones and harmonics, FFT algorithm, frequency selection


Prepare TONE m l (DIAMOND | BOX str) HBMODE = (0 | 1)
+ HB_SAMPLING_METHOD = ( TONE1 | MULTIDIM | ONEDIM )
+ NTHREADS = nth

TONE: m-tone analysis, order of mixing frequencies is l


Piecewise HB: HBMODE=0, Nodal HB: HBMODE=1
Number of threads = nth
All items above need not be specified, the only obligatory
parameter that enables HB analysis is TONE m l

Excitation (Curr or Volt)


Curr Jg 0 1 DC=2 TONE=[k1,k2,...],exci

A!

[k1,k2,...]: excitation at frequency k1f1 +k2f2 + ...,


the source value is complex or real exci
Example: TONE=1,3 defines the excitation at the first harmonic,
value is 3 cos(1 t)

Aalto University
School of Electrical
Engineering

Page 40 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Using HB Analysis
Analysis commands and results

Analysis command: Analyze HB FC=[f1 , f2 , ...fm ] or use


Sweep,i.e., Sweep ... HB FC=[f1 , f2 , ..., fm ]

Analysis results:

A!

FC specifies the fundamental analysis frequencies [Hz], all


harmonics and mixing products j are computed from these
excitation frequencies
Number of frequencies must agree with the definition specified
in Prepare, m cannot be changed
Functions Spectrum(), Waveform(), VWf(), IWf(),...
Graphics:
spectrum: Show SPECTRUM Mag(Spectrum(node))
waveform: Show WAVEFORM VWf(node)
All voltages/currents: Print VOLTAGES HB CURRENTS HB

Aalto University
School of Electrical
Engineering

Page 41 / 41 | S-55.3240 Lecture 6: Harmonic Balance (Steady-State Analysis)


c 2011 Jarmo Virtanen
Copyright

Você também pode gostar