Find a symmetric matrix $P$ that satisfies the matrix equation $PD+DP=-Q$

138 Views Asked by At

Let

$$ D= \left[\begin{matrix} d_1 & 0 & 0 \\ 0 & d_2 & 0 \\ 0 & 0 & d_3 \\ \end{matrix}\right]$$

and

$$Q=\left[\begin{matrix} q_1 & q_2 & q_3 \\ q_2 & q_4 & q_5\\ q_3 & q_6 & q_7 \\ \end{matrix}\right]$$

Find a symmetric matrix $P$ that satisfies the matrix equation $PD+DP=-Q$.

How can I solve it? Help me solve it.

1

There are 1 best solutions below

3
On BEST ANSWER

Using Einstein's summation convention and dropping the $-$ sign which is essentially useless:

$$ q_{ij} = p_{ik} d_{kj} + d_{ik}p_{kj} $$

but $d_{ik} = d_{i}\delta_{ik}$ where $\delta_{ik}$ is 1 if $k=i$, $0$ otherwise so that:

$$ q_{ij} = p_{ij} d_j + d_{i} p_{ij} = p_{ij} (d_i+d_j)$$

and finally $p_{ij} = q_{ij}/(d_i+d_j)$

Small (inefficient but hopefully clear) Julia code to check it:

tmp = randn(3,3)
P   = (tmp+tmp')/2 # make it symmetric
d   = randn(3)
D   = diagm(d)

Q = P*D + D*P

# check the relation P_{ij}=Q_{ij}/(d_i+d_j)

test = Q*0

for i=1:3
    for j=1:3
        test[i,j] = Q[i,j]/(d[i]+d[j])
    end
end 

println(norm(test-P))

should give you something < 1e-15