### Example 1: 10 patches
r<-1 #rate of recovery
d<-(0) #mean size of disturbance (mu in text)
d_sd<-sqrt(0.1) #SD of disturbances (sigma in text)
f<-1 #average time between disturbances (1/lambda in text)
sf<-0.1 #sampling interval
tmax<-120 #maximum time for simulation
d_cov<-d_cov0<-(d_sd)^2/2 #covariance in disturbance size among patches
xtNpatches<-symdynN(r = r, amu=0, asd=0, f=f, d=d,
d_sd=d_sd, d_cov=d_cov, N=10,
sf=sf, tmax=tmax, Ifrac=0, dffun = df_col)
### Example 2: 30 species
r<-1 #rate of recovery
d<-(0) #mean size of disturbance (mu in text)
d_sd<-sqrt(0.1) #SD of disturbances (sigma in text)
f<-1 #average time between disturbances (1/lambda in text)
sf<-0.1 #sampling interval
tmax<-120 #maximum time for simulation
d_cov<-0 #covariance in disturbances among species
amu<-(-r/2) #average interaction coefficient
asd<-0.1 #standard deviation of interaction coefficient
xtNsp<-symdynN(r = r, amu=amu, asd=asd, f=f, d=d,
d_sd=d_sd, d_cov=d_cov, N=30,
sf=sf, tmax=tmax)
Run the code above in your browser using DataLab