check_balance {PantaRhei}R Documentation

Checks the mass balance of the flows involved

Description

For each substance involved, the balance per (internal) node is inspected. If outflow exceed inflow, or vice versa, a message is printed, and the function returns FALSE.

Usage

check_balance(nodes, flows, tolerance = 0.01)

Arguments

nodes

data.frame containing the nodes definition

flows

data.frame containing the flows definition

tolerance

numeric specifying a tolerance. Default is 0.01 (1%)

Value

TRUE if balanced, FALSE if not.

Examples

nodes <- data.frame(ID=c("A","B","C"), x=1:3, y=1:3, dir=c("right","right","stock"))
flows <- data.frame(from=c("A","B"), to=c("B","C"), quantity=c(10,10))
check_balance(nodes,flows)

[Package PantaRhei version 0.1.2 Index]