collect_vars(expr, iv) returns the unknowns and parameters appearing in
expr (an expression, equation, inequality, pair list(a, b), or a list
of them), as collect_vars! in ModelingToolkit. Derivatives contribute
their variable; a delayed or evaluated variable x(t - tau) contributes
x(t) and the parameters of its argument. Only variables whose scope
matches depth are kept (0: local, d: ParentScope applied d times, -1:
global). collect_scoped_vars(sys) collects the variables of the
equations, jumps and constraints of sys that refer to the enclosing
system (depth 1 by default). eqtype_supports_collect_vars(eq) tells
whether an object is supported.
Usage
collect_vars(expr, iv = NULL, depth = 0, scopes = NULL)
collect_scoped_vars(sys, iv = get_iv(sys), depth = 1)
eqtype_supports_collect_vars(eq)