Learn R Programming

⚠️There's a newer version (1.64.0) of this package.Take me there.

Overview

The biogas package is an R package for biogas research. It provides tools for processing biogas data, predicting biogas production, making conversions, and planning experiments. For example, the calcBgVol() function can be used for calculating biochemical methane potential from original measurements. The calcCOD() function can calculate the chemical oxygen demand of a compound based on a chemical formula. And the planBMP() function can suggest substrate or inoculum quantities for a biochemical methane potential (BMP) experiment based on multiple constraints.

An example

Much of the biogas package is dedicated to processing of laboratory measurements, but those functions are difficult to demonstrate in a short example. So, an alternative is the predBg() microbial stoichiometry function. With it, the theoretical maximum BMP of, say, cellulose, could be calculated with

> predBg("C6H10O5")
[1] 413.7274

and we could get a lot more information, including an estimate of biogas composition as affected by pH, for a 5:1 mixture of waste paper and waste oil with

> predBg(mcomp = c(C6H10O5 = 5/6, C54H100O7 = 1/6), mass = 1,
fd = 0.8, fs = 0.1, conc.sub = 50, pH = c(6.5, 7, 8.5),
temp = 35, value = "all")
                      form mass mol.mass      moles      COD  fs  fe  fd
1 C1.52618H2.61516O1.00000    1  36.9655 0.02705225 1.454303 0.1 0.9 0.8
2 C1.52618H2.61516O1.00000    1  36.9655 0.02705225 1.454303 0.1 0.9 0.8
3 C1.52618H2.61516O1.00000    1  36.9655 0.02705225 1.454303 0.1 0.9 0.8
  conc.sub temp  pH      hydro      fCH4      xCH4     vCH4      vCO2      vBg
1       50   35 6.5 0.09279292 0.5566161 0.5689900 365.8395 275.91411 641.7536
2       50   35 7.0 0.09279292 0.5566161 0.5864017 365.8395 256.90636 622.7459
3       50   35 8.5 0.09279292 0.5566161 0.8921576 365.8395  44.02904 409.8686
       mCH4      mCO2     mCO2Bg   mCO2.sol       cTIC      m.bio      N.req
1 0.2624617 0.5735654 0.54543300 0.02813242 0.03196140 0.08225028 0.01018521
2 0.2624617 0.5735654 0.50785807 0.06570735 0.07465048 0.08225028 0.01018521
3 0.2624617 0.5735654 0.08703757 0.48652785 0.55274693 0.08225028 0.01018521

See the vignettes and help files for more details.

Getting started

The biogas package is available from CRAN, and so can be installed directly in R with:

install.packages("biogas")

To see available vignettes, use

vignette(package = 'biogas')

and then, e.g.,

vignette('calcBgVol_function')

or

vignette('predBg_function')

Alternatively, download the vignettes from the CRAN page.

More information

Copy Link

Version

Install

install.packages('biogas')

Monthly Downloads

497

Version

1.61

License

GPL-2

Maintainer

Sasha D. Hafner

Last Published

December 5th, 2024

Functions in biogas (1.61)

UQGDSetup

BMP Bottle Setup Information
calcBgMan

Calculate Cumulative Biogas Production from Pressure Data
UQGravSetup

BMP Bottle Setup Information
UQGravBiogas

Mass Loss and Biogas Composition from BMP bottles
calcBgVol

Calculate Cumulative Biogas Production from Volumetric Data
feedSetup

Setup Details for Batch Reactors
feedVol

Biogas Volume from Batch Reactors
fitFOM

Fit a First-Order Model to Biogas or Other Data
comp2

Methane Content of Biogas
interp

Interpolate Biogas Composition or Cumulative Production
cumBg

Calculate Cumulative Biogas Production
s3volw

Biogas Volume from Batch Reactors
setup2

Setup Details for Some Batch Reactors
setup

Setup Details for Batch Reactors
mass

Mass Change of Batch Reactors
planBMP

Claculate Inoculum and Substrate Mass for BMP Experiments
s3lcombo

Biogas Volume and Methane Content from Batch Bottles
sludgeTwoBiogas

Headspace Pressure, Mass measurements, and Methane and Carbondioxid Content from Batch Bottles
s3voll

Biogas Volume from Batch Bottles
vol2

Biogas Volume from Batch Reactors
strawPressure

Headspace Pressure in Batch Reactors
summBg

Summarise and Normalise Cumulative Methane Production
predBg

Predict Biogas Production
calcCOD

Calculate Oxygen Demand
vol

Biogas Volume from Batch Reactors
vol2mass

Calculate Mass of Biogas
strawSetup

Setup Details for Batch Reactors
comp

Methane Content of Biogas
massw

Mass Change of Batch Reactors
vol2mol

Calculate Moles of a Gas
molMass

Calculate Molar Mass of Compound
sludgeTwoSetup

Setup Details for Batch Reactors
mass2vol

Calculate Biogas Production Gravimetrically
stdVol

Correct Gas Volume to 'Standard' Conditions
s3compl

Methane Content of Biogas from Batch Reactors
strawComp

Methane Content of Biogas
s3compw

Methane Content of Biogas from Batch Reactors
strawMass

Mass Change of Batch Reactors
calcBgGD

Calculate Biogas Production from Gas Density Data (GD-BMP)
calcBgGrav

Calculate Biogas Production from Gravimetric Data
UQGDBiogas

Biogas Volume and Mass Loss from BMP bottles