I want to estimate the parameter in an ordinary differential equation (ODE). However, I don’t know how to input the time series of the boundary condition. It is not a “function”, but a time series (i.e., discrete data points). For example, daily inflow of water when modelling water volume of a lake.
I checked the manual of WinBUGS Differential interface, and it seems that their "Worked Example 2: Population PK Model" offers a solution, which is by ode.block() and piecewise() function:
R31[i] <- piecewise(vec.R31[i, 1:n.block])
vec.R31[i, 1] <- 0
vec.R31[i, 2] <- 0
vec.R31[i, 3] <- dose[i] / TI[i]
vec.R31[i, 4] <- 0
...
list(
... n.block = 4, ...)
where R31[i] can be seen as a time-variable boundary condition, n.block means that there are four sub-period for this boundary condition.
However, this solution can not be applied in my model, since I have a boundary condition whose data can not be divided into only 4 (or several) periods. The boundary condition is a daily-scale time series. Thus, if the simulation is 10 years, then I have 3650 sub-periods.
Is there a way to handle the numeric (i.e., discrete) boundary condition with many data points?