I'll preface this with the fact that I have no idea what I'm doing. I'm new to MathematicaMathematica, I've only used it to solve simple ODEs with NDsolveNDsolve. I'm trying to solve a 2DOF system now with with matrices instead of constants in the eqn of motion. Thanks for any help in advance.
In[381]:= m = {{2, 0}, {0, 1}}; c = {{3, -.5}, {-.5, .5}}; k = {{4, -1}, {-1, 1}}; initu = u[0] == {{0}, {.1}}; initv = u'[0] == {{1}, {0}}; u[t_] := {{u1[t]}, {u2[t]}};
m = {{2, 0}, {0, 1}}; c = {{3, -.5}, {-.5, .5}}; k = {{4, -1}, {-1, 1}}; initu = u[0] == {{0}, {.1}}; initv = u'[0] == {{1}, {0}}; u[t_] := {{u1[t]}, {u2[t]}};
During evaluation of In[381]:= SetDelayed::write: Tag List in {{u1},{u2}}[t_] is Protected. >>
During evaluation of In[381]:= SetDelayed::write: Tag List in {{u1},{u2}}[t_] is Protected. >>
In[387]:= sol = NDSolve[{m.u''[t] + c.u'[t] + k.u[t] == {{Sin[2 t]}, {Sin[2 t]}}, initu, initv}, u, {t, 0, 100}]
sol = NDSolve[{m.u''[t] + c.u'[t] + k.u[t] == {{Sin[2 t]}, {Sin[2 t]}}, initu, initv}, u, {t, 0, 100}]
During evaluation of In[387]:= NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {{{2,0},{0,1}}.({{u1},{u2}}^[Prime][Prime])[t]+{{3,-0.5},{-0.5,0.5}}.({{u1},{u2}}^[Prime])[t]+{{4,-1},{-1,1}}.{{u1},{u2}}[t]=={{Sin[2 t]},{Sin[2 t]}},{{u1},{u2}}[0]=={{0},{0.1}},True}. >>
During evaluation of In[387]:= NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {{{2,0},{0,1}}.({{u1},{u2}}^′′)[t]+{{3,-0.5},{-0.5,0.5}}.({{u1},{u2}}^′)[t]+{{4,-1},{-1,1}}.{{u1},{u2}}[t]=={{Sin[2 t]},{Sin[2 t]}},{{u1},{u2}}[0]=={{0},{0.1}},True}. >>
Out[387]= NDSolve[{{{2, 0}, {0, 1}}.({{u1}, {u2}}^[Prime][Prime])[ t] + {{3, -0.5}, {-0.5, 0.5}}.Derivative[1][{{u1}, {u2}}][ t] + {{4, -1}, {-1, 1}}.{{u1}, {u2}}[t] == {{Sin[2 t]}, {Sin[ 2 t]}}, {{u1}, {u2}}[0] == {{0}, {0.1}}, True}, {{u1}, {u2}}, {t, 0, 100}]
NDSolve[{{{2, 0}, {0, 1}}.({{u1}, {u2}}^′′)[ t] + {{3, -0.5}, {-0.5, 0.5}}.Derivative[1][{{u1}, {u2}}][ t] + {{4, -1}, {-1, 1}}.{{u1}, {u2}}[t] == {{Sin[2 t]}, {Sin[ 2 t]}}, {{u1}, {u2}}[0] == {{0}, {0.1}}, True}, {{u1}, {u2}}, {t, 0, 100}]