Get variables number in Symbolics

Symbolics/ModelingToolkit
How do I know the number of independent variables and their names in an equation or expression?

@variables x u(x)
get_variables(u+x+cos(x)) # [x, y(x)] but I want only x
get_variables(0 ~ x^2 + y - 3) # [x, y(x)]

Open an issue. I don’t think there is a built-in for this.

1 Like