楼主: ReneeBK
2896 12

Introduction to Scientific Programming and Simulation Using R [推广有奖]

11
ReneeBK 发表于 2016-1-29 10:47:30
  1. Examples
  2. LV <- function(t=NULL, y, a, b, g, e, K=Inf)
  3. c(a*y[1]*(1 - y[1]/K) - b*y[1]*y[2], g*b*y[1]*y[2] - e*y[2])
  4. xy <- RK4adapt(LV, 0, c(100, 50), 200, 1, tol=1e-3,
  5. a=0.05, K=Inf, b=0.0002, g=0.8, e=0.03)
  6. par(mfrow = c(2,1))
  7. plot(xy$y[,1], xy$y[,2], type='p',
  8. xlab='prey', ylab='pred', main='RK4, adaptive h')
  9. plot(xy$t, xy$y[,1], type='p', xlab='time',
  10. ylab='prey circles pred triangles', main='RK4, adaptive h')
  11. points(xy$t, xy$y[,2], pch=2)
  12. par(mfrow=c(1,1))
  13. https://cran.r-project.org/web/packages/spuRs/spuRs.pdf
复制代码

12
ReneeBK 发表于 2016-1-29 10:48:16
  1. Examples
  2. transect.1 <- trapTransect(distances = 1:4,
  3. seed.counts = c(4, 3, 2, 0))
  4. transect.2 <- trapTransect(distances = 1:3,
  5. seed.counts = c(3, 2, 1))
  6. transect.3 <- trapTransect(distances=(1:5)/2,
  7. seed.counts = c(3, 4, 2, 3, 1))
  8. allTraps <- transectHolder(transect.1, transect.2, transect.3,
  9. family="Weibull")
  10. mean(allTraps)
  11. sd.transectHolder(allTraps)
  12. https://cran.r-project.org/web/packages/spuRs/spuRs.pdf
复制代码

13
tamtam701013 发表于 2016-4-21 03:07:39
thanks for your sharing.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-7 17:26