1/16
Looks like no tags are added yet.
a,b,c,d = symbols(‘a b c d’)
Defines variables
A = np.array ([[…], [ ….]., [….]])
defines matrix using an array (numpy)
P = A*B
defines product
sp.pprint
prints sympy result for matricies
P_substitued = P.subs({a: …, B: … etc.
assign values to symbolic variables
P_result = P_substituted.evalf
evaluates using new values assinged to variables
A_transpose = A.Transpose()
transposes the matrix using sympy
A_Transpose = A.T
transpose of a matrix using numpy
det_A = A.det
finds determinant sympy
det_A = np.linalg.det(A)
find determinant numpy
inv_A = A.inv()
find inverse of matrix sympy
inv_A = np.linalg.inv(A)
find inverse numpy
U S VT = np.linalg.svd(A)
finding SVD factorisations
cond_num = np.linalg.cond(A)
condition number
np.linalg.solve(A,b)
solves system in the form Ax = b
x, residuals, rank, singular values = np.linalg.lstsq(A, b, rcond = None)
finds particular solution of smallest magnitude of a consistent system with infinite solutions
eigenvalues, eigenvectors = np.linalg.eig(A)
finds eigenvalues and eigenvectors of A