Is there any way to define the matrix M that achieves the following equation?
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}} Is there any way to define the matrix M that achieves the following equation?
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}} 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 mat. {ω1, ω2, ω3, ω4} - tt // Simplify {0,0,0,0}
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}