Computing edge weights of a graph from time-series data of nodes

I’ve the following system of equations for studying information flow in the below graph,

\frac{d \phi}{dt} = -M^TDM \phi
M is the incidence matrix

\phi is a vector with properties [ A B C D E F]

enter image description here

and I want to determine the value of diagonal elements in the matrix D. The entries in the
diagonal elements are the edge weights.

The data that I have is the time-series values of the property \phi at every node. i.e time-series values of A,B,C,D,E,F are available

I’d like to know if there is a way to solve this as an optimization problem using fmincon in Mathematica.

Any suggestions will be really helpful