Lets say I have an expression like this in SymPy:
s = sp.symbols('s')
Y = s**3 + 3*s**2 + 2*s
Y
Now I would like to get a "list of orders" of that expression.
here is an example of what I want to achieve:
I would like to create a tf()
object. Where tf()
is a function like in Matlab that takes two lists, a denominator, and a numerator, and creates a transfer function out of them:
tf([1], [1, 3, 2, 0])
I would like to extract those two lists from my SymPy expression to use them like in that tf()
function. How can I do that?