did something on ex_42

This commit is contained in:
Daniel Knüttel 2019-01-23 15:37:46 +01:00
parent 2e1bbcf7cf
commit 8c2e6145a8

View File

@ -6,7 +6,7 @@ A = np.array(
, [1, 0, 1, 0, 1, 0] , [1, 0, 1, 0, 1, 0]
, [1, 1, 0, 1, 0, 0] , [1, 1, 0, 1, 0, 0]
, [0, 0, 1, 0, 1, 0] , [0, 0, 1, 0, 1, 0]
, [0, 0, 0, 1, 0, 1] , [0, 1, 0, 1, 0, 1]
, [0, 0, 0, 0, 1, 0] , [0, 0, 0, 0, 1, 0]
]) ])
@ -19,7 +19,11 @@ v_max = eigvectors[l_max_i]
def some_norm(M): def some_norm(M):
return np.abs(M).max() return np.abs(M).max()
B = A
for k in range(1, 21): for k in range(1, 21):
print("some kind of error for k =", k, ":", some_norm(A**k - l_max**k * np.outer(v_max, v_max.T))) B = B.dot(A)
print(B)
print(l_max**k * np.outer(v_max, v_max))
print("some kind of error for k =", k, ":", some_norm(B - l_max**k * np.outer(v_max, v_max)))