3
$\begingroup$

Is there any way to define the matrix M that achieves the following equation?

enter image description here

the two defined matrices are

{{(ω1 + ω4) / Sqrt[2]},
 {(μ ω2 + ω3) / Sqrt[2]},
 {(-μ ω2 + ω3) / Sqrt[2]},
 {(-ω1 + ω4) / Sqrt[2]}}

and

{{ω1}, {ω2}, {ω3}, {ω4}}
$\endgroup$
2
  • 1
    $\begingroup$ BTW, column vectors are not a necessity. $\endgroup$ Jun 4, 2020 at 12:54
  • $\begingroup$ @ΑλέξανδροςΖεγγ You're right: I realized this from the corresponding answers. $\endgroup$
    – Bekaso
    Jun 4, 2020 at 12:58

2 Answers 2

10
$\begingroup$
tt = {{(ω1 + ω4)/Sqrt[2]},
      {(μ ω2 + ω3)/Sqrt[2]},
      {(-μ ω2 + ω3)/Sqrt[2]},
      {(-ω1 + ω4)/Sqrt[2]}} // Flatten

mat =Last@ CoefficientArrays[tt, {ω1, ω2, ω3, ω4}] // Normal  

coefficient matrix

mat. {ω1, ω2, ω3, ω4} - tt // Simplify

{0,0,0,0}

$\endgroup$
2
  • $\begingroup$ Huh. Maybe I’m mistake but is this not just putting the initial vector/set of coupled equations in a matrix form? Seems magical but I know it’s simpler than it seems. Or maybe not? $\endgroup$ Jun 5, 2020 at 3:07
  • $\begingroup$ @CATrevillian yes you are right. $\endgroup$
    – chris
    Jun 5, 2020 at 7:43
5
$\begingroup$

CoefficientArrays[] works very well for this:

m1 = Normal[Last[CoefficientArrays[{(ω1 + ω4)/Sqrt[2], (μ ω2 + ω3)/Sqrt[2],
                                    (-μ ω2 + ω3)/Sqrt[2], (-ω1 + ω4)/Sqrt[2]},
                                   {ω1, ω2, ω3, ω4}]]]
   {{1/Sqrt[2], 0, 0, 1/Sqrt[2]}, {0, μ/Sqrt[2], 1/Sqrt[2], 0},
    {0, -(μ/Sqrt[2]), 1/Sqrt[2], 0}, {-(1/Sqrt[2]), 0, 0, 1/Sqrt[2]}}

Note how I used vectors instead of column matrices.

m1.{ω1, ω2, ω3, ω4} - {(ω1 + ω4)/Sqrt[2], (μ ω2 + ω3)/Sqrt[2],
                       (-μ ω2 + ω3)/Sqrt[2], (-ω1 + ω4)/Sqrt[2]}
   {0, 0, 0, 0}
$\endgroup$
1
  • $\begingroup$ oops... I simplified my silly answer and I now notice its exactly the same as yours. Oh well. Don't know why the OP changed his mind about giving you the credit. $\endgroup$
    – chris
    Jun 5, 2020 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.