Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 94
A=matrix(QQ,[[2,4,-6],[4,2,2],[2,8,-4]]) #Matriz Inicial B=identity_matrix(3) #Matriz identidade ordem 3 C=A.augment(B) #Cria a matriz C que é a matriz A junto com a matriz B C print('---------------') C.rescale_row(0,1/C[0,0]) C.add_multiple_of_row(1,0,-C[1,0]) C.add_multiple_of_row(2,0,-C[2,0]) C print('---------------') C.rescale_row(1,1/C[1,1]) C.add_multiple_of_row(0,1,-C[0,1]) C.add_multiple_of_row(2,1,-C[2,1]) C print('---------------') C.rescale_row(2,3/34) C.add_multiple_of_row(0,2,-C[0,2]) C.add_multiple_of_row(1,2,-C[1,2]) C D=C.matrix_from_columns([3,4,5]) #Cria a nova matriz D usando apenas as colunas 4, 5 e 6 da matriz C D A*D
[ 2 4 -6 1 0 0] [ 4 2 2 0 1 0] [ 2 8 -4 0 0 1] --------------- [ 1 2 -3 1/2 0 0] [ 0 -6 14 -2 1 0] [ 0 4 2 -1 0 1] --------------- [ 1 0 5/3 -1/6 1/3 0] [ 0 1 -7/3 1/3 -1/6 0] [ 0 0 34/3 -7/3 2/3 1] --------------- [ 1 0 0 3/17 4/17 -5/34] [ 0 1 0 -5/34 -1/34 7/34] [ 0 0 1 -7/34 1/17 3/34] [ 3/17 4/17 -5/34] [-5/34 -1/34 7/34] [-7/34 1/17 3/34] [1 0 0] [0 1 0] [0 0 1]