# Optimization (Mathematical)

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

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

**Page:** 106

---

## [Pyomo style "blocks" in JuMP](https://discourse.julialang.org/t/pyomo-style-blocks-in-jump/31849)

<div class="topic-metadata">

**Author:** [@jonmat](https://discourse.julialang.org/u/jonmat)\
**Replies:** 7\
**Last updated:** [December 5, 2019, 3:06pm UTC](https://discourse.julialang.org/t/pyomo-style-blocks-in-jump/31849 "2019-12-05T15:06:17Z")

</div>

I’m new to Julia/JuMP and I’m wondering if Julia has any capability that replicates “blocks” in Pyomo? In other words the possibility to maintain separate namespaces within your model, and build hierarchical/compositiona…

---

## [Convex.jl (+SCS) more than 100\* slower than R counterpart, CVXR + SCS](https://discourse.julialang.org/t/convex-jl-scs-more-than-100-slower-than-r-counterpart-cvxr-scs/31717)

<div class="topic-metadata">

**Author:** [@reumle](https://discourse.julialang.org/u/reumle)\
**Replies:** 12\
**Last updated:** [December 3, 2019, 11:48pm UTC](https://discourse.julialang.org/t/convex-jl-scs-more-than-100-slower-than-r-counterpart-cvxr-scs/31717 "2019-12-03T23:48:23Z")

</div>

Hello, I see significantly worse perf in the julia implementation. Also scaling seems linear on R side and quadratic on Julia side… \[MWE below at the bottom, in R and Julia\] timings in R/CVXR/scs, (in seconds) # A ti…

---

## [\[ANN\] SequentialConvexRelaxation.jl: non-convex optimization on top of Convex.jl](https://discourse.julialang.org/t/ann-sequentialconvexrelaxation-jl-non-convex-optimization-on-top-of-convex-jl/31743)

<div class="topic-metadata">

**Author:** [@rdoelman](https://discourse.julialang.org/u/rdoelman)\
**Replies:** 2\
**Last updated:** [December 2, 2019, 1:59pm UTC](https://discourse.julialang.org/t/ann-sequentialconvexrelaxation-jl-non-convex-optimization-on-top-of-convex-jl/31743 "2019-12-02T13:59:21Z")

</div>

Hi all, I’d like to introduce the package SequentialConvexRelaxation.jl. The package implements a heuristic method on top of Convex.jl to attempt to solve non-convex problems that can be expressed as a convex problem, …

---

## [Loops "for" and "while" in JuMP](https://discourse.julialang.org/t/loops-for-and-while-in-jump/31657)

<div class="topic-metadata">

**Author:** [@jadosfer](https://discourse.julialang.org/u/jadosfer)\
**Replies:** 2\
**Last updated:** [November 30, 2019, 6:22pm UTC](https://discourse.julialang.org/t/loops-for-and-while-in-jump/31657 "2019-11-30T18:22:35Z")

</div>

Hi, I’m working with JuMP and I want to modify expressions in my model within a while or for loop, and I have problems using the “input” command. When I modify a Julia variable, which is a coefficient in a JuMP NLexpress…

---

## [AmplNLWriter : supports\_constraint() is ambiguous in MathOptInterface](https://discourse.julialang.org/t/amplnlwriter-supports-constraint-is-ambiguous-in-mathoptinterface/31390)

<div class="topic-metadata">

**Author:** [@dmit](https://discourse.julialang.org/u/dmit)\
**Replies:** 9\
**Last updated:** [November 27, 2019, 8:41pm UTC](https://discourse.julialang.org/t/amplnlwriter-supports-constraint-is-ambiguous-in-mathoptinterface/31390 "2019-11-27T20:41:43Z")

</div>

Hi there you beautiful people! Complete Julia newbie here, so the problem I’m having may be trivial. I’m trying to use Couenne optimizer with AmplNLWriter interface, but can’t make it work. Here’s my hello-world level…

---

## [First alpha release of JuMP 0.19 (JuMP/MathOptInterface)](https://discourse.julialang.org/t/first-alpha-release-of-jump-0-19-jump-mathoptinterface/16099)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 12\
**Last updated:** [November 27, 2019, 1:40pm UTC](https://discourse.julialang.org/t/first-alpha-release-of-jump-0-19-jump-mathoptinterface/16099 "2019-11-27T13:40:58Z")

</div>

To help out early adopters in the big transition to JuMP/MathOptInterface, we’ll be making development tags of JuMP master up to the JuMP 0.19 release. The first development release, v0.19-alpha is now tagged. This is th…

---

## [Difficulty in solving a MINLP](https://discourse.julialang.org/t/difficulty-in-solving-a-minlp/31555)

<div class="topic-metadata">

**Author:** [@muriloasouza](https://discourse.julialang.org/u/muriloasouza)\
**Replies:** 2\
**Last updated:** [November 27, 2019, 12:56am UTC](https://discourse.julialang.org/t/difficulty-in-solving-a-minlp/31555 "2019-11-27T00:56:43Z")

</div>

Hello all, i’m trying to solve a MINLP using Couenne. These are my variables and constraints: Constraints: 1040 Variables: 1048 (8 integer) Auxiliaries: 3530 (13 integer) It had a lot more, bu…

---

## [How to NLsolve with sparsity but no jacobian?](https://discourse.julialang.org/t/how-to-nlsolve-with-sparsity-but-no-jacobian/31462)

<div class="topic-metadata">

**Author:** [@MatFi](https://discourse.julialang.org/u/MatFi)\
**Replies:** 7\
**Last updated:** [November 25, 2019, 8:41am UTC](https://discourse.julialang.org/t/how-to-nlsolve-with-sparsity-but-no-jacobian/31462 "2019-11-25T08:41:38Z")

</div>

From the NLsolve-docs i know that one can pass a jacobian to nlsolve and make the solver treating the jacobian as sparse. But what can I do when I don’t want to write down a jacobian of a PDE discretisation, and only k…

---

## [JuMP : Solving an optimisation problem with a large matrix of variables](https://discourse.julialang.org/t/jump-solving-an-optimisation-problem-with-a-large-matrix-of-variables/31347)

<div class="topic-metadata">

**Author:** [@Wedg](https://discourse.julialang.org/u/Wedg)\
**Replies:** 4\
**Last updated:** [November 24, 2019, 2:08pm UTC](https://discourse.julialang.org/t/jump-solving-an-optimisation-problem-with-a-large-matrix-of-variables/31347 "2019-11-24T14:08:09Z")

</div>

Hi all I have an optimisation of the following form. # Size rows = 6000 cols = 10 # Create model with solver model = Model(with\_optimizer(GLPK.Optimizer)) # Create binary variables @variable(model, X\[1:rows, 1:cols\],…

---

## [JuMP : not getting the correct solution of the optimization problem](https://discourse.julialang.org/t/jump-not-getting-the-correct-solution-of-the-optimization-problem/29947)

<div class="topic-metadata">

**Author:** [@Val](https://discourse.julialang.org/u/Val)\
**Replies:** 7\
**Last updated:** [October 16, 2019, 3:23pm UTC](https://discourse.julialang.org/t/jump-not-getting-the-correct-solution-of-the-optimization-problem/29947 "2019-10-16T15:23:28Z")

</div>

Dear everyone I am solving a minimization problem under equality and inequality constraints. I solve this problem with COSMO and I get a solution which is the vector alpha\_opt=\[0 0 0\] But I found another vector which i…

---

## [Style guide: in or =](https://discourse.julialang.org/t/style-guide-in-or/31155)

<div class="topic-metadata">

**Author:** [@remi-garcia](https://discourse.julialang.org/u/remi-garcia)\
**Replies:** 2\
**Last updated:** [November 17, 2019, 7:58am UTC](https://discourse.julialang.org/t/style-guide-in-or/31155 "2019-11-17T07:58:30Z")

</div>

Hi, JuMP’ style guide states we should prefer in over = in for loops: Style Guide · JuMP I was wondering why it is not the same for variables and constraints declaration as in the documentation we can find @variable(mo…

---

## [Installing packages](https://discourse.julialang.org/t/installing-packages/30978)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 2\
**Last updated:** [November 13, 2019, 10:03am UTC](https://discourse.julialang.org/t/installing-packages/30978 "2019-11-13T10:03:08Z")

</div>

Dear all, I just to install Julia in a new computer. When I run Pkg.add("JuMP") a error message appears: julia\> Pkg.add("JuMP") Updating registry at \`C:\\Users\\Usuário\\.juliapro\\JuliaPro\_v1.0.4.1\\registries\\JuliaPr…

---

## [JuMP with Ipopt - Error "The equality constraints contain an invalid number"](https://discourse.julialang.org/t/jump-with-ipopt-error-the-equality-constraints-contain-an-invalid-number/31004)

<div class="topic-metadata">

**Author:** [@StarecZosima](https://discourse.julialang.org/u/StarecZosima)\
**Replies:** 5\
**Last updated:** [November 12, 2019, 11:20pm UTC](https://discourse.julialang.org/t/jump-with-ipopt-error-the-equality-constraints-contain-an-invalid-number/31004 "2019-11-12T23:20:43Z")

</div>

Hi there, I am trying to solve the following system of nonlinear equations using JuMP, Ipopt c = Model(with\_optimizer(Ipopt.Optimizer,max\_cpu\_time=500.0)) @variable(c,x) @variable(c,y) @NLcon…

---

## [(binary) solution not satisfying constraint](https://discourse.julialang.org/t/binary-solution-not-satisfying-constraint/30998)

<div class="topic-metadata">

**Author:** [@mposs](https://discourse.julialang.org/u/mposs)\
**Replies:** 4\
**Last updated:** [November 12, 2019, 3:45pm UTC](https://discourse.julialang.org/t/binary-solution-not-satisfying-constraint/30998 "2019-11-12T15:45:58Z")

</div>

Hello I’m solving a small problem with Gurobi, which is given by println(cover)= Min slack\[1\] + slack\[2\] + slack\[7\] + slack\[9\] Subject to y\[135\] + y\[136\] + y\[152\] + y\[158\] + y\[159\] + y\[200\] + y\[474\] + y\[550\] + y\[551\] …

---

## [How to build @constraints?](https://discourse.julialang.org/t/how-to-build-constraints/30950)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 6\
**Last updated:** [November 12, 2019, 2:59pm UTC](https://discourse.julialang.org/t/how-to-build-constraints/30950 "2019-11-12T14:59:14Z")

</div>

This is my model, I am working on building a mathematical model and would like to be able to represent the constraint like this: I\[1\] I\[2\] I\[3\] I\[4\] I\[5\] I\[6\] \<=1500 using JuMP, GLPK m = Model(with\_optimizer(GLPK.Optimi…

---

## [SAMIN() in Julia (Simulated Annealing)?](https://discourse.julialang.org/t/samin-in-julia-simulated-annealing/30972)

<div class="topic-metadata">

**Author:** [@bashonubuntu](https://discourse.julialang.org/u/bashonubuntu)\
**Replies:** 0\
**Last updated:** [November 11, 2019, 9:57pm UTC](https://discourse.julialang.org/t/samin-in-julia-simulated-annealing/30972 "2019-11-11T21:57:47Z")

</div>

Hello, I was looking at the SAMIN() code in Optim (Optim.jl) and wanted to ask if someone could help provide some intuition for the nt, ns and neps terms. While checking some julia discourses online, there seems to be …

---

## [YALMIP vs JuMP](https://discourse.julialang.org/t/yalmip-vs-jump/30776)

<div class="topic-metadata">

**Author:** [@raktim](https://discourse.julialang.org/u/raktim)\
**Replies:** 13\
**Last updated:** [November 8, 2019, 7:19am UTC](https://discourse.julialang.org/t/yalmip-vs-jump/30776 "2019-11-08T07:19:23Z")

</div>

I compared JuMP and YALMIP’s performance in parsing convex problem. I noticed a difference in the problem size of the final optimization problem that is passed to Mosek. The problem from JuMP was quite large, than YALMIP…

---

## [Some JuMP variables values are out of bounds](https://discourse.julialang.org/t/some-jump-variables-values-are-out-of-bounds/26008)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 7\
**Last updated:** [November 6, 2019, 2:20pm UTC](https://discourse.julialang.org/t/some-jump-variables-values-are-out-of-bounds/26008 "2019-11-06T14:20:35Z")

</div>

Hi, I have problem while running optimization of our biophysical model (which is using Markov chain methodology): some parameter values during JuMP optimisation procedure are set to “0” by autodiff, but this is out of bo…

---

## [How to read the @objective command?](https://discourse.julialang.org/t/how-to-read-the-objective-command/30752)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 5\
**Last updated:** [November 5, 2019, 5:33pm UTC](https://discourse.julialang.org/t/how-to-read-the-objective-command/30752 "2019-11-05T17:33:30Z")

</div>

@objective (m,Min,sum (LS \[i, j\]\*C\[i, j\] for i, j ∈ 1:f)) How to make this expression read the for i,j. The way I did the error appears: syntax: invalid iteration specification

---

## [Solver iterates then declares model infeasible - what could explain this behaviour for a linear problem?](https://discourse.julialang.org/t/solver-iterates-then-declares-model-infeasible-what-could-explain-this-behaviour-for-a-linear-problem/27702)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 7\
**Last updated:** [November 5, 2019, 3:13pm UTC](https://discourse.julialang.org/t/solver-iterates-then-declares-model-infeasible-what-could-explain-this-behaviour-for-a-linear-problem/27702 "2019-11-05T15:13:11Z")

</div>

I’m solving a linear problem with JuMP and Gurobi, and for some formulations I end up getting the following behaviour: Academic license - for non-commercial use only Optimize a model with 6725 rows, 6346 columns and 172…

---

## [KNITRO on Jupyter notebook & Atom](https://discourse.julialang.org/t/knitro-on-jupyter-notebook-atom/30542)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 5\
**Last updated:** [November 4, 2019, 4:07pm UTC](https://discourse.julialang.org/t/knitro-on-jupyter-notebook-atom/30542 "2019-11-04T16:07:15Z")

</div>

Dear all, I am trying out KNITRO solver with a toy example: using JuMP, KNITRO model = JuMP.Model(with\_optimizer(KNITRO.Optimizer)) @variable(model, x1 \>= 0) @variable(model, x2 \>= 0) @constraint(model, -1.5 \* x1 + 2.0…

---

## [Lengauer Tarjan Algorithm (Dominator Tree)](https://discourse.julialang.org/t/lengauer-tarjan-algorithm-dominator-tree/30593)

<div class="topic-metadata">

**Author:** [@markusb](https://discourse.julialang.org/u/markusb)\
**Replies:** 2\
**Last updated:** [November 3, 2019, 1:50pm UTC](https://discourse.julialang.org/t/lengauer-tarjan-algorithm-dominator-tree/30593 "2019-11-03T13:50:03Z")

</div>

Dear all, does anyone know if the Lengauer Tarjan algorithm for creating a domiator tree from a given directed graph (i’m using LightGraphs) is already implemented in a package? thanks in advance Markus

---

## [Implement an MPS-based MOI solver](https://discourse.julialang.org/t/implement-an-mps-based-moi-solver/29218)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 7\
**Last updated:** [October 31, 2019, 12:55pm UTC](https://discourse.julialang.org/t/implement-an-mps-based-moi-solver/29218 "2019-10-31T12:55:44Z")

</div>

I want to implement an MPS-based solver interface. The actual solver is on a server and I have to send an MPS file, get the solution back and update the JuMP model with the solution. Are there any existing packages tha…

---

## [SCIP gap limit](https://discourse.julialang.org/t/scip-gap-limit/30511)

<div class="topic-metadata">

**Author:** [@Raminel](https://discourse.julialang.org/u/Raminel)\
**Replies:** 7\
**Last updated:** [October 31, 2019, 11:43am UTC](https://discourse.julialang.org/t/scip-gap-limit/30511 "2019-10-31T11:43:46Z")

</div>

Hi all, I am using SCIP optimizer and do not know how to adjust the gab limit. using SCIP m = Model(with\_optimizer(SCIP.Optimizer)) if I follow the guide for SCIP.jl I would need MIO.set and it seems but this package…

---

## [CDDLibrary not defined](https://discourse.julialang.org/t/cddlibrary-not-defined/30512)

<div class="topic-metadata">

**Author:** [@squirrel](https://discourse.julialang.org/u/squirrel)\
**Replies:** 1\
**Last updated:** [October 30, 2019, 7:48pm UTC](https://discourse.julialang.org/t/cddlibrary-not-defined/30512 "2019-10-30T19:48:18Z")

</div>

The packages were installed. Why is this telling me CDDLibrary is not defined? using Pkg Pkg.add("Polyhedra") Pkg.add("CDDLib") using CDDLib polyf = polyhedron(hrep, CDDLibrary())

---

## [For syntax in @constraints](https://discourse.julialang.org/t/for-syntax-in-constraints/30483)

<div class="topic-metadata">

**Author:** [@leclere](https://discourse.julialang.org/u/leclere)\
**Replies:** 1\
**Last updated:** [October 30, 2019, 1:28pm UTC](https://discourse.julialang.org/t/for-syntax-in-constraints/30483 "2019-10-30T13:28:48Z")

</div>

Hi! I am looking for the most elegant way of adding multiple constraints (e.g. with a for loop) in a JuMP model. For example I would like to be able to write : using JuMP m = Model() @variable(m,x\[1:5\]) @constraints(…

---

## [Newbie Question: Julia optimization multiprocessing](https://discourse.julialang.org/t/newbie-question-julia-optimization-multiprocessing/1686)

<div class="topic-metadata">

**Author:** [@Jason](https://discourse.julialang.org/u/Jason)\
**Replies:** 10\
**Last updated:** [October 30, 2019, 1:12am UTC](https://discourse.julialang.org/t/newbie-question-julia-optimization-multiprocessing/1686 "2019-10-30T01:12:17Z")

</div>

Hi, I’m trying to figure out whether Julia is a good language for a project I’m undertaking. One thing I’ll need to do is optimize a complex statistical function (Hidden Markov / CRF related) involving potentially 12K p…

---

## [3D variable in JuMP](https://discourse.julialang.org/t/3d-variable-in-jump/30416)

<div class="topic-metadata">

**Author:** [@g001234](https://discourse.julialang.org/u/g001234)\
**Replies:** 4\
**Last updated:** [October 29, 2019, 11:45pm UTC](https://discourse.julialang.org/t/3d-variable-in-jump/30416 "2019-10-29T23:45:04Z")

</div>

I am working on a convex optimization problem that needs to define several (e.g. 5) symmetric matrices as variables. I was wondering if it is possible to define those variables with a single line like @variable(m, x(N,N,…

---

## [Save the date: 4th annual JuMP-dev](https://discourse.julialang.org/t/save-the-date-4th-annual-jump-dev/30465)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 0\
**Last updated:** [October 29, 2019, 10:20pm UTC](https://discourse.julialang.org/t/save-the-date-4th-annual-jump-dev/30465 "2019-10-29T22:20:37Z")

</div>

Dear all, We are pleased to announce that the 4th annual JuMP-dev workshop will be held June 15-17 2020 in Louvain-la-Neuve, Belgium, in conjunction with UCLouvain. Further details, including a call for speakers, will …

---

## [JuMP macro @constraint where variable is in a finite set](https://discourse.julialang.org/t/jump-macro-constraint-where-variable-is-in-a-finite-set/30417)

<div class="topic-metadata">

**Author:** [@dadada\_dadada](https://discourse.julialang.org/u/dadada_dadada)\
**Replies:** 1\
**Last updated:** [October 28, 2019, 8:23pm UTC](https://discourse.julialang.org/t/jump-macro-constraint-where-variable-is-in-a-finite-set/30417 "2019-10-28T20:23:02Z")

</div>

Is it possible? I’m trying to solve a very simple optimization problem with IPOPT where the variables are binary. But it seems that IPOPT doesn’t support Bin variables, only continuous ones. Would it be possible to cre…

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

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