It is likely the "p" variable is not defined in your R environment. Inside your function model.LIDR, the variable "p" is used before being initialized in any of the environments reachable by the search path, included the model.LIDR function environment. The remedy is to define and initialize "p" before it is being referenced (used). It is not about any deSolve package specific error. -- GG [[alternative HTML version deleted]]