Displaying 1 result from an estimated 1 matches for "runintegr".
Did you mean:
ruinteger
2018 May 29
1
Difficulty in writing R code for one pool dynamic model
...orresponding to pools
inA<-5
A <- inA
t <- Tstart
#Step 3: Set up rate parameters
A<-5
kinA <- 5
koutA <- 0.2
#Step 4: Write arrays that track pool size overtime
val <- array(1, dim=c(1, length(seq(Tstart,Tstop, by=Tstep))))
val
#Step 5: Set up while loop we use to runintegration
?while(t<=Tstop){
?if(t==Tstart) A <- inA else A <- val[1, t-1]
??# Setup rates
? inA<- kinA*A
? outA<- A*koutA
? A <-A+inA-outA
?val[1,t] <- A
? t <-t+1
}
# Step 6: Print the output as array
value <- data.frame(val)
# Transpose 'value' using t...