Finding the coefficient in an expression in Symbolics.jl

Is there already something like the coeff function of SymPy for Symbolics.jl? E.g. in SymPy I do

using SymPy
@syms x y f()
ex = x^2*diff(f(x,y),y) + y^2
ex.coeff(diff(f(x,y),y))
# x^2

Can I do the same using Symbolics/ModelingToolkit ?

Open an issue. I don’t think we have a generic function for this.

1 Like