Hello,
I'm getting the error "Non numeric argument to binary operator" with this code :
SDO <- function(t,state,parms)
{
with(as.list(c(state,parms)),
{
a=parms[1]; b= parms[2];c=parms[3];d=parms[4]; b_1= parms[5]; b_2= parms[6]; b_3= parms[7]
R = state["R"] ; S=as.numeric(state["S"])
dR <- a-d*((S/b)^c/(1+(S/b)^c)) - b_1*R
dS <- b_2*R - b_3*S
return(list(c(dR, dS)))
}
)
}
a=3
b=2
c=1.5
d=1
b_1 = 1
b_2 = 2
b_3 = 3
parameters = list(a=a, b=b, c=c,d=d, b_1=b_1, b_2=b_2, b_3=b_3)
R0 = 30
S0 = 10
#
yini <- c(R=R0,S=S0) # Point de depart
#
times <- seq(0,0.5,by=0.0001)
out <- ode(y=yini,times=times,func=SDO,parms=parameters,method="lsoda")
Error in S/b : argument non numérique pour un opérateur binaire
Where is the problem ?