Cài đặt Steam
Đăng nhập
|
Ngôn ngữ
简体中文 (Hán giản thể)
繁體中文 (Hán phồn thể)
日本語 (Nhật)
한국어 (Hàn Quốc)
ไทย (Thái)
Български (Bungari)
Čeština (CH Séc)
Dansk (Đan Mạch)
Deutsch (Đức)
English (Anh)
Español - España (Tây Ban Nha - TBN)
Español - Latinoamérica (Tây Ban Nha cho Mỹ Latin)
Ελληνικά (Hy Lạp)
Français (Pháp)
Italiano (Ý)
Bahasa Indonesia (tiếng Indonesia)
Magyar (Hungary)
Nederlands (Hà Lan)
Norsk (Na Uy)
Polski (Ba Lan)
Português (Tiếng Bồ Đào Nha - BĐN)
Português - Brasil (Bồ Đào Nha - Brazil)
Română (Rumani)
Русский (Nga)
Suomi (Phần Lan)
Svenska (Thụy Điển)
Türkçe (Thổ Nhĩ Kỳ)
Українська (Ukraine)
Báo cáo lỗi dịch thuật
print("Ejercicio 4: Calcular los vectores y valores propios de la Matriz M")
print("----------------------------------------------")
M = np.array([[-2, 3, -1, 2],[1, -2, 0, 3],[-3, 2, 1, 4],[0, 2, 1, -3]])
print(" ")
print("Se imprime la matriz original:\n", M)
print(" ")
# La instrucción linalg.eig(m) calcula los
# valores y vectores propios
val, vec = np.linalg.eig(M)
# Los valores propios de la matriz M
print("Eigenvalores de la matriz M:", val)
print(" ")
# printing eigen vectors
print("Eingenvectores de la matriz M (leerse como matriz columna) :")
print(" ")
print("1er vector propio",vec[:,0])
print(" ")
print("2do vector propio",vec[:,1])
print(" ")
print("3er vector propio",vec[:,2])
print(" ")
print("El sistema queda representado como: ")
print("C=",C)
print(" ")
print("Igualado al vector columan: ")
print("D= ",D)
print(" ")
print("Se calcula la matriz inversa de C")
E = np.linalg.inv(C)
print(E)
print(" ")
print("Se multiplica la inversa de A con el vector D,")
print("y con ello encontramos el vector solución (Vect):")
print(" ")
print("Vect = ")
print(" [[x ]")
print(" [y ]")
print(" [z ]]")
print(" ]")
print(" [v ]]")
print(" ")
print("es decir")
F = E.dot(D)
print(" ")
print("Vect = \n",F)
print(" ")
print("Ejercicio 3: Resolver el sistema de ecuaciones usando el método de la matriz inversa")
print("----------------------------------------------")
C = np.array([[ 1, 3, -1, 2, 7], [2, -1, 7, -1, 3], [-1, 3, 2, -3, -2], [3, 1, 1, 4, 1], [-4, -1, -3, 5, -1]])
D = np.array([[1], [2], [-1], [-4], [3]])
print(" ")
print("El sistema de ecuaciones ")
print(" x + 3y - z + 2u + 7v = 1")
print(" 2x - y + 7z - u + 3v = 2")
print(" -x + 3y + 2z - 3u - 2v = -1")
print(" 3x + y + z + 4u + v = -4")
print(" -4x -y - 3z + 5u - v = 3")
print(" ")
det = np.linalg.det(C)
if (det == 0.0) :
print("Matriz singular")
print(" ")
from numpy import size
from numpy import zeros
from numpy import matrix
A=matrix([[1,2,-1],[2,-1,0],[-1,3,1]])
#Se vacia la matriz de cofactores, Acof
Acof=matrix(zeros((3,3)))
#Se elijen las entradas de la matriz
aij=matrix(range(3))
for i in range(size(A,0)):
for j in range(size(A,1)):
factij = aij[aij != i]
Mij = aij[aij != j]
B = A[[[factij[0,0]],[factij[0,1]]],Mij]
detA = np.linalg.det(B)
Acof[i,j]=detA*np.power(-1,i+j)
print( "A=\n",A)
print(" ")
print( "Matriz adjunta\n",Acof)
print(" ")
print("----------------------------------------------")
print("Ejercicio 2: Calcular la matriz inversa de la matriz B")
print("----------------------------------------------")
B = np.array([[1, 3, -1], [2, -1, 3], [1, 2, -3]])
invB = np.linalg.inv(B)
print(" ")
print( "B=\n",B)
print(" ")
print("La matriz inversa de D")
print(invB)
⣿⣿⣿⣿⣿⣿⢟⢯⢳⢕⢗⣝⢞⢮⡺⣕⢟⡽⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡿⡱⢝⢜⢎⢗⣝⢮⡫⡳⣝⢮⢳⡹⣕⢟⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡸⢨⢊⠊⠈⡳⡹⣪⢮⡫⣎⢇⠡⢑⢵⠱⡱⣿⣿⣿⣿
⣿⣿⣿⣿⢪⡪⡪⡳⡍⢮⢺⢸⢜⣜⢜⢵⢵⢝⢮⢪⡎⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣯⢪⢪⢪⡪⡳⠑⠑⠜⢝⢮⡪⡫⡎⣷⣿⣾⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣧⣣⢣⡫⡢⢈⠈⢄⢪⢳⢝⢵⣽⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡿⠋⢼⡲⡹⡸⡰⢬⢰⢱⢹⡌⡛⣿⣿⣿⣿⣿⣿⣿
⣿⠿⠟⢋⠉⠠⠈⢸⣿⣜⣝⢮⡫⡮⣳⣽⡇⠄⠄⢈⠩⠛⠿⢿⣿
⠄⠌⠐⠄⠂⠁⡀⠂⣿⣿⣾⣪⣫⣾⢿⣻⠄⠂⠐⢀⠐⠈⠄⠡⠄
⠄⠌⡀⠡⠈⢀⠄⠄⢹⣿⣿⠫⢌⢻⣿⡏⡀⠈⡀⠂⠠⠁⠌⠠⠁
⠄⠂⡀⠂⡈⢀⠄⢂⠨⣿⣗⡧⠢⣮⣻⠁⠄⠠⠐⠈⡀⠡⠄⠅⡈