Solving AM=MB for 3x3 Matrices: Vectorize M & Find 9 Equations

  • Context: Graduate 
  • Thread starter Thread starter daviddoria
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on solving the matrix equation AM = MB for 3x3 matrices A, B, and M. The user proposes equating the entries of the resulting matrices C and D, leading to a vectorized form of M, denoted as Mv. The transformation results in a 9x9 matrix equation, which simplifies to 9x9 times Mv = 0. The user seeks a more efficient coding method for constructing this matrix rather than manually, while the response indicates that established algorithms for linear equation systems can be utilized to solve the problem.

PREREQUISITES
  • Understanding of matrix multiplication and properties of matrices
  • Familiarity with vectorization techniques in linear algebra
  • Knowledge of linear equation systems and their solutions
  • Basic programming skills for implementing matrix operations
NEXT STEPS
  • Research algorithms for solving linear equation systems, such as Gaussian elimination
  • Explore matrix manipulation libraries in programming languages like NumPy for Python
  • Learn about vectorization in linear algebra to optimize matrix operations
  • Investigate symbolic computation tools like SymPy for algebraic expressions
USEFUL FOR

Mathematicians, data scientists, and software developers working with linear algebra and matrix computations, particularly those interested in optimizing matrix equation solutions.

daviddoria
Messages
96
Reaction score
0
I would like to solve AM = MB where A,B,M are 3x3 matrices.

What I came up with was to equate every entry in C to the corresponding entry in D (where C = AM and D = MB).

You can then vectorize M (call it Mv) and figure out the 9 equations to fill a 9x9 matrix on both sides

9x9 matrix times Mv = 9x9 matrix times Mv

Each row on the right can be subtracted from the same row on the left, leaving

9x9 times Mv = 0

The problem is, I could construct this matrix easily by hand, but this seems like an obnoxious process to write in code (a couple of loops or something?) Is there a better/different way to do this so that I can use normal algebra notation to express this?

Thanks,
Dave
 
Physics news on Phys.org
Without any specific properties of ##A,B##, or ##M##, the answer is: no. You have a linear equation system, so there should be plenty of good algorithms out there to solve it.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 25 ·
Replies
25
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K