File:Gershgorin Disk Theorem Example.svg

Summary

Description
English: Gershgorin disk theorem example. This diagram shows the discs in yellow derived for the eigenvalues. The first two disks overlap and their union contains two eigenvalues. The third and fourth disks are disjoint from the others and contain one eigenvalue each.
Date
Source Own work
Author Nicoguaro
SVG development
InfoField
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt

# Graph setup
yellow = "#e9eabb"
blue = "#122a8c"
gray = '#757575'
plt.rcParams["text.color"] = gray
plt.rcParams["font.size"] = 12
plt.rcParams["xtick.color"] = gray
plt.rcParams["ytick.color"] = gray
plt.rcParams["axes.labelcolor"] = gray
plt.rcParams["axes.edgecolor"] = gray
plt.rcParams["axes.spines.right"] = False
plt.rcParams["axes.spines.top"] = False


A = np.array([
  [10, -1, 0, 1],
  [0.2, 8, 0.2, 0.2],
  [1, 1, 2, 1],
  [-1, -1, -1, -11]])
vals = np.linalg.eigvals(A)
fig = plt.figure(figsize=(6, 4))
for cont, val in enumerate(vals):
    real = np.real(val)
    imag = np.imag(val)
    center = A[cont, cont]
    radius = sum(np.abs(A[cont, k]) for k in range(4) if k != cont)
    circle = plt.Circle((center, 0), radius, color=yellow)
    plt.plot(real, imag, color=blue, marker="x", linewidth=0)
    plt.gca().add_artist(circle)

plt.legend(["Eigenvalues"], frameon=False)
plt.xlabel("Real axis")
plt.ylabel("Imaginary axis")
plt.yticks([-10, -5, 0, 5, 10])
plt.axis("image")
plt.xlim(-15, 15)
plt.ylim(-10, 10)
plt.savefig("Gershgorin Disk Theorem Example.svg", bbox_inches="tight")
plt.show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
Category:CC-BY-4.0#Gershgorin%20Disk%20Theorem%20Example.svg
Category:Self-published work Category:Linear algebra Category:Eigenvalue problems
Category:CC-BY-4.0 Category:Eigenvalue problems Category:Linear algebra Category:Self-published work Category:Valid SVG created with Matplotlib code