# Optimization (Mathematical)

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

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

**Page:** 31

---

## [BARON - ERROR: IOError: could not spawn](https://discourse.julialang.org/t/baron-error-ioerror-could-not-spawn/44430)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 16\
**Last updated:** [March 1, 2024, 8:05am UTC](https://discourse.julialang.org/t/baron-error-ioerror-could-not-spawn/44430 "2024-03-01T08:05:59Z")

</div>

I am solving a non-linear optimization problem using BARON. The BARON.jl package version I am using is 0.6.2 and it seems to be working fine. But after I update the package to 0.6.3 or 0.6.4, following error is displayed…

---

## [What is the best way to introduce multiple variables in column generation scheme?](https://discourse.julialang.org/t/what-is-the-best-way-to-introduce-multiple-variables-in-column-generation-scheme/110963)

<div class="topic-metadata">

**Author:** [@lucasximenes](https://discourse.julialang.org/u/lucasximenes)\
**Replies:** 3\
**Last updated:** [February 29, 2024, 8:09pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-introduce-multiple-variables-in-column-generation-scheme/110963 "2024-02-29T20:09:56Z")

</div>

Hello! I was wondering what is the optimal way to introduce a group of new variables into an existing variable container, and then update their values in the objective function. My main concern is that my current implem…

---

## [Minimizing a logsumexp function with many terms (Convex.jl)](https://discourse.julialang.org/t/minimizing-a-logsumexp-function-with-many-terms-convex-jl/110853)

<div class="topic-metadata">

**Author:** [@leapsheep](https://discourse.julialang.org/u/leapsheep)\
**Replies:** 11\
**Last updated:** [February 29, 2024, 6:02pm UTC](https://discourse.julialang.org/t/minimizing-a-logsumexp-function-with-many-terms-convex-jl/110853 "2024-02-29T18:02:26Z")

</div>

I am trying to minimize a function that depends on only few parameters, but contains a logsumexp with many terms in the sum, i.e. a function of the form f(x) = \\log \\left(\\sum\_{i=1}^n e^{a\_i \\cdot x}\\right) where where…

---

## [Retrieve UserCuts' slack for sensitivity analysis](https://discourse.julialang.org/t/retrieve-usercuts-slack-for-sensitivity-analysis/110782)

<div class="topic-metadata">

**Author:** [@abreualexp](https://discourse.julialang.org/u/abreualexp)\
**Replies:** 4\
**Last updated:** [February 29, 2024, 11:50am UTC](https://discourse.julialang.org/t/retrieve-usercuts-slack-for-sensitivity-analysis/110782 "2024-02-29T11:50:35Z")

</div>

Settings: Julia 1.8, JuMP 1.13.0, Gurobi.jl 1.0.2 I have been trying to check which type of cuts that I included through callbacks are still active. As shown in Gurobi’s log, the initial formulation has 9010 constrain…

---

## [What is a good way of applying constraints "incrementally"?](https://discourse.julialang.org/t/what-is-a-good-way-of-applying-constraints-incrementally/110890)

<div class="topic-metadata">

**Author:** [@mrys](https://discourse.julialang.org/u/mrys)\
**Replies:** 4\
**Last updated:** [February 29, 2024, 9:08am UTC](https://discourse.julialang.org/t/what-is-a-good-way-of-applying-constraints-incrementally/110890 "2024-02-29T09:08:04Z")

</div>

Let say I have the following problem to solve: x\_old = zeros(\_ndofs) for i in 1:10 func(x) = f(x, x\_old) model = Model(Ipopt.Optimizer) @variable(model, x\[1:\_ndofs\]) @objective(…

---

## [How to access values of JuMP variables during optimization](https://discourse.julialang.org/t/how-to-access-values-of-jump-variables-during-optimization/110914)

<div class="topic-metadata">

**Author:** [@structural](https://discourse.julialang.org/u/structural)\
**Replies:** 7\
**Last updated:** [February 28, 2024, 8:39pm UTC](https://discourse.julialang.org/t/how-to-access-values-of-jump-variables-during-optimization/110914 "2024-02-28T20:39:49Z")

</div>

Is there a way to access values of JuMP variables during the optimization? I need to use JuMP for a constrained optimization. At each iteration of the optimization, I need to access the values of the parameters (i.e., v…

---

## [Basis and non-basis matrix](https://discourse.julialang.org/t/basis-and-non-basis-matrix/110219)

<div class="topic-metadata">

**Author:** [@mohammad\_amini](https://discourse.julialang.org/u/mohammad_amini)\
**Replies:** 14\
**Last updated:** [February 26, 2024, 7:35pm UTC](https://discourse.julialang.org/t/basis-and-non-basis-matrix/110219 "2024-02-26T19:35:46Z")

</div>

I am seeking methods to identify the basis and non-basis matrices in HiGHS, or determine the status of variables and columns within the basis and non-basis. Additionally, I am curious about accessing the final simplex ta…

---

## [Can I recover variable names to PATH labels? JuMP-\>MOI-\>PATHSolver-\>PATH-\>JuMP](https://discourse.julialang.org/t/can-i-recover-variable-names-to-path-labels-jump-moi-pathsolver-path-jump/110703)

<div class="topic-metadata">

**Author:** [@EliLazarus](https://discourse.julialang.org/u/EliLazarus)\
**Replies:** 2\
**Last updated:** [February 26, 2024, 2:19am UTC](https://discourse.julialang.org/t/can-i-recover-variable-names-to-path-labels-jump-moi-pathsolver-path-jump/110703 "2024-02-26T02:19:17Z")

</div>

I am passing named variable/constraints to JuMP. Is there a way to track the variable/constraint name linked to the row f\[ #\] which is what is reported by PATH (looks like unnamed rows as in this example without names)? …

---

## [Differentiating optimization problem solutions in Julia](https://discourse.julialang.org/t/differentiating-optimization-problem-solutions-in-julia/75988)

<div class="topic-metadata">

**Author:** [@mtfishman](https://discourse.julialang.org/u/mtfishman)\
**Replies:** 9\
**Last updated:** [February 25, 2024, 2:10pm UTC](https://discourse.julialang.org/t/differentiating-optimization-problem-solutions-in-julia/75988 "2024-02-25T14:10:32Z")

</div>

Hello, I was recently made aware of the paper “Efficient and Modular Implicit Differentiation”: which is implemented in Jax here: It is about automatically generating differentiation rules for optimization problem…

---

## [Solve MCP problems with nonlinear constraints](https://discourse.julialang.org/t/solve-mcp-problems-with-nonlinear-constraints/110061)

<div class="topic-metadata">

**Author:** [@vicentemunozlh](https://discourse.julialang.org/u/vicentemunozlh)\
**Replies:** 8\
**Last updated:** [February 25, 2024, 10:44am UTC](https://discourse.julialang.org/t/solve-mcp-problems-with-nonlinear-constraints/110061 "2024-02-25T10:44:00Z")

</div>

Hello ! Ive been trying to solve an MCP problem with JuMP and non linear constraints/optimality condition but have not been able to do so. Is there a way around this? or other package that might do the trick? Thank you…

---

## [Choice variable doesn't optimize the objective function](https://discourse.julialang.org/t/choice-variable-doesnt-optimize-the-objective-function/110633)

<div class="topic-metadata">

**Author:** [@Ayesha](https://discourse.julialang.org/u/Ayesha)\
**Replies:** 3\
**Last updated:** [February 25, 2024, 12:34am UTC](https://discourse.julialang.org/t/choice-variable-doesnt-optimize-the-objective-function/110633 "2024-02-25T00:34:31Z")

</div>

begin # set parameters b = 100.0 r = 0.2 α = 0.85 θ = 2.5 β = 0.9 A = 1.0 s = 1.0 end begin f(b) = b^α Y₂(b,θ) = θ\*f(b) C₂(R₂,b,θ) = Y₂(b,θ) - R₂ R̄(b,r) = (1+r)\*b U₂(R₂, θ, b, α) = A\*log(max(θ \* f(b) - …

---

## [Using structures with JuMP](https://discourse.julialang.org/t/using-structures-with-jump/110663)

<div class="topic-metadata">

**Author:** [@joaomcostab](https://discourse.julialang.org/u/joaomcostab)\
**Replies:** 5\
**Last updated:** [February 24, 2024, 9:07pm UTC](https://discourse.julialang.org/t/using-structures-with-jump/110663 "2024-02-24T21:07:30Z")

</div>

I am trying to solve a non-linear system re-writing it in a way that I can use optimization (basically the objective function is 1.0 and the constraints are the equations of the system). However, these equations use use…

---

## [Is JuMP suitable for very big problems?](https://discourse.julialang.org/t/is-jump-suitable-for-very-big-problems/110642)

<div class="topic-metadata">

**Author:** [@mrys](https://discourse.julialang.org/u/mrys)\
**Replies:** 3\
**Last updated:** [February 23, 2024, 7:24pm UTC](https://discourse.julialang.org/t/is-jump-suitable-for-very-big-problems/110642 "2024-02-23T19:24:41Z")

</div>

This question has certainly been asked, but I couldn’t actually find a clear answer. Having the following problem: n = 10000; k = rand(n, n) ke = 0.5(k + k'); function func(x::T...) where T y = collect(x) retur…

---

## [Suppress Error message and draw another random numbs during simulation](https://discourse.julialang.org/t/suppress-error-message-and-draw-another-random-numbs-during-simulation/110555)

<div class="topic-metadata">

**Author:** [@Wooheon](https://discourse.julialang.org/u/Wooheon)\
**Replies:** 6\
**Last updated:** [February 23, 2024, 12:08am UTC](https://discourse.julialang.org/t/suppress-error-message-and-draw-another-random-numbs-during-simulation/110555 "2024-02-23T00:08:50Z")

</div>

Hi, I am trying to calculate the bias and mean squared errors, which need repetition of simulations. The problem is my optimize result sometimes gives an error message of AssertionError: isfinite(phi\_c) && isfinite(dp…

---

## [Implementing a model with column generation](https://discourse.julialang.org/t/implementing-a-model-with-column-generation/110595)

<div class="topic-metadata">

**Author:** [@Carl\_Baier](https://discourse.julialang.org/u/Carl_Baier)\
**Replies:** 1\
**Last updated:** [February 22, 2024, 6:57pm UTC](https://discourse.julialang.org/t/implementing-a-model-with-column-generation/110595 "2024-02-22T18:57:33Z")

</div>

Hello, I have the following model and want to solve it with column generation according to these instructions. Unfortunately, I am a complete coding newbie and wanted to ask if anyone would like to help me implement this…

---

## [Lazy constraints & issues with presolve](https://discourse.julialang.org/t/lazy-constraints-issues-with-presolve/110449)

<div class="topic-metadata">

**Author:** [@salvaguerrero](https://discourse.julialang.org/u/salvaguerrero)\
**Replies:** 3\
**Last updated:** [February 21, 2024, 7:32pm UTC](https://discourse.julialang.org/t/lazy-constraints-issues-with-presolve/110449 "2024-02-21T19:32:55Z")

</div>

Good morning community, I’m trying to use lazy constraints, but I’m finding some issues. I would like to solve a problem iterative (benders decomposition) where in each iteration an additional constraint is added as la…

---

## [LoadError: UndefVarError: \`libglpk\` not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-libglpk-not-defined/110480)

<div class="topic-metadata">

**Author:** [@Carl\_Baier](https://discourse.julialang.org/u/Carl_Baier)\
**Replies:** 7\
**Last updated:** [February 20, 2024, 11:16pm UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-libglpk-not-defined/110480 "2024-02-20T23:16:52Z")

</div>

Hello, i have this code: using libglpk using GLPK using JuMP using Gurobi using DataFrames using BlockDecomposition, Coluna; I\_list = \[1, 2, 3\] T\_list = \[1, 2, 3, 4, 5, 6, 7\] K\_list = \[1, 2, 3\] alpha=0.01 M = 10000 Ma…

---

## [Autodiff Enzyme reverse mode sometimes fails on on repeated evaluation](https://discourse.julialang.org/t/autodiff-enzyme-reverse-mode-sometimes-fails-on-on-repeated-evaluation/110017)

<div class="topic-metadata">

**Author:** [@dchang10](https://discourse.julialang.org/u/dchang10)\
**Replies:** 7\
**Last updated:** [February 20, 2024, 3:27pm UTC](https://discourse.julialang.org/t/autodiff-enzyme-reverse-mode-sometimes-fails-on-on-repeated-evaluation/110017 "2024-02-20T15:27:04Z")

</div>

I’m developing a package which has a function defined the following way function emission\_radius(pix::Krang.AbstractPixel, θs::T, isindir, n) where {T} α, β = screen\_coordinate(pix) θo = inclination(pix) met…

---

## [Access JuMP variables queried as string](https://discourse.julialang.org/t/access-jump-variables-queried-as-string/110393)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 10\
**Last updated:** [February 20, 2024, 12:16pm UTC](https://discourse.julialang.org/t/access-jump-variables-queried-as-string/110393 "2024-02-20T12:16:06Z")

</div>

If a user wants to know the variable values for a JuMP model that is not exposed to the user directly, what are the options? For example: using JuMP using HiGHS #some arbitrary JuMP model model = Model(HiGHS.Optimizer)…

---

## [How to extract convergence status in Optim.jl?](https://discourse.julialang.org/t/how-to-extract-convergence-status-in-optim-jl/110430)

<div class="topic-metadata">

**Author:** [@Wooheon](https://discourse.julialang.org/u/Wooheon)\
**Replies:** 2\
**Last updated:** [February 20, 2024, 12:41am UTC](https://discourse.julialang.org/t/how-to-extract-convergence-status-in-optim-jl/110430 "2024-02-20T00:41:02Z")

</div>

I ran several optimization problems with different models, but some didn’t seem to calculate the result but spit out some random results. So, I would like to know how to extract the status of the ‘optimized’ results, but…

---

## [How to pass a constraint as Lazy with Gurobi?](https://discourse.julialang.org/t/how-to-pass-a-constraint-as-lazy-with-gurobi/110294)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 5\
**Last updated:** [February 19, 2024, 5:57pm UTC](https://discourse.julialang.org/t/how-to-pass-a-constraint-as-lazy-with-gurobi/110294 "2024-02-19T17:57:50Z")

</div>

I want to pass a constraint as Lazy in the beginning of my JuMP model. Note that I do not want it to be a lazy constraint called in a Callback. How am I supposed to do it? The corresponding Gurobi parameter is: It …

---

## [Indexing problem SDDP package](https://discourse.julialang.org/t/indexing-problem-sddp-package/110291)

<div class="topic-metadata">

**Author:** [@heiwie](https://discourse.julialang.org/u/heiwie)\
**Replies:** 4\
**Last updated:** [February 17, 2024, 10:33pm UTC](https://discourse.julialang.org/t/indexing-problem-sddp-package/110291 "2024-02-17T22:33:26Z")

</div>

I am trying to define a hydropower production problem in Julia using the SDDP package. When running the code I get this error: “ERROR: KeyError: key Symbol(“w2\[3\]”) not found”. This error seems like it is being caused b…

---

## [Energy planning](https://discourse.julialang.org/t/energy-planning/110315)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [February 17, 2024, 12:22pm UTC](https://discourse.julialang.org/t/energy-planning/110315 "2024-02-17T12:22:26Z")

</div>

There is a nice open source tool for energy planning: http://www.osemosys.org/ As far as I understand their are two open source versions, one written in GNUMathprog, and one in Python. The GNUMathprog version is quite c…

---

## [JuMP: DimensionalData Compatibility](https://discourse.julialang.org/t/jump-dimensionaldata-compatibility/109736)

<div class="topic-metadata">

**Author:** [@Ethan-Russell](https://discourse.julialang.org/u/Ethan-Russell)\
**Replies:** 3\
**Last updated:** [February 15, 2024, 10:26pm UTC](https://discourse.julialang.org/t/jump-dimensionaldata-compatibility/109736 "2024-02-15T22:26:31Z")

</div>

I’m running into compat issues with JuMP, caused by the dependence on DimensionalData.jl, v0.24. Specifically, I’m trying to use JuMP.jl and the latest version of Rasters.jl, which requires DimensionalData v0.25.1. Is t…

---

## [Unexpected JuMP variable order when indexed by tuple](https://discourse.julialang.org/t/unexpected-jump-variable-order-when-indexed-by-tuple/110262)

<div class="topic-metadata">

**Author:** [@brunompacheco](https://discourse.julialang.org/u/brunompacheco)\
**Replies:** 7\
**Last updated:** [February 15, 2024, 7:39pm UTC](https://discourse.julialang.org/t/unexpected-jump-variable-order-when-indexed-by-tuple/110262 "2024-02-15T19:39:34Z")

</div>

When creating a variable indexed by Tuple{Int64, Float64}, I get a different order (apparently, sorted as string) than that provided when creating or accessing the variable. Steps to reproduce: using JuMP model = Mode…

---

## [X' allowed in JuMP model but not transpose(X)](https://discourse.julialang.org/t/x-allowed-in-jump-model-but-not-transpose-x/110147)

<div class="topic-metadata">

**Author:** [@dhendryc](https://discourse.julialang.org/u/dhendryc)\
**Replies:** 3\
**Last updated:** [February 14, 2024, 6:39pm UTC](https://discourse.julialang.org/t/x-allowed-in-jump-model-but-not-transpose-x/110147 "2024-02-14T18:39:37Z")

</div>

Hi, I have encountered a weird behaviour in JuMP. This works JuMP.@constraint(model, sum(A\[i, :\] \* Y\_mat\[i,:\]’ for i in 1:m) .- sum(μ)\*I .== zeros(n,n)) while this does not JuMP.@constraint(model, sum(A\[i, :\] \* tran…

---

## [Comparison of derivative-free / black-box optimization algorithms in Julia](https://discourse.julialang.org/t/comparison-of-derivative-free-black-box-optimization-algorithms-in-julia/109614)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 12\
**Last updated:** [February 14, 2024, 12:02pm UTC](https://discourse.julialang.org/t/comparison-of-derivative-free-black-box-optimization-algorithms-in-julia/109614 "2024-02-14T12:02:11Z")

</div>

Is anyone aware of a comparison between derivative-free / black box optimization libraries in Julia? If not, perhaps it is worth starting one here and finally putting it in the Julia Package Comparisons website? At the …

---

## [Long NLP evaluation time in Ipopt](https://discourse.julialang.org/t/long-nlp-evaluation-time-in-ipopt/109436)

<div class="topic-metadata">

**Author:** [@tso-martin](https://discourse.julialang.org/u/tso-martin)\
**Replies:** 6\
**Last updated:** [February 14, 2024, 6:56am UTC](https://discourse.julialang.org/t/long-nlp-evaluation-time-in-ipopt/109436 "2024-02-14T06:56:32Z")

</div>

Dear all, I encounter long evaluation times and slow convergence in an AC security constraint optimal power flow (SCOPF) optimization. The problem is modelled with PowerModels and JuMP. The NLP evaluation time is higher…

---

## [Adding complementarity constraints](https://discourse.julialang.org/t/adding-complementarity-constraints/110132)

<div class="topic-metadata">

**Author:** [@anand.kumar](https://discourse.julialang.org/u/anand.kumar)\
**Replies:** 4\
**Last updated:** [February 14, 2024, 4:39am UTC](https://discourse.julialang.org/t/adding-complementarity-constraints/110132 "2024-02-14T04:39:08Z")

</div>

I’m new to both AMPL and JuMP. I’m trying to translate constraints below to jump but don’t understand how to do it. compl\_1{k in K}: 0 \<= ll\[1,k\] complements y\[1,k\] - x\[1\] \<= 0; compl\_2{k in K}: 0 \<= ll\[2,k\] comple…

---

## [Dynamically Naming Expressions and Constraints in JuMP](https://discourse.julialang.org/t/dynamically-naming-expressions-and-constraints-in-jump/110181)

<div class="topic-metadata">

**Author:** [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Replies:** 1\
**Last updated:** [February 13, 2024, 11:48pm UTC](https://discourse.julialang.org/t/dynamically-naming-expressions-and-constraints-in-jump/110181 "2024-02-13T23:48:43Z")

</div>

In JuMP, it appears that expressions, constraints, and variables cannot be dynamically named using string interpolation (i.e., the $ symbol) directly within the identifiers of the @variable or @expression macros. Given t…

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

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