# Optimization (Mathematical)

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

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

**Page:** 10

---

## [My Gurobi version is 12.0.2, but in julia it is still 12.0.1](https://discourse.julialang.org/t/my-gurobi-version-is-12-0-2-but-in-julia-it-is-still-12-0-1/128899)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 2\
**Last updated:** [May 12, 2025, 12:00am UTC](https://discourse.julialang.org/t/my-gurobi-version-is-12-0-2-but-in-julia-it-is-still-12-0-1/128899 "2025-05-12T00:00:30Z")

</div>

I update my gurobi optimizer today. And I’ve deleted all the previous version. But in julia it still shows the old version (cf. 🍅 lines). Is this normal? PS K:\\uc24\> gurobi Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 20…

---

## [A performant optimizing algorithm for a case with an expensive cost function and parallel execution](https://discourse.julialang.org/t/a-performant-optimizing-algorithm-for-a-case-with-an-expensive-cost-function-and-parallel-execution/128900)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 4\
**Last updated:** [May 11, 2025, 4:43pm UTC](https://discourse.julialang.org/t/a-performant-optimizing-algorithm-for-a-case-with-an-expensive-cost-function-and-parallel-execution/128900 "2025-05-11T16:43:31Z")

</div>

I have a very expensive multivariate cost function (FDTD simulation with openEMS) but I have resources to run many of them in parallel. What would be a good algorithm (and package) to implement this? A variant of differe…

---

## [How to save a trained policy in SDDP.jl?](https://discourse.julialang.org/t/how-to-save-a-trained-policy-in-sddp-jl/128894)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 2\
**Last updated:** [May 11, 2025, 5:48pm UTC](https://discourse.julialang.org/t/how-to-save-a-trained-policy-in-sddp-jl/128894 "2025-05-11T17:48:37Z")

</div>

I am dealing with a multi-stage mixed-integer stochastic global supply chain optimization problem and want to solve it using the SDDiP algorithm using the SDDP.jl package in Julia. In this regard, I want to download the…

---

## [SLOW\_PROGRESS or NUMERICAL\_ERROR: a simple but nontrivial SDP example, solved with LP relaxation](https://discourse.julialang.org/t/slow-progress-or-numerical-error-a-simple-but-nontrivial-sdp-example-solved-with-lp-relaxation/127399)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 8\
**Last updated:** [May 11, 2025, 10:04am UTC](https://discourse.julialang.org/t/slow-progress-or-numerical-error-a-simple-but-nontrivial-sdp-example-solved-with-lp-relaxation/127399 "2025-05-11T10:04:38Z")

</div>

I wonder why mosek cannot solve this simple problem to optimality (it reports SLOW\_PROGRESS). x-ref \[docs\] improve the docstring for DUAL\_INFEASIBLE by odow · Pull Request #2701 · jump-dev/MathOptInterface.jl · GitHub i…

---

## [Best way to train and evaluate SDDP with constraints including product of control and states variables?](https://discourse.julialang.org/t/best-way-to-train-and-evaluate-sddp-with-constraints-including-product-of-control-and-states-variables/128890)

<div class="topic-metadata">

**Author:** [@petr-a](https://discourse.julialang.org/u/petr-a)\
**Replies:** 1\
**Last updated:** [May 10, 2025, 11:27pm UTC](https://discourse.julialang.org/t/best-way-to-train-and-evaluate-sddp-with-constraints-including-product-of-control-and-states-variables/128890 "2025-05-10T23:27:30Z")

</div>

Hello! I’m solving a problem which is similar to the Milk producer example with the SDDP algorithm. This question is also related to my first question about SDDP and out-of-sample solutions. Here is my asset managemen…

---

## [Help to use AD with Optimization.jl](https://discourse.julialang.org/t/help-to-use-ad-with-optimization-jl/128866)

<div class="topic-metadata">

**Author:** [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Replies:** 5\
**Last updated:** [May 9, 2025, 2:40pm UTC](https://discourse.julialang.org/t/help-to-use-ad-with-optimization-jl/128866 "2025-05-09T14:40:52Z")

</div>

Hi all, I need your advice to use automatic differentiation with Optimization.jl. The problem - I try to find the optimal variance of a process noise covariance matrix of a standard Kalman filter. Currently, I use grad…

---

## [How to license CPLEX inside Google Colab’s Julia environment](https://discourse.julialang.org/t/how-to-license-cplex-inside-google-colab-s-julia-environment/128682)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 9\
**Last updated:** [May 8, 2025, 7:11pm UTC](https://discourse.julialang.org/t/how-to-license-cplex-inside-google-colab-s-julia-environment/128682 "2025-05-08T19:11:40Z")

</div>

I am dealing with a multi-stage mixed-integer stochastic global supply chain optimization problem and want to solve the stage-wise problem instances using the CPLEX solver within SDDiP algorithm using the SDDP.jl package…

---

## [Simplifying Iwasawa decomposition with Symbolics.jl](https://discourse.julialang.org/t/simplifying-iwasawa-decomposition-with-symbolics-jl/128842)

<div class="topic-metadata">

**Author:** [@potatoh8](https://discourse.julialang.org/u/potatoh8)\
**Replies:** 0\
**Last updated:** [May 8, 2025, 3:42pm UTC](https://discourse.julialang.org/t/simplifying-iwasawa-decomposition-with-symbolics-jl/128842 "2025-05-08T15:42:31Z")

</div>

I’m trying to verify the following matrix identity using Symbolics.jl: Here’s my attempt: using Symbolics function SL2CIwasawaDecomp(X) # given matrix X in SL2C, return tuple (z, r, α, β) such that # X = n(z…

---

## [Slow array access during labeling algorithm](https://discourse.julialang.org/t/slow-array-access-during-labeling-algorithm/128366)

<div class="topic-metadata">

**Author:** [@Walter](https://discourse.julialang.org/u/Walter)\
**Replies:** 9\
**Last updated:** [May 7, 2025, 8:03pm UTC](https://discourse.julialang.org/t/slow-array-access-during-labeling-algorithm/128366 "2025-05-07T20:03:12Z")

</div>

Hi all, I switched from Python to Julia and are currently implementing a column generation algorithm for a vehicle routing problem. To generate a column (route) with negative reduced cost, I use a labeling algorithm. T…

---

## [Type stability of destructure / re-build in Optimisers.jl](https://discourse.julialang.org/t/type-stability-of-destructure-re-build-in-optimisers-jl/128783)

<div class="topic-metadata">

**Author:** [@FerreolS](https://discourse.julialang.org/u/FerreolS)\
**Replies:** 2\
**Last updated:** [May 7, 2025, 3:20pm UTC](https://discourse.julialang.org/t/type-stability-of-destructure-re-build-in-optimisers-jl/128783 "2025-05-07T15:20:49Z")

</div>

Hi, Destructuring struct with destructure is very handy. Thank you. However I’m a bit surprise that the restructuring is not Type stable. Am I missing something? Does it have some impact on speed when re(flat) (and its…

---

## [Inner product grammar is neater than sum(index) in JuMP modeling, But triggers Warning?](https://discourse.julialang.org/t/inner-product-grammar-is-neater-than-sum-index-in-jump-modeling-but-triggers-warning/124528)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 28\
**Last updated:** [May 6, 2025, 2:34am UTC](https://discourse.julialang.org/t/inner-product-grammar-is-neater-than-sum-index-in-jump-modeling-but-triggers-warning/124528 "2025-05-06T02:34:44Z")

</div>

Continuing the discussion from JuMP slow model generation: I figured out a novel neat way to write a particular kind of constraint, however it trigger warnings like the above post did. Can we somehow improve this? see …

---

## [Specifying the Hessian for some (but not all) user-defined operators](https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741)

<div class="topic-metadata">

**Author:** [@franckgaga](https://discourse.julialang.org/u/franckgaga)\
**Replies:** 2\
**Last updated:** [May 6, 2025, 11:41am UTC](https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741 "2025-05-06T11:41:35Z")

</div>

In ModelPredictiveControl.jl, I build the nonlinear optimization problem of NonLinMPC using multiple user-defined operators in JuMP.jl. One operator is for the objective function, the other operators appear in the nonlin…

---

## [Nested task exception while using Cbc (COIN-OR Branch and Cut) solver inside SDDP.jl](https://discourse.julialang.org/t/nested-task-exception-while-using-cbc-coin-or-branch-and-cut-solver-inside-sddp-jl/128683)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 4\
**Last updated:** [May 5, 2025, 7:17pm UTC](https://discourse.julialang.org/t/nested-task-exception-while-using-cbc-coin-or-branch-and-cut-solver-inside-sddp-jl/128683 "2025-05-05T19:17:40Z")

</div>

I am dealing with a multi-stage mixed-integer stochastic global supply chain optimization problem and want to solve the stage-wise problem instances using the Cbc (and other solvers) within the SDDiP algorithm using the S…

---

## [How to license Gurobi inside Google Colab's Julia environment](https://discourse.julialang.org/t/how-to-license-gurobi-inside-google-colabs-julia-environment/128407)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 7\
**Last updated:** [May 5, 2025, 12:50pm UTC](https://discourse.julialang.org/t/how-to-license-gurobi-inside-google-colabs-julia-environment/128407 "2025-05-05T12:50:50Z")

</div>

I am dealing with a multi-stage mixed-integer stochastic global supply chain optimization problem and want to solve the stage-wise problem instances using the Gurobi solver within SDDiP algorithm using the SDDP.jl packag…

---

## [How to set tolerance attributes of Gurobi inside Google Colab’s Julia environment](https://discourse.julialang.org/t/how-to-set-tolerance-attributes-of-gurobi-inside-google-colab-s-julia-environment/128678)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 6\
**Last updated:** [May 5, 2025, 12:47pm UTC](https://discourse.julialang.org/t/how-to-set-tolerance-attributes-of-gurobi-inside-google-colab-s-julia-environment/128678 "2025-05-05T12:47:08Z")

</div>

I am dealing with a multi-stage mixed-integer stochastic global supply chain optimization problem and want to solve the stage-wise problem instances using the Gurobi solver within SDDiP algorithm using the SDDP.jl packag…

---

## [Is there a way to extract the number of mixed-integer iterations during a particular iteration or solve in the SDDP.jl?](https://discourse.julialang.org/t/is-there-a-way-to-extract-the-number-of-mixed-integer-iterations-during-a-particular-iteration-or-solve-in-the-sddp-jl/128702)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 2\
**Last updated:** [May 5, 2025, 12:46pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-extract-the-number-of-mixed-integer-iterations-during-a-particular-iteration-or-solve-in-the-sddp-jl/128702 "2025-05-05T12:46:19Z")

</div>

I am dealing with a multi-stage mixed-integer stochastic global supply chain optimization problem and want to solve it using the SDDiP algorithm using the SDDP.jl package in Julia. In this regard, I want to determine th…

---

## [How to incorporate state-dependent state constraint in JuMP](https://discourse.julialang.org/t/how-to-incorporate-state-dependent-state-constraint-in-jump/128485)

<div class="topic-metadata">

**Author:** [@stepanoslejsek](https://discourse.julialang.org/u/stepanoslejsek)\
**Replies:** 9\
**Last updated:** [May 2, 2025, 9:33am UTC](https://discourse.julialang.org/t/how-to-incorporate-state-dependent-state-constraint-in-jump/128485 "2025-05-02T09:33:18Z")

</div>

Hi, I am trying to implement energy-efficient optimal control for vehicles, which includes traffic lights in the setup. The following problem is described as: \\text{minimize}\_{u^+, u^-} \\int\_{0}^{S} \\frac{u^+}{\\eta\_1} …

---

## [Defining variable with varying number of index sets](https://discourse.julialang.org/t/defining-variable-with-varying-number-of-index-sets/128478)

<div class="topic-metadata">

**Author:** [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Replies:** 8\
**Last updated:** [April 29, 2025, 2:15pm UTC](https://discourse.julialang.org/t/defining-variable-with-varying-number-of-index-sets/128478 "2025-04-29T14:15:48Z")

</div>

I want to create a JuMP variable with the syntax @variable(model, \[U\]) such that it is equivalent to @variable(model, \[S,T\]) How can I ‘pack’ S,T into U such that it exapnds to S,T in the @variable syntax? What I wo…

---

## [Fitting a projection DPP by maximizing a sum of log determinants](https://discourse.julialang.org/t/fitting-a-projection-dpp-by-maximizing-a-sum-of-log-determinants/128502)

<div class="topic-metadata">

**Author:** [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Replies:** 5\
**Last updated:** [April 29, 2025, 10:16am UTC](https://discourse.julialang.org/t/fitting-a-projection-dpp-by-maximizing-a-sum-of-log-determinants/128502 "2025-04-29T10:16:39Z")

</div>

Hi! I am trying to solve the following optimization problem where I am trying to estimate the L-matrix of a projection determinantal point process (DPP) which is known to be of form U U^T where U is an M \\times N matrix …

---

## [Access node in custom\_recorders during historical simulation (SDDP.jl)](https://discourse.julialang.org/t/access-node-in-custom-recorders-during-historical-simulation-sddp-jl/128507)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 1\
**Last updated:** [April 29, 2025, 12:40am UTC](https://discourse.julialang.org/t/access-node-in-custom-recorders-during-historical-simulation-sddp-jl/128507 "2025-04-29T00:40:14Z")

</div>

Hey, I am calculating the dual values of some constraints during historical simulation, and the constraint index depends on the node in the body of the problem. Therefore, in the simulation part, I need to refer to the n…

---

## [How does SDDP provide decision for an out-of-sample state?](https://discourse.julialang.org/t/how-does-sddp-provide-decision-for-an-out-of-sample-state/128433)

<div class="topic-metadata">

**Author:** [@petr-a](https://discourse.julialang.org/u/petr-a)\
**Replies:** 2\
**Last updated:** [April 28, 2025, 8:47am UTC](https://discourse.julialang.org/t/how-does-sddp-provide-decision-for-an-out-of-sample-state/128433 "2025-04-28T08:47:04Z")

</div>

Hello! I’m new to SDDP and Julia and I wonder how the policy evaluation works (math behind it) for states which are out of the scenario lattice which is used to train the algorithm? For context: I’m solving the problem…

---

## [Prevent dual ray calculation when using \`HiGHS\`](https://discourse.julialang.org/t/prevent-dual-ray-calculation-when-using-highs/128414)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 4\
**Last updated:** [April 27, 2025, 10:23pm UTC](https://discourse.julialang.org/t/prevent-dual-ray-calculation-when-using-highs/128414 "2025-04-27T22:23:02Z")

</div>

I’m seeing the following log with an older model that I’ve just updated: Running HiGHS 1.10.0 (git hash: fd8665394e): Copyright (c) 2025 HiGHS under MIT licence terms LP has 51118 rows; 38919 cols; 128913 nonzeros Coe…

---

## [Change loss function depending on the iteration count within Optim.jl](https://discourse.julialang.org/t/change-loss-function-depending-on-the-iteration-count-within-optim-jl/128362)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 4\
**Last updated:** [April 25, 2025, 10:24pm UTC](https://discourse.julialang.org/t/change-loss-function-depending-on-the-iteration-count-within-optim-jl/128362 "2025-04-25T22:24:50Z")

</div>

Hi, let’s say I have a loss function which I want to change depending on the iteration count. For example: function l(x, target) target\_warp = f\_warp(target, iteration\_count) sum(abs2, x .- target\_warp) end I…

---

## [Using operator relative entropy cone in Julia](https://discourse.julialang.org/t/using-operator-relative-entropy-cone-in-julia/128285)

<div class="topic-metadata">

**Author:** [@zhouhh17](https://discourse.julialang.org/u/zhouhh17)\
**Replies:** 7\
**Last updated:** [April 25, 2025, 11:05am UTC](https://discourse.julialang.org/t/using-operator-relative-entropy-cone-in-julia/128285 "2025-04-25T11:05:37Z")

</div>

Question Is it possible to optimize over the following operator relative entropy cone natively in Julia: \\text{cl}\\{(A, B, C)\\in H^n\_+ \\times H^n\_+ \\times H^n: C \\succeq - A^{1/2} \\log(A^{-1/2} B A^{-1/2}) A^{1/2}\\} w…

---

## [Getting duals for nonlinear programming problem](https://discourse.julialang.org/t/getting-duals-for-nonlinear-programming-problem/11357)

<div class="topic-metadata">

**Author:** [@pedroborgesmelo](https://discourse.julialang.org/u/pedroborgesmelo)\
**Replies:** 7\
**Last updated:** [April 24, 2025, 3:55pm UTC](https://discourse.julialang.org/t/getting-duals-for-nonlinear-programming-problem/11357 "2025-04-24T15:55:42Z")

</div>

Hi Guys! I’m having problems getting the dual variables for a nonlinear problem, with Ipopt as the solver… I just found this post here of 2015, but not working here and a bit old: https://github.com/JuliaOpt/JuMP.jl/i…

---

## [Can Ipopt provide a dual bound?](https://discourse.julialang.org/t/can-ipopt-provide-a-dual-bound/128354)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 2\
**Last updated:** [April 24, 2025, 6:57am UTC](https://discourse.julialang.org/t/can-ipopt-provide-a-dual-bound/128354 "2025-04-24T06:57:46Z")

</div>

Continuing the discussion from Getting duals for nonlinear programming problem: As an extension, I asked ChatGPT this problem. Can anyone tell me where is its idea from? Does its reply make sense?

---

## [Add lower bound to objective function?](https://discourse.julialang.org/t/add-lower-bound-to-objective-function/36261)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 4\
**Last updated:** [April 24, 2025, 2:36am UTC](https://discourse.julialang.org/t/add-lower-bound-to-objective-function/36261 "2025-04-24T02:36:34Z")

</div>

I would like to help the MILP solver used by JuMP by providing it with a lower bound on the objective function. Is there a “smart” way of doing this other than to just add a constraint to the objective fcn expression, e.…

---

## [Objective\_bound and Gurobi](https://discourse.julialang.org/t/objective-bound-and-gurobi/46633)

<div class="topic-metadata">

**Author:** [@arkanver](https://discourse.julialang.org/u/arkanver)\
**Replies:** 2\
**Last updated:** [April 24, 2025, 2:23am UTC](https://discourse.julialang.org/t/objective-bound-and-gurobi/46633 "2025-04-24T02:23:14Z")

</div>

Hello ! I have shared some code with a research associate, aiming to compute the solution to a continuous optimization problem. Due to problem size, we use a time limit. The problem is that I use CPLEX, and my associate…

---

## [Warm starting Ipopt with higher discretization points](https://discourse.julialang.org/t/warm-starting-ipopt-with-higher-discretization-points/127974)

<div class="topic-metadata">

**Author:** [@Dhormir](https://discourse.julialang.org/u/Dhormir)\
**Replies:** 8\
**Last updated:** [April 23, 2025, 9:43pm UTC](https://discourse.julialang.org/t/warm-starting-ipopt-with-higher-discretization-points/127974 "2025-04-23T21:43:01Z")

</div>

Hello, I’m fairly new to Julia and using Ipopt as a solver, and currently I’m facing the following problem. I’m solving an Optimal control problem with a discretization size of N. Then what I want to do is grab the prov…

---

## [Ipopt does NOT memorize a best solution found so far](https://discourse.julialang.org/t/ipopt-does-not-memorize-a-best-solution-found-so-far/127244)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 7\
**Last updated:** [April 23, 2025, 7:24am UTC](https://discourse.julialang.org/t/ipopt-does-not-memorize-a-best-solution-found-so-far/127244 "2025-04-23T07:24:14Z")

</div>

The title is expounded through optimizing this function function g(x) return sin(7 \* x) + 1.2 \* cos(4.7 \* x) + 1.3 \* x end which can be visualized via, e.g. using CairoMakie f = Figure(); Axis(f\[1, 1\]); xs = LinRange(…

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

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