# Fit a system of linear ODEs from several experiments

Assume we are given several initial vectors $x^{(1)},\ldots,x^{(r)} \in \mathbb{R}^n$, where the dimension $n=6$ (in any event a number below 10) , and the number of initial vectors $r$ is in the range of 10000 to 20000. Also all entries of the vectors are real numbers between $0$ and $1$, if that helps.

We now consider the system of linear ODEs $$\frac{d}{dt} x = A_p(t) \cdot x + b_p(t),$$ with respective initial vectors $x^{(p)}$, where $A_p(t)$ is a real valued $n \times n$ matrix and $b_p(t)$ is a real $n$-dimensional vector. (For the sake of simplicity we can assume $A_p$ and $b_p$ to be constant.)

Now we assume that $(i,j)$-th coefficients of $A_p(t)$ are of the form $$A_p(t)_{ij} = \sum_{k=1}^m v_{pk} \cdot h_{ijk}(t) + c_{ij}(t)$$

and the $i$-th coefficients $b_p(t)$ of the form $$b_p(t)_{i} = \sum_{k=1}^m v_{pk} \cdot h_{ik}(t) + d_{i}(t).$$ Here $m$ is a number around 1000. Hence, in both $A_p(t)_{ij}$ and $b_p(t)_{i}$ we do have components that are universial for that particular matrix/vector position over all $p$, namely $c_{ij}(t)$ and $d_{i}(t)$ and we do have components that are known and fixed for each individual $p$ and all positions in a matrix resp. vector, namely the real numbers $v_{pk}$, and we do have components to do depend on the position in the matrix but not on the $p$, and which are unknown, namely $h_{ijk}(t)$ resp $h_{ik}(t)$.

Now to each initial vector $x^{(p)}$ we are given a state vector $y^{(p)}$ after some time $t_0$. That means we have bunch of experiments where we know the start point $x^{(p)}$ and end point $y^{(p)}$ and the time distance $t_0$ and we know/assume that the dynamics is described by the system of linear ODEs from above.

Can we get out the $h_{ijk}(t), c_{ij}(t), h_{ik}(t)$ and $d_{i}(t)$ by combining all these experiments?

Here I am not interested just in a theoretic answer, but more in an applied one where a robust approach is outlined with which I can get out those functions resp. some values at the start or end or some intermediate values. (Also R/Matlab packages and commands, that do help me here, would be welcomed.)

It seems a case for system identification (e.g. http://es.mathworks.com/products/sysid/) but I do not get the dependence on $p$, does it stand both for the initial value and the time-varying parameters $A$, $b$?
If you have a set of observations $x(t_i)$ at instants $t_i$, at the end of the day you have a regression problem with all data, which can also be formulated in recurrent form.
• Miguel, many thanks for your comment! The $A_p$'s and $b_p$'s are each making up an individual system of linear ODEs. However, the $A_p$'s resp. the $b_p$'s are related to each other in many ways and have identical time dependent functions, but which are multiplied with different prefactors depending on p. Hope that clarifies things! – tobias Aug 17 '15 at 14:12