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
2
votes
3 answers

How to extract optimization problem matrices A,b,c using JuMP in Julia

I create an optimization model in Julia-JuMP using the symbolic variables and constraints e.g. below using JuMP using CPLEX # model Mod = Model(CPLEX.Optimizer) # sets I = 1:2; # Variables x = @variable( Mod , [I] , base_name = "x" ) y =…
Manos
  • 85
  • 5
2
votes
1 answer

How to write a JuMP constraint into a text file?

I have searched but didn't find an answer. I have read a MPS file into a JuMP model. Now I would like to write a subset of constraints into a text file for further analysis. I know how to write a JuMP model into a LP or MPS file. But here I just…
Feng
  • 105
  • 5
2
votes
1 answer

How to define a JuMP expression conditional on index value

I am trying to define a @NLexpression in JuMP that has different specifications at different indices. In the below example, I want the expression y[j,k] to be defined as 1/(x[j] - x[k]) when j != k and take some other value when j == k. I can…
hilberts_drinking_problem
  • 11,322
  • 3
  • 22
  • 51
2
votes
1 answer

Julia JuMP - array index which is an index of another array

I have to solve a problem with permutations. The function takes vector a with n elements as a parameter. I declare b as @variable - there should be the permutation 1:n that gives the best result after finding the solution of a problem. The error…
jakub1998
  • 400
  • 2
  • 13
2
votes
1 answer

AMPL to JuMP (Julia)

I need to transform a AMPL code to JuMP. param f; set R := 1..N; set R_OK := 1..M; set V := 1..N; param tMax; set T := 1..tMax; var primary{R,V}, binary; var SendPrepReq{T,R,V}, binary; "param f" would be an int. The varibles I know how to do.…
2
votes
0 answers

JuMP 0.20 - How to get a relaxed solution using !optimize?

In JuMP 0.18 we could do solve(model, relaxation=true). There isn't this option in !optimize, so how can I get a relaxed solution?
Henrique Andrade
  • 855
  • 1
  • 12
  • 25
2
votes
1 answer

UndefVarError in Julia

Very new to Julia and trying to work through some code. I keep getting this error: "ERROR: LoadError: LoadError: UndefVarError: @defVar not defined". The start of the code is below where I define the @defVar. Julia Version 1.1.1 (2019-05-16). Here…
2
votes
2 answers

How to sum for all in Julia/JuMP v 1.10

I saw an outdated answer in the following thread (How to do "for all" in sum notation in Julia/JuMP) which is 3 years old unfortunately, but it's exactly what I want. However the code fails due to a number of syntax errors as the sum() function has…
2
votes
1 answer

How can I use universal and existential quantification in julia?

I want to code domination definition in Julia. x dom y. x , y are 2 vectors. b=all(x<=y) && any(x
Soma
  • 743
  • 6
  • 19
2
votes
1 answer

Is there any function such as repmat for struct in julia?

would you please help me. I want to produce a population of struct in Julia.In matalab,we can use repmat for a structure. but in Julia it is impossible. is there any function like repmat in Julia? for example: npop=20; struct individual …
Soma
  • 743
  • 6
  • 19
2
votes
2 answers

Range for continuos distribution in Julia

I am trying to calculate the density function of a continuos random variable in range in Julia using Distributions, but I am not able to define the range. I used Truncator constructor to construct the distribution, but I have no idea how to define…
2
votes
2 answers

Julia Key Error when accessing a value in dictionary

When trying to run this code Julia keeps giving me the error message "KeyError: key 18=>63 not found" anytime I try to access demand[i]. It seems that this error happens every time the element in dem is larger than 50. using JuMP, Clp hours =…
mmcook
  • 23
  • 1
  • 3
2
votes
0 answers

Modifying code of package downloaded via JuliaPro

I have an issue with my JuliaPro installation: I want to add a function in the Cbc C interface, but all I have in my JuliaPro installation directories are include files and dynamic libraries. Can I keep my JuliaPro installation as is and still have…
A. Toullat
  • 33
  • 4
2
votes
0 answers

Juliaopt JuMP CbcSolver how to print progress

I coding in julia using JuMP of Juliopt. I would like to know how to print the solve progress using CbcSolver? I already used the log level parameter: m = Model(solver = CbcSolver(log=1)) it works and you can choose between 0 to 3, higher more…
2
votes
3 answers

Julia's equivalent of MATLAB's inpolygon()

Is there such function in Julia? Desperately trying to migrate to Julia from MATLAB, but still finding myself dependent on it...
aberdysh
  • 1,634
  • 2
  • 13
  • 34