# Optimization (Mathematical)

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

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

**Page:** 33

---

## [Current State of LP solvers supporting warmstart (start values) in JuMP](https://discourse.julialang.org/t/current-state-of-lp-solvers-supporting-warmstart-start-values-in-jump/109160)

<div class="topic-metadata">

**Author:** [@BenniHs](https://discourse.julialang.org/u/BenniHs)\
**Replies:** 2\
**Last updated:** [January 31, 2024, 4:45pm UTC](https://discourse.julialang.org/t/current-state-of-lp-solvers-supporting-warmstart-start-values-in-jump/109160 "2024-01-31T16:45:46Z")

</div>

Hi everyone, I have a rather general question on JuMP and LP-Solvers. I am working on an algorithm, where many LPs have to be solved. I want to solve them using the JuMP Framework. There appears to be a lot of potential…

---

## [Help with Performance in Large Mixed Complementarity Problem](https://discourse.julialang.org/t/help-with-performance-in-large-mixed-complementarity-problem/106052)

<div class="topic-metadata">

**Author:** [@jmc](https://discourse.julialang.org/u/jmc)\
**Replies:** 23\
**Last updated:** [January 31, 2024, 1:56am UTC](https://discourse.julialang.org/t/help-with-performance-in-large-mixed-complementarity-problem/106052 "2024-01-31T01:56:05Z")

</div>

Hi! I have a complementarity problem in which I am using the new awesome additions to JuMP to solve it. The problem involves a summation over 2^J terms, where J is around 30 and performance is critical. I was wondering…

---

## [Historical simulation in SDDP.jl](https://discourse.julialang.org/t/historical-simulation-in-sddp-jl/109473)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 3\
**Last updated:** [January 30, 2024, 10:01pm UTC](https://discourse.julialang.org/t/historical-simulation-in-sddp-jl/109473 "2024-01-30T22:01:33Z")

</div>

Hi, I did simulation in SDDP.jl using historical data. It works; however, I could not retrieve the optimal solutions anymore by simply putting \[:variable\] as an argument in SDDP.simulate. What should we do in historica…

---

## [Will unprecised float printing affect my optimization solving time?](https://discourse.julialang.org/t/will-unprecised-float-printing-affect-my-optimization-solving-time/109456)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [January 30, 2024, 8:04pm UTC](https://discourse.julialang.org/t/will-unprecised-float-printing-affect-my-optimization-solving-time/109456 "2024-01-30T20:04:26Z")

</div>

I have a JuMP model and when I show my objective function, i.e.: @show objective\_function(model) objective\_function(model) = -0.17258400000000138 x\[1,1\] - 0.03807000000000031 x\[2,1\] - 0.07106400000000057 x\[3,1\] - 0.073…

---

## [Improving model formulation](https://discourse.julialang.org/t/improving-model-formulation/109252)

<div class="topic-metadata">

**Author:** [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Replies:** 10\
**Last updated:** [January 30, 2024, 11:14am UTC](https://discourse.julialang.org/t/improving-model-formulation/109252 "2024-01-30T11:14:30Z")

</div>

I’m currently working on a sales optimization problem using JuMP in Julia. The challenge involves representing the total sales value under specific constraints. However, my current approach leads to bilinear terms, which…

---

## [Stop JuMP optimization when gap doesn't improve enough](https://discourse.julialang.org/t/stop-jump-optimization-when-gap-doesnt-improve-enough/109437)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [January 30, 2024, 10:45am UTC](https://discourse.julialang.org/t/stop-jump-optimization-when-gap-doesnt-improve-enough/109437 "2024-01-30T10:45:38Z")

</div>

Suppose that I have a time limit of one day with JuMP and CPLEX: using JuMP, CPLEX, Dates set\_optimizer\_attributes(model, "CPX\_PARAM\_TILIM" =\> Dates.value(Second(Day(1))) # CPU limit in seconds Can I also have another…

---

## [Struggling to define Jump constraints for modified TSP in a programmatic way](https://discourse.julialang.org/t/struggling-to-define-jump-constraints-for-modified-tsp-in-a-programmatic-way/106346)

<div class="topic-metadata">

**Author:** [@Lee\_Phillips](https://discourse.julialang.org/u/Lee_Phillips)\
**Replies:** 4\
**Last updated:** [January 30, 2024, 2:55am UTC](https://discourse.julialang.org/t/struggling-to-define-jump-constraints-for-modified-tsp-in-a-programmatic-way/106346 "2024-01-30T02:55:07Z")

</div>

Hey All I’m working on a traveling salesman like problem with a few additional constraints and I’m using the JUMP package. One of the constraints is that certain nodes on the graph need to be performed sequentially Ho…

---

## [Choosing an optimizer](https://discourse.julialang.org/t/choosing-an-optimizer/109313)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [January 28, 2024, 12:45pm UTC](https://discourse.julialang.org/t/choosing-an-optimizer/109313 "2024-01-28T12:45:10Z")

</div>

I have the following optimization problem: Tuning of a filter, that has two (real value) parameters, subject to one constraint (the time delay). My simulation returns two parameters, the standard deviation of the differ…

---

## [Multiple user cut](https://discourse.julialang.org/t/multiple-user-cut/109080)

<div class="topic-metadata">

**Author:** [@Fabrizio](https://discourse.julialang.org/u/Fabrizio)\
**Replies:** 6\
**Last updated:** [January 26, 2024, 9:26am UTC](https://discourse.julialang.org/t/multiple-user-cut/109080 "2024-01-26T09:26:39Z")

</div>

Hi, I am using a solver indipendent callback to add user cut withing a for loop, in a bilevel opt model. They are of the form: function MyUsercutRelaxedSD(cb\_data) #Get var ... for t in T SDrelcon = @build\_co…

---

## [Worked tutorial on low-level AbstractNLPEvaluator interface?](https://discourse.julialang.org/t/worked-tutorial-on-low-level-abstractnlpevaluator-interface/109210)

<div class="topic-metadata">

**Author:** [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Replies:** 4\
**Last updated:** [January 25, 2024, 8:23pm UTC](https://discourse.julialang.org/t/worked-tutorial-on-low-level-abstractnlpevaluator-interface/109210 "2024-01-25T20:23:10Z")

</div>

I have a very old lab-internal package that performs a variety of image registration tasks. It was written against MathProgBase, and clearly it’s well past time to rewrite it for MathOptInterface. While the documentation…

---

## [Constructing a sparse variable for optimization](https://discourse.julialang.org/t/constructing-a-sparse-variable-for-optimization/109269)

<div class="topic-metadata">

**Author:** [@legio](https://discourse.julialang.org/u/legio)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 8:15pm UTC](https://discourse.julialang.org/t/constructing-a-sparse-variable-for-optimization/109269 "2024-01-25T20:15:39Z")

</div>

I want to optimize over a matrix X. While I specify in my model constraints the indices at which X must be zero (according to the specifications I provide in a binary matrix A): @variable(model, X\[1:n\_rows, 1:n\_cols\]) …

---

## [How to set the random seed using GLPK.jl?](https://discourse.julialang.org/t/how-to-set-the-random-seed-using-glpk-jl/109231)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 2\
**Last updated:** [January 25, 2024, 2:40pm UTC](https://discourse.julialang.org/t/how-to-set-the-random-seed-using-glpk-jl/109231 "2024-01-25T14:40:06Z")

</div>

I have asked my students to set a fixed random seed in their experiments with a formulation implementation. Many have used Julia/JuMP as I have incentivized them to do so. However, I was not able to tell them how to set …

---

## [JuMP-dev 2024](https://discourse.julialang.org/t/jump-dev-2024/106179)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 3\
**Last updated:** [January 24, 2024, 2:47am UTC](https://discourse.julialang.org/t/jump-dev-2024/106179 "2024-01-24T02:47:00Z")

</div>

Dear all, We are pleased to announce that JuMP-dev 2024 will take place July 19-21 in Montréal, Canada. (The location and time is intended to coincide with the start of ISMP: https://ismp2024.gerad.ca.) For more inform…

---

## [Setting TimeLimit of BilevelJumP with MibS-solver](https://discourse.julialang.org/t/setting-timelimit-of-bileveljump-with-mibs-solver/108770)

<div class="topic-metadata">

**Author:** [@NKonti](https://discourse.julialang.org/u/NKonti)\
**Replies:** 3\
**Last updated:** [January 24, 2024, 10:01pm UTC](https://discourse.julialang.org/t/setting-timelimit-of-bileveljump-with-mibs-solver/108770 "2024-01-24T22:01:37Z")

</div>

Hello everyone, is it possible to set a time limit for the MibS solver? using JuMP, BilevelJuMP, MibS\_jll model = BilevelModel() … Rest of the Model… solution = BilevelJuMP.solve\_with\_MibS(model, MibS\_jll.mibs; verbo…

---

## [How to get rid of the error: "MethodError: no method matching optimize!(::AffExpr)"](https://discourse.julialang.org/t/how-to-get-rid-of-the-error-methoderror-no-method-matching-optimize-affexpr/109218)

<div class="topic-metadata">

**Author:** [@Aliaksandra\_Kizhyk](https://discourse.julialang.org/u/Aliaksandra_Kizhyk)\
**Replies:** 2\
**Last updated:** [January 24, 2024, 9:34pm UTC](https://discourse.julialang.org/t/how-to-get-rid-of-the-error-methoderror-no-method-matching-optimize-affexpr/109218 "2024-01-24T21:34:10Z")

</div>

Hello everyone! I urgently need some help with this code. I am getting the error “MethodError: no method matching optimize!(::AffExpr)”, and I can’t understand why it appears. I am not proficient with programming and ne…

---

## [How to properly specify maximum interations in Optimization?](https://discourse.julialang.org/t/how-to-properly-specify-maximum-interations-in-optimization/109144)

<div class="topic-metadata">

**Author:** [@foolcat](https://discourse.julialang.org/u/foolcat)\
**Replies:** 4\
**Last updated:** [January 23, 2024, 10:58pm UTC](https://discourse.julialang.org/t/how-to-properly-specify-maximum-interations-in-optimization/109144 "2024-01-23T22:58:59Z")

</div>

Hello, I am pretty new to Julia and SciML. I have a question about how to specify the maximum iterations in Optimzation.jl. I read the documentation and tried different combinations of maxiters, iterations, etc. So far …

---

## [Basic solve with Optim/ NLsolve](https://discourse.julialang.org/t/basic-solve-with-optim-nlsolve/109125)

<div class="topic-metadata">

**Author:** [@jovansam](https://discourse.julialang.org/u/jovansam)\
**Replies:** 1\
**Last updated:** [January 23, 2024, 3:00am UTC](https://discourse.julialang.org/t/basic-solve-with-optim-nlsolve/109125 "2024-01-23T03:00:05Z")

</div>

I have a very simple problem, but a little stomped. Below is a MWE using NLsolve f! = function (dx, x, a, b) # we want to find roots for f dx\[1\] = x\[1\] - a\[1\] dx\[2\] = x\[2\] = a\[2\] b = 5 end a = \[1; 5\] b = 0 g…

---

## [Looking for a "trick" to express a constraint on binary variables](https://discourse.julialang.org/t/looking-for-a-trick-to-express-a-constraint-on-binary-variables/109049)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 9\
**Last updated:** [January 21, 2024, 11:10am UTC](https://discourse.julialang.org/t/looking-for-a-trick-to-express-a-constraint-on-binary-variables/109049 "2024-01-21T11:10:54Z")

</div>

I would like to know if there is a synthetic form to express the constraint Max(Si)-Min(Si) \<=s, without having to explicitly write all the possible differences (Si-Sj) and impose the constraint on these S1:: x\[1,1,N\]+x…

---

## [Round variables in JuMP](https://discourse.julialang.org/t/round-variables-in-jump/109045)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 3\
**Last updated:** [January 20, 2024, 9:12pm UTC](https://discourse.julialang.org/t/round-variables-in-jump/109045 "2024-01-20T21:12:50Z")

</div>

Dear all, I have a model in JuMP with the following range index: variable(model, x\[i in 1:10, t in 1:10, h in H\[i\], bin) where H=\[ \[1,2\]; \[3,4,5\]; \[5\]; \[6,7\]; \[1,2,3\]; \[1,2,4\]; \[1,2,3\]; \[1,2,6,7\]; \[1,2,4\]; \[1,2\]; \] i…

---

## [Changing metric for complex sphere in Manopt.jl](https://discourse.julialang.org/t/changing-metric-for-complex-sphere-in-manopt-jl/109020)

<div class="topic-metadata">

**Author:** [@fph](https://discourse.julialang.org/u/fph)\
**Replies:** 3\
**Last updated:** [January 20, 2024, 11:48am UTC](https://discourse.julialang.org/t/changing-metric-for-complex-sphere-in-manopt-jl/109020 "2024-01-20T11:48:01Z")

</div>

A technical question on Manopt.jl. I have seen that Sphere(n-1, ℂ) gets its Hermitian metric \\langle v, w\\rangle\_p = v^\*w from its canonical embedding in \\mathbb{C}^n. Instead, I would like to use that manifold with the…

---

## [Formulating objective function, DimensionMismatch](https://discourse.julialang.org/t/formulating-objective-function-dimensionmismatch/109016)

<div class="topic-metadata">

**Author:** [@legio](https://discourse.julialang.org/u/legio)\
**Replies:** 6\
**Last updated:** [January 19, 2024, 10:21pm UTC](https://discourse.julialang.org/t/formulating-objective-function-dimensionmismatch/109016 "2024-01-19T22:21:29Z")

</div>

Hi, I’m very new to Julia, and I am trying to construct a minimization over x for the following objective: where B is a 2x8 matrix, μ is a 2x3 matrix, and x is an 8x3 matrix. I have tried using the following line to …

---

## [How do I model a combination of polynomial and SOC constraints?](https://discourse.julialang.org/t/how-do-i-model-a-combination-of-polynomial-and-soc-constraints/108968)

<div class="topic-metadata">

**Author:** [@Khr](https://discourse.julialang.org/u/Khr)\
**Replies:** 2\
**Last updated:** [January 19, 2024, 10:11am UTC](https://discourse.julialang.org/t/how-do-i-model-a-combination-of-polynomial-and-soc-constraints/108968 "2024-01-19T10:11:02Z")

</div>

I have a problem consisting of both polynomial constraints (using the PolyJuMP), with nonnegativity requirements on a certain domain, which should be able to be handled using the SumOfSquares package and several second-o…

---

## [Unexpected behavior of objective\_value with quadratic objective and semidefinite constraint](https://discourse.julialang.org/t/unexpected-behavior-of-objective-value-with-quadratic-objective-and-semidefinite-constraint/107211)

<div class="topic-metadata">

**Author:** [@ryancorywright](https://discourse.julialang.org/u/ryancorywright)\
**Replies:** 5\
**Last updated:** [January 19, 2024, 10:05am UTC](https://discourse.julialang.org/t/unexpected-behavior-of-objective-value-with-quadratic-objective-and-semidefinite-constraint/107211 "2024-01-19T10:05:45Z")

</div>

When solving a convex quadratic optimization problem with semidefinite constraints in Mosek, the objective\_value function appears to be returning an objective value that is off by a constant. Minimal working example: wh…

---

## [The Jacobian for the equality constraints contains an invalid number (+ general help with matrices in JuMP)](https://discourse.julialang.org/t/the-jacobian-for-the-equality-constraints-contains-an-invalid-number-general-help-with-matrices-in-jump/107512)

<div class="topic-metadata">

**Author:** [@Jack21](https://discourse.julialang.org/u/Jack21)\
**Replies:** 4\
**Last updated:** [January 18, 2024, 11:30am UTC](https://discourse.julialang.org/t/the-jacobian-for-the-equality-constraints-contains-an-invalid-number-general-help-with-matrices-in-jump/107512 "2024-01-18T11:30:47Z")

</div>

Hello all! I am pretty new to Julia, and am trying to implement a matrix form model for the dynamics. This is what I have written so far: using JuMP #, MadNLP import Ipopt #Number of mesh point n = 10 #Simulation para…

---

## [Enforcing Variable Allocation Priorities in JuMP Model](https://discourse.julialang.org/t/enforcing-variable-allocation-priorities-in-jump-model/108806)

<div class="topic-metadata">

**Author:** [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Replies:** 7\
**Last updated:** [January 16, 2024, 10:20pm UTC](https://discourse.julialang.org/t/enforcing-variable-allocation-priorities-in-jump-model/108806 "2024-01-16T22:20:12Z")

</div>

Hello Everyone, I’m working on an optimization problem in Julia’s JuMP and need help with correctly prioritizing the allocation of certain variables in a constraint. My primary constraint is as follows: C \\cdot x + S \\…

---

## [Solving large convex optimization/flow assignment problem](https://discourse.julialang.org/t/solving-large-convex-optimization-flow-assignment-problem/108872)

<div class="topic-metadata">

**Author:** [@SuperGrobi](https://discourse.julialang.org/u/SuperGrobi)\
**Replies:** 7\
**Last updated:** [January 17, 2024, 2:13pm UTC](https://discourse.julialang.org/t/solving-large-convex-optimization-flow-assignment-problem/108872 "2024-01-17T14:13:09Z")

</div>

I am trying to solve a convex flow-assignment problem on a large(ish) graph with (currently) about 7000 edges. Mathematically, it looks like \\underset{x\\in\\mathbb{R}\_+^{|E|}}{\\text{minimize}} \\quad U(x) \\\\ U(x) = -l^T…

---

## [Getting HiGHs to return when objective value doesn't move](https://discourse.julialang.org/t/getting-highs-to-return-when-objective-value-doesnt-move/103990)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 7\
**Last updated:** [January 15, 2024, 12:42pm UTC](https://discourse.julialang.org/t/getting-highs-to-return-when-objective-value-doesnt-move/103990 "2024-01-15T12:42:02Z")

</div>

I’m trying to solve a constrained optimization problem with JuMP and HiGHs (this is for an open source package so I want to rely on an open source solver), but for some reason the optimization never terminates although t…

---

## [Is it possible to set the attribute of optimizer in the iteration of \_solve\_in\_sequence in Lexicographic?](https://discourse.julialang.org/t/is-it-possible-to-set-the-attribute-of-optimizer-in-the-iteration-of-solve-in-sequence-in-lexicographic/108793)

<div class="topic-metadata">

**Author:** [@Hongliang\_Yang](https://discourse.julialang.org/u/Hongliang_Yang)\
**Replies:** 5\
**Last updated:** [January 15, 2024, 7:00am UTC](https://discourse.julialang.org/t/is-it-possible-to-set-the-attribute-of-optimizer-in-the-iteration-of-solve-in-sequence-in-lexicographic/108793 "2024-01-15T07:00:00Z")

</div>

For the following code using JuMP import HiGHS import MultiObjectiveAlgorithms as MOA model = JuMP.Model(() -\> MOA.Optimizer(HiGHS.Optimizer)) set\_attribute(model, MOA.Algorithm(), MOA.Lexicographic()) Is it possible…

---

## [Sparse Spike Deconvolution: how to perform a cross validation using JuMP?](https://discourse.julialang.org/t/sparse-spike-deconvolution-how-to-perform-a-cross-validation-using-jump/108776)

<div class="topic-metadata">

**Author:** [@Matheus](https://discourse.julialang.org/u/Matheus)\
**Replies:** 4\
**Last updated:** [January 13, 2024, 11:38pm UTC](https://discourse.julialang.org/t/sparse-spike-deconvolution-how-to-perform-a-cross-validation-using-jump/108776 "2024-01-13T23:38:59Z")

</div>

I’m basically trying to minimize the following matrix equation Z(the data) and c are vectors while G and A are matrices. G is a matrix that receives a scalar parameter P. To create the model, I’ve set a fix P and tri…

---

## [Nested optimisation problem in JuMP](https://discourse.julialang.org/t/nested-optimisation-problem-in-jump/107409)

<div class="topic-metadata">

**Author:** [@dbro](https://discourse.julialang.org/u/dbro)\
**Replies:** 6\
**Last updated:** [January 12, 2024, 7:17am UTC](https://discourse.julialang.org/t/nested-optimisation-problem-in-jump/107409 "2024-01-12T07:17:29Z")

</div>

I am working on a multi-objective optimisation problem involving a collection of demand nodes supplied by a collection of source nodes. The aim is to explore a range of different potential networks and their ability to m…

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

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