# Optimization (Mathematical)

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

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

**Page:** 75

---

## [Do faster optimization with Cbc solver in JuMP](https://discourse.julialang.org/t/do-faster-optimization-with-cbc-solver-in-jump/46276)

<div class="topic-metadata">

**Author:** [@Luis\_Tormo](https://discourse.julialang.org/u/Luis_Tormo)\
**Replies:** 6\
**Last updated:** [September 23, 2021, 11:00pm UTC](https://discourse.julialang.org/t/do-faster-optimization-with-cbc-solver-in-jump/46276 "2021-09-23T23:00:44Z")

</div>

I am trying to do an optimization of a MILP problem with Cbc solver but it is too slow. I know that with CPLEX it is much faster but I need to use Cbc. Does anyone know of a resource to get it? Maybe multi-threading?

---

## [Is Convex.jl still working?](https://discourse.julialang.org/t/is-convex-jl-still-working/68624)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 12\
**Last updated:** [September 23, 2021, 6:19pm UTC](https://discourse.julialang.org/t/is-convex-jl-still-working/68624 "2021-09-23T18:19:30Z")

</div>

I would like to run an example for a class like the tutorials on Convex.jl, but these no longer work (they fail at the ‘solve’ step). I could use JUMP but I just want to do simple quadratic programming and the syntax o…

---

## [How to debug JuMP code (not debug model feasiblity, etc.) in VScode](https://discourse.julialang.org/t/how-to-debug-jump-code-not-debug-model-feasiblity-etc-in-vscode/68613)

<div class="topic-metadata">

**Author:** [@iiitr](https://discourse.julialang.org/u/iiitr)\
**Replies:** 1\
**Last updated:** [September 23, 2021, 4:17am UTC](https://discourse.julialang.org/t/how-to-debug-jump-code-not-debug-model-feasiblity-etc-in-vscode/68613 "2021-09-23T04:17:32Z")

</div>

Hi, all When the jump macro is included in my code, the debug using vscode always jumps to some internal functions. What I want to ask is how to step through these codes without jumping into places where no breakpoints…

---

## [BlackBoxOptim hangs with multi-threaded optimization](https://discourse.julialang.org/t/blackboxoptim-hangs-with-multi-threaded-optimization/68454)

<div class="topic-metadata">

**Author:** [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Replies:** 3\
**Last updated:** [September 22, 2021, 2:54pm UTC](https://discourse.julialang.org/t/blackboxoptim-hangs-with-multi-threaded-optimization/68454 "2021-09-22T14:54:28Z")

</div>

Hi everyone, I had tried using BlackBoxOptim.jl for a parameter estimation problem, following this tutorial. In particular, I have a rather slow intermediate ODE system to solve which does not benefit from multithreadin…

---

## [Querying optimal solution without allocating memory](https://discourse.julialang.org/t/querying-optimal-solution-without-allocating-memory/68184)

<div class="topic-metadata">

**Author:** [@bsturt](https://discourse.julialang.org/u/bsturt)\
**Replies:** 4\
**Last updated:** [September 21, 2021, 5:33pm UTC](https://discourse.julialang.org/t/querying-optimal-solution-without-allocating-memory/68184 "2021-09-21T17:33:50Z")

</div>

I am implementing a large-scale decomposition method for solving a huge linear optimization problem. At each iteration of the algorithm, I need to efficiently obtain the optimal primal and dual solution to the LP. The al…

---

## [Absolute value, abs(), on Gurobi solver](https://discourse.julialang.org/t/absolute-value-abs-on-gurobi-solver/68493)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 3\
**Last updated:** [September 21, 2021, 12:49pm UTC](https://discourse.julialang.org/t/absolute-value-abs-on-gurobi-solver/68493 "2021-09-21T12:49:48Z")

</div>

Hi all, is there a way to use absolute value e.g. abs(x) with JuMP/Gurobi? It seems like Gurobi supports it (see: https://www.gurobi.com/documentation/9.1/refman/py\_abs\_.html), but abs(x) is linked with a NLconstraint w…

---

## [Help with Normal Distribution](https://discourse.julialang.org/t/help-with-normal-distribution/68486)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 1\
**Last updated:** [September 20, 2021, 5:07pm UTC](https://discourse.julialang.org/t/help-with-normal-distribution/68486 "2021-09-20T17:07:51Z")

</div>

Because when I compile my model I get the following error message: MethodError: no method matching Normal(; μ=0.16, σ=0.05) using JuMP, Gurobi, Random, Distributions Modelmathematical = Model(Gurobi.Optimizer) a = 280…

---

## [JuMP+Ipopt producing infeasible solutions for constraints with small upper bounds](https://discourse.julialang.org/t/jump-ipopt-producing-infeasible-solutions-for-constraints-with-small-upper-bounds/68306)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 2\
**Last updated:** [September 17, 2021, 5:30am UTC](https://discourse.julialang.org/t/jump-ipopt-producing-infeasible-solutions-for-constraints-with-small-upper-bounds/68306 "2021-09-17T05:30:19Z")

</div>

using JuMP, Ipopt function parametertest() m = Model(Ipopt.Optimizer) set\_silent(m) a = \[0.15, 0.16, 0.72, -0.80, -12.0\] @variable(m, x\[1:5\]) @variable(m, abs\_x\[1:5\]) for i in 1:5 …

---

## [What is the best tool to use for weighting matrices](https://discourse.julialang.org/t/what-is-the-best-tool-to-use-for-weighting-matrices/68218)

<div class="topic-metadata">

**Author:** [@Nenndul](https://discourse.julialang.org/u/Nenndul)\
**Replies:** 8\
**Last updated:** [September 16, 2021, 8:18pm UTC](https://discourse.julialang.org/t/what-is-the-best-tool-to-use-for-weighting-matrices/68218 "2021-09-16T20:18:10Z")

</div>

I have a problem that involves combining several matrices with a weighted average to optimize for a given feature, such as the average value of over the data in the resulting matrix. The setup is essentially like this. …

---

## [Rew file format in MOI.FileFormats / JuMP](https://discourse.julialang.org/t/rew-file-format-in-moi-fileformats-jump/68238)

<div class="topic-metadata">

**Author:** [@obar](https://discourse.julialang.org/u/obar)\
**Replies:** 2\
**Last updated:** [September 16, 2021, 1:54am UTC](https://discourse.julialang.org/t/rew-file-format-in-moi-fileformats-jump/68238 "2021-09-16T01:54:35Z")

</div>

Would it be possible to include support for .rew model file formats in JuMP? It is sometimes useful to share models where a risk of leaking proprietary information is present (e.g. here) and .mps files contain constrain…

---

## [Gurobi not using barrier method](https://discourse.julialang.org/t/gurobi-not-using-barrier-method/68078)

<div class="topic-metadata">

**Author:** [@gleyland](https://discourse.julialang.org/u/gleyland)\
**Replies:** 9\
**Last updated:** [September 15, 2021, 11:11pm UTC](https://discourse.julialang.org/t/gurobi-not-using-barrier-method/68078 "2021-09-15T23:11:16Z")

</div>

Hi, I have a model (the LP mentioned in my earlier post), that, when solved from Julia, logs indicate that Gurobi uses a primal simplex algorithm, but when I dump the MPS and solve it from the command-line, gurobi\_cl us…

---

## [Coding up basic power flow equation](https://discourse.julialang.org/t/coding-up-basic-power-flow-equation/67896)

<div class="topic-metadata">

**Author:** [@mbah](https://discourse.julialang.org/u/mbah)\
**Replies:** 6\
**Last updated:** [September 15, 2021, 9:55am UTC](https://discourse.julialang.org/t/coding-up-basic-power-flow-equation/67896 "2021-09-15T09:55:58Z")

</div>

Hello, I am relatively new to Julia and power systems optimization. At the moment, I am trying to understand power flows from scratch and this involves coding up/defining branch power flows for a simple three bus netwo…

---

## [Solving a Convex Quadratic Program Using Gurobi & Mosek](https://discourse.julialang.org/t/solving-a-convex-quadratic-program-using-gurobi-mosek/67214)

<div class="topic-metadata">

**Author:** [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Replies:** 12\
**Last updated:** [September 14, 2021, 10:18pm UTC](https://discourse.julialang.org/t/solving-a-convex-quadratic-program-using-gurobi-mosek/67214 "2021-09-14T22:18:25Z")

</div>

I would like to solve the following Quadratic Program / Quadratic Programming: \\begin{aligned} \\arg \\min\_{x} \\quad & \\frac{1}{2} {x}^{T} P x + {x}^{T} q \\\\ \\text{subject to} \\quad & l \\leq A x \\leq u \\end{aligned} The…

---

## [Using the solver SDPT3 with PowerModels.jl](https://discourse.julialang.org/t/using-the-solver-sdpt3-with-powermodels-jl/68070)

<div class="topic-metadata">

**Author:** [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Replies:** 4\
**Last updated:** [September 14, 2021, 2:52pm UTC](https://discourse.julialang.org/t/using-the-solver-sdpt3-with-powermodels-jl/68070 "2021-09-14T14:52:46Z")

</div>

Hello I’m trying to use the solver SDPT3 for solving a SDP problem using the library PowerModels.jl that utilizes JuMP, the error that I get is julia\> test=run\_opf(“case3\_SDP.m”,SDPWRMPowerModel,solver4) ┌ Warning: Ma…

---

## [Gurobi Error 10005: Unable to retrieve attribute 'Slack'](https://discourse.julialang.org/t/gurobi-error-10005-unable-to-retrieve-attribute-slack/68067)

<div class="topic-metadata">

**Author:** [@gleyland](https://discourse.julialang.org/u/gleyland)\
**Replies:** 3\
**Last updated:** [September 13, 2021, 3:35am UTC](https://discourse.julialang.org/t/gurobi-error-10005-unable-to-retrieve-attribute-slack/68067 "2021-09-13T03:35:24Z")

</div>

Hi, I’m getting the above error when using Gurobi to solve an LP and then querying the value of a constraint. The LP has been solved such that @assert(termination\_status(𝓜) == MOI.OPTIMAL) passes. Unfortunately, I hav…

---

## [How to create JuMP expressions without adding them to a model?](https://discourse.julialang.org/t/how-to-create-jump-expressions-without-adding-them-to-a-model/68012)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 5\
**Last updated:** [September 11, 2021, 11:56am UTC](https://discourse.julialang.org/t/how-to-create-jump-expressions-without-adding-them-to-a-model/68012 "2021-09-11T11:56:27Z")

</div>

I’m trying to build a GARCH(1, 1) model, and this requires recursively constructing the variance: \\sigma\_t^2 = \\alpha + \\beta \\epsilon\_{t-1}^2 + \\gamma \\sigma\_{t-1}^2 Since the variances are unobserved (only the epsil…

---

## [Powermodels Solver options](https://discourse.julialang.org/t/powermodels-solver-options/68003)

<div class="topic-metadata">

**Author:** [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Replies:** 7\
**Last updated:** [September 10, 2021, 9:54pm UTC](https://discourse.julialang.org/t/powermodels-solver-options/68003 "2021-09-10T21:54:28Z")

</div>

Hello everyone i have a question regarding how to change solver options while using Powermodels.jl. I would appreciate your help in this regard.

---

## [Huge jump in version numbers for coin-or binary dependencies](https://discourse.julialang.org/t/huge-jump-in-version-numbers-for-coin-or-binary-dependencies/67825)

<div class="topic-metadata">

**Author:** [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Replies:** 2\
**Last updated:** [September 7, 2021, 6:58pm UTC](https://discourse.julialang.org/t/huge-jump-in-version-numbers-for-coin-or-binary-dependencies/67825 "2021-09-07T18:58:42Z")

</div>

After my most recent \] up, I saw \[38041ee0\] ↑ Cbc\_jll v2.10.3+5 ⇒ v200.1000.500+1 \[3830e938\] ↑ Cgl\_jll v0.60.2+6 ⇒ v0.6000.200+0 \[06985876\] ↑ Clp\_jll v1.17.6+7 ⇒ v100.1700.600+0 Did something go wrong in the buil…

---

## [System data in different formats in PowerModels.jl](https://discourse.julialang.org/t/system-data-in-different-formats-in-powermodels-jl/67344)

<div class="topic-metadata">

**Author:** [@Mariana](https://discourse.julialang.org/u/Mariana)\
**Replies:** 2\
**Last updated:** [September 7, 2021, 9:14am UTC](https://discourse.julialang.org/t/system-data-in-different-formats-in-powermodels-jl/67344 "2021-09-07T09:14:56Z")

</div>

Hello. I’m using PowerModels.jl to study different power flow methods. However, for a specific system that I’m studying, I don’t have all the data in a single file. Also, the system’s data files I have are in different …

---

## [Cbc JuMP set constraints](https://discourse.julialang.org/t/cbc-jump-set-constraints/67570)

<div class="topic-metadata">

**Author:** [@giulia](https://discourse.julialang.org/u/giulia)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 10:03pm UTC](https://discourse.julialang.org/t/cbc-jump-set-constraints/67570 "2021-09-02T22:03:59Z")

</div>

Hello, I am trying to create a simple optimization model using JuMP and Cbc. My code is following: using JuMP, Cbc m = Model(Cbc.Optimizer) @variable(m, x1) @variable(m, x2) @constraint(m, constraint1, x1 \* x2 == 1…

---

## [Compute conflict indexed output for gurobi](https://discourse.julialang.org/t/compute-conflict-indexed-output-for-gurobi/67585)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 9:55pm UTC](https://discourse.julialang.org/t/compute-conflict-indexed-output-for-gurobi/67585 "2021-09-02T21:55:13Z")

</div>

Hi All, i am using compute conflict with gurobi the sample code and output is given as @constraint(model,conexisting20\[p in 1:P, b in 1:B\],sum(ME\_B\_O\_20\[b,c,p\]\*C\_s20\[c\] for c in 1:C)==Moves20\[p,b\] ) println("=======…

---

## [Hypatia sum of squares cone](https://discourse.julialang.org/t/hypatia-sum-of-squares-cone/67523)

<div class="topic-metadata">

**Author:** [@geo](https://discourse.julialang.org/u/geo)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 6:16pm UTC](https://discourse.julialang.org/t/hypatia-sum-of-squares-cone/67523 "2021-09-02T18:16:36Z")

</div>

I want to optimize over sum of squares, but with constraints on the coefficients of the polynomials. I know that this can be done by adding constraints; however, this often seems wasteful. For example I want to restrict …

---

## [Key 1.0 not found](https://discourse.julialang.org/t/key-1-0-not-found/67400)

<div class="topic-metadata">

**Author:** [@fksayaci](https://discourse.julialang.org/u/fksayaci)\
**Replies:** 13\
**Last updated:** [September 2, 2021, 5:03am UTC](https://discourse.julialang.org/t/key-1-0-not-found/67400 "2021-09-02T05:03:38Z")

</div>

Hi, I have an optimization model, which I have run for a long time on my personal machine. When I run the same model on a cluster, it gives some errors. The error is as follows: ERROR: LoadError: KeyError: key 1.0 not …

---

## [Efficient deletion of affine constraints](https://discourse.julialang.org/t/efficient-deletion-of-affine-constraints/67529)

<div class="topic-metadata">

**Author:** [@bsturt](https://discourse.julialang.org/u/bsturt)\
**Replies:** 3\
**Last updated:** [September 1, 2021, 8:56pm UTC](https://discourse.julialang.org/t/efficient-deletion-of-affine-constraints/67529 "2021-09-01T20:56:53Z")

</div>

Many apologies in advance if this topic has already been answered. I am implementing an cutting plane algorithm for solving a class of large-scale LPs using JuMP and Gurobi. Because the model requires lots of RAM, I am …

---

## [\[ANN\] Hypatia.jl: a new solver for generic conic optimization](https://discourse.julialang.org/t/ann-hypatia-jl-a-new-solver-for-generic-conic-optimization/47786)

<div class="topic-metadata">

**Author:** [@chriscoey](https://discourse.julialang.org/u/chriscoey)\
**Replies:** 0\
**Last updated:** [October 5, 2020, 1:47pm UTC](https://discourse.julialang.org/t/ann-hypatia-jl-a-new-solver-for-generic-conic-optimization/47786 "2020-10-05T13:47:53Z")

</div>

Hi friends, particularly those of you interested in conic optimization. We (myself and Lea Kapelevich, under the supervision of Juan Pablo Vielma) have just released v0.1.0 of Hypatia.jl, our pure-Julia open-source gener…

---

## [Libraries for constrained genetics algorithm](https://discourse.julialang.org/t/libraries-for-constrained-genetics-algorithm/66978)

<div class="topic-metadata">

**Author:** [@Hilaire\_Foillard](https://discourse.julialang.org/u/Hilaire_Foillard)\
**Replies:** 7\
**Last updated:** [August 30, 2021, 3:24pm UTC](https://discourse.julialang.org/t/libraries-for-constrained-genetics-algorithm/66978 "2021-08-30T15:24:48Z")

</div>

Hello, I’m an engineer in operational research and I was working on a MILP. Since the problem was to big I decided to use Benders cut. But it’s still very big so I want to change my method and to use genetics algorithm. …

---

## [How to view which model the variable belongs to?](https://discourse.julialang.org/t/how-to-view-which-model-the-variable-belongs-to/67233)

<div class="topic-metadata">

**Author:** [@iiitr](https://discourse.julialang.org/u/iiitr)\
**Replies:** 4\
**Last updated:** [August 29, 2021, 1:59am UTC](https://discourse.julialang.org/t/how-to-view-which-model-the-variable-belongs-to/67233 "2021-08-29T01:59:17Z")

</div>

Hi, all Here, I create two variables which belong to two different model, respectively, like: m1 = Model() m2 = Model() @variable(m1, x) @variable(m2, y) How can I know x and y belong to which model? I already kno…

---

## [It's running too long](https://discourse.julialang.org/t/its-running-too-long/66921)

<div class="topic-metadata">

**Author:** [@zhangsanle](https://discourse.julialang.org/u/zhangsanle)\
**Replies:** 6\
**Last updated:** [August 28, 2021, 2:07am UTC](https://discourse.julialang.org/t/its-running-too-long/66921 "2021-08-28T02:07:08Z")

</div>

I ran the following code for 7 hours without any results, how can I modify it? Thanks using Optim, LinearAlgebra, Statistics, Plots, QuantEcon, Distributions, Interpolations, NLsolve, Random, JuMP, GLPK import Ipopt β…

---

## [Error This intrinsic must be compiled to be called. Flux/Zygote](https://discourse.julialang.org/t/error-this-intrinsic-must-be-compiled-to-be-called-flux-zygote/66966)

<div class="topic-metadata">

**Author:** [@bgladman](https://discourse.julialang.org/u/bgladman)\
**Replies:** 5\
**Last updated:** [August 28, 2021, 1:10am UTC](https://discourse.julialang.org/t/error-this-intrinsic-must-be-compiled-to-be-called-flux-zygote/66966 "2021-08-28T01:10:33Z")

</div>

Hey all. I am trying to implement a neural network controller which emulates this example https://github.com/FluxML/Trebuchet.jl. In place of the ODE solver I am using a previously trained Flux model which outputs a si…

---

## [Smooth Signal Correlation](https://discourse.julialang.org/t/smooth-signal-correlation/67055)

<div class="topic-metadata">

**Author:** [@user1200](https://discourse.julialang.org/u/user1200)\
**Replies:** 4\
**Last updated:** [August 27, 2021, 3:30pm UTC](https://discourse.julialang.org/t/smooth-signal-correlation/67055 "2021-08-27T15:30:34Z")

</div>

Hello I wanted, to smooth data signal. For example, using mean y\[1\]=(a\[1\]+a\[2\])/2 it is y\[1\]=0.5\*a\[1\]+0.5\*a\[2\] y\[2\]=0.5\*a\[3\]+0.5\*a\[4\] But in specific way, that new signal (y), need to have some attributes: for e…

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

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