# Optimization (Mathematical)

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

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

**Page:** 115

---

## [add second order cone type constraint](https://discourse.julialang.org/t/add-second-order-cone-type-constraint/18742)

<div class="topic-metadata">

**Author:** [@WangQuanmeng](https://discourse.julialang.org/u/WangQuanmeng)\
**Replies:** 4\
**Last updated:** [December 19, 2018, 2:28am UTC](https://discourse.julialang.org/t/add-second-order-cone-type-constraint/18742 "2018-12-19T02:28:39Z")

</div>

Hi, I am new to Julia and JuMP, and I am learning to solve SOCP with integer constraint. The only example I can find online shows I should add the constraint in the following way. @constraint(m, norm(2x\[i\] - i for i=1…

---

## [Question about LsqFit](https://discourse.julialang.org/t/question-about-lsqfit/18754)

<div class="topic-metadata">

**Author:** [@yanyuechuixue](https://discourse.julialang.org/u/yanyuechuixue)\
**Replies:** 1\
**Last updated:** [December 18, 2018, 8:47am UTC](https://discourse.julialang.org/t/question-about-lsqfit/18754 "2018-12-18T08:47:32Z")

</div>

Dear all, When I using LsqFit.curve\_fit, I encountered an error. the codes are: using LsqFit xdata = \[\[42.7908, 240.168, 32.799\], \[43.262, 346.383, -0.296673\], \[43.842, 332.0, -32.1631\] , \[44.184, 324.176, 35.19…

---

## [NLconstraint: equality, absolute value](https://discourse.julialang.org/t/nlconstraint-equality-absolute-value/18674)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 1\
**Last updated:** [December 17, 2018, 12:13am UTC](https://discourse.julialang.org/t/nlconstraint-equality-absolute-value/18674 "2018-12-17T00:13:50Z")

</div>

I have a nonlinear, nonconvex equality constraint, and I only care about its magnitude. I saw this thread but wasn’t sure how to best handle the constraint in the nonconvex case. For example, I want something like: m = …

---

## [Fastest open-licensed solver for integer problems](https://discourse.julialang.org/t/fastest-open-licensed-solver-for-integer-problems/17440)

<div class="topic-metadata">

**Author:** [@vtjeng](https://discourse.julialang.org/u/vtjeng)\
**Replies:** 8\
**Last updated:** [December 16, 2018, 8:42pm UTC](https://discourse.julialang.org/t/fastest-open-licensed-solver-for-integer-problems/17440 "2018-12-16T20:42:21Z")

</div>

I’m trying to compare solve times for a large mixed-integer linear problem on 1) Gurobi, 2) a fast open-licensed solver. I’m currently using Cbc.jl, but I’d like to know if there is another alternative that is significan…

---

## [Show all linear constraints after building JuMP model](https://discourse.julialang.org/t/show-all-linear-constraints-after-building-jump-model/18536)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 5\
**Last updated:** [December 13, 2018, 2:16pm UTC](https://discourse.julialang.org/t/show-all-linear-constraints-after-building-jump-model/18536 "2018-12-13T14:16:22Z")

</div>

Hi all, I want to visualize all linear constraint in my JuMP model. I used ( model.linconstr) command but it gives only a portion of my constraints. I have 454 constraints but (model.linconstr) shows only 36 of these co…

---

## [PSA: Convex.jl default solver deprecation](https://discourse.julialang.org/t/psa-convex-jl-default-solver-deprecation/18570)

<div class="topic-metadata">

**Author:** [@Rory-Finnegan](https://discourse.julialang.org/u/Rory-Finnegan)\
**Replies:** 4\
**Last updated:** [December 12, 2018, 11:37pm UTC](https://discourse.julialang.org/t/psa-convex-jl-default-solver-deprecation/18570 "2018-12-12T23:37:44Z")

</div>

Support for default solvers in Convex.jl is about to be dropped. For the most part this’ll just require you to explicitly pass a MathProgBase.AbstractMathProgSolver as the second argument to solve!, if you aren’t already…

---

## [Performance of log in nonlinear optimization](https://discourse.julialang.org/t/performance-of-log-in-nonlinear-optimization/18450)

<div class="topic-metadata">

**Author:** [@danielcas](https://discourse.julialang.org/u/danielcas)\
**Replies:** 6\
**Last updated:** [December 10, 2018, 9:30pm UTC](https://discourse.julialang.org/t/performance-of-log-in-nonlinear-optimization/18450 "2018-12-10T21:30:06Z")

</div>

I’m having some trouble with the function “log” in an optimization problem. For instance: I create a variable, and then the following constraint: @NLconstraint(ModelName, log(x) \<=100), I use Ipopt to solve it (a fea…

---

## [JuMP and Julia 0.7/1.0](https://discourse.julialang.org/t/jump-and-julia-0-7-1-0/12964)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 15\
**Last updated:** [December 9, 2018, 6:58pm UTC](https://discourse.julialang.org/t/jump-and-julia-0-7-1-0/12964 "2018-12-09T18:58:59Z")

</div>

Updated Oct 1: tl;dr: Thanks mostly to the persistence of @ExpandingMan, JuMP 0.18.3 was released today supporting Julia 0.6, 0.7, and 1.0. Upgrade away! If you are using JuMP 0.18 on Julia 0.6, we do recommend upgradin…

---

## [Using JuMP to pick winners of a tournament](https://discourse.julialang.org/t/using-jump-to-pick-winners-of-a-tournament/18476)

<div class="topic-metadata">

**Author:** [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Replies:** 2\
**Last updated:** [December 9, 2018, 2:11pm UTC](https://discourse.julialang.org/t/using-jump-to-pick-winners-of-a-tournament/18476 "2018-12-09T14:11:48Z")

</div>

Hi, I’m using JuMP to pick winners of games of a single-elimination tournament. I have everything running fine except for the fact that I can’t seem to figure out how to impose a constraint that eliminated teams not be …

---

## [MIQP: How does Pavito treat convex quadratic functions?](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400)

<div class="topic-metadata">

**Author:** [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Replies:** 6\
**Last updated:** [December 8, 2018, 1:19pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400 "2018-12-08T13:19:43Z")

</div>

Some Integer Programming solvers, e.g. CPLEX, provide specialised algorithms for convex quadratic constraints and objectives. Does Pavito enable such algorithms for a quadratic objective, or is it treated as a general…

---

## [Maximum Likelihood Example Update](https://discourse.julialang.org/t/maximum-likelihood-example-update/18436)

<div class="topic-metadata">

**Author:** [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Replies:** 2\
**Last updated:** [December 7, 2018, 9:36pm UTC](https://discourse.julialang.org/t/maximum-likelihood-example-update/18436 "2018-12-07T21:36:25Z")

</div>

Hello! I wanted to point to a new gist that I have developed to update the Normal Linear Model Maximum Likelihood example that is part of the Optim.jl examples. I am going over all of my code to make sure it is 0.7.0 c…

---

## [Fibonacci Heap implementation](https://discourse.julialang.org/t/fibonacci-heap-implementation/18412)

<div class="topic-metadata">

**Author:** [@Lefteris\_Manousakis](https://discourse.julialang.org/u/Lefteris_Manousakis)\
**Replies:** 4\
**Last updated:** [December 7, 2018, 1:07pm UTC](https://discourse.julialang.org/t/fibonacci-heap-implementation/18412 "2018-12-07T13:07:20Z")

</div>

Hi everyone! I am implementing a Local Search algorithm using the Static Move Descriptors presented in A strategy for reducing the computational complexity of local search-based methods for the vehicle routing problem - …

---

## [Plotting with JuMP variables](https://discourse.julialang.org/t/plotting-with-jump-variables/18255)

<div class="topic-metadata">

**Author:** [@muriloasouza](https://discourse.julialang.org/u/muriloasouza)\
**Replies:** 2\
**Last updated:** [December 3, 2018, 5:58pm UTC](https://discourse.julialang.org/t/plotting-with-jump-variables/18255 "2018-12-03T17:58:45Z")

</div>

Hello, Not sure if i should post this here or in the visualization domain… but how can i plot a bar graph that has JuMP variables and regular Julia variables? For example, i’m trying to plot a bargraph, like this: Usi…

---

## [Difficulty to understand the JuMP problem setting](https://discourse.julialang.org/t/difficulty-to-understand-the-jump-problem-setting/18112)

<div class="topic-metadata">

**Author:** [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Replies:** 13\
**Last updated:** [December 2, 2018, 5:50pm UTC](https://discourse.julialang.org/t/difficulty-to-understand-the-jump-problem-setting/18112 "2018-12-02T17:50:51Z")

</div>

Here is my MWE of the problem: using JuMP using Clp Random.seed!(2017) xlocs, ylocs = rand(5), rand(5) function demo\_problem(x,y) counter = 0 for (xx,yy) in zip(x,y) val = xx - yy if (…

---

## [User defined objective function to run MICP](https://discourse.julialang.org/t/user-defined-objective-function-to-run-micp/16992)

<div class="topic-metadata">

**Author:** [@coiacy](https://discourse.julialang.org/u/coiacy)\
**Replies:** 18\
**Last updated:** [December 2, 2018, 11:01am UTC](https://discourse.julialang.org/t/user-defined-objective-function-to-run-micp/16992 "2018-12-02T11:01:21Z")

</div>

I have the following objective function (w is the variable vector of size nx): function obj\_trace(w::Array{Float64,1}) dg = Diagonal(w) M = F' \* (gamma \\ dg) \* F + eye(nx) obj = trace(inv(M)) return obj …

---

## [Active set and list of (NL) constraints in JuMP](https://discourse.julialang.org/t/active-set-and-list-of-nl-constraints-in-jump/18186)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 1\
**Last updated:** [November 30, 2018, 4:10pm UTC](https://discourse.julialang.org/t/active-set-and-list-of-nl-constraints-in-jump/18186 "2018-11-30T16:10:22Z")

</div>

Is there a convenient way to access all of the constraints (including @NLconstraint) in a JuMP (v0.18.4) model? I’ve tried accessing model.linconstr etc, but it doesn’t give the nonlinear constraints. I’d also like to ge…

---

## [How to avoid re-computing the same matrix in optimisation/JuMP?](https://discourse.julialang.org/t/how-to-avoid-re-computing-the-same-matrix-in-optimisation-jump/17883)

<div class="topic-metadata">

**Author:** [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Replies:** 3\
**Last updated:** [November 29, 2018, 5:34pm UTC](https://discourse.julialang.org/t/how-to-avoid-re-computing-the-same-matrix-in-optimisation-jump/17883 "2018-11-29T17:34:55Z")

</div>

I have a user-defined nonlinear constraint and its analytical gradient. A major effort is to compute the same matrix in both functions. In the problem below, it’s computed twice; in other problems, up to 2p times for a p…

---

## [Binary Variable](https://discourse.julialang.org/t/binary-variable/18093)

<div class="topic-metadata">

**Author:** [@muriloasouza](https://discourse.julialang.org/u/muriloasouza)\
**Replies:** 4\
**Last updated:** [November 29, 2018, 4:52am UTC](https://discourse.julialang.org/t/binary-variable/18093 "2018-11-29T04:52:54Z")

</div>

I got in my problem some binary variable, thats a decision to install or not an equipment in a house. Among a lot of other variables and constraints, my problem is something like this: N = 5; # number of houses @variabl…

---

## [Saving JUMPArray to JLD or JLD2 file](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033)

<div class="topic-metadata">

**Author:** [@YoungFaithful](https://discourse.julialang.org/u/YoungFaithful)\
**Replies:** 3\
**Last updated:** [November 28, 2018, 4:07am UTC](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033 "2018-11-28T04:07:06Z")

</div>

Hi, I’m facing the problem that trying to save a JUMPArray with JLD or JLD2 causes the error that it “cannot write pointers to JLD file”. Is there any way to save an entire JUMPArray to a file without decomposing it into…

---

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

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 2\
**Last updated:** [November 27, 2018, 6:57am UTC](https://discourse.julialang.org/t/undefvarerror-variable-not-defined/17903 "2018-11-27T06:57:18Z")

</div>

hi Guys, recently i have been trying to write a code but when i run it it shows me this: “UndefVarError: @variable not defined” this is the entire code: ’ ’ ’ Julia function scan\_maker(A) m = Model(solver=ClpSolver(…

---

## [solving convex MINLP problem](https://discourse.julialang.org/t/solving-convex-minlp-problem/18015)

<div class="topic-metadata">

**Author:** [@Jay\_Dave](https://discourse.julialang.org/u/Jay_Dave)\
**Replies:** 0\
**Last updated:** [November 26, 2018, 2:36pm UTC](https://discourse.julialang.org/t/solving-convex-minlp-problem/18015 "2018-11-26T14:36:19Z")

</div>

Hello, I am using second-order cone relaxation to convert my original non-linear problem. When I solve it using juniper (cplex as mip+ ipopt ), the solved objective is correct but takes longer than solving the non-linea…

---

## [What JuMP algorithm to use for this optimization problem?](https://discourse.julialang.org/t/what-jump-algorithm-to-use-for-this-optimization-problem/17936)

<div class="topic-metadata">

**Author:** [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Replies:** 5\
**Last updated:** [November 24, 2018, 7:16pm UTC](https://discourse.julialang.org/t/what-jump-algorithm-to-use-for-this-optimization-problem/17936 "2018-11-24T19:16:16Z")

</div>

I have a question about what type of algorithm I should be using for a fairly straightforward optimization problem. I have the following data id,val,score,id1 1,9,0,64 2,4,0,7 3,11,12,53 4,7,0,8 5,4,35,11 6,14,0,31 7,1…

---

## [Trying to use quadprog function from MathProgBase, has error "no method matching"](https://discourse.julialang.org/t/trying-to-use-quadprog-function-from-mathprogbase-has-error-no-method-matching/17831)

<div class="topic-metadata">

**Author:** [@Balance37](https://discourse.julialang.org/u/Balance37)\
**Replies:** 2\
**Last updated:** [November 23, 2018, 4:28pm UTC](https://discourse.julialang.org/t/trying-to-use-quadprog-function-from-mathprogbase-has-error-no-method-matching/17831 "2018-11-23T16:28:28Z")

</div>

Hi, I was trying to use JuMP.MathProgBase and Ipopt solver to solve a problem, but it seems my parameters are wrong. The third option in the error message seems to be the closest one to my problem. Does it mean, for exa…

---

## [Common error: providing an Integer when a Float is expected](https://discourse.julialang.org/t/common-error-providing-an-integer-when-a-float-is-expected/17786)

<div class="topic-metadata">

**Author:** [@anodos](https://discourse.julialang.org/u/anodos)\
**Replies:** 6\
**Last updated:** [November 21, 2018, 8:19am UTC](https://discourse.julialang.org/t/common-error-providing-an-integer-when-a-float-is-expected/17786 "2018-11-21T08:19:09Z")

</div>

Hi all, Perhaps this should be taken as a comment, but I wanted to raise it nonetheless, as it is an issue I have run into time and time again, and I am beginning to suspect I am missing something. The following code, …

---

## [Debugging optimization problem in jump](https://discourse.julialang.org/t/debugging-optimization-problem-in-jump/17798)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 2\
**Last updated:** [November 21, 2018, 1:35pm UTC](https://discourse.julialang.org/t/debugging-optimization-problem-in-jump/17798 "2018-11-21T13:35:32Z")

</div>

Hi everybody, I want to debug my code in julia that solves an optimization problem. I used to debug optimization problem in Matlab by assigning, the corresponding solution obtained by another approach, to variables. “a…

---

## [Set the solver tolerance in Optimization Based Bound Tightening (OBBT)](https://discourse.julialang.org/t/set-the-solver-tolerance-in-optimization-based-bound-tightening-obbt/17797)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 2\
**Last updated:** [November 21, 2018, 1:21am UTC](https://discourse.julialang.org/t/set-the-solver-tolerance-in-optimization-based-bound-tightening-obbt/17797 "2018-11-21T01:21:05Z")

</div>

Hi all, I have been working with optimization based bound tightening code in PowerModels for a while. I have a question about setting solver tolerance in which the OBBT code can work for different test cases without an…

---

## [Writing a simple production scheduling (optimal control) problem in JuMP](https://discourse.julialang.org/t/writing-a-simple-production-scheduling-optimal-control-problem-in-jump/17748)

<div class="topic-metadata">

**Author:** [@rotsoc](https://discourse.julialang.org/u/rotsoc)\
**Replies:** 4\
**Last updated:** [November 20, 2018, 2:31pm UTC](https://discourse.julialang.org/t/writing-a-simple-production-scheduling-optimal-control-problem-in-jump/17748 "2018-11-20T14:31:18Z")

</div>

Hi! I am working through the introductory exercises of “Linear Programming & Network Flows” by Bazaraa et.al by writing and solving them as JuMP programs. Actually, my question is about an example from the Introduction. …

---

## [Multi-threading in Gurobi-JuMP Interface](https://discourse.julialang.org/t/multi-threading-in-gurobi-jump-interface/17626)

<div class="topic-metadata">

**Author:** [@GabrielYin](https://discourse.julialang.org/u/GabrielYin)\
**Replies:** 4\
**Last updated:** [November 17, 2018, 11:46pm UTC](https://discourse.julialang.org/t/multi-threading-in-gurobi-jump-interface/17626 "2018-11-17T23:46:45Z")

</div>

Hi there, I am a new Julia user in optimization usage, switched from GAMS and AMPL. I have tested some codes and they worked well. However, I would like to know how to set multi-threading in the Gurobi-JuMP interface. I…

---

## [Discarding unused AffExpr](https://discourse.julialang.org/t/discarding-unused-affexpr/17634)

<div class="topic-metadata">

**Author:** [@vtjeng](https://discourse.julialang.org/u/vtjeng)\
**Replies:** 1\
**Last updated:** [November 17, 2018, 3:44pm UTC](https://discourse.julialang.org/t/discarding-unused-affexpr/17634 "2018-11-17T15:44:31Z")

</div>

As I’m creating my model in JuMP, I’m creating many AffExprs (~100k) but only a small fraction of them actually get used in constraints (I’m using interval arithmetic via ConditionalJuMP.jl to determine that the rest of …

---

## [Getting incremental cost for variables](https://discourse.julialang.org/t/getting-incremental-cost-for-variables/17563)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 1\
**Last updated:** [November 15, 2018, 4:09pm UTC](https://discourse.julialang.org/t/getting-incremental-cost-for-variables/17563 "2018-11-15T16:09:32Z")

</div>

Can you please let me know how can I get incremental cost associated with variables after solving an optimization problem in Jump? Thanks in advance!

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

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