2023-02-18から1日間の記事一覧

Banach's fixed point theorem

=== import numpy as npimport matplotlib.pyplot as plt x = np.linspace(0,1,100) def f(x): return np.cos(x) plt.plot(x, x, color = "blue")plt.plot(x, f(x), color = "green")plt.plot(x, f(f(x)), color = "yellow")plt.plot(x, f(f(f(f(x)))), colo…

Gershgorin circle theorem

=== import numpy as np # Input matrix A A = np.array([[3+2j, -1+4j, 2-3j], [2-1j, 1+2j, 3-2j], [1+3j, 1-1j, -1+2j]]) # Check if A is a square matrix if A.shape[0] != A.shape[1]: print("A is not a square matrix!") else: n = A.shape[0] eigen…

Leontief inverse matrix

""" import numpy as np # Input matrix A A = np.array([[0.3, 0.3, 0.2], [0.2, 0.1, 0.2], [0, 0.2, 0.2]]) d = np.array([1, 2, 3]) # Check if A is a square matrix if A.shape[0] != A.shape[1]: print("A is not a square matrix!") else: n = A.sha…