
Numerical Methods in Dynamic Systems
Discover the foundations and applications of numerical methods in dynamic systems, covering problem formulations, integration methods, system solvers, sensitivity analysis, and more. Explore the motivation behind analyzing and optimizing energy, astrophysics, climate, biology, and socioeconomic modeling. Circuit simulation techniques and program structures are also outlined.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CSE291: Numerical Methods Lecture 1: Introduction and Formulation Spring 2020 Chung-Kuan Cheng
Administration CK Cheng, CSE 2130, tel. 858 534-6184, ckcheng+291@ucsd.edu Lectures: 330-450PM TTH, Zoom Grading Project Proposal: 20% Project Presentation: 40% Final Report: 40%
References 1. Electronic Circuit and System Simulation Methods, T.L. Pillage, R.A. Rohrer, C. Visweswariah, McGraw-Hill, 1998 2. Convex Optimization Algorithms, D.P. Bertsekas, Athena Scientific 2015
Dynamic Systems Outline 1. Introduction 2. Problem Formulations 3. Integration Methods: matrix solvers, explicit and implicit integrations, matrix exponential methods, stability 4. System Solvers: 1) Distributed computation: Parareal and multigrid in time 2) Gradient descent methods 3) Subgradient descent methods 4) Homotopy methods 5. Sensitivity Analysis: direct method, adjoint network approach 6. Multiple Dimensional Analysis: Tensor decomposition 7. Source Localization
Motivation: Analysis and Optimization Energy: Fission, Fusion, Fossil Energy, Efficiency Optimization Astrophysics: Dark energy, Nucleosynthesis Climate: Pollution, Weather Prediction Biology: Microbial life Socioeconomic Modeling: Global scale modeling Nonlinear Systems, ODE, PDE, Heterogeneous Systems, Multiscale Analysis.
Circuit Simulation: Overview stimulant generation netlist extraction, modeling Circuit Input and setup Simulator: Solve numerically frequency & time domain simulation user interface: worst cases, eye diagrams, noises Complexity Accuracy Debug Output
Circuit Simulation Circuit Input and setup Simulator: dt ( ) dX t = Solve numerically ( ) f X C Output ( ) dX t = = + ( ) ( ) ( ) f X C GX t BU t dt Types of analysis: DC Analysis DC Transfer curves Transient Analysis AC Analysis, Noise, Distortions, Sensitivity = + ( ) ( ) Y DX t FU t
Program Structure (a closer look) Models Input and setup Numerical Techniques: Formulation of circuit equations Solution of ordinary differential equations Solution of nonlinear equations Solution of linear equations Output
Lecture 1: Formulation Basic Elements KCL/KVL and Topology Sparse Tableau Analysis (IBM) Nodal Analysis, Modified Nodal Analysis (SPICE) *some slides borrowed from Berkeley EE219 Course
Basic Elements Two terminal elements Multiple port elements Resistors: i=i(v) or v=v(i), e.g. i=v/R Capacitors: q=q(v) Inductors: ?= ?(i) Sources:
Basic Elements: Summary For the simulation of two terminal elements, we can convert capacitors and inductors to resistors via Euler or trapezoidal integration. The conversion leaves two variables and one constraint. When the element is nonlinear, we need to watch out the slope of the device and the conservation of the charge or flux. Use examples of nonlinear and time varying capacitors to illustrate the formula of charge conservation.
Branch Constitutive Equations (BCE) Ideal elements Element Branch Eqn v = R i i = C dv/dt v = L di/dt v = vs i = is vs = AV vc is = GT vc vs = RT ic is = AI ic Variable parameter v, i dv/dt, i v, di/dt i = ? v = ? i = ? v = ? i = ? v = ? Resistor Capacitor Inductor Voltage Source Current Source VCVS VCCS CCVS CCCS
Conservation Laws Determined by the topology of the circuit Kirchhoff s Current Law (KCL): The algebraic sum of all the currents flowing out of (or into) any circuit node is zero. No Current Source Cut Kirchhoff s Voltage Law (KVL): Every circuit node has a unique voltage with respect to the reference node. The voltage across a branch vb is equal to the difference between the positive and negative referenced voltages of the nodes on which it is incident No voltage source loop
Conservation Laws: Topology A circuit (V, E) can be decomposed into a spanning tree and links. The tree has n-1 (n=|V|) trunks, and m-n+1 (m=|E|) links. A spanning tree that spans the nodes of the circuit. Trunk of the tree: voltages of the trunks are independent. Check the case that the spanning tree does not exist! Link that forms a loop with tree trunks Link: currents of the links are independent. Check the case that the link does not exist! Thus, a circuit can be represented by n-1 trunk voltage and m-n+1 link currents.
Formulation of Circuit Equations Unknowns B branch currents (i) N node voltages B branch voltages (v) Equations N+B Conservation Laws B Constitutive Equations 2B+N equations, 2B+N unknowns => unique solution (e)
Equation Formulation - KCL R3 2 1 Is5 R1 R4 G2v3 0 Law: State Equation: i A i = 0 1 i 2 1 1 1 0 0 0 Node 1: Node 2: = i 3 N equations 0 Branches 0 1 1 1 0 i 4 i 5 Kirchhoff s Current Law (KCL)
Equation Formulation - KVL R3 2 1 Is5 R1 R4 G2v3 0 Law: State Equation: 1 0 0 v v - AT e = 0 1 v 1 0 0 2 e vi = voltage across branch i ei = voltage at node i 1 = 1 1 1 0 v 3 e B equations 2 v 0 0 4 0 1 0 v 5 Kirchhoff s Voltage Law (KVL)
Equation Formulation - BCE R3 2 1 Is5 R1 R4 G2v3 0 Law: State Equation: 1 R Kvv + Kii = is 0 0 0 0 0 v i 1 1 1 0 0 0 0 G 0 v i B equations 2 2 2 1 R + = 0 0 0 0 0 v i 3 3 3 0 v i 1 R 4 4 0 0 0 0 v i si 5 5 5 4 0 0 0 0 0
Equation Formulation Node-Branch Incidence Matrix A branches 1 2 3 j B n o d e s 1 2 i (+1, -1, 0) N { +1 if node i is + terminal of branch j -1 if node i is - terminal of branch j 0 if node i is not connected to branch j Aij =
Equation Assembly (Stamping Procedures) Different ways of combining Conservation Laws and Branch Constitutive Equations Sparse Table Analysis (STA) Nodal Analysis (NA) Modified Nodal Analysis (MNA)
Sparse Tableau Analysis (STA) 1. Write KCL: 2. Write KVL: 3. Write BCE: Ai=0 v - ATe=0 Kii + Kvv=S (N eqns) (B eqns) (B eqns) 0 0 0 A 0 i N+2B eqns N+2B unknowns = T 0 I A 0 v N = # nodes B = # branches K K e S i v Sparse Tableau
Sparse Tableau Analysis (STA) Advantages It can be applied to any circuit Eqns can be assembled directly from input data Coefficient Matrix is very sparse Disadvantages Sophisticated programming techniques and data structures are required for time and memory efficiency
Nodal Analysis (NA) Use vector e as the only variables. Assume no voltage source 1. Write KCL Ai=0 2. Use BCE to relate branch currents to branch voltages i=f(v) (B equations B unknowns) 3. Use KVL to relate branch voltages to node voltages v=h(e) (B equations N unknowns) (N equations, B unknowns) N eqns N unknowns N = # nodes Yne=ins Nodal Matrix
Nodal Analysis - Example R3 1 2 Is5 R1 R4 G2v3 0 1. KCL: 2. BCE: 3. KVL: Ai=0 Kvv + i = is i = is - Kvv A Kvv = A is v = ATe A KvATe = A is Yne = ins 1 R 1 R 1 R + + G G 0 2 2 e Yn = AKvAT Ins = Ais 1 = 1 3 3 1 R 1 R 1 R si e + 5 2 3 3 4
Nodal Analysis Example shows how NA may be derived from STA Better Method: Yn may be obtained by direct inspection (stamping procedure) Each element has an associated stamp Ynis the composition of all the elements stamps
Nodal Analysis Resistor Stamp Spice input format: Rk N+ N- Rkvalue N+ N+ N- What if a resistor is connected to ground? . Only contributes to the diagonal 1 1 N+ i Rk R R 1 k 1 k N- R R N- k k 1 ( ) + = others i e e i KCL at node N+ + N N s R 1 k ( ) = others i e e i KCL at node N- + N N s R k
Nodal Analysis VCCS Stamp Spice input format: Gk N+ N- NC+ NC- Gkvalue NC+ N+ + NC+ NC- N+ G G vc k k Gkvc G G N- k k - NC- N- ( ( ) ) + = others i G e e i KCL at node N+ + k NC NC s = others i G e e i KCL at node N- + k NC NC s
Nodal Analysis Current source Stamp Spice input format: Ik N+ N- Ikvalue N+ N+ N- N+ I k = Ik I N- k N-
Nodal 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 (N+2B)x(N+2B) Limitations Conserved quantity must be a function of node variable Cannot handle floating voltage sources, VCVS, CCCS, CCVS. How do we handle the current variable? Hint: No cut of currents
Modified Nodal Analysis (MNA) How do we deal with independent voltage sources? Ekl k + - 1 e k l k = l e 1 ikl l i E 1 1 0 kl kl 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)
MNA Voltage Source Stamp Spice input format: Vk N+ N- Ekvalue Ek N+ N- ik RHS + - 0 0 0 1 0 0 -1 0 1 -1 N+ N+ N- 0 N- ik E Branch k k
Modified Nodal Analysis (MNA) How do we deal with independent voltage sources? Augmented nodal matrix Yn B 0 e In general B= -CT Why? = MS C i Some branch currents Yn B e = MS C D i
MNA General rules A branch current is always introduced as an 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
MNA CCCS and CCVS Stamp
MNA An example + v3 - ES6 R3 2 3 1 - + Is5 R1 R8 R4 G2v3 - + 0 4 E7v3 Step 1: Write KCL + i + i = i (1) (2) (3) (4) 0 i i i 1 2 3 i + i = 0 i 3 4 = 5 6 + 0 6 8 = 8 i i 7 8
MNA An example Step 2: Use branch equations to eliminate as many branch currents as possible 1 1 3 3 1 R R + + = (1) 0 v G v v 1 2 3 1 R 1 R + = v v i i (2) 3 4 6 5 s 3 4 1 R + = 0 i v (3) 6 8 8 1 R = 0 i v (4) 7 8 8 Step 3: Write down unused branch equations = (b6) (b7) v ES 6 6 = 0 v E v 7 7 3
MNA An example Step 4: Use KVL to eliminate branch voltages from previous equations 1 R 1 R (1) + + = ( ) ( ) 0 e G e e e e 1 2 1 2 1 2 1 3 1 R 1 R (2) + = ( ) e e e i i 1 2 2 6 5 s 3 4 1 R (3) + = ( ) 0 i e e 6 3 4 8 (4) 1 R = ( ) 0 i e e 7 3 4 8 (b6) (b7) = ( e ) e e ES 3 2 6 = ( ) 0 E e e 4 7 1 2
MNA An example Yn B 0 e = MS C i 1 R 1 R 1 R + + + 0 0 0 0 G G 2 2 1 3 3 0 i s e 1 R 1 R 1 R 1 + 0 0 1 0 e 2 5 3 3 4 0 e 1 R 1 R 3 = 0 0 1 0 0 e 4 8 8 1 R 1 R i 6 ES 0 0 0 1 6 0 i 8 8 7 0 1 1 0 0 0 7 7 0 1 0 0 E E
MNA An example + v3 - R3 ES6 2 3 1 - + Is5 R1 R8 R4 G2v3 - + 0 4 E7v3 1 R 1 R 1 R + + + 0 0 0 0 G G 2 2 1 3 3 0 i s e 1 R 1 R 1 R 1 + 0 0 1 0 e 2 5 3 3 4 0 e 1 R 1 R 3 = 0 0 1 0 0 e 4 8 8 1 R 1 R i 6 ES 0 0 0 1 6 0 i 8 8 7 0 1 1 0 0 0 7 7 0 1 0 0 E E
Modified 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
Formulation: Summary Ingredients Basic Elements Topology: Tree trunks and links Formats STA, NA, MNA Are there other formats? Use an example of link analysis.