# Optimization (Mathematical)

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

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

**Page:** 42

---

## [Gather Optimal Tableau Information using CPLEX.jl](https://discourse.julialang.org/t/gather-optimal-tableau-information-using-cplex-jl/101331)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 3\
**Last updated:** [July 8, 2023, 2:56pm UTC](https://discourse.julialang.org/t/gather-optimal-tableau-information-using-cplex-jl/101331 "2023-07-08T14:56:24Z")

</div>

Hey! I’m currently working on implementing fractional Gomory cuts, and I need to know the optimal simplex tableau in order to obtain these constraints. In this post on Simplex tableau, they suggested using ccall and men…

---

## [Largest number of variables that SCS.jl can handle](https://discourse.julialang.org/t/largest-number-of-variables-that-scs-jl-can-handle/100929)

<div class="topic-metadata">

**Author:** [@WellWellww](https://discourse.julialang.org/u/WellWellww)\
**Replies:** 11\
**Last updated:** [July 8, 2023, 2:50pm UTC](https://discourse.julialang.org/t/largest-number-of-variables-that-scs-jl-can-handle/100929 "2023-07-08T14:50:10Z")

</div>

I was using JuMP.jl and SCS.jl to code and solve an optimization problem. The problem involved 234,932 optimization variables and 251,088 constraints. However, I encountered the following error: \[113945\] signal (11.1): …

---

## [Cannot multiply a quadratic expression by an affine expression](https://discourse.julialang.org/t/cannot-multiply-a-quadratic-expression-by-an-affine-expression/101240)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 6\
**Last updated:** [July 7, 2023, 11:57pm UTC](https://discourse.julialang.org/t/cannot-multiply-a-quadratic-expression-by-an-affine-expression/101240 "2023-07-07T23:57:01Z")

</div>

I am trying to define an expression P = Q’ \* R \* Q using @expression but it is not cooperating. I tried to split the matrix product and even use @NLexpression macro but no luck. Can someone suggest a way to define P? u…

---

## [Include fixed point in JuMP](https://discourse.julialang.org/t/include-fixed-point-in-jump/101236)

<div class="topic-metadata">

**Author:** [@leima0521](https://discourse.julialang.org/u/leima0521)\
**Replies:** 10\
**Last updated:** [July 7, 2023, 8:30pm UTC](https://discourse.julialang.org/t/include-fixed-point-in-jump/101236 "2023-07-07T20:30:41Z")

</div>

Hi, I am using JuMP to maximize a nonlinear function. The function takes two vector inputs: d and p. The dimension of p is much smaller than the dimension of d. The trick is that the value of d is determined by p. Give…

---

## [JuMP summation constraint error](https://discourse.julialang.org/t/jump-summation-constraint-error/101181)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 5\
**Last updated:** [July 7, 2023, 2:10am UTC](https://discourse.julialang.org/t/jump-summation-constraint-error/101181 "2023-07-07T02:10:40Z")

</div>

I’m trying to add a constraint to a JuMP model that sums the elements of a constant matrix c times binary variables x. For i=1:I, x\[i,j\] is a binary variable for j=1:len\_J\_i\[i\]. That is for each i=1:I, x\[i,:\] is a vecto…

---

## [Ipopt solves large-scale nonlinear problems](https://discourse.julialang.org/t/ipopt-solves-large-scale-nonlinear-problems/98831)

<div class="topic-metadata">

**Author:** [@lzq-zbc](https://discourse.julialang.org/u/lzq-zbc)\
**Replies:** 18\
**Last updated:** [July 7, 2023, 2:06am UTC](https://discourse.julialang.org/t/ipopt-solves-large-scale-nonlinear-problems/98831 "2023-07-07T02:06:52Z")

</div>

I’m new to Julia, I’m working on optimal power flow problems in the direction of power systems, and when solving large-scale problems with Julia (there are thousands of variables and constraints, of course, most of them …

---

## [Identical diagonal elements](https://discourse.julialang.org/t/identical-diagonal-elements/83969)

<div class="topic-metadata">

**Author:** [@ivzktch99](https://discourse.julialang.org/u/ivzktch99)\
**Replies:** 6\
**Last updated:** [July 7, 2023, 2:01am UTC](https://discourse.julialang.org/t/identical-diagonal-elements/83969 "2023-07-07T02:01:56Z")

</div>

Suppose you have using JuMP,Ipopt model = Model(Ipopt.Optimizer) n = 5 @variable(model, X\[1:n, 1:n\]) What is the easiest way to impose that the elements of main diagonal of X are identical. No restriction on what they …

---

## ["BoundError: attempt to access JuMP containers" when creating a constraint](https://discourse.julialang.org/t/bounderror-attempt-to-access-jump-containers-when-creating-a-constraint/100306)

<div class="topic-metadata">

**Author:** [@Luiz\_Monteiro](https://discourse.julialang.org/u/Luiz_Monteiro)\
**Replies:** 2\
**Last updated:** [July 7, 2023, 1:37am UTC](https://discourse.julialang.org/t/bounderror-attempt-to-access-jump-containers-when-creating-a-constraint/100306 "2023-07-07T01:37:04Z")

</div>

Hi, I’m trying to create a constraint like specified below, but have this error: “ERROR: BoundsError: attempt to access JuMP.Containers.SparseAxisArray{VariableRef, 3, Tuple{Int64, Int64, Bool}} with 44 entries at index”…

---

## [Fixing some regions of a Variable array in convex.jl](https://discourse.julialang.org/t/fixing-some-regions-of-a-variable-array-in-convex-jl/101246)

<div class="topic-metadata">

**Author:** [@UgeB](https://discourse.julialang.org/u/UgeB)\
**Replies:** 2\
**Last updated:** [July 6, 2023, 9:11am UTC](https://discourse.julialang.org/t/fixing-some-regions-of-a-variable-array-in-convex-jl/101246 "2023-07-06T09:11:38Z")

</div>

The fix! function in the Convex.jl packages allows to fix the value of a variable to a constant during the optimization. I was wondering how I can get the same result with a multi-dimensional variable for which I want t…

---

## [Geometric Programming in Convex.jl](https://discourse.julialang.org/t/geometric-programming-in-convex-jl/101223)

<div class="topic-metadata">

**Author:** [@corbinklett](https://discourse.julialang.org/u/corbinklett)\
**Replies:** 1\
**Last updated:** [July 6, 2023, 2:12am UTC](https://discourse.julialang.org/t/geometric-programming-in-convex-jl/101223 "2023-07-06T02:12:17Z")

</div>

Has anyone seen a wrapper for geometric programs for Convex.jl, such as that offered by CVXPY? Disciplined Geometric Programming — CVXPY 1.3 documentation

---

## [How to Find the constraints which are causing infeasibility in the model using compute\_iis in Gurobi](https://discourse.julialang.org/t/how-to-find-the-constraints-which-are-causing-infeasibility-in-the-model-using-compute-iis-in-gurobi/101203)

<div class="topic-metadata">

**Author:** [@Gagan\_Meena](https://discourse.julialang.org/u/Gagan_Meena)\
**Replies:** 1\
**Last updated:** [July 5, 2023, 2:40pm UTC](https://discourse.julialang.org/t/how-to-find-the-constraints-which-are-causing-infeasibility-in-the-model-using-compute-iis-in-gurobi/101203 "2023-07-05T14:40:22Z")

</div>

How to compute the IIS form for the model shown below using JuMP, Gurobi include("Data.jl") UnitCommitment\_dt = UC\_dt function DUC\_Clearing(UnitCommitment\_dt) # Indices ngen = length(UC\_dt.Gen\_Constraints\[:,1\]…

---

## [Reduce Interpolating data size for initial guess](https://discourse.julialang.org/t/reduce-interpolating-data-size-for-initial-guess/101116)

<div class="topic-metadata">

**Author:** [@PatrickeTownsend](https://discourse.julialang.org/u/PatrickeTownsend)\
**Replies:** 3\
**Last updated:** [July 3, 2023, 1:00pm UTC](https://discourse.julialang.org/t/reduce-interpolating-data-size-for-initial-guess/101116 "2023-07-03T13:00:03Z")

</div>

Hello, I hope someone can help me with this. I have a 1x721 data vector with initial guesses, but i need to adjust it to just 200 nodes, is it possible to adjust the vector size by interpolating and reducing its size? …

---

## [JuMP: save SOL file for MILP](https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 3\
**Last updated:** [July 3, 2023, 2:52am UTC](https://discourse.julialang.org/t/jump-save-sol-file-for-milp/101101 "2023-07-03T02:52:11Z")

</div>

If JuMP solves a MILP using a solver like HiGHS, SCIP, COPT, etc., is it possible to save the solution in a SOL (.sol) file?

---

## [Dual Variable](https://discourse.julialang.org/t/dual-variable/100934)

<div class="topic-metadata">

**Author:** [@Gagan\_Meena](https://discourse.julialang.org/u/Gagan_Meena)\
**Replies:** 2\
**Last updated:** [June 29, 2023, 12:52am UTC](https://discourse.julialang.org/t/dual-variable/100934 "2023-06-29T00:52:37Z")

</div>

using JuMP, Gurobi include("Data.jl") UnitCommitment\_dt = UC\_dt function DUC\_Clearing(UnitCommitment\_dt) # Indices ngen = length(UC\_dt.Gen\_Constraints\[:,1\]) periods = length(UC\_dt.Forecast\[1,:\]) # Sets…

---

## [PSD sparse matrix generation: (almost) negative eigenvalues](https://discourse.julialang.org/t/psd-sparse-matrix-generation-almost-negative-eigenvalues/100851)

<div class="topic-metadata">

**Author:** [@selvi-aras](https://discourse.julialang.org/u/selvi-aras)\
**Replies:** 6\
**Last updated:** [June 28, 2023, 2:52am UTC](https://discourse.julialang.org/t/psd-sparse-matrix-generation-almost-negative-eigenvalues/100851 "2023-06-28T02:52:43Z")

</div>

This question is not fully related to optimization (though I am using it for optimization); but a quick search on the Julia forum hinted me that such questions go to the optimization tag. I can generate PSD matrices wit…

---

## [Huber regression by using Jump and optimizing with MOSEK](https://discourse.julialang.org/t/huber-regression-by-using-jump-and-optimizing-with-mosek/100081)

<div class="topic-metadata">

**Author:** [@selvi-aras](https://discourse.julialang.org/u/selvi-aras)\
**Replies:** 13\
**Last updated:** [June 27, 2023, 7:58am UTC](https://discourse.julialang.org/t/huber-regression-by-using-jump-and-optimizing-with-mosek/100081 "2023-06-27T07:58:53Z")

</div>

Dear JUMP Community, I am solving a Huber regression problem. I am using the following second-order conic reformulation of the problem (from MOSEK tutorials): My implementation is pretty straightforward: function h…

---

## [Cannot build CPLEX 22.11 in Julia 1.6.7 (Mac)](https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825)

<div class="topic-metadata">

**Author:** [@mlozano](https://discourse.julialang.org/u/mlozano)\
**Replies:** 2\
**Last updated:** [June 26, 2023, 1:44pm UTC](https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825 "2023-06-26T13:44:20Z")

</div>

Hello, I think there’s a file type mismatch between the CPLEX download and what Julia is expecting. Specifically, I downloaded the version of both programs for Mac OSX, but it appears that Julia wants the version that is…

---

## [Access to automatic reformulations created internally by BilevelJump](https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268)

<div class="topic-metadata">

**Author:** [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Replies:** 2\
**Last updated:** [June 21, 2023, 4:32am UTC](https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268 "2023-06-21T04:32:43Z")

</div>

Hi, I was wondering if there is a possibility to access the automatic reformulations that BilevelJump creates internally to solve the bilinear model. In particular, I would like to access (1) the dual of the lower level…

---

## [Optimization Challenges in matching simulated data](https://discourse.julialang.org/t/optimization-challenges-in-matching-simulated-data/100771)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 1\
**Last updated:** [June 24, 2023, 4:53am UTC](https://discourse.julialang.org/t/optimization-challenges-in-matching-simulated-data/100771 "2023-06-24T04:53:58Z")

</div>

I am trying to abstract some components of the Yields.jl package and having a hard time with a particular problem, which I’ve tried to distill down to a MWE. If it helps, the context is fitting a Nelson-Siegel-Svensson y…

---

## [Convex.jl gives solution but constraints are not satisfied](https://discourse.julialang.org/t/convex-jl-gives-solution-but-constraints-are-not-satisfied/100428)

<div class="topic-metadata">

**Author:** [@shaurya](https://discourse.julialang.org/u/shaurya)\
**Replies:** 8\
**Last updated:** [June 23, 2023, 8:08pm UTC](https://discourse.julialang.org/t/convex-jl-gives-solution-but-constraints-are-not-satisfied/100428 "2023-06-23T20:08:50Z")

</div>

Hi, I’ve been using convex.jl for some of my problems but I feel stuck in one SDP implementation. When I run the following code, the solver says that it’s feasible and reaches an optimal point, however, when I check the…

---

## [Constraint optimization of a vector norm under constraints imposed by integer-valued function](https://discourse.julialang.org/t/constraint-optimization-of-a-vector-norm-under-constraints-imposed-by-integer-valued-function/100693)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 8\
**Last updated:** [June 22, 2023, 1:28pm UTC](https://discourse.julialang.org/t/constraint-optimization-of-a-vector-norm-under-constraints-imposed-by-integer-valued-function/100693 "2023-06-22T13:28:21Z")

</div>

Hi all, I need to say in advance I don’t have much expertise in optimization, so it was difficult for me to phrase the post title properly, but please bear with me. Here is the problem we have and we are trying to solve…

---

## [Problem in my object function because of NaN in my vector](https://discourse.julialang.org/t/problem-in-my-object-function-because-of-nan-in-my-vector/100670)

<div class="topic-metadata">

**Author:** [@lara](https://discourse.julialang.org/u/lara)\
**Replies:** 9\
**Last updated:** [June 22, 2023, 7:19am UTC](https://discourse.julialang.org/t/problem-in-my-object-function-because-of-nan-in-my-vector/100670 "2023-06-22T07:19:12Z")

</div>

Hi, all! I have this code, already working great. My objective function is @NLobjective(model, Min, sum(total\_price\[i\] for i in 1:21)) When I add a new constraint, this total\_price vector assumes some NaN values and …

---

## [Parallelization Optimization Runs](https://discourse.julialang.org/t/parallelization-optimization-runs/100667)

<div class="topic-metadata">

**Author:** [@A\_M](https://discourse.julialang.org/u/A_M)\
**Replies:** 10\
**Last updated:** [June 21, 2023, 9:48pm UTC](https://discourse.julialang.org/t/parallelization-optimization-runs/100667 "2023-06-21T21:48:52Z")

</div>

I need to run over a million small optimization problems which are similar from the perspective of the structure but have different coefficients for constraint and objective. I know I can create and solve many models con…

---

## [How to best model different domains in Optimization, especially Manifolds?](https://discourse.julialang.org/t/how-to-best-model-different-domains-in-optimization-especially-manifolds/100390)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 40\
**Last updated:** [June 21, 2023, 2:10pm UTC](https://discourse.julialang.org/t/how-to-best-model-different-domains-in-optimization-especially-manifolds/100390 "2023-06-21T14:10:26Z")

</div>

Recently there have been some approaches here and here to introduce (my favourite topic) optimization on manifolds into general optiimization frameworks. One thing, that might be missing and that I would like to discuss…

---

## [LazyConstraintCallback not called at every solution?](https://discourse.julialang.org/t/lazyconstraintcallback-not-called-at-every-solution/100611)

<div class="topic-metadata">

**Author:** [@Eetu\_Reijonen](https://discourse.julialang.org/u/Eetu_Reijonen)\
**Replies:** 4\
**Last updated:** [June 21, 2023, 11:36am UTC](https://discourse.julialang.org/t/lazyconstraintcallback-not-called-at-every-solution/100611 "2023-06-21T11:36:17Z")

</div>

The MathOptInterface documentation states that: there is no guarantee that the callback is called at every feasible primal solution. Is there a way to get around this using Gurobi? I have run into a problem where only …

---

## [Bilevel model with multiple lower levels](https://discourse.julialang.org/t/bilevel-model-with-multiple-lower-levels/100113)

<div class="topic-metadata">

**Author:** [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Replies:** 3\
**Last updated:** [June 21, 2023, 4:40am UTC](https://discourse.julialang.org/t/bilevel-model-with-multiple-lower-levels/100113 "2023-06-21T04:40:09Z")

</div>

Hi, I’m currently working on a bilevel problem that has: one lower level problem for each period a single upper level problem that considers all the periods How to code this kind of bilevel problem with “mode=Bilevel…

---

## [How to impose absolute value greater than constraint](https://discourse.julialang.org/t/how-to-impose-absolute-value-greater-than-constraint/100631)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 6\
**Last updated:** [June 21, 2023, 2:37am UTC](https://discourse.julialang.org/t/how-to-impose-absolute-value-greater-than-constraint/100631 "2023-06-21T02:37:09Z")

</div>

The following gives me an error and I don’t know how to fix it. I want entries of the matrix X to be bounded by -1 and 1, and in addition I wand |X(i,j)| \>= 0.01 for all i and j. What am I doing wrong? using JuMP mode…

---

## [Show and use expressions](https://discourse.julialang.org/t/show-and-use-expressions/100584)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 1\
**Last updated:** [June 20, 2023, 1:42am UTC](https://discourse.julialang.org/t/show-and-use-expressions/100584 "2023-06-20T01:42:16Z")

</div>

I am having a trouble 1- printing the expression Ad, and 2- using it in a nonlinear constraint. using LinearAlgebra using JuMP model = Model( ) n = 8 u = ones(n) @variable(model, A\[1:n, 1:n\], Symmetric) A = Lower…

---

## [Nonlinear optimization: Registering a function with parameters](https://discourse.julialang.org/t/nonlinear-optimization-registering-a-function-with-parameters/100457)

<div class="topic-metadata">

**Author:** [@selvi-aras](https://discourse.julialang.org/u/selvi-aras)\
**Replies:** 10\
**Last updated:** [June 20, 2023, 12:08am UTC](https://discourse.julialang.org/t/nonlinear-optimization-registering-a-function-with-parameters/100457 "2023-06-20T00:08:52Z")

</div>

I followed the link that teaches how to register a function in a NL model. As far as I can see, the registered functions’ inputs are optimization variables. I would like to also allow inputting a separate object, whose …

---

## [Should Tulip catch SQDExceptions thrown by LDLFactorizations?](https://discourse.julialang.org/t/should-tulip-catch-sqdexceptions-thrown-by-ldlfactorizations/100487)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 0\
**Last updated:** [June 17, 2023, 1:08pm UTC](https://discourse.julialang.org/t/should-tulip-catch-sqdexceptions-thrown-by-ldlfactorizations/100487 "2023-06-17T13:08:55Z")

</div>

@mtanneau Sometimes MathOptInterface.optimize!(::Tulip.Optimizer{BigFloat}) throws an LDLFactorizations.SQDException: ERROR: LoadError: LDLFactorizations.SQDException("LDL' factorization was not computed or failed") Sta…

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

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