The objective is to solve a large system of NL equations. Equations should be obtained via polynomial operations and passed on to JuMP as user-defined function. Below is the minuaturised code for eveluating polynomials’ variables as function’s arguments:

`using JuMP`

`using Ipopt`

`using MultivariatePolynomials`

`using DynamicPolynomials`

`function f(k_1,c_1)`

`c_1*k_1^2`

`end`

`@polyvar c_1 k_1 s`

`d=2*k_1^2+c_1-s`

`p5=subs(d,s=>f(k_1,c_1))`

`function y_2(c,k)`

`p5(c_1=>c,k_1=>k)`

`end`

`y_2(c,k)`

The error message is the following when I call for the evaluated function:

`UndefVarError: c not defined`

Please, what is wrong in the code? How differently can I convert MultivariatePolynomials output into user-defined functions usable into JuMP?