I need to add a condition over an exogenous parameter. These seems not to work:
@NLconstraint(m, myConstraint[i in 1:N], x[i] == (myExogenousParameter[i] == 0.0 ? 0.0 : expression[i]) )
I found then this that seems to work, but I wonder if it is the correct approach:
parCheck(nzpar,expr) = (nzpar == 0 ? 0.0 : return expr)
register(m, :parCheck, 2, parCheck, autodiff=true)
@NLconstraint(m, myConstraint[i in 1:N], x[i] == parCheck(myExogenousParameter[i],expression[i]) )