Large Timestep Issues Lecture 12 Alessandra Nardi Thanks


















![Stiff Problems (Large Timestep Issues) Example Interval of interest is [0, 5] Uniform step Stiff Problems (Large Timestep Issues) Example Interval of interest is [0, 5] Uniform step](https://slidetodoc.com/presentation_image/56df8375645b81fc84e75c7bb008d93f/image-19.jpg)























- Slides: 42
Large Timestep Issues Lecture 12 Alessandra Nardi Thanks to Prof. Sangiovanni, Prof. Newton, Prof. White, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy
Last lecture review • Transient Analysis of dynamical circuits – i. e. , circuits containing C and/or L • Examples • Solution of ODEs (IVP) – Forward Euler (FE), Backward Euler (BE) and Trapezoidal Rule (TR) – Multistep methods – Convergence • Consistency
Outline • Convergence for multistep methods – Stability • Region of Absolute Stability • Dahlquist’s Stability Barriers • Stiff Stability (Large timestep issues) – – Examples Analysis of FE, BE Gear’s Method Variable step size • More on Implicit Methods – Solution with NR • Application of multistep to circuit equations
Multistep Methods – Common Algorithms TR, BE, FE are one-step methods Multistep Equation: Forward-Euler Approximation: FE Discrete Equation: Multistep Coefficients: BE Discrete Equation: Multistep Coefficients: Trap Discrete Equation: Multistep Coefficients:
Multistep Methods – Convergence Analysis Two conditions for Convergence 1) Local Condition: One step errors are small (consistency) Typically verified using Taylor Series 2) Global Condition: The single step errors do not grow too quickly (stability) All one-step methods are stable in this sense.
Multistep Methods – Stability Difference Equation Why did the “best” 2 -step explicit method fail to Converge? Multistep Method Difference Equation LTE Global Error We made the LTE so small, how come the Global error is so large?
An Aside on Solving Difference Equations Consider a general kth order difference equation Three important observations
Multistep Methods – Stability Difference Equation Multistep Method Difference Equation Definition: A multistep method is stable if and only if Theorem: A multistep method is stable if and only if Less than one in magnitude or equal to one and distinct
Multistep Methods – Stability Theorem Proof Given the Multistep Method Difference Equation If the roots of are either • less than one in magnitude • equal to one in magnitude but distinct Then from the aside on difference equations From which stability easily follows.
Multistep Methods – Stability Theorem Proof Im -1 1 Re
Multistep Methods – Stability A more formal approach • Def: A method is stable if all the solutions of the associated difference equation obtained from (1) setting q=0 remain bounded if l • The region of absolute stability of a method is the set of q such that all the solutions of (1) remain bounded if l • Note that a method is stable if its region of absolute stability contains the origin (q=0)
Multistep Methods – Stability A more formal approach Def: A method is A-stable if the region of absolute stability contains the entire left hand plane (in the space) Im(z) Im( ) Re(z) Re( ) -1 -1 1
Multistep Methods – Stability A more formal approach • Each method is associated with two polynomials a and b: – a : associated with function past values – b: associated with derivative past values • Stability: roots of a must stay in |z| 1 and be simple on |z|=1 • Absolute stability: roots of (a-bq) must stay in |z| 1 and be simple on |z|=1 when Re(q)<0.
Multistep Methods – Stability Dahlquist’s Stability Barriers • First: For a stable, explicit k-step multistep method, the maximum number of exactness constraints that can be satisfied is less than or equal to k (note there are 2 k coefficients). For implicit methods, the number of constraints that can be satisfied is either k+2 if k is even or k+1 if k is odd. • Second: There are no A-stable methods of convergence order greater than 2, and the trapezoidal rule is the most accurate. TR very popular (SPICE)
Multistep Methods – Convergence Analysis Conditions for convergence – Consistency & Stability 1) Local Condition: One step errors are small (consistency) Exactness Constraints up to p 0 (p 0 must be > 0) 2) Global Condition: One step errors grow slowly (stability) Convergence Result:
Multistep Methods FE region of absolute stability Forward Euler ODE stability region Im(z) -1 Difference Eqn Stability region 1 Re(z) Region of Absolute Stability
Multistep Methods BE region of absolute stability Backward Euler Im(z) -1 Difference Eqn Stability region 1 Re(z) Region of Absolute Stability
Summary • Convergence for one-step methods – Consistency for FE – Stability for FE • Convergence for multistep methods – Consistency (Exactness Constraints) • Selecting coefficients – Stability • Region of Absolute Stability • Dahlquist’s Stability Barriers
Stiff Problems (Large Timestep Issues) Example Interval of interest is [0, 5] Uniform step size (for accuracy) Dt 10 -6 5 x 106 steps !!!
Stiff Problems (Large Timestep Issues) Example Strategy (for previous example): Take 5 steps of size 10 -6 for accuracy during initial phase and then 5 steps of size 1. Stiff problem: 1. 2. 3. Natural time constants Input time constants Interval of interest If these are widely separated, then the problem is stiff
Application Problems Signal Transmission in an IC – 2 x 2 example C 1 R 2 R 1 R 3 C 2 Eigenvectors Eigenvalues
Stiff Problems (Large Timestep Issues) FE on two time-constant circuit Forward-Euler Computed Solution The Forward-Euler is accurate for small timesteps, but goes unstable when the timestep is enlarged
Stiff Problems (Large Timestep Issues) BE on two time-constant circuit Circuit Example Backward-Euler Computed Solution With Backward-Euler it is easy to use small timesteps for the fast dynamics and then switch to large timesteps for the slow decay
Multistep Methods (Large Timestep Issues) BE, FE, TR on the scalar ODE problem Scalar ODE: Forward-Euler: Backward-Euler: Trap Rule:
Stiff Problems (Large Timestep Issues) FE on two time-constant circuit ODE stability region Region of Absolute Stability
Stiff Problems (Large Timestep Issues) BE on two time-constant circuit Region of Absolute Stability
Stiff Problems • We showed that: – The analysis of stiff circuits requires the use of variable step sizes – Not all the linear multistep methods can be efficiently used to integrate stiff equations • To be able to choose Dt based only on accuracy considerations, the region of absolute stability should allow a large Dt for large time constants, without being constrained by the small time constants • Clearly A-stable methods satisfy this requirement
Backward Differentiation Formula - BDF (Gear Methods) • Note that Gear’s first order method is BE • It can be shown that: – Gear’s methods up to order 6 are stiffly stable and are well-suited for stiff ODEs – Gear’s methods of order higher than 6 are not stiffly stable • Less stringent than A-stable
Gear’s Method region of absolute stability (outside the closed curve) k=1 k=2
Gear’s Method region of absolute stability (outside the closed curve) k=3 k=4
Variable step size • When the step size is changed during the integration, the coefficients of the method need to be recomputed at each iteration • Example: Gear’s method of order 2
Variable step size
More observations • To minimize the computation time needed to integrate differential equations, the Dt must be chosen as large as possible provided that the desired accuracy is achieved – Several approximation are available. SPICE 2 uses Divided Differences • At a certain time point, different integration methods would allow different step size – Advantageous to implement a strategy which allows a change of method as well as of Dt
Summary on Stiff Stability • FE: timestep is limited by stability and not by accuracy • BE: A-stable, any timestep could be used • TR: most accurate A-stable multistep method • Gear: stiffly stable method (up to order 6) • The analysis of stiff circuits requires the use of variable timestep
Multistep Methods More on Implicit Methods Forward-Euler Requires just function Evaluations Backward-Euler Nonlinear equation solution at each step
Multistep Implicit Methods Solution with Newton Rewrite the multistep Equation Solve with Newton Jacobian Here j is the Newton iteration index
Multistep Implicit Methods Solution with Newton Iteration: Solution with Newton is very efficient Converged Solution Polynomial Predictor Easy to generate a good initial guess using polynomial fitting Jacobian become easy to factor for small timesteps
Application of linear multistep methods to circuit equations
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. Done? NO
Summary • Transient Analysis of dynamical circuits • Solution of ODEs (IVP) – FE, BE and TR – Multistep methods – Convergence • Consistency • Stability • Stiff Stability (Large timestep issues) – Gear’s method • Application of multistep to circuit equations • Did not talk about: – Runge-Kutta – Predictor-Corrector Methods
Summary on circuit simulation • Circuit Equation Formulation – STA, MNA • DC Analysis of Nonlinear Circuits – Solution of Linear Equations (direct and iterative methods) – Solution of Nonlinear Equations (Newton’s method) • Transient Analysis of Nonlinear Circuits – Solution of Ordinary Differential Equations- IVP (multistep methods)
Appendix to circuit simulation Preconditioners • The convergence rate of iterative methods depends on spectral properties of the coefficient matrix. Hence one may attempt to transform the linear system into one that is equivalent, but that has more favorable spectral properties. • A preconditioner is a matrix that effects such a transformation: Mx=b A-1 Mx=A-1 b • The choice of a preconditioner is largely application specific