# Optimization (Mathematical)

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

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

**Page:** 60

---

## [Submitted arrays of different types in JuMP Heuristic Callbacks](https://discourse.julialang.org/t/submitted-arrays-of-different-types-in-jump-heuristic-callbacks/83950)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [July 19, 2022, 1:31pm UTC](https://discourse.julialang.org/t/submitted-arrays-of-different-types-in-jump-heuristic-callbacks/83950 "2022-07-19T13:31:33Z")

</div>

Hi! I am sorry, I can not produce a MWE but I think you can still answer my question. I need to use JuMP heuristic callbacks. However, the documentation only gives an exemple for a single variable. I need to submit a h…

---

## [Julia JuMP | Continue even when an infeasible solution is found](https://discourse.julialang.org/t/julia-jump-continue-even-when-an-infeasible-solution-is-found/84424)

<div class="topic-metadata">

**Author:** [@hexjulia](https://discourse.julialang.org/u/hexjulia)\
**Replies:** 2\
**Last updated:** [July 18, 2022, 10:32pm UTC](https://discourse.julialang.org/t/julia-jump-continue-even-when-an-infeasible-solution-is-found/84424 "2022-07-18T22:32:31Z")

</div>

Hello! I’m wondering if there’s any way for JuMP (specifically Clp) to continue even when an infeasible solution is found during an SDDP system optimization. Frequently running into problems where a primal solution is …

---

## [How to implment \`logsumexp\` function in JuMP?](https://discourse.julialang.org/t/how-to-implment-logsumexp-function-in-jump/84376)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 7\
**Last updated:** [July 18, 2022, 6:23am UTC](https://discourse.julialang.org/t/how-to-implment-logsumexp-function-in-jump/84376 "2022-07-18T06:23:24Z")

</div>

Hi, as I described my situation here, I’m trying to use DiffOpt.jl for my custom neural network training. I realised that if I can use logsumexp function to express the objective function, I can make it. However, I ca…

---

## [Syntax for specifying block diagonal constraints in Convex](https://discourse.julialang.org/t/syntax-for-specifying-block-diagonal-constraints-in-convex/84372)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 5\
**Last updated:** [July 18, 2022, 4:01am UTC](https://discourse.julialang.org/t/syntax-for-specifying-block-diagonal-constraints-in-convex/84372 "2022-07-18T04:01:41Z")

</div>

Hi community, I am having issues inputting the following problem into Convex.jl where \\Sigma and S\_1,...,S\_m are positive definite matrices of appropriate dimensions. The syntax diag(x\_1S\_1,...,x\_mS\_m) in the constrai…

---

## [Getting the upper and lower bounds in MILP - JuMP](https://discourse.julialang.org/t/getting-the-upper-and-lower-bounds-in-milp-jump/84293)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 1\
**Last updated:** [July 16, 2022, 12:13am UTC](https://discourse.julialang.org/t/getting-the-upper-and-lower-bounds-in-milp-jump/84293 "2022-07-16T00:13:03Z")

</div>

Hello everyone, When I use JuMP v0.21.7 with the Gurobi solver and optimize a MILP, how do I get, after optimization: The value of the first upper bound (of the first incumbent solution). The value of the first lower …

---

## [Maximize Min Objective](https://discourse.julialang.org/t/maximize-min-objective/83431)

<div class="topic-metadata">

**Author:** [@sophiepavia](https://discourse.julialang.org/u/sophiepavia)\
**Replies:** 8\
**Last updated:** [July 14, 2022, 9:00pm UTC](https://discourse.julialang.org/t/maximize-min-objective/83431 "2022-07-14T21:00:14Z")

</div>

I am working on a convex optimization problem in Julia using JuMP and Pajarito. I have three objectives that I will solve for independently. For the third objective how can I maximize the min? @NLobjective(model, Max, …

---

## [ANN: JuMP-dev 2022](https://discourse.julialang.org/t/ann-jump-dev-2022/77043)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 3\
**Last updated:** [July 15, 2022, 1:32am UTC](https://discourse.julialang.org/t/ann-jump-dev-2022/77043 "2022-07-15T01:32:11Z")

</div>

Dear all, We are pleased to announce that JuMP-dev 2022 will be co-located with JuliaCon 2022, to be held virtually July 27-29 2022. The purpose of JuMP-dev is to bring together students, researchers, and practitioners…

---

## [How to get the value of an NLconstraint in JuMP](https://discourse.julialang.org/t/how-to-get-the-value-of-an-nlconstraint-in-jump/84248)

<div class="topic-metadata">

**Author:** [@ko56](https://discourse.julialang.org/u/ko56)\
**Replies:** 3\
**Last updated:** [July 15, 2022, 12:52am UTC](https://discourse.julialang.org/t/how-to-get-the-value-of-an-nlconstraint-in-jump/84248 "2022-07-15T00:52:53Z")

</div>

The value(.) function accepts a ConstraintRef argument, so you can use it to print the value of a JuMP @constraint after the optimization is done. But if you have a @NLconstraint, whose type is e.g. NonlinearConstraintRe…

---

## [Reading LP/MPS file and using callback](https://discourse.julialang.org/t/reading-lp-mps-file-and-using-callback/68254)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 3\
**Last updated:** [July 13, 2022, 5:50pm UTC](https://discourse.julialang.org/t/reading-lp-mps-file-and-using-callback/68254 "2022-07-13T17:50:55Z")

</div>

Hi All, is there a way to read an lp/MPS file in julia and apply the callback function. Thanks, Manoj Kumar

---

## [Least-Angle Regression (LARS) package](https://discourse.julialang.org/t/least-angle-regression-lars-package/68424)

<div class="topic-metadata">

**Author:** [@Frederic\_Gilt](https://discourse.julialang.org/u/Frederic_Gilt)\
**Replies:** 32\
**Last updated:** [July 13, 2022, 1:03pm UTC](https://discourse.julialang.org/t/least-angle-regression-lars-package/68424 "2022-07-13T13:03:34Z")

</div>

Hello I need LARS method and fortunately a package is (was?) available… Unfortunately is has not been updated since several years, so I download the code, remove the call for ArrayViews package which is outdated and doe…

---

## [Unconstrained optimization problem?](https://discourse.julialang.org/t/unconstrained-optimization-problem/84140)

<div class="topic-metadata">

**Author:** [@ivzktch99](https://discourse.julialang.org/u/ivzktch99)\
**Replies:** 5\
**Last updated:** [July 13, 2022, 6:43am UTC](https://discourse.julialang.org/t/unconstrained-optimization-problem/84140 "2022-07-13T06:43:11Z")

</div>

I have a control problem that requires (in addition to other linear constraints) finding optimal coefficients M (n \\times n matrix) and a nth dimensional vector b such that \\det(I + xub^T - xM) \\geq 0 for all x \\in \\ma…

---

## [Maximum likelihood optimization problem through Optim.jl](https://discourse.julialang.org/t/maximum-likelihood-optimization-problem-through-optim-jl/84096)

<div class="topic-metadata">

**Author:** [@Jian\_ZUO](https://discourse.julialang.org/u/Jian_ZUO)\
**Replies:** 14\
**Last updated:** [July 12, 2022, 1:11pm UTC](https://discourse.julialang.org/t/maximum-likelihood-optimization-problem-through-optim-jl/84096 "2022-07-12T13:11:50Z")

</div>

Hi, I am trying to solve a likelihood function in Optim as follows: I have some increments which are gamma-distributed (Ga(a\*t, β)): det\_x = \[0.0175, 0.0055, 0.0059\] # increments det\_t = \[185, 163, 167\] # correspondi…

---

## [Question on handling product of variables in BilevelJuMP](https://discourse.julialang.org/t/question-on-handling-product-of-variables-in-bileveljump/83375)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 3\
**Last updated:** [July 10, 2022, 12:47am UTC](https://discourse.julialang.org/t/question-on-handling-product-of-variables-in-bileveljump/83375 "2022-07-10T00:47:52Z")

</div>

I have a bilevel model where my inner-level problem has terms in constraints and objective that are the product of an upper-level and a lower-level variable. For example, using JuMP, BilevelJuMP, Gurobi model = Bilevel…

---

## [Question about problem modifications in Gurobi](https://discourse.julialang.org/t/question-about-problem-modifications-in-gurobi/83963)

<div class="topic-metadata">

**Author:** [@guilhermebodin](https://discourse.julialang.org/u/guilhermebodin)\
**Replies:** 1\
**Last updated:** [July 9, 2022, 8:02pm UTC](https://discourse.julialang.org/t/question-about-problem-modifications-in-gurobi/83963 "2022-07-09T20:02:40Z")

</div>

There are two ways of changing the RHS of a constraint in Gurobi, one is to directly use MOI.set(model, MOI.ConstraintSet(), ci, new\_set) and the other one would be to make a MOI.modify(model, c, MOI.ScalarConstantChange…

---

## [Getting around \`Zygote\` mutating array issue](https://discourse.julialang.org/t/getting-around-zygote-mutating-array-issue/83907)

<div class="topic-metadata">

**Author:** [@pat-alt](https://discourse.julialang.org/u/pat-alt)\
**Replies:** 5\
**Last updated:** [July 8, 2022, 10:23am UTC](https://discourse.julialang.org/t/getting-around-zygote-mutating-array-issue/83907 "2022-07-08T10:23:45Z")

</div>

I’m faced with the Mutating arrays is not supported error message and looking for ideas/help. In particular, I am trying to compute gradients of the following metric that measures diversity across a multi-dimensional arr…

---

## [How to define this expression?](https://discourse.julialang.org/t/how-to-define-this-expression/83930)

<div class="topic-metadata">

**Author:** [@ivzktch99](https://discourse.julialang.org/u/ivzktch99)\
**Replies:** 1\
**Last updated:** [July 8, 2022, 3:46am UTC](https://discourse.julialang.org/t/how-to-define-this-expression/83930 "2022-07-08T03:46:04Z")

</div>

Hello there I want to solve the following model using JuMP, Ipopt model = Model(Ipopt.Optimizer) n = 5 @variable(model, X\[1:n, 1:n\]) @variable(model, y\[1:n\]) u = ones(n) z = @expression(model, X \* u) expr = (1/factor…

---

## [Can't run simple JuMP example](https://discourse.julialang.org/t/cant-run-simple-jump-example/67938)

<div class="topic-metadata">

**Author:** [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Replies:** 12\
**Last updated:** [July 7, 2022, 9:27pm UTC](https://discourse.julialang.org/t/cant-run-simple-jump-example/67938 "2022-07-07T21:27:22Z")

</div>

I am learning the basics of JuMP and tried running the code below, which computes the MLE of the parameters of a Gaussian distribution (mean and variance, source): using JuMP, Ipopt, Random, Statistics Random.seed!(12…

---

## [Converting Dense Axis array results into dataframe](https://discourse.julialang.org/t/converting-dense-axis-array-results-into-dataframe/83780)

<div class="topic-metadata">

**Author:** [@mbah](https://discourse.julialang.org/u/mbah)\
**Replies:** 6\
**Last updated:** [July 6, 2022, 8:23am UTC](https://discourse.julialang.org/t/converting-dense-axis-array-results-into-dataframe/83780 "2022-07-06T08:23:17Z")

</div>

Hello, I have the following two-dimensional dense axis array results extracted from a constraint. Rows represent time stamps \[T\] and columns represent nodes \[N\]. Is there a way of converting the DenseAxisArray into …

---

## [MultiJuMP.jl: more than 3 hours' calculation for nonlinear example](https://discourse.julialang.org/t/multijump-jl-more-than-3-hours-calculation-for-nonlinear-example/83764)

<div class="topic-metadata">

**Author:** [@chenr86](https://discourse.julialang.org/u/chenr86)\
**Replies:** 4\
**Last updated:** [July 6, 2022, 8:15am UTC](https://discourse.julialang.org/t/multijump-jl-more-than-3-hours-calculation-for-nonlinear-example/83764 "2022-07-06T08:15:14Z")

</div>

Hello, I am learning MultiJuMP.jl to solve a MINLP multi-objective problem. Now I am testing the nonlinear example given by the developer of the package, and I find it costs more than 3 hours to solve the problem. For n…

---

## [JuMP and CPLEX - Setting number of threads](https://discourse.julialang.org/t/jump-and-cplex-setting-number-of-threads/83747)

<div class="topic-metadata">

**Author:** [@vmk97](https://discourse.julialang.org/u/vmk97)\
**Replies:** 4\
**Last updated:** [July 5, 2022, 12:56pm UTC](https://discourse.julialang.org/t/jump-and-cplex-setting-number-of-threads/83747 "2022-07-05T12:56:37Z")

</div>

I am trying to solve a mixed integer linear program by branch-and-cut using JuMP and CPLEX. I am having some trouble setting the number of threads for CPLEX. I am trying to set the parameter CPXPARAM\_Threads using set\_…

---

## [Correct Way to Compose ReverseDiff and ForwardDiff](https://discourse.julialang.org/t/correct-way-to-compose-reversediff-and-forwarddiff/83708)

<div class="topic-metadata">

**Author:** [@RS-Coop](https://discourse.julialang.org/u/RS-Coop)\
**Replies:** 8\
**Last updated:** [July 4, 2022, 3:22pm UTC](https://discourse.julialang.org/t/correct-way-to-compose-reversediff-and-forwarddiff/83708 "2022-07-04T15:22:45Z")

</div>

I am trying to use ReverseDiff.jl and ForwardDiff.jl as a mixed mode AD approach to computing a Hessian vector product. I am using the following function: import ForwardDiff as fdiff import ReverseDiff as rdiff functio…

---

## [Why SDDP.jl can not work together with nonlinear optimizer like juniper](https://discourse.julialang.org/t/why-sddp-jl-can-not-work-together-with-nonlinear-optimizer-like-juniper/83559)

<div class="topic-metadata">

**Author:** [@chenr86](https://discourse.julialang.org/u/chenr86)\
**Replies:** 5\
**Last updated:** [July 1, 2022, 1:56am UTC](https://discourse.julialang.org/t/why-sddp-jl-can-not-work-together-with-nonlinear-optimizer-like-juniper/83559 "2022-07-01T01:56:28Z")

</div>

Hello, I’m using JuMP.jl and Juniper.jl to solve a MINLP problem. Now I attempt to consider the uncertainty in some of the constraints by consulting theory guide of SDDP.jl. But I can’t understand how SDDP.jl deal with …

---

## [JuMP.write\_to\_file small change to model](https://discourse.julialang.org/t/jump-write-to-file-small-change-to-model/83543)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 2\
**Last updated:** [June 30, 2022, 2:34am UTC](https://discourse.julialang.org/t/jump-write-to-file-small-change-to-model/83543 "2022-06-30T02:34:26Z")

</div>

I have created a large LP in a JuMP model. I want to write a small variation, e.g. fixing a variable or changing the RHS of a scalar constraint, of the LP to a MPS file using JuMP. write\_to\_file. Once the original LP has…

---

## [Debugging in Ipopt without JuMP](https://discourse.julialang.org/t/debugging-in-ipopt-without-jump/83384)

<div class="topic-metadata">

**Author:** [@Itzahack23](https://discourse.julialang.org/u/Itzahack23)\
**Replies:** 5\
**Last updated:** [June 29, 2022, 1:48am UTC](https://discourse.julialang.org/t/debugging-in-ipopt-without-jump/83384 "2022-06-29T01:48:56Z")

</div>

Hi all, I am trying to solve a constrained optimization problem by using Ipopt “without” using JuMP as I want to see how the performance changes by giving the gradient and hessian information. I am referring to the C w…

---

## [Multi-dimensional array of tuples](https://discourse.julialang.org/t/multi-dimensional-array-of-tuples/83288)

<div class="topic-metadata">

**Author:** [@pqdmac](https://discourse.julialang.org/u/pqdmac)\
**Replies:** 2\
**Last updated:** [June 24, 2022, 7:26pm UTC](https://discourse.julialang.org/t/multi-dimensional-array-of-tuples/83288 "2022-06-24T19:26:30Z")

</div>

I am working in an combinatorial optimization problem (multiple vehicle routing with profits) where I have a binary variable x\[i,j,p\] representing an edge (i,j) traversed by a vehicle p. I would like to get a p-dimens…

---

## [Question on BilevelJuMP model concise formulation](https://discourse.julialang.org/t/question-on-bileveljump-model-concise-formulation/82988)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 5\
**Last updated:** [June 24, 2022, 3:46pm UTC](https://discourse.julialang.org/t/question-on-bileveljump-model-concise-formulation/82988 "2022-06-24T15:46:12Z")

</div>

I am trying to break a BilevelJuMP model into smaller functions (similar to what is recommended for a JuMP model when working with complex problems). My question is whether the models written below are all interpreted as…

---

## [Advice on optimizing large SDP model generation with JuMP + ComplexOptInterface](https://discourse.julialang.org/t/advice-on-optimizing-large-sdp-model-generation-with-jump-complexoptinterface/82629)

<div class="topic-metadata">

**Author:** [@cgois](https://discourse.julialang.org/u/cgois)\
**Replies:** 6\
**Last updated:** [June 24, 2022, 11:03am UTC](https://discourse.julialang.org/t/advice-on-optimizing-large-sdp-model-generation-with-jump-complexoptinterface/82629 "2022-06-24T11:03:18Z")

</div>

I am implementing a somewhat large SDP with complex-valued variables in JuMP, using ComplexOptInterface. For small test cases, it seems to work, but my real interest is in larger instances (specifically, when sn \> 1 and n…

---

## [Adding objective to JuMP model changes feasibility?](https://discourse.julialang.org/t/adding-objective-to-jump-model-changes-feasibility/83200)

<div class="topic-metadata">

**Author:** [@mhar](https://discourse.julialang.org/u/mhar)\
**Replies:** 4\
**Last updated:** [June 23, 2022, 6:58pm UTC](https://discourse.julialang.org/t/adding-objective-to-jump-model-changes-feasibility/83200 "2022-06-23T18:58:49Z")

</div>

I have written a function that is supposed to output whether the problem is feasible and the Gram matrix. using DynamicPolynomials using JuMP using MosekTools using SumOfSquares @polyvar var1 var2 """ get\_max\_log\_de…

---

## [How to write conditional expression using JuMP](https://discourse.julialang.org/t/how-to-write-conditional-expression-using-jump/83106)

<div class="topic-metadata">

**Author:** [@chenr86](https://discourse.julialang.org/u/chenr86)\
**Replies:** 17\
**Last updated:** [June 23, 2022, 6:42am UTC](https://discourse.julialang.org/t/how-to-write-conditional-expression-using-jump/83106 "2022-06-23T06:42:26Z")

</div>

Hello, I am using JuMP to solve dynamic programming problem. My constraints are flow and level, which are piecewise and depend on each other. level\[r, i\] = f(flow\[r, i\], level\[r, i-1\]) , flow\[r, i\] = f(level\[r, i\], n). …

---

## [Gaussian Process Optimization JuMP.jl](https://discourse.julialang.org/t/gaussian-process-optimization-jump-jl/83217)

<div class="topic-metadata">

**Author:** [@j0sh](https://discourse.julialang.org/u/j0sh)\
**Replies:** 4\
**Last updated:** [June 23, 2022, 4:09am UTC](https://discourse.julialang.org/t/gaussian-process-optimization-jump-jl/83217 "2022-06-23T04:09:55Z")

</div>

My goal is to design a trajectory (x,y coordinates) that minimizes the variance of a Gaussian Process at a specified set of query points. The objective function is the trace of the covariance matrix from the Gaussian Pro…

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

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