From 8c2e6145a845b217787d9dbda7e9e74a000a0c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Wed, 23 Jan 2019 15:37:46 +0100 Subject: [PATCH] did something on ex_42 --- ex_42.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ex_42.py b/ex_42.py index 9994fda..113851b 100644 --- a/ex_42.py +++ b/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)))