Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Returns the coefficient matrix of a system of equations
ResourceFunction["CoefficientMatrix"][eqns,vars] returns the coefficient matrix of the system of equations eqns in the variables vars. |
Get the coefficient matrix of a linear system:
In[1]:= | ![]() |
Out[1]= | ![]() |
Matrix equations are allowed:
In[2]:= | ![]() |
Out[2]= | ![]() |
In[3]:= | ![]() |
Out[3]= | ![]() |
Find all matrices X that commute with . These matrices must satisfy the system of equations:
In[4]:= | ![]() |
Out[3]= | ![]() |
We compute the null space of this matrix:
In[5]:= | ![]() |
Out[5]= | ![]() |
A basis for the matrix X:
In[6]:= | ![]() |
Out[6]= | ![]() |
Thus, any such matrix must be of the form:
In[7]:= | ![]() |
Out[7]= | ![]() |
Check:
In[8]:= | ![]() |
Out[8]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License