Hi All,
i want to create @NL expreesion on fly in JuMP. I am getting the below error.
model = Model()
@variable(model, x[1:3])
@constraint(model, c2, x[1] + 2 * x[3] >= 2)
@constraint(model, c4, 4 <= 2 * x[2] <= 5)
@variable(model,x1[h in 1:5, i in 1:1, j in 1:2, k in 1:1,p in 1:2])
xx=[];
push!(xx,"(196.3769 + 0.00003780828 *x1[h,i,j,k,p] + (3.682656*(10)^-10) * (x1[h,i,j,k,p])^2)")
x
#zz=@NLexpression(model,sum(x1[h,i,j,k,p] *
#(196.3769 + 0.00003780828 *x1[h,i,j,k,p] + (3.682656*(10)^-10) * (x1[h,i,j,k,p])^2) for h in 1:1, i in 1:1 ,j in 1:2,k in 1:1, p in 1:2)
zz=@NLexpression(model,sum(x1[h,i,j,k,p] *xx[1] for h in 1:1, i in 1:1 ,j in 1:2,k in 1:1, p in 1:2)
Unexpected object (196.3769 + 0.00003780828 *x1[h,i,j,k,p] + (3.682656*(10)^-10) * (x1[h,i,j,k,p])^2) (of type String in nonlinear expression.
error(::String) at error.jl:33
_parse_NL_expr_runtime(::Model, ::String, ::Array{JuMP._Derivatives.NodeData,1}, ::Int64, ::Array{Float64,1}) at parse_nlp.jl:223
macro expansion at parse_nlp.jl:247 [inlined]