pyplot (generic function with 1 method)
8.7 s

Eigenvalue analysis for more general matrices

For 1D heat conduction we had a very special regular structure of the matrix which allowed exact eigenvalue calculations.

We need a generalization to varying coefficients, nonsymmetric problems, unstructured grids \ what can be done for general matrices ?

6.0 μs

The Gershgorin Circle Theorem

Theorem (Varga, Th. 1.11) Let A be an n×n (real or complex) matrix. Let Λi be the sum of the absolute values of the i-th row's off-diagonal entries:

Λi=j=1nji|aij|

If λ is an eigenvalue of A, then there exists r, 1rn such that λ lies on the disk defined by the circle of radius Λr around arr:

|λarr|Λr

5.0 μs

Proof: Assume λ is an eigenvalue, x=(x1xn) is a corresponding eigenvector. Assume x is normalized such that

maxi=1n|xi|=|xr|=1.

From Ax=λx it follows that

λxi=j=1naijxj(λaii)xi=j=1njiaijxj|λarr|=|j=1njrarjxj|j=1njr|arj||xj|j=1njr|arj|=Λr

4.0 μs

Corollary Any eigenvalue λσ(A) lies in the union of the disks defined by the Gershgorin circles

λi=1n{μC:|μaii|Λi}

Corollary The Gershgorin circle theorem allows to estimate the spectral radius ρ(A):

ρ(A)maxi=1nj=1n|aij|=||A||,ρ(A)maxj=1ni=1n|aij|=||A||1.

Proof:

|μaii|Λi|μ|Λi+|aii|=j=1n|aij|

Furthermore, σ(A)=σ(AT).

6.4 μs

This appears to be very easy to use, so let us try:

2.2 μs
gershgorin_circles (generic function with 1 method)
87.8 μs
n1
5
60.0 ns
A1
5×5 Array{Complex{Float64},2}:
 0.178502+0.0192365im  0.744411+0.093342im   …  0.392995+0.0961931im
 0.285649+0.0786766im  0.196577+0.0252502im     0.564553+0.0803397im
 0.169284+0.0438933im  0.755742+0.0518099im      0.55119+0.0852875im
 0.669057+0.0866883im  0.867834+0.0229806im     0.607358+0.0276727im
 0.480013+0.0704921im  0.581088+0.0177494im     0.247122+0.0167818im
3.5 μs
32.0 μs
52.7 ms

So this is kind of cool! Let us try this out with our heat example and the Jacobi iteration matrix: B=ID1A

2.4 μs
heatmatrix1d (generic function with 1 method)
50.7 μs
jacobi_iteration_matrix (generic function with 1 method)
20.2 μs
N
10
176 ns
A2
10×10 Tridiagonal{Float64,Array{Float64,1}}:
 109.0  -9.0    ⋅     ⋅     ⋅     ⋅     ⋅     ⋅     ⋅      ⋅ 
  -9.0  18.0  -9.0    ⋅     ⋅     ⋅     ⋅     ⋅     ⋅      ⋅ 
    ⋅   -9.0  18.0  -9.0    ⋅     ⋅     ⋅     ⋅     ⋅      ⋅ 
    ⋅     ⋅   -9.0  18.0  -9.0    ⋅     ⋅     ⋅     ⋅      ⋅ 
    ⋅     ⋅     ⋅   -9.0  18.0  -9.0    ⋅     ⋅     ⋅      ⋅ 
    ⋅     ⋅     ⋅     ⋅   -9.0  18.0  -9.0    ⋅     ⋅      ⋅ 
    ⋅     ⋅     ⋅     ⋅     ⋅   -9.0  18.0  -9.0    ⋅      ⋅ 
    ⋅     ⋅     ⋅     ⋅     ⋅     ⋅   -9.0  18.0  -9.0     ⋅ 
    ⋅     ⋅     ⋅     ⋅     ⋅     ⋅     ⋅   -9.0  18.0   -9.0
    ⋅     ⋅     ⋅     ⋅     ⋅     ⋅     ⋅     ⋅   -9.0  109.0
9.2 μs
B2
10×10 Tridiagonal{Float64,Array{Float64,1}}:
 0.0  0.0825688   ⋅    ⋅    ⋅    ⋅    ⋅    ⋅    ⋅          ⋅ 
 0.5  0.0        0.5   ⋅    ⋅    ⋅    ⋅    ⋅    ⋅          ⋅ 
  ⋅   0.5        0.0  0.5   ⋅    ⋅    ⋅    ⋅    ⋅          ⋅ 
  ⋅    ⋅         0.5  0.0  0.5   ⋅    ⋅    ⋅    ⋅          ⋅ 
  ⋅    ⋅          ⋅   0.5  0.0  0.5   ⋅    ⋅    ⋅          ⋅ 
  ⋅    ⋅          ⋅    ⋅   0.5  0.0  0.5   ⋅    ⋅          ⋅ 
  ⋅    ⋅          ⋅    ⋅    ⋅   0.5  0.0  0.5   ⋅          ⋅ 
  ⋅    ⋅          ⋅    ⋅    ⋅    ⋅   0.5  0.0  0.5         ⋅ 
  ⋅    ⋅          ⋅    ⋅    ⋅    ⋅    ⋅   0.5  0.0        0.5
  ⋅    ⋅          ⋅    ⋅    ⋅    ⋅    ⋅    ⋅   0.0825688  0.0
5.2 μs
ρ2
0.9421026930965894
56.6 μs

We have bii=0, Λi={11+αh,i=1,n1i=2n1

We see two circles around 0: one with radius 1 and one with radius 11+αh

estimate |λi|1

3.4 μs

We can also caculate the value from the estimate: Gershgorin circles of B2 are centered in the origin, and the spectral radius estimate just consists in the maximum of the sum of the absolute values of the row entries.

2.5 μs
ρ2_gershgorin
1.0
54.7 ms
41.1 ms

So the estimate from the Gershgorin Circle theorem is very pessimistic... Can we improve this ?

Matrices and Graphs

3.0 μs
  • Permutation matrices are matrices which have exactly one non-zero entry in each row and each column which has value 1.

  • There is a one-to-one correspondence permutations π of the the numbers 1n and n×n permutation matrices P=(pij) such that

pij={1,π(i)=j0,else

  • Permutation matrices are orthogonal, and we have P1=PT

  • APA permutes the rows of A

  • AAPT permutes the columns of A

7.4 μs

Define a directed graph from the nonzero entries of a matrix A=(aik):

  • Nodes: N={Ni}i=1n

  • Directed edges: E={NkNl|akl0}

  • Matrix entries weights of directed edges

  • 1:1 equivalence between matrices and weighted directed graphs

6.1 μs

Create a bidirectional graph (digraph) from a matrix in Julia. Create edge labels from off-diagonal entries and node labels combined from diagonal entries and node indices.

2.4 μs
create_graph (generic function with 1 method)
37.0 μs
rndmatrix (generic function with 1 method)
22.4 μs
A3
5×5 Array{Float64,2}:
 0.0   0.0   0.77  0.0   0.0
 0.0   0.0   0.0   0.0   0.0
 0.84  0.9   0.0   0.33  0.0
 0.0   0.0   0.0   0.0   0.32
 0.0   0.41  0.0   0.38  0.0
7.0 μs
12.1 μs
0.77 0.84 0.9 0.33 0.32 0.41 0.38 1 0.0 2 0.0 3 0.0 4 0.0 5 0.0
77.4 μs
  • Matrix graph of A3 is strongly connected: false

  • Matrix graph of A3 is weakly connected: true

19.4 μs

Definition A square matrix A is reducible if there exists a permutation matrix P such that

PAPT=(A11A120A22)

A is irreducible if it is not reducible.

Theorem (Varga, Th. 1.17): A is irreducible the matrix graph is strongly connected, i.e. for each ordered pair (Ni,Nj) there is a path consisting of directed edges, connecting them.

Equivalently, for each i,j there is a sequence of consecutive nonzero matrix entries aik1,ak1k2,ak2k3,akr1krakrj.

8.4 μs

The Taussky theorem

2.1 μs

Theorem (Varga, Th. 1.18) Let A be irreducible. Assume that the eigenvalue λ is a boundary point of the union of all the disks

λi=1n{μC:|μaii|Λi}

Then, all n Gershgorin circles pass through λ, i.e. for i=1n,

|λaii|=Λi

4.9 μs

Proof Assume λ is eigenvalue, x a corresponding eigenvector, normalized such that maxi=1n|xi|=|xr|=1. From Ax=λx it follows that

(λarr)xr=j=1njrarjxj|λarr|j=1njr|arj||xj|j=1njr|arj|=Λr(*)

λ is boundary point |λarr|=j=1njr|arj||xj|=Λr

For all pr with arp0, |xp|=1.

Due to irreducibility there is at least one p with arp0. For this p, |xp|=1 and equation (*) is valid (with p in place of r) |λapp|=Λp

Due to irreducibility, this is true for all p=1n.

5.7 μs

Apply this to the Jacobi iteration matrix for the heat conduction problem: We know that |λi|1, and we can see that the matrix graph is strongly connected.

Assume |λi|=1. Then λi lies on the boundary of the union of the Gershgorin circles. But then it must lie on the boundary of both circles with radius 11+αh and 1 around 0.

Contradiction! |λi|<1, ρ(B)<1!

3.3 μs
α
1
150 ns
N4
5
67.0 ns
A4
5×5 Tridiagonal{Float64,Array{Float64,1}}:
  5.0  -4.0    ⋅     ⋅     ⋅ 
 -4.0   8.0  -4.0    ⋅     ⋅ 
   ⋅   -4.0   8.0  -4.0    ⋅ 
   ⋅     ⋅   -4.0   8.0  -4.0
   ⋅     ⋅     ⋅   -4.0   5.0
9.4 μs
B4
5×5 Tridiagonal{Float64,Array{Float64,1}}:
 0.0  0.8   ⋅    ⋅    ⋅ 
 0.5  0.0  0.5   ⋅    ⋅ 
  ⋅   0.5  0.0  0.5   ⋅ 
  ⋅    ⋅   0.5  0.0  0.5
  ⋅    ⋅    ⋅   0.8  0.0
4.0 μs
ρ4
0.9486832980505135
27.5 μs
ρ4_gershgorin
1.0
34.6 ms
13.6 μs
0.8 0.5 0.5 0.5 0.5 0.5 0.5 0.8 1 0.0 2 0.0 3 0.0 4 0.0 5 0.0
85.8 μs
  • Matrix graph is strongly connected: true

  • Matrix graph is weakly connected: true

18.7 μs
39.8 ms
  • Unfortunately, we don't get a quantitative estimate here.

  • Advantage: we don't need to assume symmetry of A or spectral equivalence estimates

4.1 μs