Computer-Aded Crcut Smulaton and Verfcaton CSE245 Fall 24 Professor:Chung-Kuan Cheng
Admnstraton Lectures: 5:pm ~ 6:2pm TTH HSS 252 Offce Hours: 4:pm ~ 4:45pm TTH APM 4256 Textbook Electronc Crcut and System Smulaton Methods T.L. Pllage,.A. ohrer, C. Vsweswarah, McGraw- Hll TA: Zhengyong (Smon) Zhu (zzhu@cs.ucsd.edu)
Crcut Smulaton Input and setup Crcut Smulator: Solve dx/dt=f(x) numercally Output Types of analyss: DC Analyss DC Transfer curves Transent Analyss AC Analyss, Nose, Dstorton, Senstvty
Program Structure (a closer look) Input and setup Models Numercal Technques: Formulaton of crcut equatons Soluton of ordnary dfferental equatons Soluton of nonlnear equatons Soluton of lnear equatons Output
CSE245: Course Outlne Formulaton LC Lnear, Nonlnear Components,Transstors, Dodes Incdent Matrx Nodal Analyss, Modfed Nodal Analyss K Matrx Dynamc Lnear System S doman analyss, Impulse esponse Taylor s expanson Moments, Passvty, Stablty, ealzablty Symbolc analyss, Y-Delta, BDD analyss Matrx Solver LU, KLU, reorderng Mutgrd, PCG, GMES
CSE245: Course Outlne (Cont ) Integraton Forward Euler, Backward Euler, Trapezodal ule Explct and Implct Method, Predcton and Correcton Equvalent Crcut Errors: Local error, Local Truncaton Error, Global Error A-Stable Alternatng Drecton Implct Method Nonlnear System Newton aphson, Lne Search Transmsson Lne, S-Parameter FDTD: equvalent crcut, convoluton Frequency dependent components Senstvty Mechancal, Thermal, Bo Analyss
Lecture : Formulaton KCL/KVL Sparse Tableau Analyss Nodal Analyss, Modfed Nodal Analyss *some sldes borrowed from Berkeley EE29 Course
Formulaton of Crcut Equatons Unknowns B branch currents () N node voltages (e) B branch voltages (v) Equatons N+B Conservaton Laws B Consttutve Equatons
Branch Consttutve Equatons (BCE) Ideal elements Element esstor Capactor Inductor Voltage Source Current Source VCVS VCCS CCVS CCCS Branch Eqn v = = C dv/dt v = L d/dt v = v s, =? = s, v =? v s = A V v c, =? s = G T v c, v =? v s = T c, =? s = A I c, v =?
Conservaton Laws Determned by the topology of the crcut Krchhoff s Voltage Law (KVL): Every crcut node has a unque voltage wth respect to the reference node. The voltage across a branch e b s equal to the dfference between the postve and negatve referenced voltages of the nodes on whch t s ncdent No voltage source loop Krchhoff s Current Law (KCL): The algebrac sum of all the currents flowng out of (or nto) any crcut node s zero. No Current Source Cut
Equaton Formulaton - KCL 2 G 2 v 3 3 4 I s5 = 5 4 3 2 A = Krchhoff s Current Law (KCL) N equatons
Equaton Formulaton - KVL 2 G 2 v 3 3 4 I s5 = 2 5 4 3 2 e e v v v v v v - A T e = Krchhoff s Voltage Law (KVL) B equatons
Equaton Formulaton - BCE 2 G 2 v 3 3 4 I s5 = + 5 5 4 3 2 5 4 3 2 4 3 2 s v v v v v G K v v+ = s B equatons
n o d e 2 Equaton Formulaton Node-Branch Incdence Matrx branches 2 3 j B s (+, -, ) N A j ={+ f node s termnal + of branch j - f node s termnal - of branch j f node s not connected to branch j
Equaton Assembly (Stampng Procedures) Dfferent ways of combnng Conservaton Laws and Consttutve Equatons Sparse Table Analyss (STA) Modfed Nodal Analyss (MNA)
Sparse Tableau Analyss (STA). Wrte KCL: A= (N eqns) 2. Wrte KVL: v -A T e= (B eqns) 3. Wrte BCE: K + K v v=s (B eqns) = S e v K K A I A v T N+2B eqns N+2B unknowns N = # nodes B = # branches Sparse Tableau
Sparse Tableau Analyss (STA) Advantages It can be appled to any crcut Eqns can be assembled drectly from nput data Coeffcent Matrx s very sparse Problem Sophstcated programmng technques and data structures are requred for tme and memory effcency
Nodal Matrx N = # nodes Nodal Analyss (NA). Wrte KCL A = (N eqns, B unknowns) 2. Use BCE to relate branch currents to branch voltages =f(v) (B unknowns B unknowns) 3. Use KVL to relate branch voltages to node voltages 4. v=h(e) (B unknowns N unknowns) Y n e= ns N eqns N unknowns
Nodal Analyss - Example 3 2 G 2 v 3 4 I s5. KCL: A= 2. BCE: K v v+ = s = s -K v v A K v v= A s 3. KVL: v = A T e A K v A T e= A s Y n e= ns = + + + 5 2 4 3 3 3 2 3 2 s e e G G
Nodal Analyss Example shows NA may be derved from STA Better: Y n may be obtaned by drect nspecton (stampng procedure) Each element has an assocated stamp Y n s the composton of all the elements stamps
Nodal Analyss esstor Stamp Spce nput format: k N+ N- kvalue N+ k N- N+ N- N+ N- k k k k What f a resstor s connected to ground?. Only contrbutes to the dagonal others others + k k ( e e ) N + N = ( e ) = N + en s s KCL at node N+ KCL at node N-
Nodal Analyss VCCS Stamp Spce nput format: Gk N+ N- NC+ NC- Gkvalue NC+ NC+ NC- NC- + v c - G k v c N+ N- N+ N- Gk G k G G k k G ( e ) NC+ enc = ( e ) = NC+ enc + G KCL at node N+ others others k k s s KCL at node N-
Nodal Analyss Current source Stamp Spce nput format: Ik N+ N- Ikvalue N+ I k N+ N- N+ N- = I I k k N-
Nodal Analyss (NA) Advantages Yn s often dagonally domnant and symmetrc Eqns can be assembled drectly from nput data Yn has non-zero dagonal entres Yn s sparse (not as sparse as STA) and smaller than STA: NxN compared to (N+2B)x(N+2B) Lmtatons Conserved quantty must be a functon of node varable Cannot handle floatng voltage sources, VCVS, CCCS, CCVS
Modfed Nodal Analyss (MNA) kl cannot be explctly expressed n terms of node voltages t has to be added as unknown (new column) e k and e l are not ndependent varables anymore a constrant has to be added (new row) How do we deal wth ndependent voltage sources? kl k l + - E kl = kl kl l k E e e k l
MNA Voltage Source Stamp Spce nput format: Vk N+ N- Ekvalue E k + - N+ N- k N+ N- Branch k N+ N- k HS - - E k
Modfed Nodal Analyss (MNA) How do we deal wth ndependent voltage sources? Augmented nodal matrx Y B e n = C MS Some branch currents In general: Y B e n = C D MS
MNA General rules A branch current s always ntroduced as and addtonal varable for a voltage source or an nductor For current sources, resstors, conductors and capactors, the branch current s ntroduced only f: Any crcut element depends on that branch current That branch current s requested as output
MNA CCCS and CCVS Stamp
MNA An example + v 3-3 2 E S6 - + 3 G 2 v 3 4 I s5 - + 8 4 E 7 v 3 Step : Wrte KCL + 2 + 3 = () -3 + 4-5 - 6 = (2) 6 + 8 = (3) 7 8 = (4)
MNA An example Step 2: Use branch equatons to elmnate as many branch currents as possble / v + G2 v3 + /3 v3 = () - /3 v3 + /4 v4-6 = s5 (2) 6 + /8 v8 = (3) 7 /8 v8 = (4) Step 3: Wrte down unused branch equatons v6 = ES6 v7 E7 v3 = (b6) (b7)
MNA An example Step 4: Use KVL to elmnate branch voltages from prevous equatons / e + G2 (e-e2) + /3 (e-e2) = () - /3 (e-e2) + /4 e2-6 = s5 (2) 6 + /8 (e3-e4) = (3) 7 /8 (e3-e4) = (4) (e3-e2) = ES6 (b6) e4 E7 (e-e2) = (b7)
MNA An example = + + + + 6 7 7 5 7 6 4 3 2 8 8 8 8 4 3 3 3 2 3 2 ES e e e e E E G G s MS e C B Y n =
Modfed Nodal Analyss (MNA) Advantages MNA can be appled to any crcut Eqns can be assembled drectly from nput data MNA matrx s close to Y n Lmtatons Sometmes we have zeros on the man dagonal