3
$\begingroup$

I can't solve (analytically or numerically) the following matrix differential equation by hand.

I want to solve it using Mathematica or similar. I know that I must write my effort about code.

M V''[t] + C V'[t] +K V(t)== P(t)?

But I am a beginner in such a programs.

The question : https://math.stackexchange.com/questions/2680397/solving-following-second-order-matrix-differential-equation

I have a code for Matrices in Maple.

Can we transform the Maple code to Mathematica code?

    M:= Matrix
      ( n,
        n,
        shape=identity
      )
      +
      alpha*Matrix
            ( n,
              n,
              (i,j)->sin(i*Pi*nu*t/l)*sin(j*Pi*nu*t/l)
            ):
  C:= 2*alpha*Matrix
              ( n,
                n,
                (i,j)->(j*Pi*nu/l)*sin(i*Pi*nu*t/l)*cos(j*Pi*nu*t/l)
              ):
  K:= Matrix
      ( n,
        n,
        (i,j)-> `if`( i=j,
                      (j*Pi/l)^4*E*J/(rho*A)+(j*Pi/l)^2*N/(rho*A),
                      0
                    )
      )
      -
      alpha*Matrix
            ( n,
              n,
              (i,j)->(j*Pi*nu/l)^2*sin(i*Pi*nu*t/l)*sin(j*Pi*nu*t/l)
            ):
  VV:= Vector[column]
       ( n,
         j->V[j](t)
       ):
FF:=Vector[column]
       ( n,
         j->F[j](t)
       ):
  PP:= P/(rho*A)
       *
       Vector[column]
       ( n,
         j->sin(j*Pi*nu*t/l)
       )+FF:

  params:=( indets(sys1, name)
            minus
            {Pi,t}
          )=~1:
  ics:= [ Equate
          ( eval(VV,t=0),
            Vector[column]
            ( n,
              fill=0
            )
          )[],
          Equate
          ( convert(eval(diff~(VV,t),t=0),D),
            Vector[column]
            ( n,
              fill=0
            )
          )[]
        ]:
$\endgroup$

1 Answer 1

9
$\begingroup$

Here's an example:

a = {{a11, a12}, {a21, a22}};
x[t_] = {x1[t], x2[t]}; 
sol = DSolve[x''[t] == a.x[t] + b , x[t], t]

If you have specific numbers then you can use NDSolve. You can find lots of examples in the help files.

$\endgroup$
4
  • 1
    $\begingroup$ Thank you. But I think I'm misunderstood. Please find the following link? math.stackexchange.com/questions/2680397/… $\endgroup$
    – 1_student
    Commented Mar 9, 2018 at 7:01
  • 1
    $\begingroup$ I did not misunderstand. You need to make some effort. Put your matrices M, C, K, etc into Mathematica form. Then use DSolve (or perhaps NDSolve) as in my toy problem above. If you run into trouble, let us know where you have problems. $\endgroup$
    – bill s
    Commented Mar 9, 2018 at 12:48
  • 1
    $\begingroup$ Thanks for interest. I edited post. Could you look again? $\endgroup$
    – 1_student
    Commented Mar 9, 2018 at 13:05
  • 1
    $\begingroup$ When trying to solve a large problem, it often helps to solve a simple one first, to get the hang of how things go. Why not find a simple version of the problem and see where you get stuck? $\endgroup$
    – bill s
    Commented Mar 9, 2018 at 23:00

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.