What do you expect to happen? C1[1:z] is a vector, y[i, j] + y1[i, j] is a scalar. You can’t sum vectors like this, because cause it is essentially (ignoring the scalar) C1[1:1] + C1[1:2] + C1[1:3] + ....
It might be helpful if you can provide the mathematical form of the objective function you are trying to code.
For your objective, you have some parentheses in the wrong place:
# Wrong
@objective(Model1,Min,sum(C1[z]*(y[i,j]+y1[i,j])+C2[z]*y1[i,j]) for z ∈ 1:i)
# Right
@objective(Model1,Min,sum(C1[z]*(y[i,j]+y1[i,j])+C2[z]*y1[i,j] for z ∈ 1:i))
Thanks for the help.
Now the following error has appeared after compiling the objective function
BoundsError: attempt to access 5-element Array{Int64,1} at index [6]
getindex(::Array{Int64,1}, ::Int64) at array.jl:731
top-level scope at macros.jl:978
You need to properly define the linear program you are trying to build.
What are the sets?
What are the decision variables? (What are they indexed over?)
What is the objective function? (In math, with the proper sums and indices.)
What are the sets? i = 80, j = 18, z = 5
What are the decision variables? (What are they indexed on?) The variables must be indexed to "i" which are the activities and "j" time period. The variables y[i,j] and y1[i,j]
What is the objective function? (In mathematics, with the appropriate sums and indices.)
11[5]*(y[80,18]+y1[80,18])+50[5]*y1[80,18]
@objective(Model1,Min,sum(C1[z]*(y[i,j]+y1[i,j])+C2[z]*y1[i,j] for z ∈ 1:i))