Equivalence to add_nonlinear_constraint in new JuMP version

Hi,

I have used the functions add_nonlinear_constraint/ add_nonlinear_expression/ add_nonlinear_objective in the old version of JuMP to add programmatically-generated Expr objects to models. I wonder if these functions are still available in the new versions of JuMP (v 1.15 and newer), or if we have some equivalences. Thank you.

There is no equivalent to the old functions. You shouldn’t need them.

What are trying to achieve?

Hi @odow,
Thanks for responding. I need to repeatedly solve an optimization problem as a part in my genetic programming workflow. The problem has fixed parameters, variables, and objective function. It has a few fixed constraints, while the other constraints change each time. The constraints which change over time are generated programmatically, so I could not control their forms or declare them manually.
Before I use add_nonlinear_constraint() together with delete() for this purpose, but now it is not possible with the newer versions.

Can you provide a reproducible example of what you are trying to do?

The @NL interface is now legacy.

The new nonlinear interface has first-class support for nonlinear expressions: Nonlinear Modeling · JuMP, and you can, for example, delete a nonlinear constraint.

You should not need to use the Base.Expr input syntax.