Solve matrix equation in sympy

asked 2021-01-13 21:38:17 +0200

Tintin1 gravatar image

updated 2021-01-13 22:12:50 +0200

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 22:11:37 +0200 )edit

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

Tintin1 gravatar imageTintin1 ( 2021-01-15 10:35:52 +0200 )edit