did something on ex_42
This commit is contained in:
parent
2e1bbcf7cf
commit
8c2e6145a8
8
ex_42.py
8
ex_42.py
|
@ -6,7 +6,7 @@ A = np.array(
|
|||
, [1, 0, 1, 0, 1, 0]
|
||||
, [1, 1, 0, 1, 0, 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]
|
||||
])
|
||||
|
||||
|
@ -19,7 +19,11 @@ v_max = eigvectors[l_max_i]
|
|||
def some_norm(M):
|
||||
return np.abs(M).max()
|
||||
|
||||
B = A
|
||||
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)))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user