Solve matrix equation in sympy

asked 2021-01-13 14:38:17 -0600

Tintin1 gravatar image

updated 2021-01-13 15:12:50 -0600

How can I solve Q*v=0 for v in matrix terms (Q is a matrix, v is a vector). v should be a zero vector. The matrix Q is supposed to be invertible and full rank.

from sympy.solvers import solve
from sympy import symbols
from sympy import MatrixSymbol
n=symbols('n')
v = MatrixSymbol('v', n, 1)
Q = MatrixSymbol('Q', n, n)
eq=Q*v
solve(eq,v)

Please help, thanks.

edit retag flag offensive close merge delete

Comments

I am not sure how to assure that Q has full rank.

Tintin1 gravatar imageTintin1 ( 2021-01-13 15:11:37 -0600 )edit

Is there possibly a completely different approach outside of sympy to calculate v=0?

Tintin1 gravatar imageTintin1 ( 2021-01-15 03:35:52 -0600 )edit