def california_migration_matrix_eigenvalues ( ): #*****************************************************************************80 # ## california_migration_matrix_eigenvalues() determines the eigen information. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 19 January 2025 # # Author: # # John Burkardt # # Output: # # real L[2]: the eigenvalues. # # real V[2,2]: the eigenvectors. # import numpy as np print ( '' ) print ( 'california_migration_matrix_eigenvalues():' ) print ( ' Compute eigen information for matrix A' ) A = np.array ( [ \ [ 0.70, 0.10 ], \ [ 0.30, 0.90 ] ] ) L, V = np.linalg.eig ( A ) print ( '' ) print ( ' eigenvalues L: ') print ( L ) print ( '' ) print ( ' eigenvectors V:') print ( V ) AV = np.matmul ( A, V ) print ( '' ) print ( ' A*V:') print ( AV ) VL = np.matmul ( V, np.diag ( L ) ) print ( '' ) print ( ' V*np.diag(L):' ) print ( VL ) return if ( __name__ == "__main__" ): california_migration_matrix_eigenvalues ( )