tcm {heR.IndoorAir}R Documentation

Simple Two Compartment Model

Description

Execute a relatively simple two-compartment model, producing the pollutant time series in each of two rooms based on source emissions for either room and ventilation between rooms and between each room and the outdoors

Usage

tcm(x1=1, x2=1, c10=0, c20=0,
    v1=rep(10,length(t)), v2=rep(10,length(t)),
    a21=rep(50,length(t)), a12=rep(50,length(t)),
    phi1=rep(0.5,length(t)), phi2=rep(0.5,length(t)),
    e1=abs(sin((1:length(t))/25)), e2=rep(0,length(t)),
    c3=rep(0,length(t)),
    t=0:239,
    recycle=TRUE, silent=FALSE,
    plot=FALSE, plotp=FALSE)

Arguments

x1 the source factor for room 1, multipled by e1 to give final time series of emission rates in room 1
x2 the source factor for room 2, multiplied by e2 to give final time series of emission rates in room 2
c10 the initial concentration in room 1
c20 the initial concentration in room 2
v1 the volume of room 1
v2 the volume of room 2
a21 the percentage of flow room 1 gets from room 2
a12 the percentage of flow room 2 gets from room 1
phi1 the air exchange rate for room 1
phi2 the air exchange rate for room 2
e1 the base emission rate in room 1, see x1
e2 the base emission rate in room 2, see x2
c3 the (fixed) outdoor concentration
t vector of times (elapsed minutes) at which to simulate concentrations
recycle logical, repeat last value of phi1, phi2, e1, e2, c3, if recycle=FALSE, otherwise recycle the values
silent logical, suppress warnings if TRUE
plot if TRUE, create a plot of the time series; if FALSE, a data frame with the results is output
plotp logical, if TRUE plot another graph with time-varying parameters

Details

This function allows for irregular time intervals, specified as increasing values in t, and for time-varying input parameters: phi1, phi2, e1, e2, c3. These input values are recycled by default, if the input vectors are too short. The final parameter input vectors will have lengths one less than the time vector.

This function uses Fortran-77 code, with model formulae produced by solving first-order linear differential equations using Mathematica by Wolfram Research, Inc. (http://www.wolfram.com).

Value

A data frame containing elapsed minutes and the concentration in each room, if plot=FALSE

Author(s)

Neil E. Klepeis

See Also

opttcm optimizes parameters for the tcm model using the observed concentration time series in each room.

cmpt, one.cmpt, and two.cmpt are multi-compartment, one- and two-compartment models that allow for more removal mechanisms (e.g., ventilation and deposition) than tcm.

tcm.stat,tcm.wrap are other auxiliary functions that will likely be changed or dropped in the future.


[Package heR.IndoorAir version 0.0.3 Index]