Difficulty running an ODE model in R including a parameter that varies by time (forcing function)
问题 I am trying to fit a reasonably basic ODE model using deSolve, including within the model a parameter that varies by time (force of infection; FOI). While running the model without this parameter works fine, inclusion of the time dependent parameter gives an error (see below). I am relatively new to R and mathematical modelling, and have been trying to solve this problem for some time now. I have created the FOI parameter as a matrix of values and then used the approxfun function for