initModel: Create model object and generate code

Description Usage Arguments Value Note Author(s)

Description

Creates a model object from user inputs and builds a shared library from generated Fortran code.

Usage

1
2
3
4
initModel(dir = ".", xlFile = "model.xlsx", funsR = "functions.r",
  funsF = list.files(path = dir, pattern = ".+[.]f95$"), tables = c(vars =
  "vars", pars = "pars", funs = "funs", pros = "pros", stoi = "stoi"),
  colsep = ",", stoiAsMatrix = FALSE, dllname = NULL)

Arguments

dir

Directory where input files are located. This is assumed to apply to any input files (i.e. xlFile, funsR, funsF, and possibly the values of tables).

xlFile

Either the base name of file in MS Excel format holding the model definition or NULL. In the latter case, the model definition is read from delimited text files using read.table(header=TRUE, sep=colsep) where the last argument is under user control (see colsep below).

funsR

Base name of file with function definitions in R.

funsF

Base name of file with function definitions in Fortran 95.

tables

Named vector with required elements 'vars', 'pars', 'funs', 'pros', and 'stoi'. If a file name was supplied in xlFile, the values are interpreted as the names of worksheets holding the declaration of variables, parameters, functions, process rates, and stoichiometry factors, respectively. If xlFile is an empty string, the values are interpreted as the names of delimited text files holding the respective information.

colsep

Specifies the column separator in text files. Only used if xlFile is NULL.

stoiAsMatrix

Logical. Allows the stoichiometry matrix to be supplied as a 3-column table or as a matrix.

dllname

Character string used as the name for the built library. This is the base name without file extension (must not contain path separators, white space, etc.). If set to NULL (the default), an automatic name is assigned. The library is created in the folder returned by tempdir() and it carries the system-specific extension for shared libraries according to .Platform$dynlib.ext.

Value

A list with the following components.

Note

Files in MS Excel format can also be created/edited with free software such as, e.g., LibreOffice Calc.

Spreadsheets are typically more convenient to edit as compared to delimited text files. However, with text files it is easier to track the history of a model using version control software and/or diff tools.

Author(s)

David Kneis david.kneis@tu-dresden.de


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