steady-state methods
DESCRIPTION
Steady-State Methods. UCB EE219A Oct 29 2002 Joel Phillips, Cadence Berkeley Labs. Some artwork thanks to: K. Kundert. Steady-State Methods: Goals. Understand alternative way of analyzing differential equations Faster Application-Specific “Tie together” several numerical themes - PowerPoint PPT PresentationTRANSCRIPT
1
Steady-State Methods
UCB EE219A Oct 29 2002
Joel Phillips, Cadence Berkeley Labs
Some artwork thanks to: K. Kundert
2
Steady-State Methods: Goals
• Understand alternative way of analyzing differential equations
‑ Faster
‑ Application-Specific
• “Tie together” several numerical themes
‑ Circuit theory
‑ Solution of ODEs/DAEs
‑ Newton methods
‑ Iterative solvers & preconditioning
3
Review: Solution of ODEs/DAEs
1. Given an ODE/DAE
2. Start with an initial condition
3. Pick a next time point (discretize time)
4. Compute next solution (Newton etc.)
5. Go to 3. and repeat till done
),,( 1111
nnnnn
tuxfhxx),,( tuxf
dtdx
4
Good Questions For Transient Analysis
• How does the circuit behave
‑ When driven by a sinusoids (for a short time?)
‑ When driven by a step input?
‑ When driven by unstructured (i.e. a-periodic) inputs
• Other time-domain characteristics
‑ Delay, Risetime, Overshoot
5
Hard Questions for Transient Analysis
• How does the circuit behave
‑ When driven by sinusoid(s) for a very long time? (steady-state)
• How much noise does the circuit introduce to a signal?
‑ Where does the noise come from? Where does it go?
• Other frequency-domain questions
‑ Small-signal stability, Bode plot, pole-zero
6
Example Frequency-Domain Analysis
TBR Model Not Positive Real
)( Re Y
7
Why steady-state methods?
• Speed
‑ E.g., AC
• Accuracy
‑ E.g., distortion
• Insight
‑ E.g., stability
• No choice!
‑ RF noise
8
Prototypical steady-state analysis: AC
• Linear Circuits
‑ Apply a sinusoidal source at single frequency
‑ Sweep the frequency of source (Bode/Nyquist plot)
Small-signalsource
Measuredresponse
+
–v1 i2 i4
+
–v5
+
–v3
9
AC via TRAN
• Apply source
• Solve IVP (Trap, Euler, etc.)
• Wait till steady state is reached
• Fourier-transform the output
10
Problem #1: Speed
• Consider a 1Hz sinusoid applied to a resonant RLC circuit
Transients mustdie out to avoid
corrupting steady-state
Each period requires20-50 timepoints?
Must simulate forminimum one second
past transients
11
Problem #2: Accuracy
• Widely used BAD method for Fourier analysis
‑ Interpolate onto uniform timepoints, apply FFT
• Problems
‑ Detecting “onset” of steady-state
‑ Polynomial interpolation creates high noise floors in Fourier analysis
‑ Truncation errors corrupt spectrum
‑ Aperiodicity/endpoint errors
12
How bad can it be?
• Experiment:
‑ Sample sinusoid at 256 random points
‑ Interpolate onto uniform 1024-point grid
‑ FFT
• Looks good so far!!!
13
It can be really bad!!!
dB
14
AC Linear Analysis
• Consider linear problem
• Recall: In the frequency-domain
• Nice feature: work for all linear elements (e.g., transmission lines)
tjueAxdtdx
uAxxj )()(
)(AA
)()( ssxtxdtd xjx
dtd
Laplacetransform
Fouriertransform
Sinusoidalsteady-state
tjacextx )(
Sinusoidalinput u
FundamentalAC analysis equation
15
AC Small-Signal for Nonlinear Circuits
• Step 1: Find the DC operating point
‑ In a circuit, this means find a set of currents, voltages that satisfy Kirchoff’s voltage & current laws, with all capacitors deleted and all inductors shorted
),,( tuxfdtdx 0)0,,( dcuxf
(Recall that: DC operating point itself is very useful in circuit design…..)
16
AC Small-Signal for Nonlinear Circuits
• Step 2: Linearize around the DC operating point
‑ Assume the inputs are small perturbations around the DC point
‑ Assume circuit response is in turn a small perturbation around the DC point (use Taylor series)
0)0,,( dcdc uxf
tiacdc euutu )(
)()0,,(),,( dcdcdc xxxf
uxftuxf
17
AC Small-Signal for Nonlinear Circuits
• Step 3: Solve the AC analysis equation
• Note: Fourier portion of analysis is exact
‑ No truncation error
‑ No aliasing errors
‑ No periodicity errors
acx
uxxf
xjdc
)()(
18
More Linear Analyses: Pole-Zero
• Is the design stable? Poles all in left half-plane? Recall AC analysis:
• Poles occur at (complex) such that
• Solve eigenvalue problem by
‑ Direct methods: QZ; or Krylov methods: Lanczos, Arnoldi (similar to GMRES!)
0)(
sxxf
sIdcx
s
acx
uxf
sIsxdc
1
)(
19
Noise Analysis
• Lossy devices in circuit generate noise
• Noise is: Stochastic (random) unwanted signal
• Typical model:
‑ Stationary Gaussian process characterized by power spectrum
Thermal Noise
Source
Noise appearsat output
20
White Noise
•Noise at each time point is independent
‑ Noise is uncorrelated in time
‑ Spectrum is white
•Examples: thermal noise, shot noise
R(t,) S(f )
f
FourierTransform
Autocorrelation Spectrum
21
Colored Noise
‑ Noise is correlated in time because of time constant
‑ Spectrum is shaped by frequency response of circuit
‑ Noise at different frequencies is independent (uncorrelated)
Time correlation Frequency shaping
R(t,) S(f )
f
FourierTransform
Autocorrelation Spectrum
22
Noise Analysis
• Typical model
‑ Assume “small” small signal analysis
‑ Stationary Gaussian process characterized by power spectrum
• Small-signal analysis with noise sources
• Frequency-domain method:
‑ Compute transfer function from each noise source to the observation point (output) [Same transfer functions as computed by AC]
‑ Sum noise power contributions. Correlations will be correctly tracked.
dwwdwwdtxxf
dxdcx
21
Possibly correlated “white” Gaussian processes
23
AC-like Transfer Function Computation
LinearizedCircuit
Source 1
Source M
etc.
kuxxf
xj kac
k
x
k
dc
sourceeach for )()(
Output
• Each source requires a transfer function analysis
• Number of sources M number of devices
•Too many solves!
24
Adjoint Analysis
• Standard AC analysis to compute
‑ Solve (expensive)
‑ For any output desired, compute (cheap)
• Key observation:
• Adjoint analysis
‑ One c, lots of b (or many more b than c)
‑ Solve
‑ For all the inputs (sources), compute
bAx
bAcTk1
xcTk
cAbbAc TTT 1
cyAT ybTk
25
Forward Analysis: Circuit Interpretation
LinearizedCircuit
Output 1
Output 2
Output 3
Output 4
Input 1
Input 2
Input 3
For one input configuration, compute TF from to all possible outputs
26
Adjoint Analysis: Circuit Interpretation
LinearizedCircuit
Output 1
Output 2
Output 3
Output 4
Input 1
Input 2
Input 3
For one output configuration, compute TF from all possible inputs
27
Generalizations of Steady-State Analyses
• Mostly ways of dealing with LARGE signal effects
‑ i.e., NONLINEAR analysis
• Examples:
‑ Distortion
‑ Frequency Conversion
28
Distortion
• Consider amplifier with cubic nonlinearity
• Harmonic distortion
• Intermodulation distortion
+
-inv
3ininout BvAvv
tBatBaAvout 3sin4/sin4/3 33 tavin sin
tbtavin 21 sinsin ,)2(,3,3in termssinsin 212121 ttttbAtaAvout
29
Distortion
122
Real life is more complicated with nonlinearfrequency-dependent terms, higher-order nonlinearities, and more complex inputs.
30
Frequency-Translation
• Linear Mixer
• Common confusion: frequency translation itself is a linear process (not nonlinear)
‑ But all actual frequency-translating devices are nonlinear
tavin sin
tbvlo 2sin
ttab
vvv inloout
)cos()cos(2
2121
31
Simple Nonlinear Steady-State Problems
• Compute harmonic distortion in the amplifier
• Compute conversion gain in the mixer
• Compute noise in either
• All three are periodic-steady-state problems
‑ (or periodic steady-state + small-signal analysis)
*
*[intermodulation distortion is a quasi-periodic steady-state problem]
32
Periodic Steady-State
• Assume general excitation by periodic inputs
• In many cases, we expect a periodic solution [if we wait long enough…]
‑ Recall: periodic functions have a Fourier-series representation (sum of sine and cosines)
• Why not solve for the periodic solution directly?
33
Periodic Steady-State Computation
• Apply a sinusoid or other periodic input signal
• Find the periodic response
‑ Time-domain solution over one “fundamental” period
‑ Or spectrum: Fourier coefficients at fundamental + harmonics
• Sound familiar????
‑ Recall: in AC, we solved directly for the Fourier response (“fundamental”). No higher harmonics arise because system was linear.
• Need:
‑ Steady-state “equations” ala
‑ FAST & ACCURATE way of solving equations
acx
uxxf
xjdc
)()(
34
IVP vs BVP
• No problem specified with differential equations is complete without boundary condition
• Before: Solving an Initial Value Problem (IVP)
• What about:
• Example of a boundary-value problem (BVP)
),,( tuxfdtdx 0)0( xx
),,( tuxfdtdx )()0( Txx
35
Note on PBCs
• If solution to DAE is unique, then solution on one period determines solution for all time
‑ Both the shooting method and spectral interval methods (harmonic balance) use this fact
• From knowledge of solution at one timepoint, can easily construction solution over entire period by solving IVP
‑ We will exploit this in the shooting method
36
Enforcing PBCs
• Approach 1: Build BCs in basis function
‑ Example: Fourier series satisfy periodic boundary conditions
• Approach 2: Write extra equations
‑ PBC
tkbtkatxk
kk
k
00
10 cossin)(
)()0( Txx
37
PSS Algorithm #1: Harmonic Balance
• Periodic solution can be expressed in terms of Fourier series with fundamental frequency
• Pick
tkbtkatxN
kk
N
kk
00
10 cossin)(
N
Nk
tikkectx 0)(
0
kk cc
-- OR --
(real solutions please!)
38
PSS Algorithm #1: Harmonic Balance
• Pick
• Want to solve
• Clever trick: spectral derivatives!
N
Nk
tikkectx 0)(
N
Nk
tikkecik
dtdx
00
N
Nk
tikkecdt
dx0
kk cikc 0
utxfdtdx ),(
39
Spectral Differentiation
• Recall
• Works on any function
‑ With suitable technical conditions
• Spectral differentiation is exact for sinusoids!!!!
)()(
ssxdttdx
Occasional linearity confusion:Linear circuit sinusoids do not interact.Differentiation acts on signals, not the nonlinear functions, so Fourier analysisworks fine.
40
How good is spectral differentiation?
Plot vs. on finite difference grid i)(2xieD
41
Aside on Weighted Residuals
• Many numerical methods you know are weighted residual methods
• General scheme to solve
‑ Pick basis functions
‑ Ansatz:
‑ Select weighting functions
‑ Force
uxF )(
N
kkkcx
1
k
j
0)(,0
N
kkkj cFu
42
Weighted Residuals: Examples
• Least-Squares
‑ GMRES
• Collocation:
‑ Original equations satisfied exactly at some “points”
‑ BDF collocates derivatives
• Galerkin:
‑ Residual orthogonal to basis space (or some other space)
‑ Krylov-based Model Reduction
)( jj t
jj
43
Harmonic Balance: Equation Formation
• Enforce
‑ Galerkin (true spectral method)
‑ Point collocation (“pseudo-spectral method”)
• Force at selected timepoints
‑ Which ones? Time for another trick…..
uxF )( ),()( txfdtdx
xF
uxF )(
44
Differentiation and the DFT
• Fourier transform (DFT) relates solution at discrete points to Fourier coefficients
Mx
x
x
KX
KX
2
1
0
0
F
)(
)(
[strictly speaking, we are evaluating the Fourier integral via quadratureusing the trapezoidal rule. Useful fact: trapezoidal rule is the best rule (spectrally accurate!) for quadrature on a circle. ]
45
Differentiation and the FFT
• Derivative in Fourier space:
• DFT-based differentiation formula
• We can evaluate a DFT fast using an FFT
• Suggests selecting timepoints to be evenly spaced
MM x
x
x
K
K
K
i
x
x
x
dtd
2
1
1-0
2
1
F1
F
)()( kXikkX
46
Equation Structure
• BVP becomes
• Jacobian with
),(
),(
),(
-F )( F),()(22
11
1-
MM txf
txf
txf
itxfdtdx
xF
M
2
1
1-0
g
g
g
-F
K
K-
F
iJ
xtxfg kkk /),(
(sorta looks like AC, doesn’t it???)
47
Equation Solution
• We need to solve
• These matrices are dense in either Fourier- or real- space LU factorization is bad news
• They are potentially very large
• Yet a matrix-vector product can be done fast
• Ideal candidate for iterative solution methods (GMRES!)
• Good preconditioners are necessary, but hard to construct
M
2
1
1-0
g
g
g
-F
K
K-
F
iJ
bJx
48
Historical Note about Device Evaluation
• Once upon a time…..microwave/RF simulators were purely frequency-domain…..like AC.
• Problem: This required frequency-domain transistor models.
• At some point it was noticed that the devices could be evaluated in the time-domain (with equations written in frequency domain) by using Fourier transforms.