# Optimization (Mathematical)

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

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

**Page:** 95

---

## [JuMP on repl.it (Julia 1.3)](https://discourse.julialang.org/t/jump-on-repl-it-julia-1-3/42662)

<div class="topic-metadata">

**Author:** [@elalaouifaris](https://discourse.julialang.org/u/elalaouifaris)\
**Replies:** 7\
**Last updated:** [August 2, 2020, 2:11pm UTC](https://discourse.julialang.org/t/jump-on-repl-it-julia-1-3/42662 "2020-08-02T14:11:47Z")

</div>

Hi, Just trying to use Julia on the repl.it website. There you can spin up an instance with Julia 1.3 pre-configured. using JuMP in it results in a compilation error. Is this a known problem? is there a way to make Ju…

---

## [bilevelJuMP](https://discourse.julialang.org/t/bileveljump/44088)

<div class="topic-metadata">

**Author:** [@dty](https://discourse.julialang.org/u/dty)\
**Replies:** 1\
**Last updated:** [August 1, 2020, 3:06pm UTC](https://discourse.julialang.org/t/bileveljump/44088 "2020-08-01T15:06:25Z")

</div>

@joaquimg I’m sorry to disturb you. Please tell me something about bilevel jump. When defining objective functions in the bilevel jump package, is it not allowed to minimize the sum of multiple objective functions? In …

---

## [Syntax for custom cost function for ODE parameter estimation](https://discourse.julialang.org/t/syntax-for-custom-cost-function-for-ode-parameter-estimation/43467)

<div class="topic-metadata">

**Author:** [@vaglino](https://discourse.julialang.org/u/vaglino)\
**Replies:** 3\
**Last updated:** [August 1, 2020, 12:04pm UTC](https://discourse.julialang.org/t/syntax-for-custom-cost-function-for-ode-parameter-estimation/43467 "2020-08-01T12:04:55Z")

</div>

Hi, I’m trying to write my own cost function for parameter estimation of an ode model. I am trying to weight the loss by the time t. Based on the documentation I came up with the following, but I’m unsure about the cor…

---

## [Setting environment variables for a package "SCIP"](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 27\
**Last updated:** [July 31, 2020, 9:46pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839 "2020-07-31T21:46:07Z")

</div>

hello there, I need to set the environment variable for SCIP package I am wokring on windows 10…so I opened: Advanced system Settings…Advanced…Environment Variables I created a new variable and added the path as: C:…

---

## [Convert Optim objective value back to a Float](https://discourse.julialang.org/t/convert-optim-objective-value-back-to-a-float/43942)

<div class="topic-metadata">

**Author:** [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Replies:** 6\
**Last updated:** [July 30, 2020, 7:32pm UTC](https://discourse.julialang.org/t/convert-optim-objective-value-back-to-a-float/43942 "2020-07-30T19:32:16Z")

</div>

I am working with the code in this gist. In the file test\_autochoice\_mew2.jl , I have the following pieces of code: \[...\] T = promote\_type(promote\_type(promote\_type(eltype(X),eltype(b)),eltype(Z)),eltype(W)) \[...\] ℓ …

---

## [PowerModels.jl building a data dictionary](https://discourse.julialang.org/t/powermodels-jl-building-a-data-dictionary/43856)

<div class="topic-metadata">

**Author:** [@fnbillimoria](https://discourse.julialang.org/u/fnbillimoria)\
**Replies:** 5\
**Last updated:** [July 30, 2020, 4:45am UTC](https://discourse.julialang.org/t/powermodels-jl-building-a-data-dictionary/43856 "2020-07-30T04:45:22Z")

</div>

I am using PowerModels.jl and PowerModelsAnnex.jl. Are there any helper functions available to build the PowerModels.jl data dictionary? I have an excel / csv file with the relevant data for the test case, which I wo…

---

## [Unable to delete constraints stored in dictionaries using JuMP@.constraint macro](https://discourse.julialang.org/t/unable-to-delete-constraints-stored-in-dictionaries-using-jump-constraint-macro/43920)

<div class="topic-metadata">

**Author:** [@srajan76](https://discourse.julialang.org/u/srajan76)\
**Replies:** 6\
**Last updated:** [July 30, 2020, 1:15am UTC](https://discourse.julialang.org/t/unable-to-delete-constraints-stored-in-dictionaries-using-jump-constraint-macro/43920 "2020-07-30T01:15:18Z")

</div>

I am unable to delete the constraints which is created and stored in a dictionary using the JuMP.@constraint macro. the constraints are added in the form for i in array d\[i\] = JuMP.@constraint(model, variable\[i\] == co…

---

## [Cleaning information to solve multiple instances of a JuMP model](https://discourse.julialang.org/t/cleaning-information-to-solve-multiple-instances-of-a-jump-model/43930)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 1:02am UTC](https://discourse.julialang.org/t/cleaning-information-to-solve-multiple-instances-of-a-jump-model/43930 "2020-07-30T01:02:15Z")

</div>

Hi all. I created an extensive program using JuMP library, to solve a specific model. To solve instances, I did make a routine to run for each instance all at once, using a loop and include to run. But I notice that it …

---

## [Parallel Solves in Gurobi.jl](https://discourse.julialang.org/t/parallel-solves-in-gurobi-jl/9908)

<div class="topic-metadata">

**Author:** [@vtjeng](https://discourse.julialang.org/u/vtjeng)\
**Replies:** 7\
**Last updated:** [July 29, 2020, 9:26pm UTC](https://discourse.julialang.org/t/parallel-solves-in-gurobi-jl/9908 "2020-07-29T21:26:47Z")

</div>

I have a JuMP (mixed-integer) model where I’m trying to determine the upper and lower bounds on many variables. Each individual solve is very quick, but since I have many variables (~1,000), the overall solve time is slo…

---

## [Beginner Question: How to use JuMP model variables in different functions](https://discourse.julialang.org/t/beginner-question-how-to-use-jump-model-variables-in-different-functions/43909)

<div class="topic-metadata">

**Author:** [@GerhardTotschnig](https://discourse.julialang.org/u/GerhardTotschnig)\
**Replies:** 2\
**Last updated:** [July 29, 2020, 7:38pm UTC](https://discourse.julialang.org/t/beginner-question-how-to-use-jump-model-variables-in-different-functions/43909 "2020-07-29T19:38:45Z")

</div>

I want to create a JUMP energy system model, where different features can be added or not. So my idea was to use different functions which can be called if needed for adding new equations to the model. Cannot figure out…

---

## [User Callback nodeid](https://discourse.julialang.org/t/user-callback-nodeid/43847)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 3\
**Last updated:** [July 29, 2020, 1:34pm UTC](https://discourse.julialang.org/t/user-callback-nodeid/43847 "2020-07-29T13:34:26Z")

</div>

Is there any way to retrieve the node id on user callback? On the Gurobi callback, cbget\_mipnode\_nodcnt serves well. But I want to use the MOI user callback, instead. Thanks in advance!

---

## [Enforce a matrix to be positive semidefinite in JuMP](https://discourse.julialang.org/t/enforce-a-matrix-to-be-positive-semidefinite-in-jump/43853)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 1\
**Last updated:** [July 29, 2020, 9:34am UTC](https://discourse.julialang.org/t/enforce-a-matrix-to-be-positive-semidefinite-in-jump/43853 "2020-07-29T09:34:10Z")

</div>

Hi All, I want to enforce a square matrix in my code (i.e. W) to be positive semidefinite. I am using Gurobi solver. I have added the following constraint in my code to fulfill the task. @constraint (model, W in PSDcon…

---

## [PowerModelsAnnex.jl obtaining duals](https://discourse.julialang.org/t/powermodelsannex-jl-obtaining-duals/43535)

<div class="topic-metadata">

**Author:** [@fnbillimoria](https://discourse.julialang.org/u/fnbillimoria)\
**Replies:** 5\
**Last updated:** [July 29, 2020, 4:17am UTC](https://discourse.julialang.org/t/powermodelsannex-jl-obtaining-duals/43535 "2020-07-29T04:17:10Z")

</div>

I have downloaded the PowerModelsAnnex.jl files. I am using the build\_qc\_opf functions, and wish to obtain dual prices from the solution. The specific dual prices I wish to obtain are the duals of the power balance or …

---

## [Setting a small case in PowerModels as m file](https://discourse.julialang.org/t/setting-a-small-case-in-powermodels-as-m-file/43821)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 3\
**Last updated:** [July 28, 2020, 6:57pm UTC](https://discourse.julialang.org/t/setting-a-small-case-in-powermodels-as-m-file/43821 "2020-07-28T18:57:44Z")

</div>

hello there, I want to test a small 3 bus system on PowerModels and I had to modify the case5.m into case3.m since there was no smaller system than 5 bus network however I get this error when I run my julia file with t…

---

## [Gurobi - Branch Priority](https://discourse.julialang.org/t/gurobi-branch-priority/43826)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 3\
**Last updated:** [July 28, 2020, 6:39pm UTC](https://discourse.julialang.org/t/gurobi-branch-priority/43826 "2020-07-28T18:39:55Z")

</div>

I wish I could use the Gurobi attribute “Branch Priority”. So I tried to use it that way and it gave an error. Is there a smarter way to do this? MOI.set(model,Gurobi.ModelAttribute("BranchPriority"), u) u is the varia…

---

## [Benders decomposition in JuMP](https://discourse.julialang.org/t/benders-decomposition-in-jump/43678)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 4\
**Last updated:** [July 28, 2020, 6:10pm UTC](https://discourse.julialang.org/t/benders-decomposition-in-jump/43678 "2020-07-28T18:10:44Z")

</div>

Hello, I have been experimenting with JuMP and I have coded a CVaR optimisation problem using the method introduced by Rockfeller and Uryasev. My implementation given below uses extensive form of the stochastic program. …

---

## [Julia+JuMP performances](https://discourse.julialang.org/t/julia-jump-performances/43766)

<div class="topic-metadata">

**Author:** [@mamo](https://discourse.julialang.org/u/mamo)\
**Replies:** 2\
**Last updated:** [July 27, 2020, 4:24pm UTC](https://discourse.julialang.org/t/julia-jump-performances/43766 "2020-07-27T16:24:29Z")

</div>

A question for Julia community. The problem I have has: \_nvars = 2483610 \_ncons = 1269620 \_total\_solve\_time = 91.625 sec Solver is AMPL+CPLEX. Is this a feasible problem for JuMP + GLPK? Anybody compared performanc…

---

## [Which JuMP.jl solver for this problem?](https://discourse.julialang.org/t/which-jump-jl-solver-for-this-problem/43350)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 19\
**Last updated:** [July 27, 2020, 12:04pm UTC](https://discourse.julialang.org/t/which-jump-jl-solver-for-this-problem/43350 "2020-07-27T12:04:53Z")

</div>

I’ve been struggling for a couple of days now to coerce JuMP to solve a particular problem. The goal is fairly simple and I’ll describe a simplified version of my real problem here, along with the code: Given the latitu…

---

## [Juniper...Solver gets only local optimum point](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 10\
**Last updated:** [July 26, 2020, 8:53pm UTC](https://discourse.julialang.org/t/juniper-solver-gets-only-local-optimum-point/43676 "2020-07-26T20:53:35Z")

</div>

Hello there, Congratulations on the amazing conference of 2020 at first…Let me tell you my problem briefly I have a non convex NLP (OPF or Optimal Power Flow) and I want to try different solvers on this problem. I deci…

---

## [Adding a new function to the PowerModelsAnnex](https://discourse.julialang.org/t/adding-a-new-function-to-the-powermodelsannex/43634)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 5\
**Last updated:** [July 26, 2020, 4:37pm UTC](https://discourse.julialang.org/t/adding-a-new-function-to-the-powermodelsannex/43634 "2020-07-26T16:37:50Z")

</div>

Hi all, I have written a function, i.e, sdp\_opf, to solve the OPF problem via SDP relaxation which exports the build\_sdp\_opf. However, when I want to run my code via build\_sdp\_opf(case,model) I get the following error…

---

## [Why do I get Infeasible Solution (JuMP with Optimizer Ipopt)](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 31\
**Last updated:** [July 26, 2020, 4:36pm UTC](https://discourse.julialang.org/t/why-do-i-get-infeasible-solution-jump-with-optimizer-ipopt/43141 "2020-07-26T16:36:41Z")

</div>

hello, I have developed a code that optimizes a power system and then I find that JuMP return infeasible solution My constraints are non linear and my objective is non linear too Am I utilizing the wrong solver or wh…

---

## [JuMP development sprints](https://discourse.julialang.org/t/jump-development-sprints/42433)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 5\
**Last updated:** [July 26, 2020, 2:42pm UTC](https://discourse.julialang.org/t/jump-development-sprints/42433 "2020-07-26T14:42:59Z")

</div>

Edit: Please read this Google doc, which has all the information. Dear all, Ever wanted to contribute to JuMP but not known where to start? Now’s your chance! Over the next few months, we will be holding a series of …

---

## [Slower code after migrating from MathProgBase](https://discourse.julialang.org/t/slower-code-after-migrating-from-mathprogbase/43650)

<div class="topic-metadata">

**Author:** [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Replies:** 10\
**Last updated:** [July 25, 2020, 8:04pm UTC](https://discourse.julialang.org/t/slower-code-after-migrating-from-mathprogbase/43650 "2020-07-25T20:04:27Z")

</div>

Hi, after updating some packages I got this error: \`ClpSolver\` is no longer supported. If you are using JuMP, upgrade to the latest version and use \`Clp.Optimizer\` instead. If you are using MathProgBase (e.g., via \`lin…

---

## [Correct use of the sparsity pattern in NLsolve.jl for Diagonal Jacobians](https://discourse.julialang.org/t/correct-use-of-the-sparsity-pattern-in-nlsolve-jl-for-diagonal-jacobians/43469)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 6\
**Last updated:** [July 24, 2020, 11:34pm UTC](https://discourse.julialang.org/t/correct-use-of-the-sparsity-pattern-in-nlsolve-jl-for-diagonal-jacobians/43469 "2020-07-24T23:34:01Z")

</div>

Hello, I would like to solve \\sim 400 nonlinear equations using NLsolve.jl for which the Jacobian matrix is diagonal, i.e. the components are independent of each other. I would like to use the sparsity pattern to sp…

---

## [Trying variety of Solvers](https://discourse.julialang.org/t/trying-variety-of-solvers/43567)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 2\
**Last updated:** [July 24, 2020, 11:45am UTC](https://discourse.julialang.org/t/trying-variety-of-solvers/43567 "2020-07-24T11:45:31Z")

</div>

hello there, I have been looking for some solver to try with my problem ( non convex NLP) After finishing the modelling stage, I was really impressed by the easiness of using a solver like Ipopt with JuMP, but now to l…

---

## [SDP relaxation in PowerModelsAneex](https://discourse.julialang.org/t/sdp-relaxation-in-powermodelsaneex/41898)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 6\
**Last updated:** [July 23, 2020, 11:37pm UTC](https://discourse.julialang.org/t/sdp-relaxation-in-powermodelsaneex/41898 "2020-07-23T23:37:11Z")

</div>

Hi All, I am wondering if there is an SDP relaxation of the OPF problem in PowerModelsAnnex? If there is no such function, I would appreciate any guide for implementing that in the PowerModelsAnnex. I have noticed ther…

---

## [How to define a heuristic callback using JuMP?](https://discourse.julialang.org/t/how-to-define-a-heuristic-callback-using-jump/43322)

<div class="topic-metadata">

**Author:** [@Gaiato](https://discourse.julialang.org/u/Gaiato)\
**Replies:** 8\
**Last updated:** [July 23, 2020, 9:10pm UTC](https://discourse.julialang.org/t/how-to-define-a-heuristic-callback-using-jump/43322 "2020-07-23T21:10:01Z")

</div>

I’m trying to implement integer programming callbacks using JuMP. Basically, my heuristic callback is defined like this: function my\_heuristic\_callback(cb\_data) x\_val = \[callback\_value(cb\_data, x\_i) for x\_i in x\] x\_s…

---

## [Install CPLEX in Julia 1.4.2 32 bits](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564)

<div class="topic-metadata">

**Author:** [@Luis\_Tormo](https://discourse.julialang.org/u/Luis_Tormo)\
**Replies:** 5\
**Last updated:** [July 23, 2020, 6:43pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564 "2020-07-23T18:43:05Z")

</div>

Do you know if there is any way to install CPLEX on Julia 1.4.2 32 bit? I know I need one of the latest versions of CPLEX in 32 bit. I tried to install CPLEX 12.6.3 32bit but it gave me a lot of problems and I didn’t get…

---

## [Preconditioner for nonlinear optimization](https://discourse.julialang.org/t/preconditioner-for-nonlinear-optimization/43558)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 3:14pm UTC](https://discourse.julialang.org/t/preconditioner-for-nonlinear-optimization/43558 "2020-07-23T15:14:13Z")

</div>

Hello, I am working on the following nonlinear minimization problem: \\displaystyle{\\min\_{\\boldsymbol{c} \\in R^n}} \\mbox{ }\\frac{1}{M} \\sum\_{i=1}^{M} \\left(\\frac{1}{2} \\left\[\\boldsymbol{c}^T \\boldsymbol{f}\_0 + \\int…

---

## [Count the number of evauations of the objective function](https://discourse.julialang.org/t/count-the-number-of-evauations-of-the-objective-function/43251)

<div class="topic-metadata">

**Author:** [@Ariel\_Cruz\_Cruz](https://discourse.julialang.org/u/Ariel_Cruz_Cruz)\
**Replies:** 3\
**Last updated:** [July 23, 2020, 1:06pm UTC](https://discourse.julialang.org/t/count-the-number-of-evauations-of-the-objective-function/43251 "2020-07-23T13:06:23Z")

</div>

Hello, I am using JuMP with the Ipopt solver to optimize certain optimization problem. And I need to get the number of evaluations of the objective function. When I run my program I get some information such as: Number …

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

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