See Procedural Nonlinear Constaint Generation - String to NLconstraint - #4 by odow There have been a few similar questions asked over the previous few days. Pull requests to improve the documentation appreciated.
Why not declare f
as a user-defined function? Nonlinear Modeling · JuMP