Objective function error in a robust model

I need to put this objective function in Julia. Can someone help me?
F.O

I started doing this, but I still couldn’t compile the objective function

using JuMP, JuMPeR, DataFrames, MathOptInterface, GLPKMathProgInterface
ModelRobust = RobustModel(solver = GLPKSolverLP())

a = 1:4
t = 1:4
w = 1:2

A = a 
T = t 
W = w 

#Parameter
QD = [878 0; 0 1131; 100 0; 0 200]

@variable(ModelRobust,x[A,T]<=0)
@variable(ModelRobust,k[A,T]<=0)
@objective(ModelRobust,Max,sum(QD[a,w]*x[a,t]*k[a,t] for a in A))

Hi!

I have never used JuMP, but if I am not missing something, the variable w is not defined in that sum when you are declaring the objective function. Is that correct?

1 Like

This is similar to a number of your previous questions.

Your (math) objective function doesn’t make sense because w and t are not defined.

In code, you need your summation to loop over all the indices, something like for a in A, w in W, t in T.

3 Likes