Message Boards Message Boards

Solve a Matrix differential equation?

GROUPS:

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]
POSTED BY: reza hamzeh
Answer
3 months ago

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 BY: Michael Rogers
Answer
3 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 "

POSTED BY: reza hamzeh
Answer
3 months ago

Group Abstract Group Abstract