Skip to contents

get_variables(expr) returns the variables appearing in an expression or equation, as Symbolics' get_variables: applied variables such as x(t) count as one variable, derivatives contribute the differentiated variable, and parameters and bare independent variables are included.

Usage

get_variables(expr)

Arguments

expr

An expression, equation or list of them.

Value

A list of variables, unique, in order of appearance.

Examples

t <- t_nounits; D <- D_nounits
x <- Variable("x", t); k <- Parameter("k")
get_variables(D(x) ~ -k * x + t)
#> [[1]]
#> x(t)
#> 
#> [[2]]
#> k
#> 
#> [[3]]
#> t
#>