Skip to contents

For a system returned by mtkcompile(), map_variables_to_equations(sys) gives, for every unknown and observed variable, the equation that is used to solve for it: the differential equation of a state, the matched algebraic equation of an algebraic unknown, or the observed equation.

Usage

map_variables_to_equations(sys, rename_dummy_derivatives = TRUE)

Arguments

sys

A system returned by mtkcompile().

rename_dummy_derivatives

Name dummy derivative variables such as yˍt(t) by their derivative form Derivative(y(t), t).

Value

A list of equations named by the printed form of the variables; the attribute "vars" holds the variables.

Examples

t <- t_nounits; D <- D_nounits
variables("x(t)", "y(t)")
sys <- mtkcompile(System(list(D(x) ~ -x, y ~ x + 1), t, name = "sys"))
map_variables_to_equations(sys)
#> $`x(t)`
#> Derivative(x(t), t) ~ -x(t) 
#> 
#> $`y(t)`
#> y(t) ~ x(t) + 1 
#> 
#> attr(,"vars")
#> attr(,"vars")$`x(t)`
#> x(t)
#> 
#> attr(,"vars")$`y(t)`
#> y(t)
#>