.nl file writer does not eliminate constant constraints
I have written two examples in which BARON chokes on a constant constraint passed through the ASL interface. In both cases, the .nl writer simplifies the constraint to 0 == 0, but writes it anyways.
This has a constraint which is constant (with respect to the solver) because both variables in it are "fixed" in the Pyomo model. kmn_model.py.txt
This has a constraint which is constant because the constraint is of the form Constant == Parameter kmnc_model.py.txt
Note that the line number on the syntax error refers to the .bar file which baron generates from the .nl file, not the .nl file itself.
This is a known issue. I can't recall why the *.nl writer behaves in such a way, but if you want to get around the problem, try TransformationFactory('contrib.deactivate_trivial_constraints').apply_to(model). Before solving.
@jsiirola - Is this still a valid concern given the recent NL writer rewrite?
This is still an issue: NLv2 has improved handling of trivial constraints, but for backwards compatibility, skip_trivial_constraints still defaults to False. We should eventually move to defaulting it to True, and at the same time, it should verivy that any eliminated nonlinear expressions are still numerically valid at the solution returned by the solver.