Reads an inverse input file and creates the inverse problem as a list, of type "liminput"
Read(file, verbose = FALSE, checkLinear = TRUE, remtabs = TRUE)
a list containing :
name of the inverse input file.
a data.frame with parameter declarations.
a data.frame with compartments (or states, stocks).
a data.frame with rate declarations.
a data.frame with external declarations.
a data.frame with flow declarations.
a data.frame with variable declarations.
a data.frame with cost declarations.
a data.frame with profit declarations.
a data.frame with equality declarations.
a data.frame with constraint declarations.
a data.frame with reaction declarations.
a vector with TRUE
values if reaction or flow
is unidirectional (and the unknown x is thus positive), FALSE
if it is two-way reaction or flow, and x can be positive or negative.
a data.frame with marker declarations - see vignette("LIM").
a vector with parameter names.
a vector with variable names.
a vector with compartment names.
a vector with names of externals.
a string; one of "web" (flows are unknowns), "reaction" (reaction rates unknown) and "simple" (compartments are unknowns).
name of inverse input file.
if TRUE
: prints warnings and messages to the screen.
if FALSE
: does not check for linearity
remove tabs.
Karline Soetaert <karline.soetaert@nioz.nl>
The structure of an inverse input file is explained in vignette("LIM") which should be consulted.
In short the inverse input file contains the declaration sections enclosed inbetween two lines starting with a ##.
For instance, the following section declares two components
# COMP
State1
State2
# END COMP
Only the first 4 characters of the section names are read
The following sections are allowed:
Parameters - ## PARAMETERS
Components - ## STOCKS or ## DECISION VARIABLES or ## STATES or ## UNKNOWNS
Externals - ## EXTERNALS
Rates - ## RATES
Flows - ## FLOWS
Variables - ## VARIABLES
Cost - ## COST or ## MINIMISE
Profit - ## PROFIT or ## MAXIMISE
Equalities - ## EQUALITIES
InEqualities - ## INEQUALITIES or ## CONSTRAINTS
Any (part of a) line starting with a "!" is considered a comment.
Input is NOT case sensitive
The output of this function is used as input in function Setup
which creates the inverse matrices
By default, only linear problems can be solved, and the function checks
whether the input is linear.
To toggle off this check, set checkLinear
to FALSE
.
Some input files contain tabs, which are converted to spaces, unless
this logical is set to FALSE
.
Setup
the function to create inverse matrices, based
on output of Read
.
# this input has been created with function Read:
LIMinputBlending
if (FALSE) {
wd <- getwd()
setwd(paste(system.file(package = "LIM"), "/doc/examples/Foodweb", sep = ""))
Read("RigaAutumn.input")
setwd(wd)
}
Run the code above in your browser using DataLab