Message Boards Message Boards


Solve a Matrix differential equation?

Posted 9 months ago
2 Replies
1 Total Likes

I need to solve Milburn equation. But my code didn't work? what the problem ? H is a matrix in this code

DSolve[{p'[t] + r*p[t] == r*MatrixExp[-I*H/r]*p[t]*MatrixExp[I*H/r], p[0] == 0}, p[t], t]
2 Replies

Three things: The IC p[0] == 0 makes p[t] a scalar; should it be a matrix? The operator * does elementwise multiplication; you probably want matrix multiplication . (Dot). You probably need an explicit matrix for H, too.

Finally, I'm not sure DSolve is even programmed to solve a properly coded matrix ODE in terms of a matrix-valued variable p. NDSolve can solve them numerically, provided the parameters H and r are explicit numerical matrices/scalars. For DSolve, you might also try an explicit symbolic matrix for p[t] like {{p11[t], p12[t]}, {p21[t], p22[t]}}.

Posted 9 months ago

thx . i changed code to this (i gave to r , H their values)

<pre>NDSolve[{p'[t] + r*p[t] == r*MatrixExp[-I*H/r].p[t].MatrixExp[I*H/r], 
  p[0] == H}, p[t], {t, 0, 10}]

and it gave me this error "NDSolve::deqn: Equation or list of equations expected instead of True in the first argument "

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract