Okay I think I’m getting there, but this still isn’t an MWE which means it’s still unnecessarily hard to answer this question, and involves some guesswork on my part. It originally seemed like you’re unhappy with the format in which JuMP prints its models, but now it looks rather like you have an issue in how you’re constructing your constraints.
Consider the following (note that this is an MWE, so you can try it out yourself by copy-pasting my code below!):
using JuMP, GLPK
model = Model(with_optimizer(GLPK.Optimizer))
@variable(model, Y[1:2] >= 0)
@objective(model, Max, 12*Y[1] + 60*Y[2])
@constraint(model, 0.1*Y[1] <= 15.0)
@constraint(model, 0.4*Y[2] <= 15.0)
Which yields:
julia> print(model)
Max 12 Y[1] + 60 Y[2]
Subject to
Y[1] >= 0.0
Y[2] >= 0.0
0.1 Y[1] <= 15.0
0.4 Y[2] <= 15.0
However, if we do:
model2 = Model(with_optimizer(GLPK.Optimizer))
@variable(model2, Y[1:2] >= 0)
@objective(model2, Max, 12*Y[1] + 60*Y[2])
@constraint(model2, 0.1*Y[1] + 0.4*Y[2] <= 15.0)
we get:
julia> print(model2)
Max 12 Y[1] + 60 Y[2]
Subject to
Y[1] >= 0.0
Y[2] >= 0.0
0.1 Y[1] + 0.4 Y[2] <= 15.0
The output looks like you’re desired output (I’ve reduced the number of constraints for brevity), however note that the difference in outputs is because of different constraints - your original model restricts 0.1*Y[1]
and 0.4*Y[2]
to each be smaller or equal to 15, while your desired output only restricts the sum of both to be below 15. You might want to go through the JuMP documentation in detail to ensure that you understand how constraints are specified.
Now the guesswork part: you asked some questions previously about errors you got when trying to define constraints in a loop, which is probably how you ended up with a bunch of separate univariate constraints that you didn’t actually want. This is the whole point of the MWE: if you had provided a simple code snippet saying “here’s the loop I run to define constraints, here’s the resulting model and here’s what I would have wanted my model to look like”, you probably would have had answers to this as well as your last two (1, 2) questions within 5 minutes.