while related questions and replies exist, I could not translate them to my own problem, so here it goes:
ratedegrad<-0.012
releaser<-0.0016666667
times2<-seq(from=1, to=240, by=1)
state2<-c(degrad=300,titre=101,released=13.7)
dtitre2<-function(y,t,parms) {
with(as.list(y), {
dX2=-ratedegrad*titre
dY2=(-releaser*titre)-(ratedegrad*titre)
dZ2= releaser*titre
list(c(abs(dX2),dY2,dZ2)) } )
}
outtitre2<-ode(y=state2,times=times2,func=dtitre2,parms=NULL)
plot(outtitre2)
the error message I get is : The number of derivatives returned by func() (153) must equal the length of the initial conditions vector (3)
thank you!