Skip to contents

variables("x(t) = 1", "y(t)") declares x(t) with default 1 and y(t) and assigns them to x and y in the calling environment, like the @variables macro. parameters("k = 0.5", "m") does the same for parameters, and brownians(), constants() and discretes() for the other kinds. The independent variable named inside the parentheses is looked up in the calling environment, and created if missing. Array variables are written "x(t)[1:3]".

Usage

variables(..., .meta = list(), .env = parent.frame())

parameters(..., .meta = list(), .env = parent.frame())

constants(..., .env = parent.frame())

brownians(..., .env = parent.frame())

discretes(..., .meta = list(), .env = parent.frame())

Arguments

...

Declaration strings, or a system for the accessor forms.

.meta

Metadata applied to every declared variable, as a named list.

.env

Environment to assign into.

Value

Invisibly, a named list of the declared variables.

Details

Given a system, parameters() and brownians() return its parameters and brownian variables instead, as the accessors of the same name in ModelingToolkit.

Examples

t <- t_nounits
variables("x(t) = 1", "y(t)")
parameters("k = 0.5", "m")
x; k
#> x(t)
#> k