Struggle at using JuMP/MathOptInterface for calculating number of constraints

The @NL macros are part of the legacy interface. You should change them to use @constraint instead.

For information on the new nonlinear interface, see: