# NOT RUN {
# Calculate BMP with data from a laboratory BMP test, and compare results for
# cellulose to the expected value
# First load example data sets
data("vol")
data("comp")
data("setup")
# vol has measured biogas volumes
head(vol)
# comp has measured biogas composition
head(comp)
# setup has information on batch reactor content
head(setup)
# Calculate cumulative biogas and methane production volumes at dry conditions and
# 0 degrees C and 1.0 atm
cum.vol <- cumBg(vol, comp = comp, time.name = "days", temp = 35,
pres = 1, extrap = TRUE)
head(cum.vol)
dim(cum.vol)
cum.vol
# Now calculate BMP (60 days) with summBg()
# Interpolation is used if needed, inoculum contribution
# is calculated and subtracted out, and results are
# normalised by substrate VS mass
BMP <- summBg(cum.vol, setup = setup, time.name = "days",
inoc.name = "inoc", inoc.m.name = "minoc",
norm.name = "mvs.sub", when = 60)
BMP
# More details with show.obs = TRUE
summBg(cum.vol, setup = setup, time.name = "days",
inoc.name = "inoc", inoc.m.name = "minoc",
norm.name = "mvs.sub", when = 60,
show.obs = TRUE)
# How do results compare to theoretical methane potential for
# cellulose?
predBg("C6H10O5")
# Set aside 10% of cellulose for microbial biomass production
predBg("C6H10O5", fs = 0.1)
# Both are close to measured values
# }
Run the code above in your browser using DataLab