sim1D.create: Create an Object of Class 'sim1D'

Description Usage Arguments Value Author(s) Examples

Description

Create an object of class 'sim1D' from the output of a dynamic, 1D model.

Usage

1
2
3
sim1D.create(dyn, namesVars, namesPros, xMin, xMax, keepItems = c(namesVars,
  namesPros), sep = ".", rangeT = c(NA, NA), rangeX = c(NA, NA),
  nsig = 2)

Arguments

dyn

Numeric matrix output by the ODE solver (e.g. ode) for a 1D model.

namesVars

Names of the state variables in dyn. If dyn was produced with a rodeo-based model, the model object's namesVars() method returns the required names.

namesPros

Names of the processes in dyn. If dyn was produced with a rodeo-based model, the model object's namesPros() method returns the required names.

xMin

Minimum coordinates of the spatial boxes, e.g. top layer boundaries in a vertical 1D model.

xMax

Maximum coordinates of the spatial boxes, e.g. bottom layer boundaries in a vertical 1D model.

keepItems

Names of the items to be kept. Must be names of state variables or processes existing in the model.

sep

The character used in the column names of dyn to separate the variable/process name from the box/layer index.

rangeT

Time range. Data outside this range are dropped.

rangeX

Range of spatial coordinates (e.g. depths). Data outside this range are dropped.

nsig

Number of significant digits to retain (integer).

Value

An object of class 'sim1D'. Use sim1D.query to extract data from such objects.

Author(s)

David Kneis david.kneis@tu-dresden.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gr <- makeGrid(dz0=0.01, dzMax=0.02, zMax=0.1, beta=1)
times <- 0:2
vars <- c("A","B")
pros <- c("X","Y")
values <- matrix(1:(length(times)*nrow(gr)*(length(vars)+length(pros))),
  nrow=length(times))
dyn <- cbind(times, values)
colnames(dyn) <- c("time", paste(rep(vars, each=nrow(gr)), 1:nrow(gr),sep="."),
  paste(rep(pros, each=nrow(gr)), 1:nrow(gr),sep="."))
obj <- sim1D.create(dyn, namesVars=vars, namesPros=pros, xMin=gr$zUp, xMax=gr$zLw)

dkneis/diatools documentation built on May 15, 2019, 9:12 a.m.