Error encountered while specifying events in deSolve R package
问题 Here is the sample R code: library(deSolve) d = c(5.29,4.16,2.49,1.53,0.7,0.41,0.21)*10^-4 rho = rep(1.27,7) dg = d * sqrt(1/rho) r0 = dg/2 Fr = c(0.188,0.297,0.274,0.181,0.032,0.013,0.015) X0 = Fr*200*10^-6 N0 = X0*(3/(4*3.14*r0^3*rho)) state <- c(X1=X0[1],X2=X0[2],X3=X0[3],X4=X0[4],X5=X0[5], X6=X0[6],X7=X0[7],S=0) parameters <- c(D=6.19*60*10^-6,rho=rho,N=N0,Cs=17*10^-6,V=1000) times <- seq(0,16,by=0.0005) func2 <- function(t,state,parameters){ n <- length(state) v <- 1:(n-1) grad <- rep(NA