@NLconstraint(m, x[6]>= obj_expr)
the above line gives the following error:
julia> @NLconstraint(m,x[6]>= obj_exp)
ERROR: Unexpected object x[6] >= x[1] ^ 2.0 + x[2] ^ 2.0 + x[3] ^ 2.0 + x[4] ^ 2.0 + x[5] ^ 2.0 in nonlinear expression.
Stacktrace:
[1] parseNLExpr_runtime(::Model, ::Expr, ::Array{ReverseDiffSparse.NodeData,1}, ::Int64, ::Array{Float64,1}) at
C:\Users\mahbu\.julia\packages\JuMP\I7whV\src\parsenlp.jl:207
[2] top-level scope at C:\Users\mahbu\.julia\packages\JuMP\I7whV\src\parsenlp.jl:249
[3] top-level scope at C:\Users\mahbu\.julia\packages\JuMP\I7whV\src\macros.jl:1352
And your are right the obj_expr expression has variables which are referenced to the model “model”. So how could I dereference the obj_expr to the variables of model “m”?