I have a slightly different question than this post:
How do I find the degree of a multivariable polynomial automatically?
I would like to compute the degree of a multivariate polynomial but with respect to a gradation that is I put weights on variables to compute the order.
For instance, $p=x^2y + z^3 + y^4$ with the gradation $(1,1,2)$ for $(x,y,z)$ is of degree $6$.
I have that to compute the order of a monomial $x^i y^j z^k$ I apply
ordMonome[mon]:=Log[mon]/.{x->Exp[1],y->Exp[1],z->Exp[2]};
take $p = x^2 y + y$, $deg(p) = 3$ but it's not what you compute....
– Smilia Jan 24 '17 at 12:02https://en.wikipedia.org/wiki/Degree_of_a_polynomial
– Smilia Jan 24 '17 at 12:20g. I think I see what you want now? I shall update my answer. Please let me know. If I still fail I'll delete this answer. – Mr.Wizard Jan 24 '17 at 12:32E.wts = {1, 1, 2}; vars = {x, y, z}; Exponent[p /. Thread[vars -> (t*vars)^wts], t]Also, the method above will fail onp = x^2 y + z^3 - y^6(because it is not safe against cancellation of lead terms). – Daniel Lichtblau Jan 24 '17 at 19:26GroebnerBasis`DistributedTermsList[p, {x, y, z}, MonomialOrder -> Join[{wts}, NullSpace[{wts}]]][[1, 1, 1]].wtswherewtsis the weight vector. Requires that it be all nonnegative rationals, I think. – Daniel Lichtblau Jan 24 '17 at 19:30