Message Boards Message Boards

0
|
6557 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Solve a Matrix differential equation?

Posted 6 years ago

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
2 Replies
Posted 6 years 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

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract