# Optimization (Mathematical)

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

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

**Page:** 17

---

## [LazyBridgeOptimizer not working with copy\_to](https://discourse.julialang.org/t/lazybridgeoptimizer-not-working-with-copy-to/123366)

<div class="topic-metadata">

**Author:** [@thibault-vignon](https://discourse.julialang.org/u/thibault-vignon)\
**Replies:** 9\
**Last updated:** [December 11, 2024, 7:52am UTC](https://discourse.julialang.org/t/lazybridgeoptimizer-not-working-with-copy-to/123366 "2024-12-11T07:52:39Z")

</div>

Hi, I’m writing a script in order to convert files from CBF to NL format. See example below: src = MOI.FileFormats.Model(format = MOI.FileFormats.FORMAT\_CBF); MOI.read\_from\_file(src, "path\_to\_file"); dest = MOI.FileForm…

---

## [Plotting sensitivity of variable to parameter](https://discourse.julialang.org/t/plotting-sensitivity-of-variable-to-parameter/123534)

<div class="topic-metadata">

**Author:** [@laurence\_jj](https://discourse.julialang.org/u/laurence_jj)\
**Replies:** 7\
**Last updated:** [December 10, 2024, 6:49am UTC](https://discourse.julialang.org/t/plotting-sensitivity-of-variable-to-parameter/123534 "2024-12-10T06:49:00Z")

</div>

Hi! I am using JuMP to model bertran competition in a market with firms and households. One of the parameters in the model is the marginal cost for firms. I would like to evaluate how the average price of goods varies a…

---

## [Cheesing IMO 2006/3 problem with JuMP](https://discourse.julialang.org/t/cheesing-imo-2006-3-problem-with-jump/123566)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 0\
**Last updated:** [December 7, 2024, 1:14pm UTC](https://discourse.julialang.org/t/cheesing-imo-2006-3-problem-with-jump/123566 "2024-12-07T13:14:48Z")

</div>

Here is the IMO 2006. I will focus on problem 3 Normally, you are expected to mathematically solve this problem. However, this problem is instructive in illustrating how an ounce of computation can save a pound of mat…

---

## [Vehical routing problem with time windows](https://discourse.julialang.org/t/vehical-routing-problem-with-time-windows/123550)

<div class="topic-metadata">

**Author:** [@aditya\_lokesh](https://discourse.julialang.org/u/aditya_lokesh)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 9:20pm UTC](https://discourse.julialang.org/t/vehical-routing-problem-with-time-windows/123550 "2024-12-06T21:20:12Z")

</div>

The VRPTW is defined by a fleet of vehicles, V, a set of customers, C, and a directed graph Q, Typically the fleet is considered to be homo- geneous, that is, all vehicles are identical. The graph consists of |C| + 2 …

---

## [NLopt verbose output in JuMP](https://discourse.julialang.org/t/nlopt-verbose-output-in-jump/123508)

<div class="topic-metadata">

**Author:** [@afossa](https://discourse.julialang.org/u/afossa)\
**Replies:** 4\
**Last updated:** [December 6, 2024, 1:16am UTC](https://discourse.julialang.org/t/nlopt-verbose-output-in-jump/123508 "2024-12-06T01:16:01Z")

</div>

Hello, I am trying to solve an NLP modeled with InfiniteOpt/JuMP using the SLSQP solver in NLopt.jl However, the solver fails and I am struggling to investigate the root cause of this failure. Is there a way to have a…

---

## [Incorrect return type classification in Optimization.jl](https://discourse.julialang.org/t/incorrect-return-type-classification-in-optimization-jl/123490)

<div class="topic-metadata">

**Author:** [@marast](https://discourse.julialang.org/u/marast)\
**Replies:** 2\
**Last updated:** [December 5, 2024, 2:37pm UTC](https://discourse.julialang.org/t/incorrect-return-type-classification-in-optimization-jl/123490 "2024-12-05T14:37:17Z")

</div>

Hello, with version 4.0.0 Optimization.jl started to classify the return value “FTOL\_REACHED” from NLOpt as failure. This produces a warning. The following example reproduces the problem: using Optimization, Optimizati…

---

## [Optimization of an univariate function using Optim.jl](https://discourse.julialang.org/t/optimization-of-an-univariate-function-using-optim-jl/123454)

<div class="topic-metadata">

**Author:** [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Replies:** 3\
**Last updated:** [December 5, 2024, 5:36am UTC](https://discourse.julialang.org/t/optimization-of-an-univariate-function-using-optim-jl/123454 "2024-12-05T05:36:57Z")

</div>

Dear all, I am trying to deepen my knowledge of the Optim.jl package and in a near future of Optimization.jl. In the course of my research, I have developed a method for estimating the noise in a signal. This methodol…

---

## [How can you get the Lagrange/KKT multipliers out of JuMP when using Ipopt?](https://discourse.julialang.org/t/how-can-you-get-the-lagrange-kkt-multipliers-out-of-jump-when-using-ipopt/123432)

<div class="topic-metadata">

**Author:** [@lamont](https://discourse.julialang.org/u/lamont)\
**Replies:** 3\
**Last updated:** [December 4, 2024, 3:46am UTC](https://discourse.julialang.org/t/how-can-you-get-the-lagrange-kkt-multipliers-out-of-jump-when-using-ipopt/123432 "2024-12-04T03:46:46Z")

</div>

CasADI has lam\_x and lam\_g outputs. I can’t find in what they’re calling in Ipopt to get these, or I’d try digging into the Ipopt.jl code to see where it was. I haven’t had any luck with the jump-dev or ipopt documenta…

---

## ["Int64" error message during Optimisation](https://discourse.julialang.org/t/int64-error-message-during-optimisation/123382)

<div class="topic-metadata">

**Author:** [@Jordie](https://discourse.julialang.org/u/Jordie)\
**Replies:** 5\
**Last updated:** [December 4, 2024, 1:19am UTC](https://discourse.julialang.org/t/int64-error-message-during-optimisation/123382 "2024-12-04T01:19:30Z")

</div>

Hi, I am trying to find multiple parameters for the optimized system which is governed by a system of equations. In my code, I need to be able to use 4 or 5 equations and determine the parameters for the optimized syste…

---

## [Functions like set\_binary, etc. does not work in a user-defined function](https://discourse.julialang.org/t/functions-like-set-binary-etc-does-not-work-in-a-user-defined-function/123325)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 3\
**Last updated:** [December 2, 2024, 1:37am UTC](https://discourse.julialang.org/t/functions-like-set-binary-etc-does-not-work-in-a-user-defined-function/123325 "2024-12-02T01:37:59Z")

</div>

Hello, I created a simple function that solves a JuMP MIP model with arrays as inputs. The problem I want to solve is minimize c’\*x s.t. Ax = b l \<= x \<= u some x\[i\] in {0, 1} \[vartype is a vector that defines th…

---

## [Minimize f(x) with |x|=1](https://discourse.julialang.org/t/minimize-f-x-with-x-1/123307)

<div class="topic-metadata">

**Author:** [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Replies:** 5\
**Last updated:** [December 1, 2024, 7:21am UTC](https://discourse.julialang.org/t/minimize-f-x-with-x-1/123307 "2024-12-01T07:21:05Z")

</div>

What is the simplest way to minimize f(x) with |x|=1 where x is a vector ? (I know the gradient of f) I’ve checked the example on Using Equality and Inequality Constraints · Optimization.jl but the solution calls AmplNL…

---

## [Solving an SDP repeatedly where the matrix data changes in each repetition](https://discourse.julialang.org/t/solving-an-sdp-repeatedly-where-the-matrix-data-changes-in-each-repetition/123271)

<div class="topic-metadata">

**Author:** [@Shuvomoy\_Das\_Gupta](https://discourse.julialang.org/u/Shuvomoy_Das_Gupta)\
**Replies:** 4\
**Last updated:** [November 30, 2024, 10:47pm UTC](https://discourse.julialang.org/t/solving-an-sdp-repeatedly-where-the-matrix-data-changes-in-each-repetition/123271 "2024-11-30T22:47:53Z")

</div>

Dear All, I am trying to solve the following semidefinite optimization problem in JuMP that I want to solve repeatedly: \\begin{align\*} p^{\\star}(\\alpha)=\\text{minimize}\_{X,y} &\\; \\mathbf{tr}CX+\\sum\_{i=1}^{n}c\_{i}y\_{i…

---

## [Optimizing over 3d array: adjoint not defined for Array{Float64, 3}](https://discourse.julialang.org/t/optimizing-over-3d-array-adjoint-not-defined-for-array-float64-3/123235)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [November 30, 2024, 4:09pm UTC](https://discourse.julialang.org/t/optimizing-over-3d-array-adjoint-not-defined-for-array-float64-3/123235 "2024-11-30T16:09:09Z")

</div>

I’m trying to optimize over a 3d array. It seems like it doesn’t want to handle a 3d array, but I’m not sure why. Is there a solution for this? using Optimization, Optim, OptimizationOptimJL, Zygote, DifferentiationInte…

---

## [Naming JuMP constraint in a loop](https://discourse.julialang.org/t/naming-jump-constraint-in-a-loop/123238)

<div class="topic-metadata">

**Author:** [@priantop](https://discourse.julialang.org/u/priantop)\
**Replies:** 5\
**Last updated:** [November 29, 2024, 11:00pm UTC](https://discourse.julialang.org/t/naming-jump-constraint-in-a-loop/123238 "2024-11-29T23:00:29Z")

</div>

Hi, Sorry for the rookie question I am trying to find a way to name constraints inside a loop I understand that it is common to define a constraint with the base name inside the @constraint below is the MWE using Ju…

---

## [Change of return syntax for loss\_function in Optimization.jl](https://discourse.julialang.org/t/change-of-return-syntax-for-loss-function-in-optimization-jl/123224)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 8\
**Last updated:** [November 29, 2024, 7:48pm UTC](https://discourse.julialang.org/t/change-of-return-syntax-for-loss-function-in-optimization-jl/123224 "2024-11-29T19:48:19Z")

</div>

I’m using Optimization.jl to optimize conditions of ODE simulation to a given objective. Before the latest update (4.0.0), one could use this return syntax function loss\_adjoint(fullp, batch, time\_batch) pred = pre…

---

## [Staff Scheduling Optimization](https://discourse.julialang.org/t/staff-scheduling-optimization/123230)

<div class="topic-metadata">

**Author:** [@Honcho868](https://discourse.julialang.org/u/Honcho868)\
**Replies:** 7\
**Last updated:** [November 29, 2024, 1:12am UTC](https://discourse.julialang.org/t/staff-scheduling-optimization/123230 "2024-11-29T01:12:57Z")

</div>

So im trying to code the following model from the paper in JuMP to determine optimal number of staff for 3 shifts daily for 7 days a week where staff must work atleast 1 shift per day This is the code: using JuMP using…

---

## [Optimization using GLPK](https://discourse.julialang.org/t/optimization-using-glpk/107210)

<div class="topic-metadata">

**Author:** [@doriiido](https://discourse.julialang.org/u/doriiido)\
**Replies:** 15\
**Last updated:** [November 28, 2024, 11:14pm UTC](https://discourse.julialang.org/t/optimization-using-glpk/107210 "2024-11-28T23:14:31Z")

</div>

I am trying to find an optimal number of employees to satisfy a scheduling problem, this is my code: using JuMP using GLPK # Constants and parameters Wjk = \[19 16 22 22 22 22 22; 19 16 22 22 22 22 22; 14 11 16 16 16 16…

---

## [SCIP constraints](https://discourse.julialang.org/t/scip-constraints/123206)

<div class="topic-metadata">

**Author:** [@Rajender\_Mudigonda](https://discourse.julialang.org/u/Rajender_Mudigonda)\
**Replies:** 2\
**Last updated:** [November 28, 2024, 7:24pm UTC](https://discourse.julialang.org/t/scip-constraints/123206 "2024-11-28T19:24:31Z")

</div>

When using SCIP solver, what is the alternative for compute\_conflict!(model) to identify constraint conflicts?

---

## [Choosing a package for univariate (convex) optimization in Julia](https://discourse.julialang.org/t/choosing-a-package-for-univariate-convex-optimization-in-julia/109089)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 8\
**Last updated:** [November 28, 2024, 4:34pm UTC](https://discourse.julialang.org/t/choosing-a-package-for-univariate-convex-optimization-in-julia/109089 "2024-11-28T16:34:55Z")

</div>

I need to solve 1d convex optimization programs, where I have access to all derivatives. Ideally I’d use Optim.jl but the interface only supports vectors. The backend NLSolvers.jl works but the documentation is not as de…

---

## [Sin(x), cos(x) w/ Gurobi?](https://discourse.julialang.org/t/sin-x-cos-x-w-gurobi/123179)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 2\
**Last updated:** [November 28, 2024, 2:19am UTC](https://discourse.julialang.org/t/sin-x-cos-x-w-gurobi/123179 "2024-11-28T02:19:08Z")

</div>

Can I use sinusoidal functions with JuMP/Gurobi? something like: using JuMP, Gurobi m=Model(Gurobi.Optimizer) @variable(m, -2π \<= x \<= 2π) @objective(m, Min, cos(x)) optimize!(m) It seems like there’s a section on sine…

---

## [How to copy variables from one optimized JuMP model into another model?](https://discourse.julialang.org/t/how-to-copy-variables-from-one-optimized-jump-model-into-another-model/123103)

<div class="topic-metadata">

**Author:** [@Realife\_Brahmin](https://discourse.julialang.org/u/Realife_Brahmin)\
**Replies:** 1\
**Last updated:** [November 26, 2024, 6:44pm UTC](https://discourse.julialang.org/t/how-to-copy-variables-from-one-optimized-jump-model-into-another-model/123103 "2024-11-26T18:44:20Z")

</div>

Hello everyone, I’m working on a multi-period optimization problem using Julia, JuMP, and Ipopt. My approach involves solving individual time-step optimization subproblems as separate JuMP models (sub\_model\_t0), then in…

---

## [Very slow performance when modifying and querying a model with JuMP](https://discourse.julialang.org/t/very-slow-performance-when-modifying-and-querying-a-model-with-jump/122842)

<div class="topic-metadata">

**Author:** [@njozefow](https://discourse.julialang.org/u/njozefow)\
**Replies:** 4\
**Last updated:** [November 26, 2024, 10:56am UTC](https://discourse.julialang.org/t/very-slow-performance-when-modifying-and-querying-a-model-with-jump/122842 "2024-11-26T10:56:34Z")

</div>

Hello, I have a question about the modifications and queries of a model with jump. If I use a jump model with set\_objective\_coefficient and set\_normalized\_coefficient, the computational times are 25 times slower than wi…

---

## [Problem setting constraint in simple LP using JuMP](https://discourse.julialang.org/t/problem-setting-constraint-in-simple-lp-using-jump/123059)

<div class="topic-metadata">

**Author:** [@miguelborrero](https://discourse.julialang.org/u/miguelborrero)\
**Replies:** 5\
**Last updated:** [November 26, 2024, 1:48am UTC](https://discourse.julialang.org/t/problem-setting-constraint-in-simple-lp-using-jump/123059 "2024-11-26T01:48:32Z")

</div>

Hi there, Im trying to construct a simple LP using JuMP but I am running into an issue with the constraint in the function. I checked this is the line causing the issue since if I delete it, I can define the function in…

---

## [Facility location problem](https://discourse.julialang.org/t/facility-location-problem/123068)

<div class="topic-metadata">

**Author:** [@aditya\_lokesh](https://discourse.julialang.org/u/aditya_lokesh)\
**Replies:** 1\
**Last updated:** [November 26, 2024, 1:39am UTC](https://discourse.julialang.org/t/facility-location-problem/123068 "2024-11-26T01:39:28Z")

</div>

facing a issue with my implementation of the facility location problem. I tried implementing the problem however the optimization model just does not seem to stop even after 3 hours not sure if I have slow computer. n…

---

## [Rand does not return expected confidence interval](https://discourse.julialang.org/t/rand-does-not-return-expected-confidence-interval/123053)

<div class="topic-metadata">

**Author:** [@Trylmand](https://discourse.julialang.org/u/Trylmand)\
**Replies:** 2\
**Last updated:** [November 25, 2024, 7:02pm UTC](https://discourse.julialang.org/t/rand-does-not-return-expected-confidence-interval/123053 "2024-11-25T19:02:32Z")

</div>

Dear all, Testing Rand() on MC algorithm for estimating integral of Sine from 0 to Pi, only returns 50% of the expected confidence interval. Can anybody see, where my code breaks? n = 1000 in\_ci = 0 for i in 1:500 …

---

## [Implementing the log-sum-exp function](https://discourse.julialang.org/t/implementing-the-log-sum-exp-function/122946)

<div class="topic-metadata">

**Author:** [@kangqiu](https://discourse.julialang.org/u/kangqiu)\
**Replies:** 10\
**Last updated:** [November 23, 2024, 9:23am UTC](https://discourse.julialang.org/t/implementing-the-log-sum-exp-function/122946 "2024-11-23T09:23:55Z")

</div>

Hi everyone! I am working on stochastic model predictive control in Julia/JuMP. I am using essentially a log-sum-exp function in the objective and encountered some issues with overflow. Now I am trying to implement a re…

---

## [Comparing model solutions - Validating solutions](https://discourse.julialang.org/t/comparing-model-solutions-validating-solutions/122294)

<div class="topic-metadata">

**Author:** [@daro.slai](https://discourse.julialang.org/u/daro.slai)\
**Replies:** 6\
**Last updated:** [November 22, 2024, 9:37pm UTC](https://discourse.julialang.org/t/comparing-model-solutions-validating-solutions/122294 "2024-11-22T21:37:48Z")

</div>

Hi! I’m working on an MINLP model and solving it with KNITRO. Since it’s an MINLP, the solver solution heavily depends on solver settings and I’m looking for new ways to validate it. I was trying to take the same mode…

---

## [Robust and adaptive optimization support?](https://discourse.julialang.org/t/robust-and-adaptive-optimization-support/122965)

<div class="topic-metadata">

**Author:** [@karlzhu](https://discourse.julialang.org/u/karlzhu)\
**Replies:** 3\
**Last updated:** [November 22, 2024, 9:24pm UTC](https://discourse.julialang.org/t/robust-and-adaptive-optimization-support/122965 "2024-11-22T21:24:35Z")

</div>

Are there any currently maintained packages that extend JuMP and formulate robust and adaptive optimization models? I see there’s a JuMPeR package built many years ago, but I heard it’s unusable since it’s quite outdated…

---

## [Cannot get HSL to work with AmplNLWriter](https://discourse.julialang.org/t/cannot-get-hsl-to-work-with-amplnlwriter/122903)

<div class="topic-metadata">

**Author:** [@pulsipher](https://discourse.julialang.org/u/pulsipher)\
**Replies:** 8\
**Last updated:** [November 22, 2024, 11:37am UTC](https://discourse.julialang.org/t/cannot-get-hsl-to-work-with-amplnlwriter/122903 "2024-11-22T11:37:51Z")

</div>

I have installed HSL\_jll.jl as provided by HSL and also installed HSL.jl. With this I can get Ipopt to work with ma27 when I use Ipopt directly: using JuMP, Ipopt, HSL, HSL\_jll model = Model(Ipopt.Optimizer) @variable(m…

---

## [Capturing best solution from a JuMP model that times out](https://discourse.julialang.org/t/capturing-best-solution-from-a-jump-model-that-times-out/122807)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 5\
**Last updated:** [November 22, 2024, 6:59am UTC](https://discourse.julialang.org/t/capturing-best-solution-from-a-jump-model-that-times-out/122807 "2024-11-22T06:59:54Z")

</div>

I have a mixed integer problem that I think is sufficiently hard that it won’t complete in sensible time. I am probably using HiGHS. I would like to see the best feasible solution that was found. Actually I might like…

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

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