Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solve matrix equation in sympy

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.

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.

Solve matrix equation in sympy

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.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.