Solving linear algebra equation in Python

558 Views Asked by At

I want to solve for matrix $X$ in this linear system:

$$(AX + B)^T(AX + B) = 0$$

where $A$ and $B$ are known.

Is there a function for this in Python?

1

There are 1 best solutions below

0
On

As underlined by @Peter Franek, your equation is equivalent to:

$$\tag{1}\|AX+B\|^2=0$$

But a vector has norm $0$ if and only if it is the zero vector.

Thus (1) is equivalent to $AX+B=0$. Therefore, you have to find solution(s) to linear system:

$$AX=-B$$

Now, it's classical. It depends on matrices' dimensions (you don't provide information about it).

If $A$ is square, take a look at (https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html).