DRWbalance: Mass or Flux balance for a DRW model result

Usage Arguments Value

Usage

1
2
3
4
5
DRWbalance(dr, type = c("mass", "flux")[1L], plot = FALSE, t = dr, ...)

## S3 method for class 'DRWbalance'
plot(balance, t = NULL, detail = TRUE, col = c(in_ =
  "red", out = "blue", Dactive = "darkgreen", imbalance = "black"), ...)

Arguments

dr

DRWmodel S4 class object; results from DRW

type

"mass" or "flux"

plot

logical [1]; whether to plot the results using plot.DRWbalance before returning

t

NULL, numeric [nts - 1] or a DRWmodel; time values to use for x axis; if NULL is given, then time step numbers are plotted

...

DRWbalance: additional parameters to pass to plot.DRWbalance; plot.DRWbalance: axis range and label and title parameters (although there are internal defaults if these aren't given)

detail

logical [1]; whether to subdivide inputs, outputs and active mass

col

character [4]; colours to use for inputs, outputs, active mass and imbalance respectively

balance;

a DRWbalance object, the result of DRWbalance

Value

DRWbalance returns a list of class "DRWbalance", with elements:
$in_ numeric [nts - 1, 1]: input mass or flux from sources by time step
$out numeric [nts - 1, 8]: output mass or flux to sinks, degradation or out of the model active region by time step; these values are negative
$Dactive numeric [nts - 1, 2]: change in or rate of change of plume and sorbed mass by time step
$active (only if type == "mass") numeric [nts, 2]: mass in plume and sorbed by time step
$imbalance numeric [nts - 1]: unaccounted for mass; should be 0 apart from machine imprecision

Each element has informative column names (try colnames(bal$out) for example). nts means the number of time steps in the DRW model. Because time step 1 of a DRW model represents the initial state, fluxes and changes of mass are between the time steps, which is why the in_, out and Dactive matrices have one less row than the number of time steps.

The result is returned invisibly if plot == TRUE.

plot.DRWbalance returns NULL.


CJBarry/DRW documentation built on May 6, 2019, 9:25 a.m.