# Optimization (Mathematical)

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

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

**Page:** 35

---

## [Is it expected that a zero-one variable may have a non-integer value after an optimal solution is found?](https://discourse.julialang.org/t/is-it-expected-that-a-zero-one-variable-may-have-a-non-integer-value-after-an-optimal-solution-is-found/107430)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 5\
**Last updated:** [December 11, 2023, 12:37pm UTC](https://discourse.julialang.org/t/is-it-expected-that-a-zero-one-variable-may-have-a-non-integer-value-after-an-optimal-solution-is-found/107430 "2023-12-11T12:37:37Z")

</div>

I formulate a mathematical optimization (MIQCP) problem with MathOptInterface.jl and solve it with Gurobi.jl. Certain variables in my problem are constrained (with MOI.add\_constrained\_variables(optimizer, \[MOI.ZeroOne() …

---

## [Gurobi AddGenConstrPoly() in JuMP](https://discourse.julialang.org/t/gurobi-addgenconstrpoly-in-jump/107123)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 7\
**Last updated:** [December 11, 2023, 5:17am UTC](https://discourse.julialang.org/t/gurobi-addgenconstrpoly-in-jump/107123 "2023-12-11T05:17:23Z")

</div>

Hi All, Can we code GRBModel.AddGenConstrPoly() constraint available in gurobi directly in JuMP. The MINLP is solved using Juniper. we want to try Gurobi for this.

---

## [Minimisation with equality constraints](https://discourse.julialang.org/t/minimisation-with-equality-constraints/107358)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 5\
**Last updated:** [December 10, 2023, 9:13pm UTC](https://discourse.julialang.org/t/minimisation-with-equality-constraints/107358 "2023-12-10T21:13:06Z")

</div>

I am trying a constrained minimisation with equality constraints. using LinearAlgebra using Optimization, OptimizationMOI, AmplNLWriter, Ipopt\_jll function objectivehelp(N) car = rand(N) .+ 1; sar = rand(N); r…

---

## [Evaluating constraints at fixed points (and extracting their variables) in JuMP](https://discourse.julialang.org/t/evaluating-constraints-at-fixed-points-and-extracting-their-variables-in-jump/47227)

<div class="topic-metadata">

**Author:** [@1ozturkbe](https://discourse.julialang.org/u/1ozturkbe)\
**Replies:** 5\
**Last updated:** [December 10, 2023, 3:47am UTC](https://discourse.julialang.org/t/evaluating-constraints-at-fixed-points-and-extracting-their-variables-in-jump/47227 "2023-12-10T03:47:44Z")

</div>

Hello folks, I know this has likely been addressed in a really deep thread here somewhere, but I have been having trouble evaluating constraints in JuMP for fixed variable values. So far, I am doing the following: # Wo…

---

## [Infeasible warmstart with JuMP & HiGHS](https://discourse.julialang.org/t/infeasible-warmstart-with-jump-highs/106869)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 7\
**Last updated:** [December 9, 2023, 8:47pm UTC](https://discourse.julialang.org/t/infeasible-warmstart-with-jump-highs/106869 "2023-12-09T20:47:20Z")

</div>

I’m a bit at a loss with an issue I have when trying to warmstart HiGHS on my model. EDIT: I originally did not manage to build a minimal reproducer, so I made a relatively messy post (kept below for posterity). But I j…

---

## [Optimization with complex requirements](https://discourse.julialang.org/t/optimization-with-complex-requirements/107266)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 3\
**Last updated:** [December 9, 2023, 8:33pm UTC](https://discourse.julialang.org/t/optimization-with-complex-requirements/107266 "2023-12-09T20:33:12Z")

</div>

My optimization problem can be simplified as follows. A vector of coefficients x has an upper an lower bound for each element. μ is a function of the elements of x that itself has an upper and lower bound. And μ has a…

---

## [Extracting the Power Flow equations from PowerModels](https://discourse.julialang.org/t/extracting-the-power-flow-equations-from-powermodels/107165)

<div class="topic-metadata">

**Author:** [@Jim16](https://discourse.julialang.org/u/Jim16)\
**Replies:** 4\
**Last updated:** [December 7, 2023, 7:48pm UTC](https://discourse.julialang.org/t/extracting-the-power-flow-equations-from-powermodels/107165 "2023-12-07T19:48:23Z")

</div>

Hello, I’m relatively new to both Julia and PowerModels.jl, and I wish to compare different algorithms for solving power flow equations. My objective is to obtain the power flow equations from PowerModels.jl, allowing m…

---

## [I'm having trouble installing GPLK](https://discourse.julialang.org/t/im-having-trouble-installing-gplk/107195)

<div class="topic-metadata">

**Author:** [@doriiido](https://discourse.julialang.org/u/doriiido)\
**Replies:** 7\
**Last updated:** [December 6, 2023, 5:31am UTC](https://discourse.julialang.org/t/im-having-trouble-installing-gplk/107195 "2023-12-06T05:31:25Z")

</div>

I’m fairly new to Julia, I’m trying to install GPLK package but this erroe keeps showing up: (@v1.6) pkg\> add GPLK Updating registry at C:\\Users\\doriiido\\.julia\\registries\\General Updating git-repo https://github.com/…

---

## [\`Gurobi.Optimizer()\` throws, reports \`Gurobi Error 10001\` even though there's plenty of memory](https://discourse.julialang.org/t/gurobi-optimizer-throws-reports-gurobi-error-10001-even-though-theres-plenty-of-memory/107193)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 2\
**Last updated:** [December 6, 2023, 4:41am UTC](https://discourse.julialang.org/t/gurobi-optimizer-throws-reports-gurobi-error-10001-even-though-theres-plenty-of-memory/107193 "2023-12-06T04:41:33Z")

</div>

I’m not sure why, but, some times when I run Gurobi.Optimizer(), it throws, reporting Gurobi Error 10001, which is meant for out-of-memory situations. I’m pretty sure that’s some kind of bug, because there seems to be pl…

---

## [What else than PATH solver for linear or mixed complementarity problem (LCP/MCP)?](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 14\
**Last updated:** [December 5, 2023, 11:09pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110 "2023-12-05T23:09:38Z")

</div>

What else than PATHSolver.jl is available in Julia for linear or mixed complementarity problem (LCP/MCP)? Within JuMP or outside it. The thing is that The PATH Solver binaries are still not available for Apple M process…

---

## [Can't solve a problem with nonlinear terms like x^0.7 or x^3 using JuMP with Gurobi 11](https://discourse.julialang.org/t/cant-solve-a-problem-with-nonlinear-terms-like-x-0-7-or-x-3-using-jump-with-gurobi-11/106896)

<div class="topic-metadata">

**Author:** [@JackaChou](https://discourse.julialang.org/u/JackaChou)\
**Replies:** 8\
**Last updated:** [December 5, 2023, 3:09pm UTC](https://discourse.julialang.org/t/cant-solve-a-problem-with-nonlinear-terms-like-x-0-7-or-x-3-using-jump-with-gurobi-11/106896 "2023-12-05T15:09:21Z")

</div>

I have installed Gurobi 11 and Gurobi 1.2.0.jl, and it’s believed that Gurobi now supports solving general nonlinear programming like x^0.7 or x^3, but I cannot solve it with JuMP using Gurobi, if I switch the solve to …

---

## [Computing common components in KNITRO callbacks](https://discourse.julialang.org/t/computing-common-components-in-knitro-callbacks/107014)

<div class="topic-metadata">

**Author:** [@fimiller](https://discourse.julialang.org/u/fimiller)\
**Replies:** 7\
**Last updated:** [December 5, 2023, 1:35pm UTC](https://discourse.julialang.org/t/computing-common-components-in-knitro-callbacks/107014 "2023-12-05T13:35:31Z")

</div>

I am using KNITRO.jl to solve a particular optimization problem. In my optimization problem, there is a common calculation done across the constraint, jacobian for the constraint, and the hessian for the constraint. Cur…

---

## [SDDP.jl without any uncertainty](https://discourse.julialang.org/t/sddp-jl-without-any-uncertainty/106964)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 5\
**Last updated:** [December 4, 2023, 5:19pm UTC](https://discourse.julialang.org/t/sddp-jl-without-any-uncertainty/106964 "2023-12-04T17:19:03Z")

</div>

Hello everyone, I was experimenting with SDDP.jl, changing parameters to see how it behaved. I defined a random variable but parametrized it equally (9 equal realizations), so the problem became deterministic and was s…

---

## [Zygote error when using Nonconvex.jl: Mutating arrays is not supported](https://discourse.julialang.org/t/zygote-error-when-using-nonconvex-jl-mutating-arrays-is-not-supported/107067)

<div class="topic-metadata">

**Author:** [@AP\_profile](https://discourse.julialang.org/u/AP_profile)\
**Replies:** 2\
**Last updated:** [December 3, 2023, 1:59pm UTC](https://discourse.julialang.org/t/zygote-error-when-using-nonconvex-jl-mutating-arrays-is-not-supported/107067 "2023-12-03T13:59:18Z")

</div>

Hi all, I am new to Julia and trying to use SLSQP Nonconvex. The optimization code is as follows: using Nonconvex Nonconvex.@load NLopt start\_vec = zeros(11) gamma\_vec = range(start=-7, stop=7, length=40) rho = 0.58 t…

---

## [Does this output look like SCIP has fallen into an infinite loop?](https://discourse.julialang.org/t/does-this-output-look-like-scip-has-fallen-into-an-infinite-loop/107061)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [December 2, 2023, 11:21pm UTC](https://discourse.julialang.org/t/does-this-output-look-like-scip-has-fallen-into-an-infinite-loop/107061 "2023-12-02T23:21:13Z")

</div>

I’m using SCIP.jl, and the SCIP solver seems like it maybe enters an infinite loop, judging by the output it’s producing: 897s|591200 |476649 |685013 | 1.2 | 3574M | 241 |1212 | 651 | 390 | 213k| 1 | 1 | 21 | 0…

---

## [Time to find the best solution in a mixed-integer linear programming model with JuMP](https://discourse.julialang.org/t/time-to-find-the-best-solution-in-a-mixed-integer-linear-programming-model-with-jump/106985)

<div class="topic-metadata">

**Author:** [@baprata](https://discourse.julialang.org/u/baprata)\
**Replies:** 2\
**Last updated:** [December 2, 2023, 10:28am UTC](https://discourse.julialang.org/t/time-to-find-the-best-solution-in-a-mixed-integer-linear-programming-model-with-jump/106985 "2023-12-02T10:28:53Z")

</div>

I am solving a mixed-integer linear programming model with JuMP and CPLEX. How could I measure the time required to find the best solution? Sometimes, the global optimal solution is found, but the solver continues the s…

---

## [MultiObjectiveAlgorithms.jl (Error Message)](https://discourse.julialang.org/t/multiobjectivealgorithms-jl-error-message/106876)

<div class="topic-metadata">

**Author:** [@IgorESMelo](https://discourse.julialang.org/u/IgorESMelo)\
**Replies:** 7\
**Last updated:** [November 30, 2023, 10:01pm UTC](https://discourse.julialang.org/t/multiobjectivealgorithms-jl-error-message/106876 "2023-11-30T22:01:52Z")

</div>

Hi everyone, I’ve modeled a simple model to assign instruments to procedures. I’ve implemented the model in JuMP using the solver Gurobi and package MOA.jl. When I tried to solve the model, the message below appear to m…

---

## [AD with Enzyme.jl: "task switch not allowed from inside staged nor pure functions"](https://discourse.julialang.org/t/ad-with-enzyme-jl-task-switch-not-allowed-from-inside-staged-nor-pure-functions/106944)

<div class="topic-metadata">

**Author:** [@Joh11](https://discourse.julialang.org/u/Joh11)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 5:58pm UTC](https://discourse.julialang.org/t/ad-with-enzyme-jl-task-switch-not-allowed-from-inside-staged-nor-pure-functions/106944 "2023-11-30T17:58:22Z")

</div>

Hi all, I am trying to use Enzyme.jl to compute a gradient. I want to use gradient descent to find the optimal parameters to reproduce the spectrum of a family of Hamiltonians (i.e. just 2x2 hermitian matrices). Here is…

---

## [Subtour elimination constraints](https://discourse.julialang.org/t/subtour-elimination-constraints/106902)

<div class="topic-metadata">

**Author:** [@Victor\_Neto](https://discourse.julialang.org/u/Victor_Neto)\
**Replies:** 15\
**Last updated:** [November 30, 2023, 1:58am UTC](https://discourse.julialang.org/t/subtour-elimination-constraints/106902 "2023-11-30T01:58:34Z")

</div>

Dear colleagues, I am studying the school bus routing problem: Redirecting. I am reproducing this mixed-integer linear programming formulation. However, I was replacing the sub-tour constraints (3) with a flow constrai…

---

## [SBRP problem with capacity os bus](https://discourse.julialang.org/t/sbrp-problem-with-capacity-os-bus/106719)

<div class="topic-metadata">

**Author:** [@Victor\_Neto](https://discourse.julialang.org/u/Victor_Neto)\
**Replies:** 5\
**Last updated:** [November 29, 2023, 7:23pm UTC](https://discourse.julialang.org/t/sbrp-problem-with-capacity-os-bus/106719 "2023-11-29T19:23:11Z")

</div>

I’m trying to model a problem with school transport routes, however, according to the code below, whenever the bus capacity is exceeded by the number of students, the code presents an error. I don’t know which constraint…

---

## [Issues solving a bilevel optimization with binary variables](https://discourse.julialang.org/t/issues-solving-a-bilevel-optimization-with-binary-variables/105460)

<div class="topic-metadata">

**Author:** [@kiki](https://discourse.julialang.org/u/kiki)\
**Replies:** 3\
**Last updated:** [November 29, 2023, 5:44pm UTC](https://discourse.julialang.org/t/issues-solving-a-bilevel-optimization-with-binary-variables/105460 "2023-11-29T17:44:23Z")

</div>

I’m new using Julia to solve my nonlinear mixed integer bilevel model, so I have a model in JuMP using BilevelJuMP with binary and continuous variables at the lower and upper level and with non-linear \[non quadratic\] co…

---

## [Xpress with bilinear models (the model is MIQCP)](https://discourse.julialang.org/t/xpress-with-bilinear-models-the-model-is-miqcp/106680)

<div class="topic-metadata">

**Author:** [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Replies:** 7\
**Last updated:** [November 29, 2023, 5:37pm UTC](https://discourse.julialang.org/t/xpress-with-bilinear-models-the-model-is-miqcp/106680 "2023-11-29T17:37:01Z")

</div>

Hi, I am trying to use Xpress on a model with bilinear terms. With linear models it works while with my bilinear model I obtain: ?900 Warning: The quadratic part of row 'R21577' defines a nonconvex region. Please chec…

---

## [Is there any method to get a JuMP model in Latex format?](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728)

<div class="topic-metadata">

**Author:** [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Replies:** 5\
**Last updated:** [November 28, 2023, 5:29pm UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728 "2023-11-28T17:29:25Z")

</div>

I use JuMP package from julia programming language for modelling optimization problems. To investigate the performance of the model I need to print some of the model constraints. I want to know is there any automatic way…

---

## [Random variables with different time scales in SDDP.jl](https://discourse.julialang.org/t/random-variables-with-different-time-scales-in-sddp-jl/106823)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 3\
**Last updated:** [November 28, 2023, 3:46am UTC](https://discourse.julialang.org/t/random-variables-with-different-time-scales-in-sddp-jl/106823 "2023-11-28T03:46:25Z")

</div>

Hi everyone, Assume that we have a wind power production problem with two random variables: Demand Wind speed We aim to solve the problem for a year. There is a daily time scale for the state variables and controls. …

---

## [Setting the number of cores for a Gurobi license in JuMPg](https://discourse.julialang.org/t/setting-the-number-of-cores-for-a-gurobi-license-in-jumpg/106809)

<div class="topic-metadata">

**Author:** [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Replies:** 3\
**Last updated:** [November 27, 2023, 5:46pm UTC](https://discourse.julialang.org/t/setting-the-number-of-cores-for-a-gurobi-license-in-jumpg/106809 "2023-11-27T17:46:33Z")

</div>

Any help with the following error would be much appreciated. I tried set\_optimizer\_attribute(model,"Threads",8), but still get the error… julia\> set\_optimizer(model,Gurobi.Optimizer) ERROR: Gurobi Error 10009: License i…

---

## [Indicator constraints Not working](https://discourse.julialang.org/t/indicator-constraints-not-working/106687)

<div class="topic-metadata">

**Author:** [@papar](https://discourse.julialang.org/u/papar)\
**Replies:** 6\
**Last updated:** [November 26, 2023, 11:27pm UTC](https://discourse.julialang.org/t/indicator-constraints-not-working/106687 "2023-11-26T23:27:43Z")

</div>

I’m encountering a problem with an optimization model in Julia where I need to enforce a specific condition using indicator variables. The goal is to ensure that for each time period ( t ) (from 2 to T), either ( y\_{i,t}…

---

## [Adding nodes to JADE.jl](https://discourse.julialang.org/t/adding-nodes-to-jade-jl/106774)

<div class="topic-metadata">

**Author:** [@Zainab](https://discourse.julialang.org/u/Zainab)\
**Replies:** 1\
**Last updated:** [November 26, 2023, 10:59pm UTC](https://discourse.julialang.org/t/adding-nodes-to-jade-jl/106774 "2023-11-26T22:59:07Z")

</div>

I am using JADE.jl which is one of the applications of the JuMP package. The results of my simulations vary too much. I was trying to add another node to the EMI version of JADE. Any help in this matter would be much ap…

---

## [Modelling non-continuous piecewise linear functions](https://discourse.julialang.org/t/modelling-non-continuous-piecewise-linear-functions/106743)

<div class="topic-metadata">

**Author:** [@Galois](https://discourse.julialang.org/u/Galois)\
**Replies:** 4\
**Last updated:** [November 26, 2023, 8:07pm UTC](https://discourse.julialang.org/t/modelling-non-continuous-piecewise-linear-functions/106743 "2023-11-26T20:07:34Z")

</div>

I have an optimization problem where the objective (and some of the constraints) contain piecewise linear functions. The problem is relatively large and my attempts at solving it with pyomo and SCIP have not been very su…

---

## [How to model a multiobjective program](https://discourse.julialang.org/t/how-to-model-a-multiobjective-program/106561)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 5\
**Last updated:** [November 26, 2023, 7:16pm UTC](https://discourse.julialang.org/t/how-to-model-a-multiobjective-program/106561 "2023-11-26T19:16:08Z")

</div>

In the following code, of which I do not report a long series of complicated constraints, I would like to be able to specify in the objective function also the fact that, together with the Min, sum(x\[2:nr,:,"G/\\\\N"\]), I …

---

## [Accessing to the dual variables, SDDP.jl](https://discourse.julialang.org/t/accessing-to-the-dual-variables-sddp-jl/106603)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 5\
**Last updated:** [November 25, 2023, 10:42pm UTC](https://discourse.julialang.org/t/accessing-to-the-dual-variables-sddp-jl/106603 "2023-11-25T22:42:02Z")

</div>

Hi, Assume that our problem is two-staged and that there is no uncertainty in stage one. To solve that, we intend to employ Benders Decompsotion. The second stage of the problem itself is a multi-stage stochastic proble…

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

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