Displaying 1 result from an estimated 1 matches for "objectfunc".
2013 Jan 03
1
R2OpenBUGS question with differential equations
...+y[1])
else
dCpdt <- -(parms["Vm"]/parms["Vol"])*y[1]/(parms["Km"]/parms["Vol"]+y[1])
list(dCpdt)
}
modelfunc<-function(time,Vm,Km,Vol) {
out <- lsoda(0,c(0,time),diffeqfun,parms=c(Vm=Vm,Km=Km,Vol=Vol),rtol=1e-5,atol=1e-5)
out[-1,2]
}
objectfunc <- function(par) {
out <- modelfunc(Input$time, par[1], par[2], par[3])
gift <- which( Input$lev != 0 )
sum((Input$lev[gift]-out[gift])^2)
}
gen <- genoud(objectfunc,nvars=3,max=FALSE,pop.size=10,max.generations=100,wait.generations=100, starting.value=c(40,8,12),BFGS=FALS...