Modelling arbitrary non-linear expression (returned by a function) in JuMP

For a similar problem and the suggested work-around, see Adding NL expressions to an AffExpr type Vector - #5 by odow