CSE 245 ComputerAided Circuit Simulation and Verification Lecture

  • Slides: 22
Download presentation
CSE 245: Computer-Aided Circuit Simulation and Verification Lecture Notes 6 Numerical Integration Spring 2006

CSE 245: Computer-Aided Circuit Simulation and Verification Lecture Notes 6 Numerical Integration Spring 2006 Prof. Chung-Kuan Cheng UCSD CSE 245 Notes – SPRING 2006

Numerical Integration: Outline • One-step Method for ODE (IVP) – Forward Euler – Backward

Numerical Integration: Outline • One-step Method for ODE (IVP) – Forward Euler – Backward Euler – Trapezoidal Rule – Equivalent Circuit Model • Convergence Analysis • Linear Multi-Step Method • Time Step Control UCSD CSE 245 Notes – SPRING 2006

Ordinary Difference Equaitons N equations, n x variables, n dx/dt. Typically analytic solutions are

Ordinary Difference Equaitons N equations, n x variables, n dx/dt. Typically analytic solutions are not available solve it numerically UCSD CSE 245 Notes – SPRING 2006

Numerical Integration Forward Euler Backward Euler Trapezoidal UCSD CSE 245 Notes – SPRING 2006

Numerical Integration Forward Euler Backward Euler Trapezoidal UCSD CSE 245 Notes – SPRING 2006

Numerical Integration: State Equation Forward Euler Backward Euler UCSD CSE 245 Notes – SPRING

Numerical Integration: State Equation Forward Euler Backward Euler UCSD CSE 245 Notes – SPRING 2006

Numerical Integration: State Equation Trapezoidal UCSD CSE 245 Notes – SPRING 2006

Numerical Integration: State Equation Trapezoidal UCSD CSE 245 Notes – SPRING 2006

Equivalent Circuit Model-BE • Capacitor + + + C - 26 October 2021 -

Equivalent Circuit Model-BE • Capacitor + + + C - 26 October 2021 - 7

Equivalent Circuit Model-BE • Inductor + + + L 26 October 2021 8

Equivalent Circuit Model-BE • Inductor + + + L 26 October 2021 8

Equivalent Circuit Model-TR • Capacitor + + + C - 26 October 2021 -

Equivalent Circuit Model-TR • Capacitor + + + C - 26 October 2021 - 9

Equivalent Circuit Model-TR • Inductor + + + L 26 October 2021 10

Equivalent Circuit Model-TR • Inductor + + + L 26 October 2021 10

Summary of Basic Concepts Trap Rule, Forward-Euler, Backward-Euler All are one-step methods xk+1 is

Summary of Basic Concepts Trap Rule, Forward-Euler, Backward-Euler All are one-step methods xk+1 is computed using only xk, not xk-1, xk-2, xk-3. . . Forward-Euler is the simplest No equation solution explicit method. Backward-Euler is more expensive Equation solution each step implicit method most stable (FE/BE/TR) Trapezoidal Rule might be more accurate Equation solution each step implicit method More accurate but less stable, may cause oscillation UCSD CSE 245 Notes – SPRING 2006

Stabilities Froward Euler 26 October 2021 12

Stabilities Froward Euler 26 October 2021 12

FE region of absolute stability Forward Euler ODE stability region Im(z) -1 Difference Eqn

FE region of absolute stability Forward Euler ODE stability region Im(z) -1 Difference Eqn Stability region 1 Re(z) UCSD CSE 245 Notes – SPRING 2006 Region of Absolute Stability

Stabilities Backward Euler 26 October 2021 14

Stabilities Backward Euler 26 October 2021 14

BE region of absolute stability Backward Euler Im(z) -1 Difference Eqn Stability region 1

BE region of absolute stability Backward Euler Im(z) -1 Difference Eqn Stability region 1 Re(z) Region of Absolute Stability UCSD CSE 245 Notes – SPRING 2006

Stabilities Trapezoidal 26 October 2021 16

Stabilities Trapezoidal 26 October 2021 16

Convergence • Consistency: A method of order p (p>1) is consistent if • Stability:

Convergence • Consistency: A method of order p (p>1) is consistent if • Stability: A method is stable if: • Convergence: A method is convergent if: Consistency + Stability Convergence UCSD CSE 245 Notes – SPRING 2006

A-Stable • Dahlqnest Theorem: – An A-Stable LMS (Linear Multi. Step) method cannot exceed

A-Stable • Dahlqnest Theorem: – An A-Stable LMS (Linear Multi. Step) method cannot exceed 2 nd order accuracy • The most accurate A-Stable method (smallest truncation error) is trapezoidal method. UCSD CSE 245 Notes – SPRING 2006

Convergence Analysis: Truncation Error • Local Truncation Error (LTE): – At time point tk+1

Convergence Analysis: Truncation Error • Local Truncation Error (LTE): – At time point tk+1 assume xk is exact, the difference between the approximated solution xk+1 and exact solution x*k+1 is called local truncation error. – Indicates consistancy – Used to estimate next time step size in SPICE • Global Truncation Error (GTE): – At time point tk+1, assume only the initial condition x 0 at time t 0 is correct, the difference between the approximated solution xk+1 and the exact solution x*k+1 is called global truncation error. – Indicates stability UCSD CSE 245 Notes – SPRING 2006

LTE Estimation: SPICE • Taylor Expansion of xn+1 about the time point tn: •

LTE Estimation: SPICE • Taylor Expansion of xn+1 about the time point tn: • Taylor Expansion of dxn+1/dt about the time point t n: • Eliminate term in above two equations we get the trapezoidal rule LTE UCSD CSE 245 Notes – SPRING 2006

Time Step Control: SPICE • We have derived the local truncation error the unit

Time Step Control: SPICE • We have derived the local truncation error the unit is charge for capacitor and flux for inductor • Similarly, we can derive the local truncation error in terms of (1) the unit is current for capacitor and voltage for inductor • Suppose ED represents the absolute value of error that is allowed per time point. That is together with (1) we can calculate the time step as UCSD CSE 245 Notes – SPRING 2006

Time Step Control: SPICE (cont’d) • DD 3(tn+1) is called 3 rd divided difference,

Time Step Control: SPICE (cont’d) • DD 3(tn+1) is called 3 rd divided difference, which is given by the recursive formula UCSD CSE 245 Notes – SPRING 2006