Skip to contents

connect(a, b, ...) connects two or more connector systems (built with connector()) or causal variables, and is placed directly in the equation list of a system. Connected potential ("Equality") variables are set equal and Flow variables sum to zero. Causal variables must be marked input or output; the first is normally the output and the rest are inputs.

Usage

connect(..., verbose = TRUE)

domain_connect(...)

Arguments

...

Connectors or causal variables; for an analysis point, the output, the name (a string or an AnalysisPoint) and the inputs.

verbose

For analysis points, warn when the causality looks reversed.

Value

A Connection (or AnalysisPoint).

Details

connect(out, "name", in, ...) instead creates an AnalysisPoint called name between the output out and the inputs, for linear analysis. domain_connect() connects domains only: it shares the parameters of a domain source without generating equations.

Examples

t <- t_nounits
Pin <- connector(function(name) System(list(), t,
  list(Variable("v", t), Variable("i", t, connect = Flow)), list(), name = name))
a <- Pin(name = "a"); b <- Pin(name = "b")
connect(a, b)
#> connect(a, b)