You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below causes an error. For some reason, the way the array dx is constructed causes a problem with:
log_x[i] = piecewiselinear(m,x[i],dx[i],log,method=method)
julia monroe4.jl
Capacity available on '10.60.129.38' - connecting...
Established 256-bit AES encrypted connection
Method: Logarithmic
ERROR: LoadError: Invalid coefficient -Inf on variable λ_1[1]
Stacktrace:
[1] assert_isfinite(::JuMP.GenericAffExpr{Float64,JuMP.Variable}) at /Users/a598124/.julia/v0.6/JuMP/src/affexpr.jl:95
[2] prepConstrMatrix(::JuMP.Model) at /Users/a598124/.julia/v0.6/JuMP/src/solvers.jl:554
[3] #build#119(::Bool, ::Bool, ::JuMP.ProblemTraits, ::Function, ::JuMP.Model) at /Users/a598124/.julia/v0.6/JuMP/src/solvers.jl:358
[4] (::JuMP.#kw##build)(::Array{Any,1}, ::JuMP.#build, ::JuMP.Model) at ./:0
[5] #solve#116(::Bool, ::Bool, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at /Users/a598124/.julia/v0.6/JuMP/src/solvers.jl:168
[6] macro expansion at /Users/a598124/juliaCode/boxPacking1/monroe4.jl:71 [inlined]
[7] anonymous at ./:?
[8] include_from_node1(::String) at ./loading.jl:576
[9] include(::String) at ./sysimg.jl:14
[10] process_options(::Base.JLOptions) at ./client.jl:305
[11] _start() at ./client.jl:371
while loading /Users/a598124/juliaCode/boxPacking1/monroe4.jl, in expression starting on line 41
using PiecewiseLinearOpt
using JuMP, Cbc, Gurobi, CPLEX
Minimize volume = xyz by minimizing log(xyz) = log(x)+log(y)+log(z) through piecewise univariate linearization of log(x), log(y), and log(z).
then the above code works properly. P.S. Is there a way to properly attach or paste Julia code into this issues editor? P.S.S. How do you get d^x and d^y (with the superscripts) to show up in the Julia code text editor, as in your example test programs?
The code below causes an error. For some reason, the way the array dx is constructed causes a problem with:
log_x[i] = piecewiselinear(m,x[i],dx[i],log,method=method)
julia monroe4.jl
Capacity available on '10.60.129.38' - connecting...
Established 256-bit AES encrypted connection
Method: Logarithmic
ERROR: LoadError: Invalid coefficient -Inf on variable λ_1[1]
Stacktrace:
[1] assert_isfinite(::JuMP.GenericAffExpr{Float64,JuMP.Variable}) at /Users/a598124/.julia/v0.6/JuMP/src/affexpr.jl:95
[2] prepConstrMatrix(::JuMP.Model) at /Users/a598124/.julia/v0.6/JuMP/src/solvers.jl:554
[3] #build#119(::Bool, ::Bool, ::JuMP.ProblemTraits, ::Function, ::JuMP.Model) at /Users/a598124/.julia/v0.6/JuMP/src/solvers.jl:358
[4] (::JuMP.#kw##build)(::Array{Any,1}, ::JuMP.#build, ::JuMP.Model) at ./:0
[5] #solve#116(::Bool, ::Bool, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at /Users/a598124/.julia/v0.6/JuMP/src/solvers.jl:168
[6] macro expansion at /Users/a598124/juliaCode/boxPacking1/monroe4.jl:71 [inlined]
[7] anonymous at ./:?
[8] include_from_node1(::String) at ./loading.jl:576
[9] include(::String) at ./sysimg.jl:14
[10] process_options(::Base.JLOptions) at ./client.jl:305
[11] _start() at ./client.jl:371
while loading /Users/a598124/juliaCode/boxPacking1/monroe4.jl, in expression starting on line 41
using PiecewiseLinearOpt
using JuMP, Cbc, Gurobi, CPLEX
Minimize volume = xyz by minimizing log(xyz) = log(x)+log(y)+log(z) through piecewise univariate linearization of log(x), log(y), and log(z).
#const solver = CbcSolver()
env = Gurobi.Env()
const solver = GurobiSolver(env,Threads=4)
#const solver = CplexSolver();
#methods_1D = (:CC,:MC,:Logarithmic,:LogarithmicIB,:ZigZag,:ZigZagInteger,:SOS2,:GeneralizedCelaya,:SymmetricCelaya,:Incremental,:DisaggLogarithmic)
#methods_1D = (:CC,:MC,:Logarithmic,:ZigZag,:ZigZagInteger,:SOS2,:GeneralizedCelaya,:SymmetricCelaya,:Incremental)
methods_1D = (:Logarithmic,:ZigZag,:ZigZagInteger)
#methods_1D = (:SOS2,:GeneralizedCelaya,:SymmetricCelaya,:Incremental)
dx2 = Array{Array{Float64}}(3)
dx2[1] = linspace(5,2π,8)
dx2[2] = linspace(4,2π,7)
dx2[3] = linspace(3,2π,9)
lb = Array{Float64}(3)
lb[1] = 0
lb[2] = 0
lb[3] = 0
ub = Array{Float64}(3)
ub[1] = 20
ub[2] = 20
ub[3] = 20
num_seg = Array{UInt8}(3)
num_seg[1] = 32
num_seg[2] = 32
num_seg[3] = 32
dx = Array{Array{Float64}}(3)
for i=1:3
dx[i] = linspace(lb[i],ub[i],num_seg[i])
#dx[i] = linspace(lb[i],9,num_seg[i])
#dx[i] = linspace(3,2π,9)
end
for method in methods_1D
println("Method: $method")
end
The text was updated successfully, but these errors were encountered: