CSE 245 Computer Aided Circuit Simulation and Verification

  • Slides: 51
Download presentation
CSE 245: Computer Aided Circuit Simulation and Verification Spring 2010 Nonlinear Equation

CSE 245: Computer Aided Circuit Simulation and Verification Spring 2010 Nonlinear Equation

Outline o Nonlinear problems o Iterative Methods o Newton’s Method o o n n

Outline o Nonlinear problems o Iterative Methods o Newton’s Method o o n n Derivation of Newton Quadratic Convergence Examples Convergence Testing n n n Basic Algorithm Quadratic convergence Application to circuits n Limiting Schemes o Direction Corrupting o Non corrupting (Damped Newton) Continuation Schemes o Source stepping Multidimensonal Newton Method Improve Convergence n 24 October 2020 2 courtesy Alessandra Nardi UCB

Nonlinear Problems - Example 1 Id Ir 0 Need to Solve 24 October 2020

Nonlinear Problems - Example 1 Id Ir 0 Need to Solve 24 October 2020 3 courtesy Alessandra Nardi UCB

Nonlinear Equations o Given g(V)=I o It can be expressed as: f(V)=g(V)-I Solve g(V)=I

Nonlinear Equations o Given g(V)=I o It can be expressed as: f(V)=g(V)-I Solve g(V)=I equivalent to solve f(V)=0 Hard to find analytical solution for f(x)=0 Solve iteratively 24 October 2020 4 courtesy Alessandra Nardi UCB

Nonlinear Equations – Iterative Methods o Start from an initial value x 0 o

Nonlinear Equations – Iterative Methods o Start from an initial value x 0 o Generate a sequence of iterate xn-1, xn+1 which hopefully converges to the solution x* o Iterates are generated according to an iteration function F: xn+1=F(xn) Ask • When does it converge to correct solution ? • What is the convergence rate ? 24 October 2020 5 courtesy Alessandra Nardi UCB

Newton-Raphson (NR) Method Consists of linearizing the system. Want to solve f(x)=0 Replace f(x)

Newton-Raphson (NR) Method Consists of linearizing the system. Want to solve f(x)=0 Replace f(x) with its linearized version and solve. Note: at each step need to evaluate f and f’ 24 October 2020 6 courtesy Alessandra Nardi UCB

Newton-Raphson Method 24 October 2020 7 – Graphical View courtesy Alessandra Nardi UCB

Newton-Raphson Method 24 October 2020 7 – Graphical View courtesy Alessandra Nardi UCB

Newton-Raphson Method – Algorithm Define iteration Do k = 0 to …. until convergence

Newton-Raphson Method – Algorithm Define iteration Do k = 0 to …. until convergence o How about convergence? o An iteration {x(k)} is said to converge with order q if there exists a vector norm such that for each k N: 24 October 2020 8 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Mean Value theorem truncates Taylor series But by Newton definition

Newton-Raphson Method – Convergence Mean Value theorem truncates Taylor series But by Newton definition 24 October 2020 9 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Subtracting Dividing through Convergence is quadratic 24 October 2020 10

Newton-Raphson Method – Convergence Subtracting Dividing through Convergence is quadratic 24 October 2020 10 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Local Convergence Theorem If Then Newton’s method converges given a

Newton-Raphson Method – Convergence Local Convergence Theorem If Then Newton’s method converges given a sufficiently close initial guess (and convergence is quadratic) 24 October 2020 11 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Example 1 Convergence is quadratic 24 October 2020 12 courtesy

Newton-Raphson Method – Convergence Example 1 Convergence is quadratic 24 October 2020 12 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Example 2 Note : not bounded away from zero Convergence

Newton-Raphson Method – Convergence Example 2 Note : not bounded away from zero Convergence is linear 24 October 2020 13 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Example 1, 2 24 October 2020 14 courtesy Alessandra Nardi

Newton-Raphson Method – Convergence Example 1, 2 24 October 2020 14 courtesy Alessandra Nardi UCB

Newton-Raphson Method 24 October 2020 15 – Convergence courtesy Alessandra Nardi UCB

Newton-Raphson Method 24 October 2020 15 – Convergence courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Check f(x) X 24 October 2020 16 courtesy Alessandra Nardi

Newton-Raphson Method – Convergence Check f(x) X 24 October 2020 16 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Check f(x) X 24 October 2020 17 courtesy Alessandra Nardi

Newton-Raphson Method – Convergence Check f(x) X 24 October 2020 17 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence demo 2 24 October 2020 18 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence demo 2 24 October 2020 18 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Local Convergence Depends on a Good Initial Guess f(x) X

Newton-Raphson Method – Convergence Local Convergence Depends on a Good Initial Guess f(x) X 24 October 2020 19 courtesy Alessandra Nardi UCB

Newton-Raphson Method – Convergence Local Convergence Depends on a Good Initial Guess 24 October

Newton-Raphson Method – Convergence Local Convergence Depends on a Good Initial Guess 24 October 2020 20 courtesy Alessandra Nardi UCB

Nonlinear Problems – Multidimensional Example + Nodal Analysis - + + - Nonlinear Resistors

Nonlinear Problems – Multidimensional Example + Nodal Analysis - + + - Nonlinear Resistors 24 October 2020 Two coupled nonlinear equations in two unknowns 21 courtesy Alessandra Nardi UCB

Outline o Nonlinear problems o Iterative Methods o Newton’s Method o o n n

Outline o Nonlinear problems o Iterative Methods o Newton’s Method o o n n Derivation of Newton Quadratic Convergence Examples Convergence Testing n n n Basic Algorithm Quadratic convergence Application to circuits n Limiting Schemes o Direction Corrupting o Non corrupting (Damped Newton) Continuation Schemes o Source stepping Multidimensonal Newton Method Improve Convergence n 24 October 2020 22 courtesy Alessandra Nardi UCB

Multidimensional Newton Method 24 October 2020 23 courtesy Alessandra Nardi UCB

Multidimensional Newton Method 24 October 2020 23 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Computational Aspects Each iteration requires: 1. Evaluation of F(xk) 2. Computation

Multidimensional Newton Method Computational Aspects Each iteration requires: 1. Evaluation of F(xk) 2. Computation of J(xk) 3. Solution of a linear system of algebraic equations whose coefficient matrix is J(xk) and whose RHS is -F(xk) 24 October 2020 24 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Algorithm 24 October 2020 25 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Algorithm 24 October 2020 25 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Convergence Local Convergence Theorem If Then Newton’s method converges given a

Multidimensional Newton Method Convergence Local Convergence Theorem If Then Newton’s method converges given a sufficiently close initial guess (and convergence is quadratic) 24 October 2020 26 courtesy Alessandra Nardi UCB

Application of NR to Circuit Equations Companion Network o Applying NR to the system

Application of NR to Circuit Equations Companion Network o Applying NR to the system of equations we find that at iteration k+1: n all the coefficients of KCL, KVL and of BCE of the linear elements remain unchanged with respect to iteration k n Nonlinear elements are represented by a linearization of BCE around iteration k This system of equations can be interpreted as the STA of a linear circuit (companion network) whose elements are specified by the linearized BCE. 24 October 2020 27 courtesy Alessandra Nardi UCB

Application of NR to Circuit Equations Companion Network o General procedure: the NR method

Application of NR to Circuit Equations Companion Network o General procedure: the NR method applied to a nonlinear circuit whose eqns are formulated in the STA form produces at each iteration the STA eqns of a linear resistive circuit obtained by linearizing the BCE of the nonlinear elements and leaving all the other BCE unmodified o After the linear circuit is produced, there is no need to stick to STA, but other methods (such as MNA) may be used to assemble the circuit eqns 24 October 2020 28 courtesy Alessandra Nardi UCB

Application of NR to Circuit Equations Companion Network – MNA templates Note: G 0

Application of NR to Circuit Equations Companion Network – MNA templates Note: G 0 and Id depend on the iteration count k G 0=G 0(k) and Id=Id(k) 24 October 2020 29 courtesy Alessandra Nardi UCB

Application of NR to Circuit Equations Companion Network – MNA templates 24 October 2020

Application of NR to Circuit Equations Companion Network – MNA templates 24 October 2020 30 courtesy Alessandra Nardi UCB

Modeling a MOSFET (MOS Level 1, linear regime) d 24 October 2020 31 courtesy

Modeling a MOSFET (MOS Level 1, linear regime) d 24 October 2020 31 courtesy Alessandra Nardi UCB

Modeling a MOSFET 24 October 2020 (MOS Level 1, linear regime) 32 courtesy Alessandra

Modeling a MOSFET 24 October 2020 (MOS Level 1, linear regime) 32 courtesy Alessandra Nardi UCB

DC Analysis Flow Diagram For each state variable in the system 24 October 2020

DC Analysis Flow Diagram For each state variable in the system 24 October 2020 33 courtesy Alessandra Nardi UCB

Implications o Device model equations must be continuous with continuous derivatives (not all models

Implications o Device model equations must be continuous with continuous derivatives (not all models do this - - be sure models are decent - beware of user-supplied models) o Watch out for floating nodes (If a node becomes disconnected, then J(x) is singular) o Give good initial guess for x(0) o Most model computations produce errors in function values and derivatives. Want to have convergence criteria || x(k+1) - x(k) || < such that > than model errors. 24 October 2020 34 courtesy Alessandra Nardi UCB

Outline o Nonlinear problems o Iterative Methods o Newton’s Method o o n n

Outline o Nonlinear problems o Iterative Methods o Newton’s Method o o n n Derivation of Newton Quadratic Convergence Examples Convergence Testing n n n Basic Algorithm Quadratic convergence Application to circuits n Limiting Schemes o Direction Corrupting o Non corrupting (Damped Newton) Continuation Schemes o Source stepping Multidimensonal Newton Method Improve Convergence n 24 October 2020 35 courtesy Alessandra Nardi UCB

Improving convergence o Improve Models (80% of problems) o Improve Algorithms (20% of problems)

Improving convergence o Improve Models (80% of problems) o Improve Algorithms (20% of problems) Focus on new algorithms: Limiting Schemes Continuations Schemes 24 October 2020 36 courtesy Alessandra Nardi UCB

Improve Convergence o Limiting Schemes n Direction Corrupting n Non corrupting (Damped Newton) o

Improve Convergence o Limiting Schemes n Direction Corrupting n Non corrupting (Damped Newton) o Globally Convergent if Jacobian is Nonsingular o Difficulty with Singular Jacobians o Continuation Schemes n Source stepping 24 October 2020 37 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Convergence Problems – Local Minimum 24 October 2020 38 courtesy Alessandra

Multidimensional Newton Method Convergence Problems – Local Minimum 24 October 2020 38 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Convergence Problems – Nearly singular f(x) X Must Somehow Limit the

Multidimensional Newton Method Convergence Problems – Nearly singular f(x) X Must Somehow Limit the changes in X 24 October 2020 39 courtesy Alessandra Nardi UCB

Multidimensional Newton Method Convergence Problems - Overflow f(x) X Must Somehow Limit the changes

Multidimensional Newton Method Convergence Problems - Overflow f(x) X Must Somehow Limit the changes in X 24 October 2020 40 courtesy Alessandra Nardi UCB

Newton Method with Limiting 24 October 2020 41 courtesy Alessandra Nardi UCB

Newton Method with Limiting 24 October 2020 41 courtesy Alessandra Nardi UCB

Newton Method with Limiting Methods • Direction Corrupting • Non. Corrupting Heuristics, No Guarantee

Newton Method with Limiting Methods • Direction Corrupting • Non. Corrupting Heuristics, No Guarantee of Global Convergence 24 October 2020 42 courtesy Alessandra Nardi UCB

Newton Method with Limiting Damped Newton Scheme General Damping Scheme Key Idea: Line Search

Newton Method with Limiting Damped Newton Scheme General Damping Scheme Key Idea: Line Search Method Performs a one-dimensional search in Newton Direction 24 October 2020 43 courtesy Alessandra Nardi UCB

Newton Method with Limiting Damped Newton – Convergence Theorem If Then Every Step reduces

Newton Method with Limiting Damped Newton – Convergence Theorem If Then Every Step reduces F-- Global Convergence! 24 October 2020 44 courtesy Alessandra Nardi UCB

Newton Method with Limiting Damped Newton – Nested Iteration 24 October 2020 45 courtesy

Newton Method with Limiting Damped Newton – Nested Iteration 24 October 2020 45 courtesy Alessandra Nardi UCB

Newton Method with Limiting Damped Newton – Singular Jacobian Problem X Damped Newton Methods

Newton Method with Limiting Damped Newton – Singular Jacobian Problem X Damped Newton Methods “push” iterates to local minimums Finds the points where Jacobian is Singular 24 October 2020 46 courtesy Alessandra Nardi UCB

Newton with Continuation schemes Basic Concepts - General setting Newton converges given a close

Newton with Continuation schemes Basic Concepts - General setting Newton converges given a close initial guess Idea: Generate a sequence of problems, s. t. a problem is a good initial guess for the following one Starts the continuation Ends the continuation Hard to insure! 24 October 2020 47 courtesy Alessandra Nardi UCB

Newton with Continuation schemes Basic Concepts – Template Algorithm 24 October 2020 48 courtesy

Newton with Continuation schemes Basic Concepts – Template Algorithm 24 October 2020 48 courtesy Alessandra Nardi UCB

Newton with Continuation schemes Basic Concepts – Source Stepping Example 24 October 2020 49

Newton with Continuation schemes Basic Concepts – Source Stepping Example 24 October 2020 49 courtesy Alessandra Nardi UCB

Newton with Continuation schemes Basic Concepts – Source Stepping Example R Vs Diode +

Newton with Continuation schemes Basic Concepts – Source Stepping Example R Vs Diode + - Source Stepping Does Not Alter Jacobian 24 October 2020 50 courtesy Alessandra Nardi UCB

Transient Analysis Flow Diagram Predict values of variables at tl Replace C and L

Transient Analysis Flow Diagram Predict values of variables at tl Replace C and L with resistive elements via integration formula Replace nonlinear elements with G and indep. sources via NR Assemble linear circuit equations Solve linear circuit equations NO Did NR converge? YES Test solution accuracy Save solution if acceptable Select new Dt and compute new integration formula coeff. 24 October 2020 Done? 51 NO courtesy Alessandra Nardi UCB