Power Grid Simulation using Matrix Exponential Method with ...

26
Power Grid Simulation using Matrix Exponential Method with Rational Krylov Subspaces Hao Zhuang, Shih-Hung Weng, and Chung-Kuan Cheng Department of Computer Science and Engineering University of California, San Diego, CA, USA Contact: {zhuangh, ckcheng}@ucsd.edu

Transcript of Power Grid Simulation using Matrix Exponential Method with ...

Page 1: Power Grid Simulation using Matrix Exponential Method with ...

Power Grid Simulation using Matrix Exponential

Method with Rational Krylov Subspaces

Hao Zhuang, Shih-Hung Weng, and Chung-Kuan Cheng Department of Computer Science and Engineering

University of California, San Diego, CA, USA Contact: {zhuangh, ckcheng}@ucsd.edu

Page 2: Power Grid Simulation using Matrix Exponential Method with ...

Outline โ€ข Background of Power Grid Transient Circuit Simulation

โ€“ Formulations โ€“ Problems

โ€ข Matrix Exponential Circuit Simulation (Mexp) โ€“ Stiffness Problem

โ€ข Rational Matrix Exponential (Rational Mexp) โ€“ Rational Krylov Subspace โ€“ Skip of Regularization โ€“ Flexible Time Stepping

โ€ข Experiments โ€“ Adaptive Time Stepping Experiment โ€“ Standard Mexp vs. Rational Mexp (RC Mesh) โ€“ Rational Mexp vs. Trapezoidal Method (PDN Cases)

โ€ข Conclusions

2

Page 3: Power Grid Simulation using Matrix Exponential Method with ...

Power Grid Circuit Power Grid modeled in RLC circuit

โ€ข Transient Power Grid formulation where โ€ข is the capacitance/inductance matrix โ€ข is the conductance matrix โ€ข is the voltage/current vector, and is input

sources

3

๐‚๐ฑ ๐‘ก = โˆ’๐†๐ฑ(๐‘ก) + ๐๐ฎ(๐‘ก)

๐‚

๐†

๐ฑ ๐๐ฎ(๐‘ก)

Page 4: Power Grid Simulation using Matrix Exponential Method with ...

Power Grid Transient Circuit Simulation Transient simulation: Numerical integration

โ€ข Low order approximation

โ€“ Traditional methods: e.g. Backward Euler, Trapezoidal

โ€“ Local truncation error limits the time step

โ€“ Power grid simulation contest [TAUโ€™12]

โ€ข Trapezoidal method with fixed time-step: only one LU factorization

โ€ข Stiffness: smallest time step

โ€ข High order approximation

โ€“ Matrix exponential based circuit simulation 4

๐‚

โ„Ž+๐†

2๐ฑ ๐‘ก + โ„Ž =

๐‚

โ„Žโˆ’๐†

2๐’™ ๐‘ก +

๐๐ฎ ๐‘ก + โ„Ž โˆ’ ๐๐ฎ(๐‘ก)

2

Page 5: Power Grid Simulation using Matrix Exponential Method with ...

Outline โ€ข Background of Power Grid Transient Circuit Simulation

โ€“ Formulations โ€“ Problems

โ€ข Matrix Exponential Circuit Simulation (Mexp) โ€“ Stiffness Problem

โ€ข Rational Matrix Exponential (Rational Mexp) โ€“ Rational Krylov Subspace โ€“ Skip of Regularization โ€“ Flexible Time Stepping

โ€ข Experiments โ€“ Adaptive Time Stepping Experiment โ€“ Standard Mexp vs. Rational Mexp (RC Mesh) โ€“ Rational Mexp vs. Trapezoidal Method (PDN Cases)

โ€ข Conclusions

5

Page 6: Power Grid Simulation using Matrix Exponential Method with ...

Matrix Exponential Method

โ€ข Linear differential equation

โ€ข Analytical solution

โ€ข Case: input is piecewise linear (PWL)

6

๐‚๐ฑ ๐‘ก = โˆ’๐†๐ฑ(๐‘ก) + ๐๐ฎ(๐‘ก) ๐ฑ ๐‘ก = โˆ’๐€๐ฑ(๐‘ก) + ๐›(๐‘ก)

๐€ = โˆ’๐‚โˆ’๐Ÿ๐†, ๐› = โˆ’๐‚โˆ’๐Ÿ๐๐ฎ(๐ญ)

๐ฑ ๐‘ก + โ„Ž = ๐‘’๐€โ„Ž๐ฑ(๐‘ก) + ๐‘’๐€(โ„Žโˆ’๐œ)๐›(๐‘ก + ๐œ) ๐‘‘๐œโ„Ž

0

๐ฑ ๐‘ก + โ„Ž = ๐‘’๐€โ„Ž๐ฑ ๐‘ก + (๐‘’๐€โ„Žโˆ’๐ˆ)๐€โˆ’๐Ÿ๐›(๐‘ก) + (๐‘’๐€โ„Žโˆ’(๐€โ„Ž + ๐ˆ))๐€โˆ’๐Ÿ๐›(๐‘ก + โ„Ž) โˆ’ ๐›(๐‘ก)

โ„Ž

Page 7: Power Grid Simulation using Matrix Exponential Method with ...

Matrix Exponential Computation

โ€ข Transform into

โ€ข The computation of matrix exponential is expensive (for simplicity, we use ๐€ to represent ๐€ , from now on)

Memory and time complexities of O(n3)

7

๐ฑ ๐‘ก + โ„Ž = ๐ˆ๐‘› ๐ŸŽ ๐‘’๐€ โ„Ž ๐ฑ(๐‘ก)

๐ž2

๐€ =๐€ ๐–๐ŸŽ ๐‰

, ๐‰ =0 10 0

, ๐ž2 =๐ŸŽ1,๐– =

๐› ๐‘ก + โ„Ž โˆ’ ๐›(๐‘ก)

โ„Ž๐›(๐‘ก)

๐’†๐€ = ๐ˆ + ๐€ +๐€2

2+๐€3

3!+ โ‹ฏ+

๐€๐‘˜

๐‘˜!+ โ‹ฏ

Page 8: Power Grid Simulation using Matrix Exponential Method with ...

Krylov Subspace Approximation

โ€ข We derive matrix-vector product:

โ€ข Krylov subspace

โ€“ Standard Basis Generation

โ€“ Orthogonalization (Arnoldi Process):

โ€“ Matrix reduction: Hm,m has m=10~30 while size of A can be millions

โ€ข Matrix exponential operator

โ€“ time stepping, h, via scaling

โ€“ Posteriori error estimate [Saad92]

8

๐’†๐€๐ฏ

๐‘ฒ๐’Ž ๐€, ๐ฏ = ๐ฏ,๐€๐ฏ, ๐€๐Ÿ๐ฏ,โ€ฆ , ๐€๐’Žโˆ’๐Ÿ๐ฏ

๐€๐ฏ = โˆ’๐‚โˆ’๐Ÿ(๐†๐ฏ)

๐•๐’Ž = ๐ฏ๐Ÿ, ๐ฏ๐Ÿ, โ‹ฏ , ๐ฏ๐’Ž

๐€๐•๐’Ž = ๐•๐’Ž๐‡๐’Ž,๐’Ž + ๐’‰๐’Ž+๐Ÿ,๐’Ž๐ฏ๐’Ž+๐Ÿ๐’†๐’ŽT ๐‡๐’Ž,๐’Ž = ๐•๐’Ž

T๐€๐•๐’Ž

๐’†๐€โ„Ž๐ฏ โ‰ˆ ๐ฏ ๐Ÿ๐•๐’Ž ๐’†๐‡๐’Ž,๐’Žโ„Ž๐’†๐Ÿ

1

ฮค

21, eeehmmErr h

mkrylovmH

Hv

Page 9: Power Grid Simulation using Matrix Exponential Method with ...

Problems of Standard Krylov Subspace Approximations

Problem of Stiffness:

โ€ข When the system is stiff, we need high order approximation so that the solution can converge,

โ€ข Standard Krylov subspace tends to capture the eigenvalues of large magnitude

โ€ข For transient analysis, the eigenvalues of small real magnitude are wanted to describe the dynamic behavior.

9

๐€ = โˆ’๐‚โˆ’๐Ÿ๐†

๐ฑ ๐‘ก = ๐€๐ฑ(๐‘ก) + ๐›(๐‘ก)

๐’†๐€ = ๐ˆ + ๐€ +๐€2

2+

๐€3

3!+โ‹ฏ+

๐€๐‘˜

๐‘˜!.

Page 10: Power Grid Simulation using Matrix Exponential Method with ...

Outline โ€ข Background of Power Grid Transient Circuit Simulation

โ€“ Formulations โ€“ Problems

โ€ข Matrix Exponential Circuit Simulation (Mexp) โ€“ Stiffness Problem

โ€ข Rational Matrix Exponential (Rational Mexp) โ€“ Rational Krylov Subspace โ€“ Skip of Regularization โ€“ Flexible Time Stepping

โ€ข Experiments โ€“ Adaptive Time Stepping Experiment โ€“ Standard Mexp vs. Rational Mexp (RC Mesh) โ€“ Rational Mexp vs. Trapezoidal Method (PDN Cases)

โ€ข Conclusions

10

Page 11: Power Grid Simulation using Matrix Exponential Method with ...

Rational Krylov Subspace โ€ข Spectral Transformation:

โ€“ Shift-and-invert matrix A

โ€“ Rational Krylov subspace captures slow-decay components

โ€“ Use rational Krylov subspace for matrix exponential

11

100

Important eigenvalue: Component that decays slowly. Not so important eigenvalue: Component that decays fast.

๐‘ฒ๐’Ž ๐€, ๐ฏ ๐‘ฒ๐’Ž (๐ˆ โˆ’ ๐›พ๐€)โˆ’๐Ÿ, ๐ฏ

(๐ˆ โˆ’ ๐›พ๐€)โˆ’๐Ÿ

Page 12: Power Grid Simulation using Matrix Exponential Method with ...

Rational Krylov Subspace

Rational Krylov subspace

โ€ข Arnoldi process to obtain Vm=[v1 v2 โ€ฆ vm]

โ€ข Matrix exponential

โ€“ Time stepping by scaling

โ€“ No need of new Krylov subspace computation.

โ€ข Posterior error to terminate the process

โ€“ Larger time step => smaller error

12

๐‘ฒ๐’Ž (๐ˆ โˆ’ ๐›พ๐€)โˆ’๐Ÿ, ๐ฏ = ๐ฏ, (๐ˆ โˆ’ ๐›พ๐€)โˆ’๐Ÿ๐ฏ, (๐ˆ โˆ’ ๐›พ๐€)โˆ’๐Ÿ ๐ฏ,โ€ฆ , (๐ˆ โˆ’ ๐›พ๐€)โˆ’๐’Ž+๐Ÿ๐ฏ

๐•๐’ŽT๐€๐•๐’Ž โ‰ˆ

๐ˆ โˆ’ ๐‡๐’Ž,๐’Žโˆ’๐Ÿ

๐œธ

๐’†๐€๐’‰๐ฏ โ‰ˆ ๐ฏ ๐Ÿ๐•๐’Ž ๐’†๐’‰/๐œธ(๐ˆโˆ’๐‡๐’Ž,๐’Žโˆ’๐Ÿ)๐’†๐Ÿ

๐’†๐’“๐’“ ๐’Ž,๐œถ =๐ฏ ๐Ÿ

๐œธโ„Ž๐’Ž+๐Ÿ,๐’Ž (๐ˆ โˆ’ ๐›พ๐€)๐ฏ๐’Ž+๐Ÿ๐’†๐’Ž

T๐‡๐’Ž,๐’Žโˆ’๐Ÿ๐’†โ„Ž/๐›พ (๐ˆโˆ’๐‡๐’Ž,๐’Ž

โˆ’๐Ÿ)๐’†๐Ÿ

Page 13: Power Grid Simulation using Matrix Exponential Method with ...

Skip of Regularization

1. No need of regularization for A= ๐‘ช โˆ’๐Ÿ๐‘ฎ using matrix pencil (๐‘ฎ , ๐‘ช )

2. LU decomposition at a fixed ๐›พ

โ€ข Require LU every time step?

13

๐ฏ๐’Œ+๐Ÿ = (๐ˆ โˆ’ ๐›พ๐€)โˆ’๐Ÿ๐ฏ๐’Œ = (๐‚ โˆ’ ๐›พ๐† )โˆ’๐Ÿ๐‚ ๐ฏ๐’Œ

๐‘ณ๐‘ผ_๐‘ซ๐’†๐’„๐’๐’Ž๐’‘ ๐‚ โˆ’ ๐›พ๐† = ๐‹ ๐”

๐‚ =๐‚ ๐ŸŽ๐ŸŽ ๐ˆ

, ๐† =โˆ’๐† ๐–

๐ŸŽ ๐‰,๐– =

๐๐ฎ ๐‘ก + โ„Ž โˆ’ ๐๐ฎ(๐‘ก)

โ„Ž๐๐ฎ(๐‘ก)

Page 14: Power Grid Simulation using Matrix Exponential Method with ...

Block LU and Updating Sub-matrix

โ€ข The majority of matrix is the same,

โ€ข Block LU can be utilized here and the former LU matrices are updated as

โ€ข We avoid LU in each time step by reusing and Block LU and updating a small part of U

14

๐‘ณ๐‘ผ_๐‘ซ๐’†๐’„๐’๐’Ž๐’‘ ๐‚ + ๐›พ๐† = ๐‹๐’”๐’–๐’ƒ ๐”๐’”๐’–๐’ƒ

๐‹ =๐‹๐’”๐’–๐’ƒ ๐ŸŽ๐ŸŽ ๐ˆ

, ๐” =๐”๐’”๐’–๐’ƒ โˆ’๐›พ๐‹๐’”๐’–๐’ƒ

โˆ’๐Ÿ๐–

๐ŸŽ ๐ˆ๐‰, ๐ˆ๐‰ = ๐ˆ โˆ’ ๐›พ๐‰

๐‘ณ๐‘ผ_๐‘ซ๐’†๐’„๐’๐’Ž๐’‘ ๐‚ โˆ’ ๐›พ๐† = ๐‹ ๐”

Page 15: Power Grid Simulation using Matrix Exponential Method with ...

Rational MEXP with Adaptive Step Control

15

๐ฏ ๐Ÿ๐•๐’Ž ๐’†๐œถ(๐ˆโˆ’๐‡๐’Ž,๐’Žโˆ’๐Ÿ)๐’†๐Ÿ

Page 16: Power Grid Simulation using Matrix Exponential Method with ...

โ€ข large step size with less dimension

Rational Matrix Exponential

16

fix , sweep m and h 1

~

2eeeError

h

hmH

m

AVvv

Page 17: Power Grid Simulation using Matrix Exponential Method with ...

โ€ข large step size with less dimension

Rational Matrix Exponential

17

1

~

2eeeError

h

hmH

m

AVvv fix h, sweep m and

Page 18: Power Grid Simulation using Matrix Exponential Method with ...

Outline โ€ข Background of Power Grid Transient Circuit

Simulation โ€“ Formulations โ€“ Problems

โ€ข Matrix Exponential Circuit Simulation (Mexp) โ€“ Matrix Exponential Computation

โ€ข Previous Standard Krylov Subspace and Stiffness Problems โ€ข Rational Krylov Subspace (Rational Mexp)

โ€“ Adaptive Time Stepping in Rational Mexp

โ€ข Experiment โ€“ Mexp vs. Rational Mexp (RC Mesh) โ€“ Rational Mexp vs. Trapezoidal Method (PDN Cases)

โ€ข Conclusions 18

Page 19: Power Grid Simulation using Matrix Exponential Method with ...

Experiment

โ€ข Linux workstation

โ€“ Intel Core i7-920 2.67GHz CPU

โ€“ 12GB memory.

โ€ข Test Cases

โ€“ Stiff RC mesh network (2500 Nodes)

โ€ข Mexp vs. Rational Mexp

โ€“ Power Distribution Network (45.7K~7.4M Nodes)

โ€ข Rational Mexp vs. Trapezoidal (TR) with fixed time step (avoid LU during the simulation)

19

Page 20: Power Grid Simulation using Matrix Exponential Method with ...

Experiment (I) โ€ข RC mesh network with 2500 nodes. (Time span [0, 1ns] with a fixed step

size 10ps)

stiffness definition:

โ€ข Comparisons between average (mavg) and peak dimensions (mpeak) of Krylov subspace using

โ€“ Standard Basis:

โ€ข mavg = 115 and mpeak=264

โ€“ Rational Basis:

โ€ข mavg = 3.11, and mpeak=10

โ€ข Rational Basis-MEXP achieves 224X speedup for the whole simulation (vs. Standard Basis-MEXP).

20

๐‘น๐’†(๐€๐’Ž๐’Š๐’)

๐‘น๐’†(๐€๐’Ž๐’‚๐’™)= ๐Ÿ. ๐Ÿ๐Ÿ ร— ๐Ÿ๐ŸŽ๐Ÿ–

Page 21: Power Grid Simulation using Matrix Exponential Method with ...

Experiment (II) โ€ข PDN Cases

โ€“ On-chip and off-chip components

โ€“ Low-, middle-, and high-frequency responses

โ€“ The time span of whole simulation [0, 1ps]

21

Page 22: Power Grid Simulation using Matrix Exponential Method with ...

Experiment (II)

22

โ€ข Mixture of low, mid, and high frequency components.

โ€ข 16X speedups over TR.

โ€ข Difference of MEXP and HSPICE: 7.33ร—10-4; TR and HSPICE: 7.47ร—10-4

Page 23: Power Grid Simulation using Matrix Exponential Method with ...

Experiment: CPU time

23

Page 24: Power Grid Simulation using Matrix Exponential Method with ...

Conclusions

โ€ข Rational Krylov Subspace solves the stiffness problem.

โ€“ No need of regularization

โ€“ Small dimensions of basis.

โ€“ Flexible time steps.

โ€ข Adaptive time stepping is efficient to explore the different frequency responses of power grid transient simulation (considering both on-chip and off-chip components)

โ€“ 15X speedup over trapezoidal method.

24

Page 25: Power Grid Simulation using Matrix Exponential Method with ...

Conclusions: Future Works

โ€ข Setting of constant ๐›พ

โ€“ Theory and practice

โ€ข Distributed computation

โ€“ Parallel processing

โ€“ Limitation of memory

โ€ข Nonlinear dynamic system

25

Page 26: Power Grid Simulation using Matrix Exponential Method with ...

Thanks and Q&A

26