Skip to content

Instantly share code, notes, and snippets.

@tanveer-sayyed
Last active May 13, 2019 11:45
Show Gist options
  • Save tanveer-sayyed/3d4c52e039082578f1d668afd7287080 to your computer and use it in GitHub Desktop.
Save tanveer-sayyed/3d4c52e039082578f1d668afd7287080 to your computer and use it in GitHub Desktop.
changed M to F
F = np.array([[1,1],[1,0]])
print('F^1: \n', F)
print('F^2: \n', F.dot(F))
print('F^3: \n', F.dot(F).dot(F))
print('F^4: \n', F.dot(F).dot(F).dot(F))
print('F^5: \n', F.dot(F).dot(F).dot(F).dot(F))
lambdas, eigenVectors = np.linalg.eig(F)
eigenVectors = Scaling_Eigen_Vectors(eigenVectors= eigenVectors)
print('lambdas of F^1: \n', lambdas)
print('eigenvectors of F^1: \n', eigenVectors)
lambdas, eigenVectors = np.linalg.eig(F.dot(F).dot(F).dot(F).dot(F))
eigenVectors = Scaling_Eigen_Vectors(eigenVectors= eigenVectors)
print('lambdas of F^5: \n', lambdas)
print('eigenvectors of F^5: \n', eigenVectors)
Output:
F^1:
[[1 1]
[1 0]]
F^2:
[[2 1]
[1 1]]
F^3:
[[3 2]
[2 1]]
F^4:
[[5 3]
[3 2]]
F^5:
[[8 5]
[5 3]]
lambdas of F^1:
[ 1.61803399 -0.61803399]
eigenvectors of F^1:
[[ 1.61803399 -1. ]
[ 1. 1.61803399]]
lambdas of F^5:
[11.09016994 -0.09016994]
eigenvectors of F^5:
[[ 1.61803399 -1. ]
[ 1. 1.61803399]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment