# Optimization (Mathematical)

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

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

**Page:** 24

---

## [Alpine Error](https://discourse.julialang.org/t/alpine-error/115987)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 12\
**Last updated:** [June 24, 2024, 7:04pm UTC](https://discourse.julialang.org/t/alpine-error/115987 "2024-06-24T19:04:06Z")

</div>

When I use Alpine to solve an optimization problem, I get the error below. Starting bound-tightening ERROR: LoadError: Constraints of type MathOptInterface.ScalarQuadraticFunction{Float64}-in-MathOptInterface.GreaterT…

---

## [How to create independent normal distribution variables in JuMP](https://discourse.julialang.org/t/how-to-create-independent-normal-distribution-variables-in-jump/116325)

<div class="topic-metadata">

**Author:** [@SSGD](https://discourse.julialang.org/u/SSGD)\
**Replies:** 4\
**Last updated:** [June 29, 2024, 5:01pm UTC](https://discourse.julialang.org/t/how-to-create-independent-normal-distribution-variables-in-jump/116325 "2024-06-29T17:01:57Z")

</div>

Hello :smiley: I followed the previous work to define variables (normal distribution) in JuMP v.1.22.2 and want to use like this: @indepnormal(m\_chance, ω\[i=1:numfarms\], mean=0, var=farms\[i\].σ^2) But I met issues, fol…

---

## [Struggle at using JuMP/MathOptInterface for calculating number of constraints](https://discourse.julialang.org/t/struggle-at-using-jump-mathoptinterface-for-calculating-number-of-constraints/116275)

<div class="topic-metadata">

**Author:** [@SSGD](https://discourse.julialang.org/u/SSGD)\
**Replies:** 6\
**Last updated:** [June 29, 2024, 4:59pm UTC](https://discourse.julialang.org/t/struggle-at-using-jump-mathoptinterface-for-calculating-number-of-constraints/116275 "2024-06-29T16:59:01Z")

</div>

Hello :smiley: I am using JuMP to solve a chance-constrained optimization, the original package is very old and I met issues of reproducing it. Following is one package I am trying to solve but stuck for more than a we…

---

## [Variables for power flow with condition in constraint](https://discourse.julialang.org/t/variables-for-power-flow-with-condition-in-constraint/116343)

<div class="topic-metadata">

**Author:** [@priantop](https://discourse.julialang.org/u/priantop)\
**Replies:** 2\
**Last updated:** [June 29, 2024, 4:42am UTC](https://discourse.julialang.org/t/variables-for-power-flow-with-condition-in-constraint/116343 "2024-06-29T04:42:58Z")

</div>

Hi, I am formulating LP problem using JuMP for electricity dispatch below is the MWE I have variables for power flow and export/import to neighbouring regions defined as follows using JuMP, HiGHS m = Model(HiGHS.Opt…

---

## [Multiple solutions from MiniZinc?](https://discourse.julialang.org/t/multiple-solutions-from-minizinc/116367)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 4\
**Last updated:** [June 29, 2024, 12:14am UTC](https://discourse.julialang.org/t/multiple-solutions-from-minizinc/116367 "2024-06-29T00:14:29Z")

</div>

Hi, I am trying to see if it is possible to return multiple solutions from MiniZinc.jl. I am not sure how to set the flag to do so for the MiniZinc solver. Following the example at this stackoverflow question (Multiple o…

---

## [Bayesian parameter estimation of a ODE with Bernouilli multivariate likelihood](https://discourse.julialang.org/t/bayesian-parameter-estimation-of-a-ode-with-bernouilli-multivariate-likelihood/116303)

<div class="topic-metadata">

**Author:** [@Marta\_Pardo\_Araujo](https://discourse.julialang.org/u/Marta_Pardo_Araujo)\
**Replies:** 6\
**Last updated:** [June 27, 2024, 2:44pm UTC](https://discourse.julialang.org/t/bayesian-parameter-estimation-of-a-ode-with-bernouilli-multivariate-likelihood/116303 "2024-06-27T14:44:03Z")

</div>

Hi, I am trying to estimate the parameters of a ODE model with N equations. The model’s output are probabilities, ie, a vector of N probabilities each time step. Each coordinate of the vector defines the probability tha…

---

## [Tolerance in using JuMP optimizer](https://discourse.julialang.org/t/tolerance-in-using-jump-optimizer/116143)

<div class="topic-metadata">

**Author:** [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Replies:** 2\
**Last updated:** [June 25, 2024, 9:14am UTC](https://discourse.julialang.org/t/tolerance-in-using-jump-optimizer/116143 "2024-06-25T09:14:15Z")

</div>

Hello :slight\_smile: I am using JuMP, and a solver named Hypatia. I want to change the tol\_inconsistent (the tolerance to numerical imprecision) to 1e-12. I found on the web that I should use this : julia \> MOI.set(mo…

---

## [Using anonymous and or symbols to create dynamic variable names?](https://discourse.julialang.org/t/using-anonymous-and-or-symbols-to-create-dynamic-variable-names/83095)

<div class="topic-metadata">

**Author:** [@Ryan\_Vogt1](https://discourse.julialang.org/u/Ryan_Vogt1)\
**Replies:** 7\
**Last updated:** [June 27, 2024, 8:53am UTC](https://discourse.julialang.org/t/using-anonymous-and-or-symbols-to-create-dynamic-variable-names/83095 "2024-06-27T08:53:48Z")

</div>

Howdy, so I asked a question on stack overflow:julia - Define several JuMP variables names in loop based on iteration - Stack Overflow , and Oscar replied. I thought a bit more, and remember this board, and thought I’d s…

---

## [How to save algorithm iteration result when using JuMP](https://discourse.julialang.org/t/how-to-save-algorithm-iteration-result-when-using-jump/115684)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 6\
**Last updated:** [June 27, 2024, 12:35am UTC](https://discourse.julialang.org/t/how-to-save-algorithm-iteration-result-when-using-jump/115684 "2024-06-27T00:35:53Z")

</div>

When using Ipopt in JuMP，it will print these information on console, I want to know how to get these info, for example, save these data as a vector or dict. thanks. '' iter objective inf\_pr inf\_du lg(mu) ||d||…

---

## [Struggle at large scale problem of nlp using ipopt](https://discourse.julialang.org/t/struggle-at-large-scale-problem-of-nlp-using-ipopt/116240)

<div class="topic-metadata">

**Author:** [@Chi\_Jan](https://discourse.julialang.org/u/Chi_Jan)\
**Replies:** 10\
**Last updated:** [June 26, 2024, 10:47pm UTC](https://discourse.julialang.org/t/struggle-at-large-scale-problem-of-nlp-using-ipopt/116240 "2024-06-26T22:47:57Z")

</div>

hi there, I have a non-linear problem where the decision variable is a matrix of dimensions m \* n \* k. The constraints may also be somewhat complex. When I set m to a small subset of the dataset, e.g., 10, the program se…

---

## [User defined gradient in JuMP with Ipopt: gradient with user data](https://discourse.julialang.org/t/user-defined-gradient-in-jump-with-ipopt-gradient-with-user-data/116236)

<div class="topic-metadata">

**Author:** [@vict\_riag](https://discourse.julialang.org/u/vict_riag)\
**Replies:** 3\
**Last updated:** [June 26, 2024, 10:15pm UTC](https://discourse.julialang.org/t/user-defined-gradient-in-jump-with-ipopt-gradient-with-user-data/116236 "2024-06-26T22:15:56Z")

</div>

Hello, I have been trying to register a gradient in JuMP that includes user data. I think the issue is with how I have formulated the gradient and fed it into JuMP, but I am not sure how to use the @expression or @param…

---

## [Injecting known primal solution (JuMP + Gurobi)](https://discourse.julialang.org/t/injecting-known-primal-solution-jump-gurobi/116213)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 1\
**Last updated:** [June 25, 2024, 6:28pm UTC](https://discourse.julialang.org/t/injecting-known-primal-solution-jump-gurobi/116213 "2024-06-25T18:28:36Z")

</div>

Hi, Is there a way to provide a solver (specifically Gurobi) with a feasible primal solution to help it prune the tree ? The answer is probably somewhere in JuMP’s documentation but the keywords I used to search lead t…

---

## [Logical conditions](https://discourse.julialang.org/t/logical-conditions/115363)

<div class="topic-metadata">

**Author:** [@papar](https://discourse.julialang.org/u/papar)\
**Replies:** 14\
**Last updated:** [June 25, 2024, 12:40am UTC](https://discourse.julialang.org/t/logical-conditions/115363 "2024-06-25T00:40:18Z")

</div>

I’m working on an optimization problem in JuMP where I need to ensure that certain constraints are enforced based on a binary variable. Here are the variables and constraints I have defined in my model: Variable Definit…

---

## [Distributed computing or Multi-threading on Optimization](https://discourse.julialang.org/t/distributed-computing-or-multi-threading-on-optimization/116147)

<div class="topic-metadata">

**Author:** [@benjamin.nunez](https://discourse.julialang.org/u/benjamin.nunez)\
**Replies:** 1\
**Last updated:** [June 24, 2024, 7:05pm UTC](https://discourse.julialang.org/t/distributed-computing-or-multi-threading-on-optimization/116147 "2024-06-24T19:05:21Z")

</div>

Hello! I am currently working on an algorithm to solve stochastic optimization problems by decomposing them into scenarios (very similar to Progressive Hedging). I am not very knowledgeable in the area of task parallel…

---

## [Moving Horizon Estimation](https://discourse.julialang.org/t/moving-horizon-estimation/115921)

<div class="topic-metadata">

**Author:** [@MarcoDellOro](https://discourse.julialang.org/u/MarcoDellOro)\
**Replies:** 8\
**Last updated:** [June 24, 2024, 11:39am UTC](https://discourse.julialang.org/t/moving-horizon-estimation/115921 "2024-06-24T11:39:08Z")

</div>

Hello everybody, I am having some issues with the Moving Horizon Estimation (MHE) code I am writing. To me, the task and the code seem quite easy, but I cannot obtain the desired results for some reason. I attach here …

---

## [\`sum\` syntax rule differs between Julia and \`JuMP\`](https://discourse.julialang.org/t/sum-syntax-rule-differs-between-julia-and-jump/116125)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 2\
**Last updated:** [June 23, 2024, 11:59pm UTC](https://discourse.julialang.org/t/sum-syntax-rule-differs-between-julia-and-jump/116125 "2024-06-23T23:59:51Z")

</div>

a = \[1, 2, 3, 4\] sum(a\[n\] for n in 1:0) # ERROR: MethodError: reducing over an empty collection is not allowed; consider supplying \`init\` to the reducer using JuMP m = Model() @constraint(m, sum(a\[n\] for n in 1:0) \>= 0)…

---

## [Why can't I set the \`initial\_value\` to a matrix value when using \`SDDP.jl\`?](https://discourse.julialang.org/t/why-cant-i-set-the-initial-value-to-a-matrix-value-when-using-sddp-jl/116086)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 2\
**Last updated:** [June 23, 2024, 1:44am UTC](https://discourse.julialang.org/t/why-cant-i-set-the-initial-value-to-a-matrix-value-when-using-sddp-jl/116086 "2024-06-23T01:44:25Z")

</div>

In the hydro-thermal scheduling example, if I define a matrix type state variable, I will not be able to set a matrix initial value to it: using SDDP graph = SDDP.LinearGraph(3) function subproblem\_builder(subproblem:…

---

## [How to use Gurobi 11 in Julia launched by Anaconda?](https://discourse.julialang.org/t/how-to-use-gurobi-11-in-julia-launched-by-anaconda/111271)

<div class="topic-metadata">

**Author:** [@rzhao](https://discourse.julialang.org/u/rzhao)\
**Replies:** 9\
**Last updated:** [June 22, 2024, 10:39pm UTC](https://discourse.julialang.org/t/how-to-use-gurobi-11-in-julia-launched-by-anaconda/111271 "2024-06-22T22:39:11Z")

</div>

I have updated my Julia to 1.10.2 indeed, and the version of Gurobi.jl is 1.2.1, all packages are newly installed for Julia 1.10.2. I have also downloaded the newest Gurobi 11 and updated the licence which support Gurob…

---

## [SCIP: Error: no BLAS/LAPACK library loaded!](https://discourse.julialang.org/t/scip-error-no-blas-lapack-library-loaded/115818)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 11\
**Last updated:** [June 22, 2024, 10:18pm UTC](https://discourse.julialang.org/t/scip-error-no-blas-lapack-library-loaded/115818 "2024-06-22T22:18:01Z")

</div>

I am getting that error repeatedly printed out when I try to solve a JuMP model with SCIP. I updated Julia to v1.10.4 yesterday using juliaup, and that error didn’t occur before the update. The error also doesn’t occur f…

---

## [Cannot update Bonmin\_jll](https://discourse.julialang.org/t/cannot-update-bonmin-jll/116099)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 1\
**Last updated:** [June 22, 2024, 10:17pm UTC](https://discourse.julialang.org/t/cannot-update-bonmin-jll/116099 "2024-06-22T22:17:35Z")

</div>

I cannot update to the latest verson of Bonmin\_jll. (@v1.10) pkg\> update Bonmin\_jll Updating registry at \`~/.julia/registries/General.toml\` No Changes to \`~/.julia/environments/v1.10/Project.toml\` No Changes to …

---

## [Minoutaur\_jll and RAPOSa\_jll](https://discourse.julialang.org/t/minoutaur-jll-and-raposa-jll/115999)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 1\
**Last updated:** [June 21, 2024, 11:24pm UTC](https://discourse.julialang.org/t/minoutaur-jll-and-raposa-jll/115999 "2024-06-21T23:24:01Z")

</div>

Are there plans to provide Minoutaur\_jll.jl and RAPOSa\_jll.jl packages so that Minotaur and RAPOSa may be used with AmplNLWriter.jl to solve JuMP optimization problems?

---

## [High Memory Usage with Convex.jl When Solving Optimization Problem with Sparse Matrices](https://discourse.julialang.org/t/high-memory-usage-with-convex-jl-when-solving-optimization-problem-with-sparse-matrices/115896)

<div class="topic-metadata">

**Author:** [@CaG21](https://discourse.julialang.org/u/CaG21)\
**Replies:** 9\
**Last updated:** [June 20, 2024, 11:14pm UTC](https://discourse.julialang.org/t/high-memory-usage-with-convex-jl-when-solving-optimization-problem-with-sparse-matrices/115896 "2024-06-20T23:14:11Z")

</div>

Hi everyone, I am using Convex.jl to solve an optimization problem. Even though it is relatively large, its constraints can be modeled using sparse matrices, which occupy a small amount of memory (about 200 MB). However…

---

## [Updating the value of a variable before a solve](https://discourse.julialang.org/t/updating-the-value-of-a-variable-before-a-solve/115882)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 2\
**Last updated:** [June 19, 2024, 8:38pm UTC](https://discourse.julialang.org/t/updating-the-value-of-a-variable-before-a-solve/115882 "2024-06-19T20:38:53Z")

</div>

I am solving a model that sets a numeraire based on the previous solution values (or starting values for the first solve). I am running into an issue where I fix a variable, but the value is still the old value. Here is…

---

## [Nonlinear solver other than IPOPT](https://discourse.julialang.org/t/nonlinear-solver-other-than-ipopt/82332)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 25\
**Last updated:** [June 19, 2024, 7:37pm UTC](https://discourse.julialang.org/t/nonlinear-solver-other-than-ipopt/82332 "2024-06-19T19:37:29Z")

</div>

I am solving a feasibility problem that consists of a lot of constraints. I tried IPOPT. It is great. But It couldn’t solve my whole problem with all constraints. It says that I have too few degrees of freedom. My constr…

---

## [Co-optimizing renewables - SDDP.jl - Policy Graph](https://discourse.julialang.org/t/co-optimizing-renewables-sddp-jl-policy-graph/115289)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 6\
**Last updated:** [June 17, 2024, 9:02pm UTC](https://discourse.julialang.org/t/co-optimizing-renewables-sddp-jl-policy-graph/115289 "2024-06-17T21:02:12Z")

</div>

Hi, I am working on co-optimizing renewables (wind and hydro) expansion and generation while accounting for uncertainty in the generation part. In these problems, one of the common issues is non-linearity in the constra…

---

## [InfiniteOpt/supports violate the domain bounds](https://discourse.julialang.org/t/infiniteopt-supports-violate-the-domain-bounds/115751)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 1\
**Last updated:** [June 17, 2024, 2:04pm UTC](https://discourse.julialang.org/t/infiniteopt-supports-violate-the-domain-bounds/115751 "2024-06-17T14:04:26Z")

</div>

I want to solve a problem with randomly generated bounds using InfiniteOpt. However, if I don’t specify the number of supports for the parameter, I get an error: If I specify the number of supports, the problem is so…

---

## [Nonlinear Least Squares Millions of Allocations](https://discourse.julialang.org/t/nonlinear-least-squares-millions-of-allocations/115583)

<div class="topic-metadata">

**Author:** [@nicrummel](https://discourse.julialang.org/u/nicrummel)\
**Replies:** 9\
**Last updated:** [June 15, 2024, 1:43am UTC](https://discourse.julialang.org/t/nonlinear-least-squares-millions-of-allocations/115583 "2024-06-15T01:43:44Z")

</div>

Overview An algorithm I am working on requires solving many largish nonlinear least squares problems. The number of allocations is exploding. My nonlinear function are efficient when passed Arrays of Float64 and generate…

---

## [End-of-horizon effect, Infinite horizon policy graph, SDDP.jl](https://discourse.julialang.org/t/end-of-horizon-effect-infinite-horizon-policy-graph-sddp-jl/115573)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 11\
**Last updated:** [June 14, 2024, 12:52am UTC](https://discourse.julialang.org/t/end-of-horizon-effect-infinite-horizon-policy-graph-sddp-jl/115573 "2024-06-14T00:52:04Z")

</div>

Hi everyone, Let’s assume a simple co-optimized expansion and generation problem with 13 nodes: 1 for expansion and 12 generations corresponding to 12 months. There is uncertainty during generation, e.g., monthly water …

---

## [SCIP does not accept starting point of nonlinear objective from .nl file](https://discourse.julialang.org/t/scip-does-not-accept-starting-point-of-nonlinear-objective-from-nl-file/115442)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 12\
**Last updated:** [June 13, 2024, 10:49pm UTC](https://discourse.julialang.org/t/scip-does-not-accept-starting-point-of-nonlinear-objective-from-nl-file/115442 "2024-06-13T22:49:34Z")

</div>

I construct a nonlinear model in JuMP using the legacy and non-legacy interfaces, providing the same initial solution, and save the models to .nl files. SCIP is able to solve both .nl files correctly to optimality. SCIP …

---

## [Implementation of the COPS benchmark in JuMP](https://discourse.julialang.org/t/implementation-of-the-cops-benchmark-in-jump/115555)

<div class="topic-metadata">

**Author:** [@frapac](https://discourse.julialang.org/u/frapac)\
**Replies:** 12\
**Last updated:** [June 13, 2024, 11:55am UTC](https://discourse.julialang.org/t/implementation-of-the-cops-benchmark-in-jump/115555 "2024-06-13T11:55:10Z")

</div>

Together with @tmigot , we have re-implemented the COPS benchmark in pure JuMP: GitHub - MadNLP/COPSBenchmark.jl: Implementation of the COPS benchmark with JuMP. The COPS benchmark is a collection of challenging nonline…

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

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