# Optimization (Mathematical)

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

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

**Page:** 32

---

## [JuMP: Behaviour of value for infeasible models](https://discourse.julialang.org/t/jump-behaviour-of-value-for-infeasible-models/109662)

<div class="topic-metadata">

**Author:** [@samysweb](https://discourse.julialang.org/u/samysweb)\
**Replies:** 10\
**Last updated:** [February 13, 2024, 2:18am UTC](https://discourse.julialang.org/t/jump-behaviour-of-value-for-infeasible-models/109662 "2024-02-13T02:18:11Z")

</div>

Hello everyone, I stumbled on a potential bug in JuMP and its dependencies, however, I wanted to ask this question here first as I am unsure whether this intended behavior and (if not) on which library level this should…

---

## [JuMP / CPLEX: solution\_summary() seemingly returns something wrong](https://discourse.julialang.org/t/jump-cplex-solution-summary-seemingly-returns-something-wrong/110102)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 2\
**Last updated:** [February 12, 2024, 6:06pm UTC](https://discourse.julialang.org/t/jump-cplex-solution-summary-seemingly-returns-something-wrong/110102 "2024-02-12T18:06:44Z")

</div>

I am trying to do some copositivity detection using a MILP with which I find an optimal solution as expected. However, solution\_summary() says that no solution exists. Here is an MWE: using JuMP using CPLEX function my…

---

## [Error with couenne](https://discourse.julialang.org/t/error-with-couenne/110046)

<div class="topic-metadata">

**Author:** [@medardo](https://discourse.julialang.org/u/medardo)\
**Replies:** 6\
**Last updated:** [February 12, 2024, 5:44pm UTC](https://discourse.julialang.org/t/error-with-couenne/110046 "2024-02-12T17:44:46Z")

</div>

Hi, please help me. I can’t see the problem. I am using this code: using JuMP, AmplNLWriter, Couenne\_jll function run() model = Model(() → AmplNLWriter.Optimizer(Couenne\_jll.amplexe)) @variable(model, x) @variable(m…

---

## [Copying a Model?](https://discourse.julialang.org/t/copying-a-model/71246)

<div class="topic-metadata">

**Author:** [@chelseas](https://discourse.julialang.org/u/chelseas)\
**Replies:** 5\
**Last updated:** [February 12, 2024, 3:34pm UTC](https://discourse.julialang.org/t/copying-a-model/71246 "2024-02-12T15:34:05Z")

</div>

Hi, I was wondering if there has been progress on the front of being able to copy/deepcopy a model in JuMP? Currently what I do is re-encode everything into the model but the encoding process is rather long and I would …

---

## [Memory management in CPLEX.jl](https://discourse.julialang.org/t/memory-management-in-cplex-jl/109704)

<div class="topic-metadata">

**Author:** [@Matheus\_Diogenes\_And](https://discourse.julialang.org/u/Matheus_Diogenes_And)\
**Replies:** 9\
**Last updated:** [February 11, 2024, 11:28pm UTC](https://discourse.julialang.org/t/memory-management-in-cplex-jl/109704 "2024-02-11T23:28:12Z")

</div>

Hello. I am investigating a behavior related to the execution of CPLEX.jl. So, let’s consider the following environment: Linux pop-os 6.4.6-76060406-generic; And Julia version 1.8.4. And the following commands: juli…

---

## [CPLEX: CPXwritemipstarts without optimize!](https://discourse.julialang.org/t/cplex-cpxwritemipstarts-without-optimize/109973)

<div class="topic-metadata">

**Author:** [@remi-garcia](https://discourse.julialang.org/u/remi-garcia)\
**Replies:** 5\
**Last updated:** [February 11, 2024, 7:42am UTC](https://discourse.julialang.org/t/cplex-cpxwritemipstarts-without-optimize/109973 "2024-02-11T07:42:23Z")

</div>

Hi, I would like to be able to save a model and its warm start as the solver got them when calling optimize!. using JuMP using CPLEX m = Model(CPLEX.Optimizer); direct\_m = direct\_model(CPLEX.Optimizer()); @variable(m, …

---

## [JuMP new nonlinear interface: adding constraint programatically](https://discourse.julialang.org/t/jump-new-nonlinear-interface-adding-constraint-programatically/110041)

<div class="topic-metadata">

**Author:** [@franckgaga](https://discourse.julialang.org/u/franckgaga)\
**Replies:** 4\
**Last updated:** [February 10, 2024, 8:41pm UTC](https://discourse.julialang.org/t/jump-new-nonlinear-interface-adding-constraint-programatically/110041 "2024-02-10T20:41:15Z")

</div>

ModelPredictiveControl.jl is still using the legacy syntax for NLP, but I’m starting the migration right now. The nonlinear inequality constraints are currently added programmatically with (simplified for the purpose of …

---

## [Dynamic Constraints in JuMP](https://discourse.julialang.org/t/dynamic-constraints-in-jump/110012)

<div class="topic-metadata">

**Author:** [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Replies:** 1\
**Last updated:** [February 10, 2024, 6:28am UTC](https://discourse.julialang.org/t/dynamic-constraints-in-jump/110012 "2024-02-10T06:28:30Z")

</div>

I am working on an iterative solution for a multi-period model. The approach involves solving the model for the initial time period (t=1), then using the outcome (specifically, the values of variable z) as parameters for…

---

## [Is using parallel computing to create JuMP constraints possible and useful?](https://discourse.julialang.org/t/is-using-parallel-computing-to-create-jump-constraints-possible-and-useful/109992)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 1\
**Last updated:** [February 9, 2024, 8:17pm UTC](https://discourse.julialang.org/t/is-using-parallel-computing-to-create-jump-constraints-possible-and-useful/109992 "2024-02-09T20:17:00Z")

</div>

I was wondering if there is any advantage to generate JuMP constraints with @threads regarding the CPU times. Threads.@threads for c in set\_curtailments @constraint(model, sum(x\[:, c\]) .\<= y\[c\] \* nrow(data\_s…

---

## [Columns and Constraints generation](https://discourse.julialang.org/t/columns-and-constraints-generation/103813)

<div class="topic-metadata">

**Author:** [@Salma](https://discourse.julialang.org/u/Salma)\
**Replies:** 13\
**Last updated:** [February 9, 2024, 1:16pm UTC](https://discourse.julialang.org/t/columns-and-constraints-generation/103813 "2024-02-09T13:16:40Z")

</div>

Hello, I’m looking to implement two-stage robust optimization using column and constraint generation. I’ve encountered an issue within while loop related to the optimize!() function when trying to implement the algorithm…

---

## [Nan values when adding constraint to inversion](https://discourse.julialang.org/t/nan-values-when-adding-constraint-to-inversion/109922)

<div class="topic-metadata">

**Author:** [@vivekag7](https://discourse.julialang.org/u/vivekag7)\
**Replies:** 2\
**Last updated:** [February 8, 2024, 11:20pm UTC](https://discourse.julialang.org/t/nan-values-when-adding-constraint-to-inversion/109922 "2024-02-08T23:20:29Z")

</div>

Hi Julia community, I have been trying to add a constraint to my inversion process: using Optimization, Optim, OptimizationOptimJL # Objective function function objfun(x, simulation, realsol) simulation.mo…

---

## [JuMP: it is possible to obtain the description of solver parameters without accessing the official documentation directly?](https://discourse.julialang.org/t/jump-it-is-possible-to-obtain-the-description-of-solver-parameters-without-accessing-the-official-documentation-directly/109935)

<div class="topic-metadata">

**Author:** [@Alex\_73](https://discourse.julialang.org/u/Alex_73)\
**Replies:** 2\
**Last updated:** [February 8, 2024, 7:02pm UTC](https://discourse.julialang.org/t/jump-it-is-possible-to-obtain-the-description-of-solver-parameters-without-accessing-the-official-documentation-directly/109935 "2024-02-08T19:02:51Z")

</div>

Hi, I’m new to the JuMP package. I took a look at the documentation (JuMP · JuMP) and I couldn’t identify if there is a way to access the description of the solver parameters via JuMP. For example, I would like to know …

---

## [Method Error: No method Matching ZeroTangent()](https://discourse.julialang.org/t/method-error-no-method-matching-zerotangent/109913)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 1\
**Last updated:** [February 8, 2024, 4:27pm UTC](https://discourse.julialang.org/t/method-error-no-method-matching-zerotangent/109913 "2024-02-08T16:27:34Z")

</div>

Here is the dummy Python code that is calling the Julia script (julia.jl) import julia julia.install() from julia.api import Julia julia.install jl = Julia(compiled\_modules=False) from julia import Main import numpy as…

---

## [Why Nelder-Mead minimization without minimal property check?](https://discourse.julialang.org/t/why-nelder-mead-minimization-without-minimal-property-check/102236)

<div class="topic-metadata">

**Author:** [@dietrich](https://discourse.julialang.org/u/dietrich)\
**Replies:** 27\
**Last updated:** [February 8, 2024, 2:33pm UTC](https://discourse.julialang.org/t/why-nelder-mead-minimization-without-minimal-property-check/102236 "2024-02-08T14:33:57Z")

</div>

In a model for biology I used a code written in f90 that worked fine, but for greater readability by the future readers of the corresponding paper, I translated it into Julia. In my f90 code, I used minimization routine…

---

## [JuMP: Constraint with a huge expression](https://discourse.julialang.org/t/jump-constraint-with-a-huge-expression/108456)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 25\
**Last updated:** [February 8, 2024, 10:46am UTC](https://discourse.julialang.org/t/jump-constraint-with-a-huge-expression/108456 "2024-02-08T10:46:26Z")

</div>

I am developing a package for Direct Optimal Control using JuMP. Function tracing is used heavily to formulate the problems. It works well for small to medium sized problems. However, recently I tried one largish example…

---

## [How to use non-linear solvers with JuMP using AmplNLWriter](https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900)

<div class="topic-metadata">

**Author:** [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Replies:** 2\
**Last updated:** [February 8, 2024, 10:09am UTC](https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900 "2024-02-08T10:09:04Z")

</div>

When I try to solve any models using AmplNLWriter to call the non-linear solvers, and then call optimize! solve the problem nothing seems to happen. I use the following code: model = Model(() -\> AmplNLWriter.Optimizer(B…

---

## [Vectorize Julia JuMP code](https://discourse.julialang.org/t/vectorize-julia-jump-code/109844)

<div class="topic-metadata">

**Author:** [@sati](https://discourse.julialang.org/u/sati)\
**Replies:** 1\
**Last updated:** [February 6, 2024, 11:39pm UTC](https://discourse.julialang.org/t/vectorize-julia-jump-code/109844 "2024-02-06T23:39:38Z")

</div>

Hi all, I have the code below. How can we write this code in a vectorized way? using JuMP using SparseArrays model = Model() D = \[1,2,3\] L = \[1,2,3,4,5\] line2dem = sparse(\[1, 2, 3\], \[1, 2, 3\], \[1, 1, 1\], 8, 3) lineIRe…

---

## [Improve speed SDP variable entries continuous 0-1 in Convex.jl](https://discourse.julialang.org/t/improve-speed-sdp-variable-entries-continuous-0-1-in-convex-jl/109794)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 4\
**Last updated:** [February 6, 2024, 9:44pm UTC](https://discourse.julialang.org/t/improve-speed-sdp-variable-entries-continuous-0-1-in-convex-jl/109794 "2024-02-06T21:44:39Z")

</div>

Hi I am trying to solve a large SDP with two matrix constraints using SCS in Convex.jl. I want to constrain all entries of my variable (a matrix) to all be continuous between 0 and 1, and was wondering what the most eff…

---

## [Supporting SIMD-enabled objective functions in optimization APIs](https://discourse.julialang.org/t/supporting-simd-enabled-objective-functions-in-optimization-apis/109728)

<div class="topic-metadata">

**Author:** [@nielsls](https://discourse.julialang.org/u/nielsls)\
**Replies:** 3\
**Last updated:** [February 5, 2024, 8:22pm UTC](https://discourse.julialang.org/t/supporting-simd-enabled-objective-functions-in-optimization-apis/109728 "2024-02-05T20:22:32Z")

</div>

With SIMD the CPU may execute the same instructions on e.g. 4x differents datasets just as fast as on 1x dataset. Assuming the user has a SIMD-enabled objective function - are there optimization algos that can exploit t…

---

## [Help with column generation implementation](https://discourse.julialang.org/t/help-with-column-generation-implementation/109737)

<div class="topic-metadata">

**Author:** [@Carl\_Baier](https://discourse.julialang.org/u/Carl_Baier)\
**Replies:** 1\
**Last updated:** [February 5, 2024, 8:12pm UTC](https://discourse.julialang.org/t/help-with-column-generation-implementation/109737 "2024-02-05T20:12:29Z")

</div>

Hello, i am currently working on a column generation model which i would like to solve with gurobi in Julia. As i am a total newbie, i dont really know where to start. This is the model i would like to implement.PDF Thi…

---

## [Stop Criteria using JuMP with HiGHS when find the first feasible solution](https://discourse.julialang.org/t/stop-criteria-using-jump-with-highs-when-find-the-first-feasible-solution/109520)

<div class="topic-metadata">

**Author:** [@grem](https://discourse.julialang.org/u/grem)\
**Replies:** 4\
**Last updated:** [February 5, 2024, 9:12am UTC](https://discourse.julialang.org/t/stop-criteria-using-jump-with-highs-when-find-the-first-feasible-solution/109520 "2024-02-05T09:12:16Z")

</div>

Hello, I have a MILP problem, which is feasible, and I would like to stop the model run when the solver find the first feasible solution. Is it possible to use a stop criteria like that? I can only find one about time…

---

## [Optimization constraints](https://discourse.julialang.org/t/optimization-constraints/109653)

<div class="topic-metadata">

**Author:** [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Replies:** 7\
**Last updated:** [February 4, 2024, 11:49pm UTC](https://discourse.julialang.org/t/optimization-constraints/109653 "2024-02-04T23:49:07Z")

</div>

I’m working on an optimization model in JuMP where I need to implement conditional constraints based on the sign of the right-hand side (RHS) of certain conditions. This is typically handled using the Big-M method, which…

---

## [Survey of Non-Linear Optimization Modeling Layers in Julia](https://discourse.julialang.org/t/survey-of-non-linear-optimization-modeling-layers-in-julia/78168)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 63\
**Last updated:** [February 4, 2024, 10:34pm UTC](https://discourse.julialang.org/t/survey-of-non-linear-optimization-modeling-layers-in-julia/78168 "2024-02-04T22:34:44Z")

</div>

I am doing a survey of the NLP modeling layers in Julia to see which might be applicable to the kinds of problems that I regularly solve. I have the following basic requirements of the modeling layer, Support for non-…

---

## [KeyError in PowerModels](https://discourse.julialang.org/t/keyerror-in-powermodels/109656)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 3\
**Last updated:** [February 3, 2024, 6:16am UTC](https://discourse.julialang.org/t/keyerror-in-powermodels/109656 "2024-02-03T06:16:20Z")

</div>

Hi All, I developed PowerModels and PowerModelsAnnex, then ran my customized code in PowerModelsAnnex and encountered the following error. Could you please provide guidance on how to resolve this? Thanks in advance! "E…

---

## [MIP start and Heuristic callback](https://discourse.julialang.org/t/mip-start-and-heuristic-callback/109615)

<div class="topic-metadata">

**Author:** [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Replies:** 1\
**Last updated:** [February 2, 2024, 8:12pm UTC](https://discourse.julialang.org/t/mip-start-and-heuristic-callback/109615 "2024-02-02T20:12:15Z")

</div>

Hi, I would like to receive a message about constraint violation when using heuristic callback. When I warm start the model, if there is an infeasibility, I obtain user MIP start violates constraints constraint\_name by…

---

## [Converting GAMS to JuMP: Defining Sets](https://discourse.julialang.org/t/converting-gams-to-jump-defining-sets/108875)

<div class="topic-metadata">

**Author:** [@sati](https://discourse.julialang.org/u/sati)\
**Replies:** 8\
**Last updated:** [February 2, 2024, 2:14pm UTC](https://discourse.julialang.org/t/converting-gams-to-jump-defining-sets/108875 "2024-02-02T14:14:52Z")

</div>

Hi all, I want to convert GAMS script to JuMP, and I have problems dealing with the sets in GAMS. Here is the constraint in GAMS: eDemIR(d)… demIReal(d) + sum(l,line2dem(l,d)\*lineIReal(l)) =e= 0; l, d are sets in GAM…

---

## [How to put bounds on Nelder-Mead in Optim?](https://discourse.julialang.org/t/how-to-put-bounds-on-nelder-mead-in-optim/58183)

<div class="topic-metadata">

**Author:** [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Replies:** 25\
**Last updated:** [February 2, 2024, 6:03am UTC](https://discourse.julialang.org/t/how-to-put-bounds-on-nelder-mead-in-optim/58183 "2024-02-02T06:03:29Z")

</div>

I am confused about how to put bounds on parameters using Nelder-Mead in the Optim.jl package. I somehow remember Nelder-Mead should not be used with Fminbox, so I wonder if the following code is correct? Also, I notice …

---

## [Sparse constraints with COSMO.jl](https://discourse.julialang.org/t/sparse-constraints-with-cosmo-jl/109537)

<div class="topic-metadata">

**Author:** [@fimiller](https://discourse.julialang.org/u/fimiller)\
**Replies:** 3\
**Last updated:** [February 1, 2024, 2:38am UTC](https://discourse.julialang.org/t/sparse-constraints-with-cosmo-jl/109537 "2024-02-01T02:38:48Z")

</div>

I am looking to solve a very large but sparse optimization problem using COSMO.jl. When creating my constraint set COSMO.Constraint(sparse(stack(A\_i\_vecs)), sparsevec(p.B), COSMO.PsdCone) where A = sparse(stack(A\_i\_vec…

---

## [Optimization.jl interface for Turing models](https://discourse.julialang.org/t/optimization-jl-interface-for-turing-models/107473)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 5\
**Last updated:** [February 1, 2024, 12:06am UTC](https://discourse.julialang.org/t/optimization-jl-interface-for-turing-models/107473 "2024-02-01T00:06:28Z")

</div>

I feel like I’ve seen an example somewhere of how to construct an Optimization.OptimizationFunction from a Turing model, but am not finding it at the moment. Can anyone help me find it? Did I imagine this functionality? …

---

## [Callback: solver independent or dependent](https://discourse.julialang.org/t/callback-solver-independent-or-dependent/109423)

<div class="topic-metadata">

**Author:** [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Replies:** 8\
**Last updated:** [January 31, 2024, 7:46pm UTC](https://discourse.julialang.org/t/callback-solver-independent-or-dependent/109423 "2024-01-31T19:46:59Z")

</div>

Hi, I’m currently diving into my first experience with callbacks and have a few doubts that I hope you can help clarify. The goal is to implement callbacks that add user cuts to the root node (or subsequent nodes) base…

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

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