I've the following system of equations for studying information flow in the below graph,
$$ \frac{d \phi}{dt} = -M^TDM\phi + \text{noise effects} \hspace{1cm} (1)$$
Here, M is the incidence matrix of the graph
$\phi$ is a vector with variables [ A B C D E F].
I've solved the above ode's to obtain the time series data of variables A,B,C,D,E,F.
Using the time-series data obtained from the above step, I'd like to do determine $\tilde{D}$ for the following system
$$ \frac{d \phi}{dt} = -M^T\tilde{D}M\phi \hspace{1cm} (2)$$
Note: The entries in the diagonal elements of $\tilde{D}$ are the edge weights.
I'd like to know if there is a way to solve this as an optimization problem using time-series data as input.
Any suggestions on how to proceed will be really helpful
EDIT: Equation (1) (with noise effects) is solved using prior values of the diagonal matrix, D and the time series profiles of variables in each node are obtained.
What do I want to achieve?
I want to determine a modified D i.e $\tilde{D}$ that can generate the same time series profile that was generated while solving equation (1).
EDIT: Based on the below discussion
The cost function that I want to minimize is
$$\int_{0}^{t_{f}} || \phi(t) - \exp{(-M^{T} \tilde{D} M t)} \phi(0) ||^{2} dt$$
to reduce the difference between the solutions of (1) and (2).
Any suggestions on the optimization function and toolbox that can be used to solve the above will be really helpful
EDIT3: I looked at some literature and I think this problem has to be solved using fmincon and it might not be possible to use convex optimization.
I'm still looking for suggestions on how to formulate the constraints for solving the cost function illustrated below.