Suppose I have a three compartments (See here) system. While concentrations of two of the compartments change with time (t), the third compartment's concentration changes with number of system sampling (n). t and n are not the same necessarily. For example, when the system is not sampled n does not change but t still increases monotonically.
How can I derive the system of differential equations for this system? Would something similar to below be correct? If so, how can I solve these 3 differential equations?
$\frac{dC_1}{dt}=k_1U(t)-k_2C_1(t)$
$\frac{dC_2}{dn}=k_2C_1(t)-k_3C_2(n)$
$\frac{dC_3}{dt}=k_3C_2(n)$
EDIT:
When $t=a\times n$, If I apply the chain rule to the above system what I get is
$\frac{dC_1}{dt}=k_1U(t)-k_2C_1(t)$
$\frac{dC_2}{dt}=[k_2C_1(t)-k_3C_2(\frac{t}{a})]\times a$
$\frac{dC_3}{dt}=k_3C_2(\frac{t}{a})$
How this system can be solved?
I will assume that your $n$ is discrete (since you speak about sampling). In this case, your second DE becomes a difference equation and you get something like $$\begin{cases}\dot{C}_1=k_1U(t)-k_2C_1(t)\\ C_2(n+1)=k_2C_1(an)-k_3C_2(n)\\ \dot{C}_3=k_3C_2(\lfloor t/a\rfloor) \end{cases}$$ Here, in $C_1(an)$ you evaluate the continuous variable $C_1$ at time instant corresponding to $n$ and in $C_2(\lfloor t/a\rfloor)$ you extend $C_2$ to continuous time domain.
EDIT 1: If, on the other hand, you assume that $n$ changes continuously with time you get the set of DEs as you described. Honestly, I'm not sure if this model can describe any realistic process as it implies that there are two processes defined on different time scales that however, interact. For instance, depending on $a$ you can have that the right-hand side of the second DE depends on the future values of $C_1$ ...
Anyway, to solve this system I'd first solve the first DE, either analytically or numerically. Then, one can solve the second DE w.r.t. $n$ (no need to rewrite in terms of $t$) while considering $C_1(t/a)$ as an input. This means that at time $n$ we pick the value of $C_1$ at $t/a$. If $C_1$ is computed numerically, we can interpolate it to get the required values. Obviously, you should have solved the DE for $C_1$ on the interval $[0,a n_f]$ in order to solve the second DE on the interval $[0,n_f]$.
Then you do the same for the third equation, but rescaling $C_2$ back to $t$.