Questions tagged [julia-jump]

JuMP is a domain-specific modeling language for mathematical programming embedded in the Julia language.

JuMP is a domain-specific modeling language for mathematical programming embedded in the Julia language.

https://github.com/JuliaOpt/JuMP.jl

362 questions
0
votes
0 answers

How can I use a set with diffrent members as indexs?

Pleas help me. I want to use a set by not order elements as indexes of some variables. for example I have s=[2,3] @constraint(ILRP,c7[ k=1:2,t=1:4],sum(x[i,j,k,t] for i=[2,3], j=[2,3])<=size(s,1)-1)' for index I ,j I want to use [2,3] as…
Soma
  • 743
  • 6
  • 19
0
votes
1 answer

Can I debug inside a for or if in julia?

would you please help me? if I have a code including some loops and IFs, how can I debug inside FOR or IF, line by line. for example I can use shift+enter for every line. but when it is used for a For all loop will run. Is there any facility to…
Soma
  • 743
  • 6
  • 19
0
votes
1 answer

How can I calculate time of my main code?

I have a code which is included some functions. for every functions I use CPUTime. but in main model how can I calculate time. Please help me. for example using CPUTime function Sminf2(ZB,ZT) model=CreateModel(); …
Soma
  • 743
  • 6
  • 19
0
votes
1 answer

How can I sort this List in julia?

Please help me that how can I sort this List by first element? List = ([-180.0; -67.5], 0), ([270.0; -570.0], 0), ([180.0, -510.0], 1), ([27.15, -288.75], 1), ([-36.0, -244.5], 1) sortList = ([-180.0; -67.5], 0), ([-36.0, -244.5], 1), ([27.15,…
Soma
  • 743
  • 6
  • 19
0
votes
0 answers

How can I use logical condition for this array?

I need to compare 2 elements of a array as following V=([-180.0 -117.0; -67.5 -111.0], [-117.0 -36.0; -111.0 -244.5]) when I use the following condition if (V[1][:,2] != V[2][:,1]) It gets true. But V[1][:,2] = [-117.0;-111.0] and V[2][:,1] =…
Soma
  • 743
  • 6
  • 19
0
votes
0 answers

JuMP & Julia - Vector optimization

Trying to work with JuMP and Julia with Gurobi solver I would like to minimize a vector of variable, but can't figure it out how to formulize it. I have where m is my model name and size_teachers an integer: @variable(m,…
Celi28
  • 101
  • 13
0
votes
2 answers

Floatmax not defined is stopping me from solving a MIP

Basically, I have an MIP completely defined, everything is working, until I attempt to solve via GLPK, when it gives me the following error: UndefVarError: floatmax not defined I tried defining floatmax as anything, but to no avail. I'm completely…
0
votes
0 answers

how can I use return values from a function?

I use some functions in my main code which they return some values (scalar). These values will compare in main code. But when I run the code it has this Error: "ERROR: MethodError: no method matching isless(::Array{Float64,1},…
Soma
  • 743
  • 6
  • 19
0
votes
1 answer

JuMP variable declaration: MethodError

I'm following the quickstart guide on JuMP. My julia version is 0.7, the code is this: using JuMP m = Model() l = zeros(10) u = ones(10) #@variable(m, x) #@variable(m, 0 <= x[1:10] <= 1) @variable(m, l<=x[1:10]<=u) The first two variable macros…
lhk
  • 27,458
  • 30
  • 122
  • 201
0
votes
1 answer

Running JuMP example

I am trying to run this example on a fresh julia installation (Version 1.0.2 (2018-11-08)): https://github.com/JuliaOpt/JuMP.jl/blob/master/examples/basic.jl But I always get this error. julia> using JuMP, Clp julia> m =…
Stein
  • 3,179
  • 5
  • 27
  • 51
0
votes
1 answer

'invalid NLopt arguments' in JuMP with a basic example.

I am new to JuMP, Julia. I am running a very basic example and I get a weird error. using JuMP using NLopt m1 = Model(solver=NLoptSolver(algorithm=:LD_MMA)) @variable(m1, x, start = 0.0) @variable(m1, y, start = 0.0) @NLobjective(m1, Min,…
chupa_kabra
  • 465
  • 2
  • 5
  • 15
0
votes
1 answer

Can't `add JuMP` in Julia

I'm attempting to add JuMP, but it's returning an error. (v1.0) pkg> add JuMP Resolving package versions... ERROR: Unsatisfiable requirements detected for package JuMP [4076af6c]: JuMP [4076af6c] log: ├─possible versions are: [0.1.1-0.1.2,…
natemcintosh
  • 730
  • 6
  • 16
0
votes
0 answers

quadratic equality constraint: Julia+Jump+Gurobi

i'm a newbie to julia and struggling how to handle quadratic equality constraints when using gurobi as the main solver. Can u may take a quick look at the following listing? I alread know that such structures are impossible to solve by using gurobi,…
PTueller
  • 31
  • 2
  • 7
0
votes
1 answer

Minimize the maximum in Julia JuMP

So I've combed through the various websites pertaining to Julia JuMP and using functions as arguments to @objective or @NLobjective, but let me try to state my problem. I'm certain that I'm doing something silly, and that this is a quick fix. Here…
0
votes
1 answer

Element-wise multiplication in JuMP environment

I'm trying to implement the following constraint in a JuMP environment: @constraint(m, ((c*x) + (p*o)) + (r.*z) - d .== g') Unfortunately, I get the following error ERROR: MethodError: no method matching append But trying the element-wise…
Marco Repetto
  • 336
  • 2
  • 15