Hi There,

I am new to JuMP and I am trying to set-up an optimization model that I already made work in Matlab, but now taking many advantages of JuMP

Out of many questions I have I would start with few simple ones, hoping one of the experts can guide.

I have created a number of variables, and passed then through number of stepps that automatically created an affine (vector) expression named Fdry (all below mentioned variables in AffExpr are also defined in the model)

10-element Array{JuMP.GenericAffExpr{Float64,JuMP.Variable},1}:

5.7839120370370365 FH2 + 0.05155351783058837 FHOG + 3 EpsSGP[1] + EpsSGP[2]

0.0004050925925925926 FH2 + 0.10310703566117674 FHOG + EpsSGP[1] - EpsSGP[2]

0.6483910407410187 FNG + 0.0008680555555555554 FH2 + 0.38398348918167985 FHOG - 0.18084490740740738 FO2 - EpsSGP[1]

0

0

0

0.026172700828610014 FNG + 0.0018518518518518517 FH2 + 0.021742696145050644 FHOG + 0.18084490740740738 FO2 + EpsSGP[2]

0.6430041152263374 FSteam + 0.36168981481481477 FO2 - 0.04105095814611863 FNG - 0.034102652044934206 FHOG - EpsSGP[1] - EpsSGP[2]

0.02811199401389529 FNG + 0.07490726140784491 FHOG

0

As this is a vector expression, I want to use it to define number of non-linear constraints, in the following way

for i = 1:10

@NLconstraint(m, ySG[i]*sum(Fdry[j] for j=1:10) - Fdry[i] == 0 )

end

where ySG[1:10] is also defined as a variable.

now, this gives me following error :

MethodError: no method matching parseNLExpr_runtime(::JuMP.Model, ::JuMP.GenericAffExpr{Float64,JuMP.Variable}, ::Array{ReverseDiffSparse.NodeData,1}, ::Int64, ::Array{Float64,1})

is there a way to circumvent this? Are AffExpr{Float64,JuMP.Variable} not allowed to be used in NL constraints?

Fdry vector involves quite some linear algebra that I skipped (I just showed the last result), and spelling it out in scalar form will be tedious work. I am sure I am missing something.

Thanks,

Stan