I have the vector equality:


I want to solve this using DSolve. How do I transform the above vector equality into a list of 2 scalar equalities (automatically):

{a*x1'[t]+b*x2'[t]==e*u1[t]+f*u2[t], c*x1'[t]+d*x2'[t]==g*u1[t]+h*u2[t]}

How do I do this? Thanks!

  • 3
    $\begingroup$ Thread[] ought to work. $\endgroup$ – J. M.'s discontentment Aug 3 '15 at 16:06
  • $\begingroup$ @Guesswhoitis. Awesome, Thread[LHS==RHS] (pseudocode) worked! $\endgroup$ – space_voyager Aug 3 '15 at 16:10
  • 6
    $\begingroup$ In recent versions of Mathematica, you do not have to transform the vector equation into a pair of scalar equations before using solving them. Thus DSolve[{{a, b}, {c, d}}.D[{x1[t], x2[t]}, t] == {{e, f}, {g, h}}.{u1[t], u2[t]}, {x1[t], x2[t]}, t] works just fine as is, whether with "abstract" functions u[t], u2[t] and symbolic coefficient matrices, or with specific functions and actual values in the coefficient matrices. $\endgroup$ – murray Aug 3 '15 at 16:18
  • 1
    $\begingroup$ @SjoerdC.deVries can you provide a link please? $\endgroup$ – chris Aug 4 '15 at 6:48
  • 1
    $\begingroup$ @chris It was rather difficult to find, but I believe I was alluding to this question. $\endgroup$ – Sjoerd C. de Vries Aug 4 '15 at 10:36