# Optimization (Mathematical)

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

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

**Page:** 23

---

## [NLsolve, preallocated ForwardDiff Dual](https://discourse.julialang.org/t/nlsolve-preallocated-forwarddiff-dual/13950)

<div class="topic-metadata">

**Author:** [@nhipsman](https://discourse.julialang.org/u/nhipsman)\
**Replies:** 3\
**Last updated:** [July 16, 2024, 5:19pm UTC](https://discourse.julialang.org/t/nlsolve-preallocated-forwarddiff-dual/13950 "2024-07-16T17:19:50Z")

</div>

I’m trying to use NLsolve (using ForwardDiff) to solve a system of equations that produces intermediate output. For performance, I’m trying to preallocate arrays for it to store that intermediate output, but I’m not sur…

---

## [Callbacks with xpress in JuMP](https://discourse.julialang.org/t/callbacks-with-xpress-in-jump/116889)

<div class="topic-metadata">

**Author:** [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Replies:** 2\
**Last updated:** [July 15, 2024, 5:11am UTC](https://discourse.julialang.org/t/callbacks-with-xpress-in-jump/116889 "2024-07-15T05:11:30Z")

</div>

Hi everyone, I’m currently working on a MILP problem using the Xpress solver in JuMP. Some instances of this problem are taking considerably longer to solve to optimality, and I would like to implement solver-specific c…

---

## [Max of a vector as an objective for JuMP?](https://discourse.julialang.org/t/max-of-a-vector-as-an-objective-for-jump/116911)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 11\
**Last updated:** [July 14, 2024, 6:13pm UTC](https://discourse.julialang.org/t/max-of-a-vector-as-an-objective-for-jump/116911 "2024-07-14T18:13:10Z")

</div>

Hi Everyone, I have an optimization problem similar to this one, except my objective is now the maximum element in a vector (which I want to minimize). Can JuMP handle this as an objective, and if so, what’s the best wa…

---

## [Using xor with JuMP and MiniZinc](https://discourse.julialang.org/t/using-xor-with-jump-and-minizinc/116519)

<div class="topic-metadata">

**Author:** [@remi-garcia](https://discourse.julialang.org/u/remi-garcia)\
**Replies:** 6\
**Last updated:** [July 13, 2024, 8:48am UTC](https://discourse.julialang.org/t/using-xor-with-jump-and-minizinc/116519 "2024-07-13T08:48:14Z")

</div>

Hi, With JuMP, I can create constraints with && and ||. I am trying to use xor and not. Is there a way to do this? I can do the following: using JuMP using MiniZinc model = Model(() -\> MiniZinc.Optimizer{Float64}("c…

---

## [It seems that MadNLP does not support general NLP problem](https://discourse.julialang.org/t/it-seems-that-madnlp-does-not-support-general-nlp-problem/116864)

<div class="topic-metadata">

**Author:** [@JackaChou](https://discourse.julialang.org/u/JackaChou)\
**Replies:** 7\
**Last updated:** [July 13, 2024, 5:50am UTC](https://discourse.julialang.org/t/it-seems-that-madnlp-does-not-support-general-nlp-problem/116864 "2024-07-13T05:50:05Z")

</div>

I recently used the solver MadNLP to solve the following NLP problem, but the terminal reported that it didn’t support this problem. Isn’t MadNLP a general NLP solver? using MadNLP, JuMP m = Model(() → MadNLP.Optimize…

---

## [Indicator constraints in IQP?](https://discourse.julialang.org/t/indicator-constraints-in-iqp/107587)

<div class="topic-metadata">

**Author:** [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Replies:** 6\
**Last updated:** [July 13, 2024, 3:32am UTC](https://discourse.julialang.org/t/indicator-constraints-in-iqp/107587 "2024-07-13T03:32:58Z")

</div>

The problem I’m trying to solve has grown to the point where it requires quadratic constraints and/or objective. When the problem was linear, I had used indicator constraints successfully. After switching to Juniper or…

---

## [Cyclic policy graph with fix number of cycles - SDDP.jl](https://discourse.julialang.org/t/cyclic-policy-graph-with-fix-number-of-cycles-sddp-jl/116546)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 1\
**Last updated:** [July 13, 2024, 12:50am UTC](https://discourse.julialang.org/t/cyclic-policy-graph-with-fix-number-of-cycles-sddp-jl/116546 "2024-07-13T00:50:05Z")

</div>

Hi everyone, Can we design a cyclic linear policy graph in SDDP.jl with a fixed number of cycles? Let’s assume there are 4 nodes, where node 4 transitions to node 1 with a probability of 1. However, this cycle should re…

---

## [MOA-HiGHS Unsupported Objective Function](https://discourse.julialang.org/t/moa-highs-unsupported-objective-function/116672)

<div class="topic-metadata">

**Author:** [@jhannyj](https://discourse.julialang.org/u/jhannyj)\
**Replies:** 4\
**Last updated:** [July 13, 2024, 12:46am UTC](https://discourse.julialang.org/t/moa-highs-unsupported-objective-function/116672 "2024-07-13T00:46:39Z")

</div>

Hi all. I’m pretty new to Julia optimization. I have this problem: model = Model(HiGHS.Optimizer) @variable(model, x\[1:n\] \>= 0) @constraint(model, A' \* x .\>= f) @objective(model, Min, b' \* x) which works perfectly when…

---

## [How to use @expression macro with non-numeric indexes](https://discourse.julialang.org/t/how-to-use-expression-macro-with-non-numeric-indexes/116782)

<div class="topic-metadata">

**Author:** [@asuski](https://discourse.julialang.org/u/asuski)\
**Replies:** 2\
**Last updated:** [July 13, 2024, 12:41am UTC](https://discourse.julialang.org/t/how-to-use-expression-macro-with-non-numeric-indexes/116782 "2024-07-13T00:41:27Z")

</div>

Hi, I am building an optimization model where I would like to use JuMP expressions to smoothly add elements of constraints across different parts of the model. However, the sets I am working with and over which I am ini…

---

## [Jump/Ipopt: is it possibe to retrieve the numerical Jacobian at the optimal point?](https://discourse.julialang.org/t/jump-ipopt-is-it-possibe-to-retrieve-the-numerical-jacobian-at-the-optimal-point/116896)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [July 13, 2024, 12:16am UTC](https://discourse.julialang.org/t/jump-ipopt-is-it-possibe-to-retrieve-the-numerical-jacobian-at-the-optimal-point/116896 "2024-07-13T00:16:45Z")

</div>

Hello, on a nonlinear solved optimization problem (JuMP/Ipopt) is it possible to retrieve the values of the Jacobian matrix at the returned optimal point ?

---

## [Is GLPK still maintained/relevant?](https://discourse.julialang.org/t/is-glpk-still-maintained-relevant/116950)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [July 13, 2024, 12:13am UTC](https://discourse.julialang.org/t/is-glpk-still-maintained-relevant/116950 "2024-07-13T00:13:13Z")

</div>

Is GLPK (the lib itself, not the Julia wrapper) still maintained and relevant ? I can’t find any activity after 2020 Also wonder if it it still relevant or newer packages as HiGHS are the way to go nowadays…

---

## [Scaled diagonally dominant programming](https://discourse.julialang.org/t/scaled-diagonally-dominant-programming/116853)

<div class="topic-metadata">

**Author:** [@Khashayar-Neshat](https://discourse.julialang.org/u/Khashayar-Neshat)\
**Replies:** 2\
**Last updated:** [July 11, 2024, 8:47pm UTC](https://discourse.julialang.org/t/scaled-diagonally-dominant-programming/116853 "2024-07-11T20:47:52Z")

</div>

In polynomial optimization, one can check the certificate of nonnegativity with sums of squares (SOS) optimization which leads to semidefinite programming. Another more conservative approach is to use SDSOS optimization …

---

## [Performance of primal versus dual forms in JuMP](https://discourse.julialang.org/t/performance-of-primal-versus-dual-forms-in-jump/116633)

<div class="topic-metadata">

**Author:** [@araujoms](https://discourse.julialang.org/u/araujoms)\
**Replies:** 6\
**Last updated:** [July 11, 2024, 10:54am UTC](https://discourse.julialang.org/t/performance-of-primal-versus-dual-forms-in-jump/116633 "2024-07-11T10:54:19Z")

</div>

I’m trying to determine the most efficient form of modelling a problem for a package (QuantumNPA.jl). The natural way of writing the problem is in the dual or geometric form (see here for nomenclature); however, this giv…

---

## [Global Constrained Nonlinear Optimization](https://discourse.julialang.org/t/global-constrained-nonlinear-optimization/111972)

<div class="topic-metadata">

**Author:** [@zaccazy](https://discourse.julialang.org/u/zaccazy)\
**Replies:** 11\
**Last updated:** [July 11, 2024, 7:41am UTC](https://discourse.julialang.org/t/global-constrained-nonlinear-optimization/111972 "2024-07-11T07:41:50Z")

</div>

I am looking for a global optimizer to solve a nonlinear problem with three variables and two nonlinear inequality constraints. So far, everything I’ve tried delivers local solutions, i.e. solution heavily relies on the …

---

## [A bug about JuMP.jl](https://discourse.julialang.org/t/a-bug-about-jump-jl/116870)

<div class="topic-metadata">

**Author:** [@lionisxn](https://discourse.julialang.org/u/lionisxn)\
**Replies:** 1\
**Last updated:** [July 10, 2024, 4:29pm UTC](https://discourse.julialang.org/t/a-bug-about-jump-jl/116870 "2024-07-10T16:29:41Z")

</div>

I was wondering whether there exist bugs of calling for "value(function, expr) ". My codes are like this: M = Model() @variable(M, x) @variable(M, y) @NLconstraint(M, con, x + x\*y^2 - 3 \>= 0) t = all\_constraints(M;…

---

## [Complexity JuMP constraints](https://discourse.julialang.org/t/complexity-jump-constraints/116773)

<div class="topic-metadata">

**Author:** [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Replies:** 5\
**Last updated:** [July 10, 2024, 3:00pm UTC](https://discourse.julialang.org/t/complexity-jump-constraints/116773 "2024-07-10T15:00:40Z")

</div>

Hello there :slight\_smile: I have a SDP problem with a SemiDefinite matrix M of size n \\times n. I have a number c of constraints. There is a time of preparation, then the problem is given to the SDP solver (for example…

---

## [Matrix Constraints in JuMP](https://discourse.julialang.org/t/matrix-constraints-in-jump/116663)

<div class="topic-metadata">

**Author:** [@Gagan\_Meena](https://discourse.julialang.org/u/Gagan_Meena)\
**Replies:** 3\
**Last updated:** [July 10, 2024, 12:13pm UTC](https://discourse.julialang.org/t/matrix-constraints-in-jump/116663 "2024-07-10T12:13:08Z")

</div>

Can I write matrix constraints in JUMP using @constraints macro? While writing this flow constraint Bd\*A\*δ .== f as one of the constraints in the @constraints macro, I am getting the following error. ERROR: MethodErro…

---

## [Iterator over all random elements without materialization](https://discourse.julialang.org/t/iterator-over-all-random-elements-without-materialization/116819)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 9\
**Last updated:** [July 10, 2024, 5:45am UTC](https://discourse.julialang.org/t/iterator-over-all-random-elements-without-materialization/116819 "2024-07-10T05:45:43Z")

</div>

Hi All, I have a specific question. I am working on abductive explanation of neural networks, f. Abductive explanation is a subset (let’s denote indices ii) of the input x guaranteeing that the model (neural network) pr…

---

## [Problem in Optim.jl using Fminbox and f\_calls\_limit](https://discourse.julialang.org/t/problem-in-optim-jl-using-fminbox-and-f-calls-limit/116820)

<div class="topic-metadata">

**Author:** [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Replies:** 2\
**Last updated:** [July 9, 2024, 6:42pm UTC](https://discourse.julialang.org/t/problem-in-optim-jl-using-fminbox-and-f-calls-limit/116820 "2024-07-09T18:42:43Z")

</div>

I have found a problem in Optim.jl using Fminbox and f\_calls\_limit, it is not well respected the limit. For instead, using the example for the documentation: julia\> using Optim julia\> f(x) = (1.0 - x\[1\])^2 + 100.0 \* (x…

---

## [Change linear solver using JuMP, Hypatia](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306)

<div class="topic-metadata">

**Author:** [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Replies:** 5\
**Last updated:** [July 9, 2024, 11:41am UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306 "2024-07-09T11:41:23Z")

</div>

Hello :slight\_smile: I am using Hypatia with JuMP, and I want to change the Linear Solver inside it. How can I do ? I found out the following : user\_options = ( "mu\_strategy" =\> "monotone", "linear\_solver" =\> "ma27"…

---

## [Hacking LineSearches.jl to parallelize step estimation](https://discourse.julialang.org/t/hacking-linesearches-jl-to-parallelize-step-estimation/116787)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 10\
**Last updated:** [July 9, 2024, 9:38am UTC](https://discourse.julialang.org/t/hacking-linesearches-jl-to-parallelize-step-estimation/116787 "2024-07-09T09:38:35Z")

</div>

I want to hack Linesearches.jl to be able to stick a @threads macro on the linesearch part. I have an objective function for an optimization problem which has many parameters and is also very expensive to compute. This …

---

## [Nonlinear optimization with ODE solution in nonlinear constraint](https://discourse.julialang.org/t/nonlinear-optimization-with-ode-solution-in-nonlinear-constraint/116730)

<div class="topic-metadata">

**Author:** [@afossa](https://discourse.julialang.org/u/afossa)\
**Replies:** 6\
**Last updated:** [July 8, 2024, 5:51pm UTC](https://discourse.julialang.org/t/nonlinear-optimization-with-ode-solution-in-nonlinear-constraint/116730 "2024-07-08T17:51:54Z")

</div>

Hello, I am trying to model and solve a fairly complex constrained nonlinear optimization problem. The main issue is that to compute some equality constraints I need to solve an ODE numerically. So far, I have been abl…

---

## [Integration of |∇p|^2](https://discourse.julialang.org/t/integration-of-p-2/116671)

<div class="topic-metadata">

**Author:** [@Banan\_alkafri](https://discourse.julialang.org/u/Banan_alkafri)\
**Replies:** 3\
**Last updated:** [July 5, 2024, 9:20pm UTC](https://discourse.julialang.org/t/integration-of-p-2/116671 "2024-07-05T21:20:47Z")

</div>

I want to create a function that integrates the magnitude of the gradient of a polynomial with 2 variables squared. I created a generic polynomial using monomials and calculated |∇p|^2 and now i have a polynomial that co…

---

## [Lazy constraint](https://discourse.julialang.org/t/lazy-constraint/116650)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 1\
**Last updated:** [July 5, 2024, 9:55am UTC](https://discourse.julialang.org/t/lazy-constraint/116650 "2024-07-05T09:55:32Z")

</div>

I am trying to use benders decomposition with callback, at some point I have to add a lazy constraint to a model as follows MOI.submit(model, MOI.LazyConstraint(cb\_data), cut) What is the way if I want to remove the c…

---

## [How to minimize the variance of time intervals between scheduled slots?](https://discourse.julialang.org/t/how-to-minimize-the-variance-of-time-intervals-between-scheduled-slots/116591)

<div class="topic-metadata">

**Author:** [@scheidan1](https://discourse.julialang.org/u/scheidan1)\
**Replies:** 2\
**Last updated:** [July 4, 2024, 2:37pm UTC](https://discourse.julialang.org/t/how-to-minimize-the-variance-of-time-intervals-between-scheduled-slots/116591 "2024-07-04T14:37:53Z")

</div>

Hi, I’m trying to setup an optimization in JuMP. I do not have much experience in this field but it seems trivial: The aim is assigns speaker to slots with respect to some conditions. I want to minimizes the variance o…

---

## [How to output the first integer solution found in B&B process in Mosek](https://discourse.julialang.org/t/how-to-output-the-first-integer-solution-found-in-b-b-process-in-mosek/116462)

<div class="topic-metadata">

**Author:** [@izng](https://discourse.julialang.org/u/izng)\
**Replies:** 2\
**Last updated:** [July 4, 2024, 7:34am UTC](https://discourse.julialang.org/t/how-to-output-the-first-integer-solution-found-in-b-b-process-in-mosek/116462 "2024-07-04T07:34:18Z")

</div>

Hi, I want to know how to output the first integer solution and its objective value found within B&B process in Mosek.

---

## [AD pipeline and Hessian–vector products](https://discourse.julialang.org/t/ad-pipeline-and-hessian-vector-products/116329)

<div class="topic-metadata">

**Author:** [@RS-Coop](https://discourse.julialang.org/u/RS-Coop)\
**Replies:** 12\
**Last updated:** [July 1, 2024, 7:24am UTC](https://discourse.julialang.org/t/ad-pipeline-and-hessian-vector-products/116329 "2024-07-01T07:24:36Z")

</div>

To be clear, this isn’t a question about the state of AD in Julia. That has been covered quite well in a variety of sources. Instead I have the following question: what is the state of the overall AD pipeline in Julia? A…

---

## [SCIP issue on Windows](https://discourse.julialang.org/t/scip-issue-on-windows/113976)

<div class="topic-metadata">

**Author:** [@asavasci](https://discourse.julialang.org/u/asavasci)\
**Replies:** 2\
**Last updated:** [July 1, 2024, 1:55am UTC](https://discourse.julialang.org/t/scip-issue-on-windows/113976 "2024-07-01T01:55:28Z")

</div>

Hi, I am trying to use SCIP solver with JuMP on Windows 11. Even if I followed the steps suggested, I could not solve problems with SCIP. Particularly, optimize!(model) shuts the REPL or kills the kernel in jupyter noteb…

---

## [Symmetry reduction in Sumsofsquares](https://discourse.julialang.org/t/symmetry-reduction-in-sumsofsquares/115727)

<div class="topic-metadata">

**Author:** [@Khashayar-Neshat](https://discourse.julialang.org/u/Khashayar-Neshat)\
**Replies:** 18\
**Last updated:** [June 30, 2024, 11:42pm UTC](https://discourse.julialang.org/t/symmetry-reduction-in-sumsofsquares/115727 "2024-06-30T23:42:55Z")

</div>

I have a simple minimization with symmetry, but Julia gives an error while using symmetry reduction. I want to find the minimum of x\_1^4+x\_2^4+x\_3^4-4x\_1x\_2x\_3+x\_1+x\_2+x\_3. Here is my script: using SumOfSquares using …

---

## [Symmetry reduction documentation](https://discourse.julialang.org/t/symmetry-reduction-documentation/98354)

<div class="topic-metadata">

**Author:** [@Khashayar-Neshat](https://discourse.julialang.org/u/Khashayar-Neshat)\
**Replies:** 18\
**Last updated:** [June 30, 2024, 11:29pm UTC](https://discourse.julialang.org/t/symmetry-reduction-documentation/98354 "2024-06-30T23:29:55Z")

</div>

Hi, If our polynomial optimization problem has a particular group symmetry, we can do symmetry reduction to get block diagonal matrices. Doing this involves constructing a symmetry-adapted basis. Since symmetry-adapted …

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

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