# Optimization (Mathematical)

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

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

**Page:** 107

---

## [(Interval) subset optimization with JuMP](https://discourse.julialang.org/t/interval-subset-optimization-with-jump/30415)

<div class="topic-metadata">

**Author:** [@joemiller](https://discourse.julialang.org/u/joemiller)\
**Replies:** 2\
**Last updated:** [October 28, 2019, 7:50pm UTC](https://discourse.julialang.org/t/interval-subset-optimization-with-jump/30415 "2019-10-28T19:50:01Z")

</div>

Hey everyone. I’m trying to figure out how to use JuMP to optimize a function of a slice of data over the left and right endpoints for the range. I’ve never used JuMP before so I’m piecing this together from tutorials a…

---

## [NCP-function implementation (ifelse)](https://discourse.julialang.org/t/ncp-function-implementation-ifelse/30411)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 3\
**Last updated:** [October 28, 2019, 7:28pm UTC](https://discourse.julialang.org/t/ncp-function-implementation-ifelse/30411 "2019-10-28T19:28:46Z")

</div>

Hi, I’m trying to implement a model with constraints based on an NCP-function (continuous & differentiable) and put it into an NLP solver such as IPOPT: @constraint(m, f(x,y) \<= 0) where f(x,y) := xy if …

---

## [Optim.jl: bracketing with Newton()](https://discourse.julialang.org/t/optim-jl-bracketing-with-newton/30332)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 9\
**Last updated:** [October 28, 2019, 2:54pm UTC](https://discourse.julialang.org/t/optim-jl-bracketing-with-newton/30332 "2019-10-28T14:54:20Z")

</div>

Is it possible to use Newton() methods with limiting some variables? Like FMinbox?

---

## [Quadratic Expression](https://discourse.julialang.org/t/quadratic-expression/30337)

<div class="topic-metadata">

**Author:** [@Nikos-Atzarakis](https://discourse.julialang.org/u/Nikos-Atzarakis)\
**Replies:** 2\
**Last updated:** [October 27, 2019, 12:49pm UTC](https://discourse.julialang.org/t/quadratic-expression/30337 "2019-10-27T12:49:46Z")

</div>

Hi, I’m trying to create a quadratic expression using a variable attached in model m : using JuMP using Ipopt m= Model(with\_optimizer(Ipopt.Optimizer)) @variables m begin u\[1:(time\_lapses)\*2,1:number\_of\_players\] …

---

## [The objective function \`Val{false}()\` is not supported by JuMP](https://discourse.julialang.org/t/the-objective-function-val-false-is-not-supported-by-jump/30296)

<div class="topic-metadata">

**Author:** [@NextMyth](https://discourse.julialang.org/u/NextMyth)\
**Replies:** 2\
**Last updated:** [October 25, 2019, 10:03pm UTC](https://discourse.julialang.org/t/the-objective-function-val-false-is-not-supported-by-jump/30296 "2019-10-25T22:03:39Z")

</div>

Hi, I am trying to build a NHL DFS lineup optimizer using code found at https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/blob/master/code\_for\_Github.jl which needs updated for the current version of JuMP. I’m very …

---

## [How to graphically solve a problem?](https://discourse.julialang.org/t/how-to-graphically-solve-a-problem/30231)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 1\
**Last updated:** [October 25, 2019, 9:53am UTC](https://discourse.julialang.org/t/how-to-graphically-solve-a-problem/30231 "2019-10-25T09:53:59Z")

</div>

Is it possible to get the graphical solution of the x1 and x2 result of this problem using the Pyplot package? using JuMP, Cbc using PyPlot Test1 = Model(solver = CbcSolver()) @variable(Test1, x1 \>= 0) @variable(Test…

---

## [Mosek and Convex.jl -- Still not working](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254)

<div class="topic-metadata">

**Author:** [@raktim](https://discourse.julialang.org/u/raktim)\
**Replies:** 3\
**Last updated:** [October 24, 2019, 1:33pm UTC](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254 "2019-10-24T13:33:12Z")

</div>

I have been trying to use Convex with Mosek, but it seems there are still some errors. I have been trying to solve the following examples problem: using Convex, Mosek m = 4; n = 5 A = randn(m, n); b = randn(m, 1) x…

---

## [Problem construction advice in JuMP for speed](https://discourse.julialang.org/t/problem-construction-advice-in-jump-for-speed/30148)

<div class="topic-metadata">

**Author:** [@bhalonen](https://discourse.julialang.org/u/bhalonen)\
**Replies:** 4\
**Last updated:** [October 22, 2019, 3:50pm UTC](https://discourse.julialang.org/t/problem-construction-advice-in-jump-for-speed/30148 "2019-10-22T15:50:07Z")

</div>

I know that parallelization of problem construction has been advised against, so I am curious on what advice there is. Problem construction takes a significant amount of time on my problem, and is time significant operat…

---

## [Number of nodes and Relative Gap](https://discourse.julialang.org/t/number-of-nodes-and-relative-gap/30133)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 1\
**Last updated:** [October 21, 2019, 1:40pm UTC](https://discourse.julialang.org/t/number-of-nodes-and-relative-gap/30133 "2019-10-21T13:40:26Z")

</div>

Dear users, I am with Julia 1.0.4, JuMP version 0.19 and using the MathOptInterface to solve a integer model. According to the documentation in Reference · MathOptInterface the relative Gap and the number of nodes resea…

---

## [How to undershand the Objective goes greater while itering?](https://discourse.julialang.org/t/how-to-undershand-the-objective-goes-greater-while-itering/29721)

<div class="topic-metadata">

**Author:** [@kuro26](https://discourse.julialang.org/u/kuro26)\
**Replies:** 5\
**Last updated:** [October 19, 2019, 2:46pm UTC](https://discourse.julialang.org/t/how-to-undershand-the-objective-goes-greater-while-itering/29721 "2019-10-19T14:46:05Z")

</div>

This is the iteration process for a problem, the result in iter 19 still acceptable. In my understanding of optimization, this should not happen! Is anybody know why waa that? I am really puzzled

---

## [Modelling DFJ elminations constraints](https://discourse.julialang.org/t/modelling-dfj-elminations-constraints/29670)

<div class="topic-metadata">

**Author:** [@Miguel\_Goncalves](https://discourse.julialang.org/u/Miguel_Goncalves)\
**Replies:** 2\
**Last updated:** [October 9, 2019, 1:41pm UTC](https://discourse.julialang.org/t/modelling-dfj-elminations-constraints/29670 "2019-10-09T13:41:27Z")

</div>

Hi, everyone. I am new in this world of programming, specially in Julia, and i have found some trouble to ‘declare’ the subtour elimination from DFJ problems in Travelling Salesman Problem (TSP). Constrait: How can …

---

## [Why isn't keys defined on SparseAxisArray?](https://discourse.julialang.org/t/why-isnt-keys-defined-on-sparseaxisarray/29667)

<div class="topic-metadata">

**Author:** [@dourouc05](https://discourse.julialang.org/u/dourouc05)\
**Replies:** 4\
**Last updated:** [October 9, 2019, 9:26am UTC](https://discourse.julialang.org/t/why-isnt-keys-defined-on-sparseaxisarray/29667 "2019-10-09T09:26:19Z")

</div>

In my code, I mostly use SparseAxisArray as an equivalent for dictionaries, except that it’s returned by JuMP. Thus, I’m trying to use keys on a SparseAxisArray, but it’s not behaving as expected, returning a DenseAxisAr…

---

## [\[JuMP + Gurobi Bug?\] value of variable in solved model changes after deleting another variable](https://discourse.julialang.org/t/jump-gurobi-bug-value-of-variable-in-solved-model-changes-after-deleting-another-variable/29619)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 7\
**Last updated:** [October 8, 2019, 10:54pm UTC](https://discourse.julialang.org/t/jump-gurobi-bug-value-of-variable-in-solved-model-changes-after-deleting-another-variable/29619 "2019-10-08T22:54:39Z")

</div>

\> using JuMP, Gurobi \> model = Model(with\_optimizer(Gurobi.Optimizer)); \> @variable(model, x\[1:3\], Bin); \> @constraint(model, sum(all\_variables(model)) \<= 2); \> @objective(model, Max, sum(model\[:x\] .\* \[10, 5, 2\])); \> opt…

---

## [Modifying hotstart of a variable](https://discourse.julialang.org/t/modifying-hotstart-of-a-variable/29609)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 1\
**Last updated:** [October 7, 2019, 6:22pm UTC](https://discourse.julialang.org/t/modifying-hotstart-of-a-variable/29609 "2019-10-07T18:22:48Z")

</div>

I would like to modify the hot start of a variable. I’ve given an minimum working example below: using JuMP, Gurobi, Ipopt m = Model(with\_optimizer(Ipopt.Optimizer)) @variable(m, x, start = 0) # hot start @constraint(m…

---

## [JuMP 0.19 installed by default](https://discourse.julialang.org/t/jump-0-19-installed-by-default/29588)

<div class="topic-metadata">

**Author:** [@leclere](https://discourse.julialang.org/u/leclere)\
**Replies:** 6\
**Last updated:** [October 7, 2019, 5:12pm UTC](https://discourse.julialang.org/t/jump-0-19-installed-by-default/29588 "2019-10-07T17:12:14Z")

</div>

Hello, setting up my julia environnement from a Jupyter notebook (Julia 1.0.2) I get JuMP 0.19 when using Pkg.add(“JuMP”) while 0.20 is presented as stable and compatible with Julia 1.0. Can someone tell me if it is …

---

## [How to add a constraint in a JuMP model using the obj function of another JuMP model](https://discourse.julialang.org/t/how-to-add-a-constraint-in-a-jump-model-using-the-obj-function-of-another-jump-model/29432)

<div class="topic-metadata">

**Author:** [@Mahbubar06](https://discourse.julialang.org/u/Mahbubar06)\
**Replies:** 8\
**Last updated:** [October 3, 2019, 10:10pm UTC](https://discourse.julialang.org/t/how-to-add-a-constraint-in-a-jump-model-using-the-obj-function-of-another-jump-model/29432 "2019-10-03T22:10:33Z")

</div>

Hello, I have the following JuMP model: using JuMP using MathProgBase using Ipopt model=Model(solver=IpoptSolver()) @variable(model, -100 \<= x\[1:5\] \<=100) @constraint(model, sum(x\[i\] for i in 1:5) \<= 50) @NLconstraint(…

---

## [Forbidden range for a variable of a LP](https://discourse.julialang.org/t/forbidden-range-for-a-variable-of-a-lp/29071)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 6\
**Last updated:** [October 3, 2019, 3:01pm UTC](https://discourse.julialang.org/t/forbidden-range-for-a-variable-of-a-lp/29071 "2019-10-03T15:01:29Z")

</div>

I would like to express a linear program having a variable that can only be greater or equal than a constant P or equal to 0. Like : x≥P or x=0 I know I could express it as a mixed integer problem but I really need to …

---

## [Solve\_time is not working - JuMP](https://discourse.julialang.org/t/solve-time-is-not-working-jump/29062)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 13\
**Last updated:** [October 3, 2019, 8:01am UTC](https://discourse.julialang.org/t/solve-time-is-not-working-jump/29062 "2019-10-03T08:01:47Z")

</div>

I have updated Julia version to 1.0 and I have tried to find the new way to get the solve time reported by the solver, in my case Clp. I have tried to use the fonction solve\_time(model::Model) as described in documentat…

---

## [How to add this formula as an objective function?](https://discourse.julialang.org/t/how-to-add-this-formula-as-an-objective-function/29345)

<div class="topic-metadata">

**Author:** [@Shor](https://discourse.julialang.org/u/Shor)\
**Replies:** 6\
**Last updated:** [October 1, 2019, 4:15pm UTC](https://discourse.julialang.org/t/how-to-add-this-formula-as-an-objective-function/29345 "2019-10-01T16:15:51Z")

</div>

Hi, I am new here. I don’t know how to add this formula in my minimization objective function. where //x//\_1 stands for the sum of the absolute values of the components of x. (x is a 10x1 array) Anyone can help me w…

---

## [Unable to use setparam for Xpress under JuMP](https://discourse.julialang.org/t/unable-to-use-setparam-for-xpress-under-jump/26804)

<div class="topic-metadata">

**Author:** [@Diego](https://discourse.julialang.org/u/Diego)\
**Replies:** 12\
**Last updated:** [October 1, 2019, 1:13pm UTC](https://discourse.julialang.org/t/unable-to-use-setparam-for-xpress-under-jump/26804 "2019-10-01T13:13:52Z")

</div>

Team, I am trying to have Xpress report its log. When programming in Mosel I used: setparam(“XPRS\_VERBOSE”,true) Though I have tried many different things I am unable to do this with JuMP. This is what I have tried la…

---

## [\`UndefVarError: x not defined\` but x is in the model](https://discourse.julialang.org/t/undefvarerror-x-not-defined-but-x-is-in-the-model/29326)

<div class="topic-metadata">

**Author:** [@Ariel\_Cruz\_Cruz](https://discourse.julialang.org/u/Ariel_Cruz_Cruz)\
**Replies:** 5\
**Last updated:** [September 30, 2019, 4:20pm UTC](https://discourse.julialang.org/t/undefvarerror-x-not-defined-but-x-is-in-the-model/29326 "2019-09-30T16:20:58Z")

</div>

Hi, I’m having the next problem: I want to solve a given optimization problem using a JuMP model. In the algorithm that I am using I need to pass the model itself to another function having just the variables and I will…

---

## [How to evaluate MathProgBase functions of a JuMP model](https://discourse.julialang.org/t/how-to-evaluate-mathprogbase-functions-of-a-jump-model/29303)

<div class="topic-metadata">

**Author:** [@Mahbubar06](https://discourse.julialang.org/u/Mahbubar06)\
**Replies:** 2\
**Last updated:** [September 30, 2019, 5:04am UTC](https://discourse.julialang.org/t/how-to-evaluate-mathprogbase-functions-of-a-jump-model/29303 "2019-09-30T05:04:18Z")

</div>

I have a JuMP model and I want to evaluate the following functions for this model: MathProgBase.eval\_f(), MathProgBase.eval\_g(), MathProgBase.jac\_structure(), MathProgBase.eval\_grad\_f(). The model is as the following: M…

---

## [second order cone constraint in JuMP 0.19 with gurobi solver](https://discourse.julialang.org/t/second-order-cone-constraint-in-jump-0-19-with-gurobi-solver/21813)

<div class="topic-metadata">

**Author:** [@nitu0317](https://discourse.julialang.org/u/nitu0317)\
**Replies:** 11\
**Last updated:** [September 27, 2019, 8:25pm UTC](https://discourse.julialang.org/t/second-order-cone-constraint-in-jump-0-19-with-gurobi-solver/21813 "2019-09-27T20:25:37Z")

</div>

I failed to add SOCP constraint to my model with gurobi solver after updating JuMP to 0.19. Since norm is no longer supported, I tried the example provided in documentation, using JuMP,Gurobi,MathOptInterface env = Gu…

---

## [Conditional if else constraint in JuMP](https://discourse.julialang.org/t/conditional-if-else-constraint-in-jump/29177)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 2\
**Last updated:** [September 27, 2019, 11:13am UTC](https://discourse.julialang.org/t/conditional-if-else-constraint-in-jump/29177 "2019-09-27T11:13:35Z")

</div>

Hi, I want to use conditional if else in JuMP. I have seen ConditionalJuMP at https://juliaobserver.com/packages/ConditionalJuMP. But it won’t work for julia v0.5.2 Please mention any package for indicator constraints. …

---

## [Building SCIP error](https://discourse.julialang.org/t/building-scip-error/28973)

<div class="topic-metadata">

**Author:** [@Ariel\_Cruz\_Cruz](https://discourse.julialang.org/u/Ariel_Cruz_Cruz)\
**Replies:** 2\
**Last updated:** [September 20, 2019, 2:31am UTC](https://discourse.julialang.org/t/building-scip-error/28973 "2019-09-20T02:31:44Z")

</div>

Hi, I’m trying to add the SCIP package to solve some optimization problems. I am using Ubuntu 18.04 and I installed SCIP already. But when I try to make the Pkg.build("SCIP") I get the next error message: julia\> Pkg.bui…

---

## [Gurobi for quadratic constraint problems](https://discourse.julialang.org/t/gurobi-for-quadratic-constraint-problems/28956)

<div class="topic-metadata">

**Author:** [@Ariel\_Cruz\_Cruz](https://discourse.julialang.org/u/Ariel_Cruz_Cruz)\
**Replies:** 2\
**Last updated:** [September 19, 2019, 5:14pm UTC](https://discourse.julialang.org/t/gurobi-for-quadratic-constraint-problems/28956 "2019-09-19T17:14:48Z")

</div>

Hi, I want to know if I can use the Gurobi solver to solve the next problem: min: ( (x1-1)^2 + (x2-2)^2 + (x3-1)^2 ) / 2 s.t.: x1, x2, x3 \>= 0 x1 \* x3 \<= 2 x2 \* x3 \<= 2 Because when I try to do that I get this error: …

---

## [Digamma not defined in JuMP nonlinear optimization](https://discourse.julialang.org/t/digamma-not-defined-in-jump-nonlinear-optimization/28824)

<div class="topic-metadata">

**Author:** [@brwst](https://discourse.julialang.org/u/brwst)\
**Replies:** 2\
**Last updated:** [September 17, 2019, 2:00am UTC](https://discourse.julialang.org/t/digamma-not-defined-in-jump-nonlinear-optimization/28824 "2019-09-17T02:00:11Z")

</div>

Hello all, I’m trying to familiarize myself with JuMP, especially in the context of using SpecialFunctions. I’m struggling with gamma() and lgamma() specifically, so I’ve tried to implement the simple example from JuMP…

---

## [Nonlinear equations on abstract vectors?](https://discourse.julialang.org/t/nonlinear-equations-on-abstract-vectors/28692)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 8\
**Last updated:** [September 12, 2019, 8:52pm UTC](https://discourse.julialang.org/t/nonlinear-equations-on-abstract-vectors/28692 "2019-09-12T20:52:23Z")

</div>

I need to solve a (smooth, unconstrained) system of nonlinear equations for an unknown defined on multiple subdomains (to wit, domain decomposition for a PDE). A natural representation of the unknown might be a vector of…

---

## [Lagrange multipliers (duals) in JuMP 0.19](https://discourse.julialang.org/t/lagrange-multipliers-duals-in-jump-0-19/28328)

<div class="topic-metadata">

**Author:** [@ko56](https://discourse.julialang.org/u/ko56)\
**Replies:** 15\
**Last updated:** [September 9, 2019, 6:06pm UTC](https://discourse.julialang.org/t/lagrange-multipliers-duals-in-jump-0-19/28328 "2019-09-09T18:06:59Z")

</div>

I have Julia 1.1.1 and JuMP 0.19. I am solving a concave maximization problem with linear constraints with Ipopt. I am confused with what is happening to the signs of the Lagrange multipliers: The correct multipliers a…

---

## [JuMP v0.20 has been released](https://discourse.julialang.org/t/jump-v0-20-has-been-released/28221)

<div class="topic-metadata">

**Author:** [@blegat](https://discourse.julialang.org/u/blegat)\
**Replies:** 4\
**Last updated:** [September 9, 2019, 3:49pm UTC](https://discourse.julialang.org/t/jump-v0-20-has-been-released/28221 "2019-09-09T15:49:54Z")

</div>

We are pleased to announce the release of JuMP v0.20 and MathOptInterface (MOI) v0.9. This release is an incremental improvement over JuMP v0.19, with the majority of breaking changes affecting only solver developers. We…

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

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