Hi, I’m working with JuMP and I want to modify expressions in my model within a while or for loop, and I have problems using the “input” command. When I modify a Julia variable, which is a coefficient in a JuMP NLexpression and de code reload the JuMP model, the error appears. For example:
for i=1:2
model = Model(with_optimizer(Ipopt.Optimizer))
variable(model, empleo, start = 0.1)
…
@NLexpression(model, er1, -empleo + c1_0 + c1_1 * out + c1_2 * stock_k + c1_3 *((1+wage)/(1+domP) -1) + c1_4 * empleo0)
…
@NLobjective(model, Min, er1^2 +er2^2)
optimize!(model)
println(“El Empleo creció:”,value(empleo))
c1_1= parse(Float64, input2("si desea modificar la inversión pública ingrese la tasa de variación y presione enter: "))
end
c1_1 is a coefficient in the first NLexpression
thanks in advance!