# =============================================================================
# Max volume subject to superficial Area
#  ___
# |___|
#
# Luis Lopez Diaz - llopeza@uninorte.edu.co
# =============================================================================
using JuMP, Ipopt, Gurobi;
# Input data
As = 73;                                        # Max superficial area
X = 8;                                          # Max width
Y = 20;                                         # Max lenght
ml = Model(with_optimizer(Ipopt.Optimizer));    # Optimizer
@variable(ml, 0 ≤ x);                           # x dimension
@variable(ml, 0 ≤ y);                           # y dimension
@variable(ml, 0 ≤ z);                           # z dimension
@NLconstraint(ml, 2*(x*y + x*z + y*z) == As);   # constraint
@NLobjective(ml, Max, x*y*z);                   # Objetive function
optimize!(ml);                                  # Optimize
println("Length: ", value(x))
println("Width : ", value(y))
println("Height: ", value(z))
