3
$\begingroup$

I am struggling in solving the following differential equation (with B and g real numbers)

        (*definition*)        
        H = B*{{1, 0}, {0, -1}}; 
        L = (1/Sqrt[2])*{{1, 0}, {0, -1}}; 
       (*initial condition*)
     R[0] = {{R00, R01}, {R10, R11}}; 

        (*solution*)
       sol = DSolve[{D[R[t], t] == (-I)*(H . R[t] - R[t] . H) + g*(L . R[t] . L - R[t]), 
        R[0]}, R, t]

I expect the solution given by the following $2 \times 2$ matrix: $$R(t) = \begin{pmatrix} R_{00}(0) & R_{01}(0) e^{-i 2Bt - g t} \\ R_{10}(0) e^{i 2Bt - g t} & R_{11}(0) \end{pmatrix}$$

$\endgroup$
2
  • $\begingroup$ You need to write the initial conditions like: ini= R[0]=={{R00, R01}, {R10, R11}} $\endgroup$ Commented May 8 at 7:57
  • $\begingroup$ Thanks, @DanielHuber. Tried this sol = DSolve[{D[R[t], t] == (-I)*(H . R[t] - R[t] . H) + g*(L . R[t] . L - R[t]), ini}, R, t] but doesn't work. $\endgroup$
    – phy_std
    Commented May 8 at 8:03

1 Answer 1

3
$\begingroup$

Write the matrix elementwise then it will work:

H = B*{{1, 0}, {0, -1}};
L = (1/Sqrt[2])*{{1, 0}, {0, -1}};
ini = R[0] == {{R00, R01}, {R10, R11}};

R[t_] = {{r11[t], r12[t]}, {r21[t], r22[t]}};
sol = DSolve[{D[R[t], t] == (-I)*(H . R[t] - R[t] . H) + 
     g*(L . R[t] . L - R[t]), ini}, Flatten[R[t]], t]

enter image description here

R[t] /. sol // TableForm

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks. Just trying to understand, why do we need Flatten[R[t]] here? Flatten seems to me "vectorizing" the matrix. Since left and right sides are $2\times 2$ matrices, why do we need to write R[t] in that vectorized form? $\endgroup$
    – phy_std
    Commented May 8 at 8:38
  • $\begingroup$ DSolve wants a list of variables. Flatten transforms the matrix into a list. $\endgroup$ Commented May 8 at 10:32

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.