# Optimization (Mathematical)

**URL:** https://discourse.julialang.org/c/domain/opt/13.md?page=90

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 91

---

## [Couenne with JuMP: can't evaluate pow"(0,1.5)](https://discourse.julialang.org/t/couenne-with-jump-cant-evaluate-pow-0-1-5/48734)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 3\
**Last updated:** [October 22, 2020, 9:15am UTC](https://discourse.julialang.org/t/couenne-with-jump-cant-evaluate-pow-0-1-5/48734 "2020-10-22T09:15:52Z")

</div>

I am playing with Couenne for NLP optimization problems with JuMP and AmplNLWriter. After setting up these packages, I tried the toy example in Couenne’s documentation (section 5). For convenience, the problem is posted …

---

## [Clp: problem to build the package](https://discourse.julialang.org/t/clp-problem-to-build-the-package/48763)

<div class="topic-metadata">

**Author:** [@Luca](https://discourse.julialang.org/u/Luca)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 6:07pm UTC](https://discourse.julialang.org/t/clp-problem-to-build-the-package/48763 "2020-10-21T18:07:09Z")

</div>

Dear all, I have installed Clp, but when I try to build it, julia reports: julia\> Pkg.build(“Clp”) Building CodecZlib ─→ ~/.julia/packages/CodecZlib/5t9zO/deps/build.log Building MbedTLS ───→ ~/.julia/packages/MbedTL…

---

## [\[ANN\] Upcoming breaking changes to CPLEX.jl and Gurobi.jl](https://discourse.julialang.org/t/ann-upcoming-breaking-changes-to-cplex-jl-and-gurobi-jl/47814)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 6\
**Last updated:** [October 21, 2020, 1:04am UTC](https://discourse.julialang.org/t/ann-upcoming-breaking-changes-to-cplex-jl-and-gurobi-jl/47814 "2020-10-21T01:04:47Z")

</div>

Update: 20 October 2020: New versions of CPLEX.jl and Gurobi.jl are tagged. tl;dr: CPLEX.jl and Gurobi.jl will have major breaking changes in the next latest release. If you just use CPLEX.Optimizer() or Gurobi.Optimize…

---

## [QP returns NUMERICAL\_ERROR status](https://discourse.julialang.org/t/qp-returns-numerical-error-status/48630)

<div class="topic-metadata">

**Author:** [@arkanver](https://discourse.julialang.org/u/arkanver)\
**Replies:** 3\
**Last updated:** [October 19, 2020, 5:38pm UTC](https://discourse.julialang.org/t/qp-returns-numerical-error-status/48630 "2020-10-19T17:38:37Z")

</div>

Hello all, I have been trying to solve a quadratic problem with linear and box constraints. My objective function is convex. In most cases the problem gets solved fine (OPTIMAL status), but sometimes on larger examples …

---

## [Optimal with IPOPTH, Infeasible with Gurobi](https://discourse.julialang.org/t/optimal-with-ipopth-infeasible-with-gurobi/48523)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 4\
**Last updated:** [October 19, 2020, 12:34am UTC](https://discourse.julialang.org/t/optimal-with-ipopth-infeasible-with-gurobi/48523 "2020-10-19T00:34:37Z")

</div>

Hi, I’m working on a bilevel problem that is converted into an equivalent non-convex QCQP by applying strong duality to the lower-level problem (LP). My code returns a (local) optimal solution with Ipopt solver (w/ ma86…

---

## [BARON ERROR: can't open nl file](https://discourse.julialang.org/t/baron-error-cant-open-nl-file/48456)

<div class="topic-metadata">

**Author:** [@tpmp](https://discourse.julialang.org/u/tpmp)\
**Replies:** 1\
**Last updated:** [October 18, 2020, 8:40pm UTC](https://discourse.julialang.org/t/baron-error-cant-open-nl-file/48456 "2020-10-18T20:40:49Z")

</div>

I was trying to use BARON to solve some problems. JuMP.jl version: 0.21.5 BARON.jl version: 0.6.5 When I run my program, the following error occurs: C:\\Program Files\\ampl\_mswin64\\baron.exe: can't open C:\\Users\\Lujia\\…

---

## [Getting "MethodError: no method matching Model()" when initializing models on JuMP](https://discourse.julialang.org/t/getting-methoderror-no-method-matching-model-when-initializing-models-on-jump/43647)

<div class="topic-metadata">

**Author:** [@hassanis](https://discourse.julialang.org/u/hassanis)\
**Replies:** 6\
**Last updated:** [October 18, 2020, 6:43pm UTC](https://discourse.julialang.org/t/getting-methoderror-no-method-matching-model-when-initializing-models-on-jump/43647 "2020-10-18T18:43:38Z")

</div>

I’m using JuMP and had several models that were running fine. Now, whenever I try to initialize a model (for example Model(Gurobi.Optimizer)), I get the error: MethodError: no method matching Model(::Type{Gurobi.Optimiz…

---

## [Annoying JuMP way to deal with shadow prices](https://discourse.julialang.org/t/annoying-jump-way-to-deal-with-shadow-prices/48420)

<div class="topic-metadata">

**Author:** [@jovansam](https://discourse.julialang.org/u/jovansam)\
**Replies:** 2\
**Last updated:** [October 16, 2020, 10:44am UTC](https://discourse.julialang.org/t/annoying-jump-way-to-deal-with-shadow-prices/48420 "2020-10-16T10:44:10Z")

</div>

JuMP has annoying shadow price behavior. First raised here, the issue also matters in the presence of non-linear models/constraints in JuMP. The behavior is not there in GAMS. My model is an economic growth model. Took …

---

## [Problem with CPLEX variable types using JuMP](https://discourse.julialang.org/t/problem-with-cplex-variable-types-using-jump/48415)

<div class="topic-metadata">

**Author:** [@arkanver](https://discourse.julialang.org/u/arkanver)\
**Replies:** 5\
**Last updated:** [October 15, 2020, 9:02pm UTC](https://discourse.julialang.org/t/problem-with-cplex-variable-types-using-jump/48415 "2020-10-15T21:02:30Z")

</div>

Hello all, I am trying to solve a quadratic optimization problem using CPLEX through JuMP. It is a continuous relaxation, hence all of my variables are continuous (with box constraints). After dealing with convexity is…

---

## [SCIP is giving me solution, but CPLEX v12.9 is not](https://discourse.julialang.org/t/scip-is-giving-me-solution-but-cplex-v12-9-is-not/48216)

<div class="topic-metadata">

**Author:** [@sogrbilja](https://discourse.julialang.org/u/sogrbilja)\
**Replies:** 8\
**Last updated:** [October 15, 2020, 9:05pm UTC](https://discourse.julialang.org/t/scip-is-giving-me-solution-but-cplex-v12-9-is-not/48216 "2020-10-15T21:05:37Z")

</div>

I understand now that you will say that you can’t help me without providing the whole code to test, but can you at least point me is there anything that I can check for ie: some logging mechanism, debug, the default sett…

---

## [Efficiently extracting rows from VectorAffineFunction structs in MOI](https://discourse.julialang.org/t/efficiently-extracting-rows-from-vectoraffinefunction-structs-in-moi/48408)

<div class="topic-metadata">

**Author:** [@asa](https://discourse.julialang.org/u/asa)\
**Replies:** 3\
**Last updated:** [October 15, 2020, 8:59pm UTC](https://discourse.julialang.org/t/efficiently-extracting-rows-from-vectoraffinefunction-structs-in-moi/48408 "2020-10-15T20:59:33Z")

</div>

The MOI.VectorAffineFunction type is used to define linear vector valued functions in MathOptInterface. I am trying to extract a row of such an object itself with type VectorAffineFunction, for example with f = MOI.Vect…

---

## [Result\_dual vs getdual. signs are the opposite](https://discourse.julialang.org/t/result-dual-vs-getdual-signs-are-the-opposite/16355)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 12\
**Last updated:** [October 15, 2020, 1:48pm UTC](https://discourse.julialang.org/t/result-dual-vs-getdual-signs-are-the-opposite/16355 "2020-10-15T13:48:46Z")

</div>

JuMP v0.19: using JuMP, Clp m = Model(with\_optimizer(Clp.Optimizer)) @variable(m, y\>=0) @objective(m, Max, y) @constraint(m, con, y \<= 3) JuMP.optimize!(m) pi\_val = JuMP.result\_dual(con) @show pi\_val I obtained pi\_val …

---

## [How to declare a binary variable in a robust model?](https://discourse.julialang.org/t/how-to-declare-a-binary-variable-in-a-robust-model/48367)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 2\
**Last updated:** [October 14, 2020, 8:35pm UTC](https://discourse.julialang.org/t/how-to-declare-a-binary-variable-in-a-robust-model/48367 "2020-10-14T20:35:36Z")

</div>

Why is it that whenever I try to compile a binary variable, Julia returns this error to me? In @variable(ModeloD,b\[A\],lower\_bound = 0,Bin): Unrecognized keyword argument lower\_bound Is there a different way of putting…

---

## [UndefVarError: t not defined](https://discourse.julialang.org/t/undefvarerror-t-not-defined/47987)

<div class="topic-metadata">

**Author:** [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)\
**Replies:** 2\
**Last updated:** [October 13, 2020, 10:01pm UTC](https://discourse.julialang.org/t/undefvarerror-t-not-defined/47987 "2020-10-13T22:01:12Z")

</div>

function DR\_Model\_MPEC(J,T,W,PS\_tw,D\_jtw,delta\_jcmax,C\_t,sigma\_w,M\_S,M\_P,M\_C,M\_T) m = Model(Gurobi.Optimizer) # Variables definition ################################# @variables(m, begin De…

---

## [A question about SCIP in Julia](https://discourse.julialang.org/t/a-question-about-scip-in-julia/35842)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 8\
**Last updated:** [October 13, 2020, 8:28am UTC](https://discourse.julialang.org/t/a-question-about-scip-in-julia/35842 "2020-10-13T08:28:41Z")

</div>

Error: Error building \`SCIP\`: │ ERROR: LoadError: Unable to locate SCIP installation. │ Tried: │ scip.dll │ Note that this must be downloaded separately from scip.zib.de. │ Please set the environment variable SCI…

---

## [JuMP Container Benchmark](https://discourse.julialang.org/t/jump-container-benchmark/47844)

<div class="topic-metadata">

**Author:** [@SonntagK](https://discourse.julialang.org/u/SonntagK)\
**Replies:** 3\
**Last updated:** [October 9, 2020, 1:41pm UTC](https://discourse.julialang.org/t/jump-container-benchmark/47844 "2020-10-09T13:41:29Z")

</div>

Hello, we are Julia beginners. We want to use Julia for solving linear programs using JuMP and some external solver. For very large LP problems the model generation time can be significant. Since JuMP covers many differ…

---

## [Documentation of Clp.jl](https://discourse.julialang.org/t/documentation-of-clp-jl/48005)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 11:06pm UTC](https://discourse.julialang.org/t/documentation-of-clp-jl/48005 "2020-10-08T23:06:28Z")

</div>

The documentation of the Julia wapper to the Clp solver is a bit out of date. Under options, “SolveType” is still listed but it looks like it has been replaced by “Algorithm”: https://github.com/jump-dev/Clp.jl Options …

---

## [Using Z3.jl](https://discourse.julialang.org/t/using-z3-jl/48006)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 10:25pm UTC](https://discourse.julialang.org/t/using-z3-jl/48006 "2020-10-08T22:25:13Z")

</div>

I am trying to use atleast and atmost to set up constraints but not sure how these work (type of the first argument). The method signature is # 1 method for generic function "atleast": \[1\] atleast(arg1::Union{CxxWrap.…

---

## [ERROR: type DataType has no field optimizer\_constructor](https://discourse.julialang.org/t/error-type-datatype-has-no-field-optimizer-constructor/47920)

<div class="topic-metadata">

**Author:** [@umbe](https://discourse.julialang.org/u/umbe)\
**Replies:** 3\
**Last updated:** [October 8, 2020, 2:54pm UTC](https://discourse.julialang.org/t/error-type-datatype-has-no-field-optimizer-constructor/47920 "2020-10-08T14:54:40Z")

</div>

Hi everyone, I’m having a problem with JuMP/Juniper. For first I create an optimization model m = Model(Juniper.Optimizer) set\_optimizer\_attribute(m, "nl\_solver", Ipopt.Optimizer) set\_optimizer\_attribute(m…

---

## [Variables declaration in JuliaPro 1.5.2-1](https://discourse.julialang.org/t/variables-declaration-in-juliapro-1-5-2-1/47802)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 10\
**Last updated:** [October 6, 2020, 7:58pm UTC](https://discourse.julialang.org/t/variables-declaration-in-juliapro-1-5-2-1/47802 "2020-10-06T19:58:44Z")

</div>

When compiling @variabel on my model, julia displays the following message Expected ModeloDeterministico to be a JuMP model, but it has type DataType error(::String, ::Type{T} where T) at error.jl:42 validmodel(::Type{T…

---

## [What is defination of dims](https://discourse.julialang.org/t/what-is-defination-of-dims/47878)

<div class="topic-metadata">

**Author:** [@Batuhan\_Guvenc](https://discourse.julialang.org/u/Batuhan_Guvenc)\
**Replies:** 1\
**Last updated:** [October 6, 2020, 6:39pm UTC](https://discourse.julialang.org/t/what-is-defination-of-dims/47878 "2020-10-06T18:39:14Z")

</div>

search func which gives sum of every matris rows in a list for matris like this 1 0 1 0 1 0 output \[2,1\] i fins sum(list,dims=2) func but i dont want use this for examle i use " +(list…) "instead of "sum(list) "i…

---

## [Checking membership in a MathOptInterface Set](https://discourse.julialang.org/t/checking-membership-in-a-mathoptinterface-set/47642)

<div class="topic-metadata">

**Author:** [@1ozturkbe](https://discourse.julialang.org/u/1ozturkbe)\
**Replies:** 5\
**Last updated:** [October 5, 2020, 3:13pm UTC](https://discourse.julialang.org/t/checking-membership-in-a-mathoptinterface-set/47642 "2020-10-05T15:13:59Z")

</div>

Hello folks, I hope this is an easy question, but unfortunately some of the internals of MathOptInterface and JuMP are opaque. constraint\_object(constraint::ConstraintRef) operation in JuMP returns a ScalarConstraint, w…

---

## [Run time constraints in optimisation](https://discourse.julialang.org/t/run-time-constraints-in-optimisation/47657)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 8\
**Last updated:** [October 3, 2020, 8:05pm UTC](https://discourse.julialang.org/t/run-time-constraints-in-optimisation/47657 "2020-10-03T20:05:08Z")

</div>

In an optimisation problem, I have some variables which must take same values. A simple example is given below where the optimisation variables with a unique identifier should have same values: using DataFrames using Ju…

---

## [Optim.jl --- Do all Methods Allow Box Constraints? Should all Work Without Them?](https://discourse.julialang.org/t/optim-jl-do-all-methods-allow-box-constraints-should-all-work-without-them/10209)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 35\
**Last updated:** [October 3, 2020, 3:28pm UTC](https://discourse.julialang.org/t/optim-jl-do-all-methods-allow-box-constraints-should-all-work-without-them/10209 "2020-10-03T15:28:35Z")

</div>

I have been experimenting with Optim.jl. Do all optimizers offer box constraints? NOTE: All optimizers I tried can work without box constraints, except the brand new SAMIN. This example failed to use them: juli…

---

## [Can't access moment\_matrix() function in SumOfSquares](https://discourse.julialang.org/t/cant-access-moment-matrix-function-in-sumofsquares/47624)

<div class="topic-metadata">

**Author:** [@aliceee](https://discourse.julialang.org/u/aliceee)\
**Replies:** 3\
**Last updated:** [October 3, 2020, 8:25am UTC](https://discourse.julialang.org/t/cant-access-moment-matrix-function-in-sumofsquares/47624 "2020-10-03T08:25:45Z")

</div>

Hi, I’m trying to use the moment\_matrix function in SumOfSquares package. using MultivariateMoments ν3 = moment\_matrix(constr) However, I got the following error: ArgumentError: ModelLike of type MosekModel does not s…

---

## [Exploring a model?](https://discourse.julialang.org/t/exploring-a-model/47472)

<div class="topic-metadata">

**Author:** [@amca01](https://discourse.julialang.org/u/amca01)\
**Replies:** 5\
**Last updated:** [October 2, 2020, 4:37am UTC](https://discourse.julialang.org/t/exploring-a-model/47472 "2020-10-02T04:37:21Z")

</div>

I have been investigating JuMP (with optimizers CBC, CLP, and GLPK) for linear models. I can obtain the values of the decision variables, the optimum of the objective function, the shadow prices of the binding constrain…

---

## [Ipopt and external function](https://discourse.julialang.org/t/ipopt-and-external-function/47496)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 11\
**Last updated:** [September 30, 2020, 6:40pm UTC](https://discourse.julialang.org/t/ipopt-and-external-function/47496 "2020-09-30T18:40:17Z")

</div>

I am trying to solve a non-linear function using JuMP. From what I saw, I have to use Ipopt and, as Nonlinear Modeling · JuMP says, I cannot directly include the function in the NLobjective. To get around this I define a…

---

## [Finding a vector which has the sum of the indices which are prime numbers](https://discourse.julialang.org/t/finding-a-vector-which-has-the-sum-of-the-indices-which-are-prime-numbers/47492)

<div class="topic-metadata">

**Author:** [@julianoob](https://discourse.julialang.org/u/julianoob)\
**Replies:** 7\
**Last updated:** [September 30, 2020, 6:28pm UTC](https://discourse.julialang.org/t/finding-a-vector-which-has-the-sum-of-the-indices-which-are-prime-numbers/47492 "2020-09-30T18:28:56Z")

</div>

For example a=\[1 2 3; 4 5 6; 7 8 9\] indices are ((1,1) ,(1,2) , (1,3); (2,1),(2,2),(2,3); (3,1),(3,2),(3,3)) and the prime number of these sums are 2,3,5 which should be in the vector s. Is there any function in julia wh…

---

## [Cant create dataframe](https://discourse.julialang.org/t/cant-create-dataframe/47502)

<div class="topic-metadata">

**Author:** [@andresmorago](https://discourse.julialang.org/u/andresmorago)\
**Replies:** 16\
**Last updated:** [September 29, 2020, 10:00pm UTC](https://discourse.julialang.org/t/cant-create-dataframe/47502 "2020-09-29T22:00:16Z")

</div>

Hello guys. Newbie here I have this array getvalue.(W) 1-dimensional DenseAxisArray{Float64,1,…} with index sets: Dimension 1, 0:6 And data, a 7-element Array{Float64,1}: 80.0 65.0 65.0 65.0 65.0 65.0 65.0 …

---

## [GPLK vs Gurobi speed on simple MIPs](https://discourse.julialang.org/t/gplk-vs-gurobi-speed-on-simple-mips/47383)

<div class="topic-metadata">

**Author:** [@adow031](https://discourse.julialang.org/u/adow031)\
**Replies:** 11\
**Last updated:** [September 29, 2020, 1:07pm UTC](https://discourse.julialang.org/t/gplk-vs-gurobi-speed-on-simple-mips/47383 "2020-09-29T13:07:21Z")

</div>

I’m needing to solve a large number of simple MIPs in succession, and I’m finding that GPLK is 2.5 times faster than Gurobi (with presolve disabled; presolve slows Gurobi further). Is this normal? I know that for large/…

[Previous page](https://discourse.julialang.org/c/domain/opt/13.md?page=89)

[Next page](https://discourse.julialang.org/c/domain/opt/13.md?page=91)
