# Result: Manning's n of 0.013
depth <- 6
slope <- 0.005
area <- 100
hp <- c(0.51,0.71,0.2,0.97,0.71)
hlm <- c(0.45,0.71,0.16,0.9,0.62)
We <- c(0.229,0.356,0.254,0.482,0.178)
Ds <- c(0.0095,0.0095,0.0063,0.0252,0.0063)
pnum <- c(2,2,2,1,3)
snum <- c(1,1,2,2,6)
n_freeman2000(depth,slope,area,hp,hlm,We,Ds,pnum,snum)
# Result: Manning's n of 0.0183
depth <- 0.3
slope <- 0.005
area <- 100
hp <- c(0.51,0.71,0.2,0.97,0.71)
hlm <- c(0.45,0.71,0.16,0.9,0.62)
We <- c(0.229,0.356,0.254,0.482,0.178)
Ds <- c(0.0095,0.0095,0.0063,0.0252,0.0063)
pnum <- c(2,2,2,1,3)
snum <- c(1,1,2,2,6)
n_freeman2000(depth,slope,area,hp,hlm,We,Ds,pnum,snum)
# Result: Vegetation height must be positive.
depth <- 0.3
slope <- 0.005
area <- 100
hp <- c(0.51,0.71,0.2,0.97,-0.23)
hlm <- c(0.45,0.71,0.16,0.9,0.62)
We <- c(0.229,0.356,0.254,0.482,0.178)
Ds <- c(0.0095,0.0095,0.0063,0.0252,0.0063)
pnum <- c(2,2,2,1,3)
snum <- c(1,1,2,2,6)
n_freeman2000(depth,slope,area,hp,hlm,We,Ds,pnum,snum)
Run the code above in your browser using DataLab