0

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.

  • You have not provided enough information. Do you mean 4 unknown coefficients in C, if so where are they? Are there coefficients in C involving 1 or more variables? Are the coefficients maybe none linear functions of the 4 variables? Is A a known vector? You are going to have to give an example of a C matrix I think – Paul Feb 17 '23 at 12:50
  • So, you always have only $4$ variables in $C$? This means that, if $C$ is $100\times 100$, you have an over-constrained system of equations ($100$ equations in $4$ variables). If you know you always have a solution, you can just pick $4$ non-redundant equations and solve those.. I agree with @Paul. you should provide more details or an example. – Carlos Santi Toledo Feb 17 '23 at 12:52
  • 1
    @Jean Marie C is unknown, A is known. I think... – Paul Feb 17 '23 at 13:53
  • How can a symmetric matrix have 4 unknowns? – Rodrigo de Azevedo Feb 17 '23 at 16:16
  • @Paul You are perfectly right. – Jean Marie Feb 17 '23 at 17:11
  • As $A$ is a nonzero eigenvector of $C$ associated with eigenvalue $0$, the kernel of $C$ has dimension $\ge 1$ which is equivalent to the condition $\det(A)=0$. Beyond that, I don't see what can be said more... – Jean Marie Feb 18 '23 at 06:19

1 Answers1

2

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

C_nm = reshape(c,n,m) 
lynn
  • 3,441