Hello. I was wondering if someone could clarify a question for me. I have a problem when it comes to modeling in JuMP. I have a MINLP problem with the following objective function and constraints.
@NLobjective(model,Min,sum(sum((c_00[i]+c_10[i]*x[i,t] + c_01[i]*n[i,t]+ c_20[i]*(x[i,t])^2 +c_11[i]*x[i,t]*n[i,t] + c_02[i]*(n[i,t])^2) +y[i,t] for i=1:nus)+μ*(z[t])^2 for t=1:nd))
@variable(model,x[i=1:nus,t=1:nd]≥0)
@variable(model, n[i=1:nus, t=0:nd],Int)
for i=1:nus
fix(n[i, 0], 3)
end
@variable(model,y[i=1:nus,t=1:nd]≥0,Int)
@variable(model,z[t=1:nd]≥0)
@constraint(model,restri[i=1:nus,t=1:nd],y[i,t]≥n[i,t]-n[i,t-1]) (1)
@constraint(model,restric[i=1:nus,t=1:nd],y[i,t]≥n[i,t-1]-n[i,t]) (2)
@constraint(model,lim_nummaq[i=1:nus,t=1:nd],nmin[i,t]≤n[i,t]≤nmax[i,t]) (3)
@constraint(model,lim_geracao[i=1:nus,t=1:nd],xmin[i,t].*n[i,t]≤x[i,t]≤xmax[i,t].*n[i,t]) (4)
@constraint(model,demanda[t=1:nd],sum(x[i,t] for i=1:nus)+z[t]==d[t]) (5)
@constraint(model,meta_geracao[i=1:nus],sum(x[i,t] for t=1:nd)==metas[i]*24) (6)
The restriction (4) is dependent on the variable n [i, t], with xmin and xmax being lower and upper bounds respectively and when I run the model I get the following message: n[i, t] expected to be a number. How do I write this constraint in the correct way?xmin and xmax must depend on n[i,t].