Newbie here,

I seek to create a multivariable polynomial and evaluate it.

In greater detail, I’d like to start by defining an array of monomials, say for example [1, x1, x1^2, x2, x2^2, x1*x2] .

With that established, I would want a function that upon input of an array of coefficients, say [3, 5, 4, 3, 0, 1] , creates the associated polynomial p = 3 + 5x1 + 4x1^2 + 3x2 + x1*x2 . And once that is in place, to be able to evaluate for any given array of values, say x1 = 2, x2 = 3, the evaluation p(2,3) = 3 + 5*2 + 4*2^2 + 3*3 + 2*3.

Are there packages with existing functions that can enable this to be accomplished easily?