Skip to contents

MTKParameters(sys, op) returns the parameter values of a complete system given an operating point, as prob$p of a problem built from it: a named numeric vector, or, when some parameter has a nonnumeric value (a function, a string, a list or a matrix, the nonnumeric buffers of ModelingToolkit's MTKParameters), a named list of class MTKParameters whose single index access p[i] returns the value itself.

Usage

MTKParameters(sys, op = list())

Arguments

sys

A complete System.

op

Values of parameters (and unknowns they depend on).

Value

A named numeric vector or an MTKParameters list.

Examples

x <- Variable("x", t_nounits)
k <- Parameter("k", default = 2)
lbl <- Parameter("lbl", default = "decay")
sys <- mtkcompile(System(list(D_nounits(x) ~ -k * x), t_nounits, ps = list(k, lbl), name = "s"))
MTKParameters(sys, list(k ~ 3))
#> $k
#> [1] 3
#> 
#> $lbl
#> [1] "decay"
#>