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]}}
.