I'm currently working on solving an equation that involves a symmetric matrix C with 4 unknown variables, and a vector A of the same dimension. The equation I'm trying to solve is:
[C]*{A}=0 (1)
where * denotes matrix multiplication and { } denotes a vector.
The dimension of the C matrix can be as large as 100x100 or more, and I'm trying to define the unknown variables in C in a way that solves equation (1). One approach I've tried is to calculate the determinant of C, |[C]|=0, and solve for the 4 different variables inside.
However, when the dimension of the matrix is large, my current method in Mathematica is not able to solve the problem. I'm wondering if anyone has any suggestions for me to solve this equation more efficiently.
I'm open to using other programming languages such as Matlab or Python as well. Any suggestions or advice would be greatly appreciated.
Thank you in advance for your help and guidance.
I have tried solving this problem with 25*25 dimensions. However, this size is not enough for the precision that I want for the variables.
$ \def\B{B^{\boldsymbol +}} \def\bbR#1{{\mathbb R}^{#1}} \def\BR#1{\Big(#1\Big)} \def\LR#1{\left(#1\right)} \def\op#1{\operatorname{#1}} \def\vc#1{\op{vec}\LR{#1}} \def\diag#1{\op{diag}\LR{#1}} \def\Diag#1{\op{Diag}\LR{#1}} \def\trace#1{\op{Tr}\LR{#1}} \def\qiq{\quad\implies\quad} \def\c#1{\color{red}{#1}} $Use lowercase letters for vectors and reserve uppercase for matrix variables, i.e. $$\eqalign{ a \in \bbR{m} \qquad 0 \in \bbR{n} \qquad C \in \bbR{n\times m}\qquad I_n \in \bbR{n\times n} }$$ Write the problem and vectorize it $$\eqalign{ 0 &= I_nCa \\ &= \LR{a^T\otimes I_n}\vc{C} \\ &= Bc \\ }$$ This means that $c=\vc C$ lies in the nullspace of $B\in\bbR{n\times mn}$
Therefore every vector $v\in\bbR{mn}$ produces a viable solution $$\eqalign{ c &= \LR{I_{mn}-\B B} v \\ }$$ Because we're dealing with a vector and the identity matrix, the pseudoinverse has a simple formula $$\eqalign{ \def\a{{\hat a}} \a &= {\frac{a}{\|a\|}},\qquad B^+ = {\frac{\a}{\|a\|}}\otimes I_{n},\qquad B^+B = \a\a^T\otimes I_{n} \\ c &= \BR{I_{mn}-\a\a^T\otimes I_{n}}\,v \\ }$$
All that remains is to convert $c$ back into the shape of a matrix.
Here's an algebraic formula, although many languages have a built-in function to do this, e.g.