I am working with some code that generates an equation with a number of derivatives. I do not know the order of the derivatives or the order. If I was working with something algebraic, for example:
a, b, c = var('a,b,c')
eqn = a**2 + 3*b + c
I could use something like
coeffs = eqn.coefficients(a) highest_order = coeffs[-1][1]
to find out the highest order of a
. It would also be okay if i could figure out the order of every derivative of a given function in an equation. I can do this if I know before-hand what the order of the derivative is
function('f')
eqn += f(a,b,c).diff(a,b)
eqn.find(f(a,b,c).diff(a,b))
and see that in fact that derivative is there somewhere. Anyone have any ideas?