# Optimization (Mathematical)

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

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

**Page:** 7

---

## [Excessive memory usage when adding millions of variables to a JuMP Model](https://discourse.julialang.org/t/excessive-memory-usage-when-adding-millions-of-variables-to-a-jump-model/130163)

<div class="topic-metadata">

**Author:** [@Walter](https://discourse.julialang.org/u/Walter)\
**Replies:** 12\
**Last updated:** [July 12, 2025, 3:28pm UTC](https://discourse.julialang.org/t/excessive-memory-usage-when-adding-millions-of-variables-to-a-jump-model/130163 "2025-07-12T15:28:52Z")

</div>

Hi, I’m solving a large MIP using JuMP + Gurobi. My approach dynamically adds variables to the model (similar to column generation). In some cases, up to 10 000 000 variables are added within a single step. During this …

---

## [Polynomial optimization without sum of squares](https://discourse.julialang.org/t/polynomial-optimization-without-sum-of-squares/130478)

<div class="topic-metadata">

**Author:** [@joemaik](https://discourse.julialang.org/u/joemaik)\
**Replies:** 11\
**Last updated:** [July 10, 2025, 1:24pm UTC](https://discourse.julialang.org/t/polynomial-optimization-without-sum-of-squares/130478 "2025-07-10T13:24:13Z")

</div>

TL-DR: I would like to solve a linear program, but the problem itself involves multivariate polynomials. So I need tools to transform polynomials to their vectors of coefficients and back. Moreoever, in the end, after so…

---

## [Relaxing Big-M constraint](https://discourse.julialang.org/t/relaxing-big-m-constraint/130592)

<div class="topic-metadata">

**Author:** [@leila\_Ra](https://discourse.julialang.org/u/leila_Ra)\
**Replies:** 5\
**Last updated:** [July 10, 2025, 3:15am UTC](https://discourse.julialang.org/t/relaxing-big-m-constraint/130592 "2025-07-10T03:15:20Z")

</div>

Hi, I’m formulating an optimization problem in JuMP and need some advice on relaxing a logical constraint. The logic is as follows: If x\>260, then Z=0. (Note: Z can only be either 0 or Zmax no values in between.) I’…

---

## [A Primal-Dual Global Optimization approach on the Cutting Stock Problem](https://discourse.julialang.org/t/a-primal-dual-global-optimization-approach-on-the-cutting-stock-problem/129686)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 18\
**Last updated:** [July 7, 2025, 10:38pm UTC](https://discourse.julialang.org/t/a-primal-dual-global-optimization-approach-on-the-cutting-stock-problem/129686 "2025-07-07T22:38:49Z")

</div>

This doc reads a bit lengthy, because it uses complex data structures (maybe for visualization purposes). Therein it uses economic interpretation, which is hard to understand for me. Therefore, I explicitly wrote the…

---

## [Memory corruption error in Julia: "Incorrect checksum for freed object" when running a JuMP/Gurobi model](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522)

<div class="topic-metadata">

**Author:** [@leonie25](https://discourse.julialang.org/u/leonie25)\
**Replies:** 5\
**Last updated:** [July 7, 2025, 5:15am UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522 "2025-07-07T05:15:04Z")

</div>

I am encountering a memory corruption error when running my optimization model using JuMP with the Gurobi solver in Julia. The error message is as follows: julia(30498,0x2012a5f00) malloc: Incorrect checksum for freed o…

---

## [Solving a large scale MILP problem with cplex takes long time](https://discourse.julialang.org/t/solving-a-large-scale-milp-problem-with-cplex-takes-long-time/130491)

<div class="topic-metadata">

**Author:** [@JOHN1](https://discourse.julialang.org/u/JOHN1)\
**Replies:** 3\
**Last updated:** [July 6, 2025, 9:24pm UTC](https://discourse.julialang.org/t/solving-a-large-scale-milp-problem-with-cplex-takes-long-time/130491 "2025-07-06T21:24:44Z")

</div>

i am solving a large scale MILP problem with cplex, it takes too much time and cannot obtain the sollution, does it means that cplex is not suitable for this large scale MILP problem? what can i do to acceralate the solv…

---

## [Gurobi gets stuck after "Loaded MIP start from previous solve"](https://discourse.julialang.org/t/gurobi-gets-stuck-after-loaded-mip-start-from-previous-solve/130406)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 13\
**Last updated:** [July 6, 2025, 5:34am UTC](https://discourse.julialang.org/t/gurobi-gets-stuck-after-loaded-mip-start-from-previous-solve/130406 "2025-07-06T05:34:33Z")

</div>

I’m writing the Benders’ decomposition for an MIP and encountering a very weird behavior of Gurobi. There is an MIP that I need to modify its obj and repeatedly re-solve (Gurobi can (according to its Logging) Loaded MIP…

---

## [Duals and constraint names for \`PowerModels\` and \`InfrastructureModels\`](https://discourse.julialang.org/t/duals-and-constraint-names-for-powermodels-and-infrastructuremodels/130311)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 5\
**Last updated:** [July 5, 2025, 4:32pm UTC](https://discourse.julialang.org/t/duals-and-constraint-names-for-powermodels-and-infrastructuremodels/130311 "2025-07-05T16:32:44Z")

</div>

I would like to (1) use PowerModels to construct a base DCOPF model and (2) make some modifications to the model (such as allowing load shed by adding new variables and modifying cosntraints). Beginning with an instance …

---

## [Differentiate through SecondOrderCone](https://discourse.julialang.org/t/differentiate-through-secondordercone/130365)

<div class="topic-metadata">

**Author:** [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Replies:** 8\
**Last updated:** [July 4, 2025, 10:45am UTC](https://discourse.julialang.org/t/differentiate-through-secondordercone/130365 "2025-07-04T10:45:14Z")

</div>

Hello :slight\_smile: I want to differentiate an Optimization Program. I use DiffOpt for this, which is built over JuMP. I have some data, that I want to fit by a function of a few parameters. This can be done with diffe…

---

## [Gurobi reports OPTIMAL on a QP having a huge MaxVio](https://discourse.julialang.org/t/gurobi-reports-optimal-on-a-qp-having-a-huge-maxvio/129645)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 8\
**Last updated:** [July 4, 2025, 1:08am UTC](https://discourse.julialang.org/t/gurobi-reports-optimal-on-a-qp-having-a-huge-maxvio/129645 "2025-07-04T01:08:16Z")

</div>

julia\> JuMP.unset\_silent(outer) Set parameter OutputFlag to value 1 julia\> JuMP.optimize!(outer) Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (win64 - Windows 11.0 (26100.2)) CPU model: 11th Gen Intel(R) Core(TM) i…

---

## [On the relationship between \`JuMP\` and \`MathOptInterface\`](https://discourse.julialang.org/t/on-the-relationship-between-jump-and-mathoptinterface/130329)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 11\
**Last updated:** [July 3, 2025, 6:12pm UTC](https://discourse.julialang.org/t/on-the-relationship-between-jump-and-mathoptinterface/130329 "2025-07-03T18:12:08Z")

</div>

JuMP is essentially a more user-friendly wrapper for MathOptInterface and it can be completely bypassed or replaced by MathOptInterface, right?

---

## [Significant difference in SCIP solving time between JuMP and Rust (\`russcip\`)](https://discourse.julialang.org/t/significant-difference-in-scip-solving-time-between-jump-and-rust-russcip/130455)

<div class="topic-metadata">

**Author:** [@ShugarSkull](https://discourse.julialang.org/u/ShugarSkull)\
**Replies:** 2\
**Last updated:** [July 3, 2025, 3:52pm UTC](https://discourse.julialang.org/t/significant-difference-in-scip-solving-time-between-jump-and-rust-russcip/130455 "2025-07-03T15:52:32Z")

</div>

Hi all, I’ve noticed a large difference in solving time when using SCIP through JuMP in Julia versus using the russcip crate in Rust, and I’m hoping someone can help explain why. :puzzle\_piece: Context I’m solving a MI…

---

## [Gurobi's Root relaxation objective in MIP Logging is Not a natural LP relaxation one](https://discourse.julialang.org/t/gurobis-root-relaxation-objective-in-mip-logging-is-not-a-natural-lp-relaxation-one/130337)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 3\
**Last updated:** [June 30, 2025, 10:57pm UTC](https://discourse.julialang.org/t/gurobis-root-relaxation-objective-in-mip-logging-is-not-a-natural-lp-relaxation-one/130337 "2025-06-30T22:57:11Z")

</div>

I’m not sure whether this is reasonable, but it is somewhat misleading. Compare the 2 lines where I draw 3 orange balls. julia\> import JuMP, Gurobi; GRB\_ENV = Gurobi.Env(); Set parameter Username Set parameter LicenseI…

---

## [PackageCompiler fails to create app for MadNLPGPU + ExaModels (CUDSS linear solver)](https://discourse.julialang.org/t/packagecompiler-fails-to-create-app-for-madnlpgpu-examodels-cudss-linear-solver/125998)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 11\
**Last updated:** [June 30, 2025, 7:26am UTC](https://discourse.julialang.org/t/packagecompiler-fails-to-create-app-for-madnlpgpu-examodels-cudss-linear-solver/125998 "2025-06-30T07:26:00Z")

</div>

I can not create “app” with PackageCompiler even for simplest GPU optimization with ExaModels+MadNLPGPU running cuDSS. I’ve made full MWE project with package to be built in attempt to help this to debug. Compiling does …

---

## [Gurobi's trial solution is numerically weird on a primitive CTPLN model](https://discourse.julialang.org/t/gurobis-trial-solution-is-numerically-weird-on-a-primitive-ctpln-model/130294)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 1\
**Last updated:** [June 29, 2025, 11:11pm UTC](https://discourse.julialang.org/t/gurobis-trial-solution-is-numerically-weird-on-a-primitive-ctpln-model/130294 "2025-06-29T23:11:27Z")

</div>

Although this might not necessarily be deemed a bug, it’s certainly a bit weird. Why? julia\> import JuMP, Gurobi; GRB\_ENV = Gurobi.Env(); Set parameter Username Set parameter LicenseID to value 2663413 Academic license …

---

## [Optim.jl : user defined Manifold, error in the definition of the retraction](https://discourse.julialang.org/t/optim-jl-user-defined-manifold-error-in-the-definition-of-the-retraction/130297)

<div class="topic-metadata">

**Author:** [@aitzkora](https://discourse.julialang.org/u/aitzkora)\
**Replies:** 2\
**Last updated:** [June 29, 2025, 8:49pm UTC](https://discourse.julialang.org/t/optim-jl-user-defined-manifold-error-in-the-definition-of-the-retraction/130297 "2025-06-29T20:49:42Z")

</div>

Hi, I try to optimize a simple quadratic function on a user-defined manifold (the hyperplan orthogonal to ones(n)) with the following code using Optim const c = ones(2) ./ sqrt(2) f(x) = 0.5 \* sum((x - c).^2) g!(g,x) =…

---

## [JuMP diet tutorial issue?](https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231)

<div class="topic-metadata">

**Author:** [@Vee\_Kalkunte](https://discourse.julialang.org/u/Vee_Kalkunte)\
**Replies:** 2\
**Last updated:** [June 26, 2025, 9:22pm UTC](https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231 "2025-06-26T21:22:06Z")

</div>

Hi! I’m following the JuMP documentation’s Diet problem code, and I’m running into a constraint error (“ERROR: At code.jl:66: @constraint(model, row.min \<= sum(foods\[!, row.nutrient\] .\* foods.x) \<= row.max): Unrecognize…

---

## [Copying a JuMP model is slower than building it from scratch](https://discourse.julialang.org/t/copying-a-jump-model-is-slower-than-building-it-from-scratch/130190)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 6\
**Last updated:** [June 26, 2025, 2:40pm UTC](https://discourse.julialang.org/t/copying-a-jump-model-is-slower-than-building-it-from-scratch/130190 "2025-06-26T14:40:39Z")

</div>

As the title. Then what is the point of the Base.copy(model::AbstractModel) function? julia\> Min\_ȷ\_fixed\_part Min\_ȷ\_fixed\_part (generic function with 1 method) julia\> t = time(); model = Min\_ȷ\_fixed\_part(); time() - t …

---

## [IPOPT suppress output file generation](https://discourse.julialang.org/t/ipopt-suppress-output-file-generation/127595)

<div class="topic-metadata">

**Author:** [@hjalgra](https://discourse.julialang.org/u/hjalgra)\
**Replies:** 22\
**Last updated:** [June 25, 2025, 7:03am UTC](https://discourse.julialang.org/t/ipopt-suppress-output-file-generation/127595 "2025-06-25T07:03:16Z")

</div>

I am using IPOPT to solve a sequence of optimization problems (interfaced using SNOW). In order to prevent the creation of an output file I am initializing IPOPT using the following options ip\_options = Dict( …

---

## [Using JuMP for solving a symbolic algebraic system](https://discourse.julialang.org/t/using-jump-for-solving-a-symbolic-algebraic-system/130153)

<div class="topic-metadata">

**Author:** [@jonlym](https://discourse.julialang.org/u/jonlym)\
**Replies:** 2\
**Last updated:** [June 24, 2025, 7:00pm UTC](https://discourse.julialang.org/t/using-jump-for-solving-a-symbolic-algebraic-system/130153 "2025-06-24T19:00:05Z")

</div>

Hi All, I’d like to solve a system of algebraic equations with the flexibility to specify one variable as independent and one as the dependent variable. In the toy example below, I am calculating the Reynolds number, Re …

---

## [KNITRO license path](https://discourse.julialang.org/t/knitro-license-path/130145)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 4\
**Last updated:** [June 24, 2025, 6:42pm UTC](https://discourse.julialang.org/t/knitro-license-path/130145 "2025-06-24T18:42:53Z")

</div>

From where does Julia in VS Code source environmental variables setting the KNITRO license path ENV\[“ARTELYS\_LICENSE”\]? The issue: I updated my KNITRO license file and its location and set the environment variable in .…

---

## [Sorting when the comparison operator depends on the entire input vector](https://discourse.julialang.org/t/sorting-when-the-comparison-operator-depends-on-the-entire-input-vector/130152)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 6\
**Last updated:** [June 24, 2025, 6:04am UTC](https://discourse.julialang.org/t/sorting-when-the-comparison-operator-depends-on-the-entire-input-vector/130152 "2025-06-24T06:04:22Z")

</div>

Hi all. Given a parameter Vector{Float64} called x, I want to find x\* such that f(x\*) \> f(x) for all possible permutations of x, where f maps x to a single Float64. I could (and have successfully) used a general optimiza…

---

## [SDDP model sometimes fails during training, or simulation](https://discourse.julialang.org/t/sddp-model-sometimes-fails-during-training-or-simulation/130139)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 2\
**Last updated:** [June 23, 2025, 9:49pm UTC](https://discourse.julialang.org/t/sddp-model-sometimes-fails-during-training-or-simulation/130139 "2025-06-23T21:49:33Z")

</div>

Hi all. I’m seeking help to diagnose a simple inventory problem over a finite horizon I’ve set up with SDDP. Currently, my model is such that the stochasticity is demand, for which we assume we know the intensity of the …

---

## [How to make a Proximal Point using Julia](https://discourse.julialang.org/t/how-to-make-a-proximal-point-using-julia/130132)

<div class="topic-metadata">

**Author:** [@Deyvid\_Andrade](https://discourse.julialang.org/u/Deyvid_Andrade)\
**Replies:** 2\
**Last updated:** [June 23, 2025, 2:28pm UTC](https://discourse.julialang.org/t/how-to-make-a-proximal-point-using-julia/130132 "2025-06-23T14:28:00Z")

</div>

I am new to julia and I’d like create an iterative function that can to modeling the proximal point method. And, apply to solve an equilibrium problems, i.e., Given function f(x,y) convex only in x, the algorithm is def…

---

## [Piecewise linear for a supply function](https://discourse.julialang.org/t/piecewise-linear-for-a-supply-function/130121)

<div class="topic-metadata">

**Author:** [@nemoincognito](https://discourse.julialang.org/u/nemoincognito)\
**Replies:** 1\
**Last updated:** [June 23, 2025, 8:08am UTC](https://discourse.julialang.org/t/piecewise-linear-for-a-supply-function/130121 "2025-06-23T08:08:52Z")

</div>

I am modelling costs for mines that have a fixed cost and a variable cost to slice the mine into realistic average costs for various levels of output. mine\_name = prod\_capa\_cost\_df\[100,:mine\_name\] capacity = prod\_capa\_c…

---

## [Not achieving convergence after prolonged training](https://discourse.julialang.org/t/not-achieving-convergence-after-prolonged-training/130093)

<div class="topic-metadata">

**Author:** [@Engr\_Moiz\_Ahmad](https://discourse.julialang.org/u/Engr_Moiz_Ahmad)\
**Replies:** 3\
**Last updated:** [June 22, 2025, 8:03pm UTC](https://discourse.julialang.org/t/not-achieving-convergence-after-prolonged-training/130093 "2025-06-22T20:03:21Z")

</div>

I am dealing with an infinite-horizon multi-stage mixed-integer linear stochastic global supply chain optimization problem and using SDDP.jl for its solution. In this regard, after a significant amount of training, the …

---

## [Build a JuMP bilinear expression with a function](https://discourse.julialang.org/t/build-a-jump-bilinear-expression-with-a-function/130091)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 2\
**Last updated:** [June 21, 2025, 2:20pm UTC](https://discourse.julialang.org/t/build-a-jump-bilinear-expression-with-a-function/130091 "2025-06-21T14:20:35Z")

</div>

I’m writing some algorithms recently and I find this bilinear structure is particularly useful, because its construction steps can be reused in the 2 models. Is there any advisable idea? out = JuMP.Model() # outer mast…

---

## [Column generation requiring a lot of memory?](https://discourse.julialang.org/t/column-generation-requiring-a-lot-of-memory/130056)

<div class="topic-metadata">

**Author:** [@mposs](https://discourse.julialang.org/u/mposs)\
**Replies:** 4\
**Last updated:** [June 20, 2025, 12:08pm UTC](https://discourse.julialang.org/t/column-generation-requiring-a-lot-of-memory/130056 "2025-06-20T12:08:11Z")

</div>

Hi I’m solving a (rather large) LP through two approaches. One involves solving the full LP. The second consists in doing column generation, gradually adding variables through @variable and set\_normalized\_coefficient. I…

---

## [Solver attributes and set\_optimizer with ParametricOptInterface.jl and JuMP.jl](https://discourse.julialang.org/t/solver-attributes-and-set-optimizer-with-parametricoptinterface-jl-and-jump-jl/129935)

<div class="topic-metadata">

**Author:** [@dcelisgarza](https://discourse.julialang.org/u/dcelisgarza)\
**Replies:** 9\
**Last updated:** [June 19, 2025, 11:44am UTC](https://discourse.julialang.org/t/solver-attributes-and-set-optimizer-with-parametricoptinterface-jl-and-jump-jl/129935 "2025-06-19T11:44:28Z")

</div>

Hi, I could really use ParametricOptInterface.jl (POI) for a library I’m developing (I’ll make an announcement at some point), but I’ve run into a few issues. I don’t know how to provide solver-specific attributes, an…

---

## [Need help wrapping cuOpt in julia](https://discourse.julialang.org/t/need-help-wrapping-cuopt-in-julia/129808)

<div class="topic-metadata">

**Author:** [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Replies:** 13\
**Last updated:** [June 16, 2025, 8:29pm UTC](https://discourse.julialang.org/t/need-help-wrapping-cuopt-in-julia/129808 "2025-06-16T20:29:07Z")

</div>

NVIDIA recently open-sourced their cuOpt solver suite. The source code is mostly C++, and it has a C API. I’m looking into wrapping that in Julia and setting up a JuMP/MOI interface so we can use cuOpt through JuMP. I h…

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

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