# Optimization (Mathematical)

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

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

**Page:** 52

---

## [Jump delete is slower than building a new model](https://discourse.julialang.org/t/jump-delete-is-slower-than-building-a-new-model/92597)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 6\
**Last updated:** [January 8, 2023, 4:16am UTC](https://discourse.julialang.org/t/jump-delete-is-slower-than-building-a-new-model/92597 "2023-01-08T04:16:16Z")

</div>

I have a rather large JuMP model which takes \>0.2 seconds to build but only 0.1 seconds to solve. I have to solve this model thousands of times with only a small change to a portion of the constraints, it therefore seems…

---

## [OptimizationMOI Ipopt violating inequality constraint](https://discourse.julialang.org/t/optimizationmoi-ipopt-violating-inequality-constraint/92608)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 26\
**Last updated:** [January 8, 2023, 12:57am UTC](https://discourse.julialang.org/t/optimizationmoi-ipopt-violating-inequality-constraint/92608 "2023-01-08T00:57:10Z")

</div>

Apparently, I still cannot get inequality constraints working, but now using Optimization.jl and IPOPT via the OptimizationMOI package. Problem The problem is that IPOPT violates my inequality constraint during a step, …

---

## [Symbolics and Convex](https://discourse.julialang.org/t/symbolics-and-convex/92628)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 3\
**Last updated:** [January 7, 2023, 9:16am UTC](https://discourse.julialang.org/t/symbolics-and-convex/92628 "2023-01-07T09:16:22Z")

</div>

Hi, I’d like to consider a symbolic variable as a constant from Convex. For example, julia\> using Symbolics julia\> using Convex julia\> @variables x 1-element Vector{Num}: x julia\> u = Convex.Variable(1) Variable si…

---

## [How to examine properties of a candidate solution vector to an optimization problem in JuMP?](https://discourse.julialang.org/t/how-to-examine-properties-of-a-candidate-solution-vector-to-an-optimization-problem-in-jump/92483)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 7:55am UTC](https://discourse.julialang.org/t/how-to-examine-properties-of-a-candidate-solution-vector-to-an-optimization-problem-in-jump/92483 "2023-01-04T07:55:26Z")

</div>

Suppose I am solving an optimization problem in JuMP (see example below), and I want to try out a candidate solution vectors to the problem and see what it’s objective value and constraint values it yields (in particular…

---

## [Issue importing Clp for SigmoidalProgramming](https://discourse.julialang.org/t/issue-importing-clp-for-sigmoidalprogramming/91884)

<div class="topic-metadata">

**Author:** [@auchtopus](https://discourse.julialang.org/u/auchtopus)\
**Replies:** 6\
**Last updated:** [January 3, 2023, 8:50pm UTC](https://discourse.julialang.org/t/issue-importing-clp-for-sigmoidalprogramming/91884 "2023-01-03T20:50:49Z")

</div>

Hi! I’m trying to use GitHub - madeleineudell/SigmoidalProgramming.jl: Julia Package for Sigmoidal Programming The Project.toml looks like: name = "SigmoidalProgramming" uuid = "ce2a0656-6bed-5c64-9e01-e7b1ac833b80" k…

---

## [How to use named parameters in objective function in Optimization.jl?](https://discourse.julialang.org/t/how-to-use-named-parameters-in-objective-function-in-optimization-jl/92360)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 3\
**Last updated:** [December 31, 2022, 3:58pm UTC](https://discourse.julialang.org/t/how-to-use-named-parameters-in-objective-function-in-optimization-jl/92360 "2022-12-31T15:58:44Z")

</div>

I’d like to refer to my design variables (parameters) by name inside my objective function, like this: objective(params, data::AbstractVector) = sum(@. (params.a \* data + params.b)^2) What’s the recommended way of …

---

## [Urban Planning model](https://discourse.julialang.org/t/urban-planning-model/92310)

<div class="topic-metadata">

**Author:** [@tonyhur](https://discourse.julialang.org/u/tonyhur)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 4:19pm UTC](https://discourse.julialang.org/t/urban-planning-model/92310 "2022-12-30T16:19:29Z")

</div>

Sometimes ago I found a interesting Model in the Tutorial : the urban planning model. It has completely disappeared now. Why? Where can I find it? Thanks for clarification Tony

---

## [JuMP slowed down in multithreading](https://discourse.julialang.org/t/jump-slowed-down-in-multithreading/92206)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:25am UTC](https://discourse.julialang.org/t/jump-slowed-down-in-multithreading/92206 "2022-12-30T10:25:34Z")

</div>

Hi, I have a question with JuMP multithreading performance that I would like to ask for your help. I wanted to solve a specific optimization problem 4 times, and I did it in 2 ways: Solve it repeatedly 4 times on a si…

---

## [Trying to Solve a 2nd Order ODE and need advice](https://discourse.julialang.org/t/trying-to-solve-a-2nd-order-ode-and-need-advice/92273)

<div class="topic-metadata">

**Author:** [@youmans](https://discourse.julialang.org/u/youmans)\
**Replies:** 5\
**Last updated:** [December 30, 2022, 8:38am UTC](https://discourse.julialang.org/t/trying-to-solve-a-2nd-order-ode-and-need-advice/92273 "2022-12-30T08:38:28Z")

</div>

Dear Community I’m new to Julia and recently trying to implement the algorithms from Direct Runge-Kutta Discretization Achieves Acceleration in which I need to solve an 2nd order ODE \\ddot x(t) + \\frac{2p+1}{t}\\dot x…

---

## [Performance issues with Multi-Objective Optimization](https://discourse.julialang.org/t/performance-issues-with-multi-objective-optimization/91901)

<div class="topic-metadata">

**Author:** [@JNSDVD](https://discourse.julialang.org/u/JNSDVD)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 1:08am UTC](https://discourse.julialang.org/t/performance-issues-with-multi-objective-optimization/91901 "2022-12-30T01:08:26Z")

</div>

Hey guys, I am working on an multi-objective optimization model (cost, strain, time). The challenge is simultaneous resource allocation and scheduling, as there are corresponding dependencies. However, I have developed …

---

## [JuMP GLPK method solver](https://discourse.julialang.org/t/jump-glpk-method-solver/69048)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 7\
**Last updated:** [December 29, 2022, 11:43am UTC](https://discourse.julialang.org/t/jump-glpk-method-solver/69048 "2022-12-29T11:43:01Z")

</div>

Hello, I am trying to solve a linear problem using GLPK. I have already found a solution but I would like to know which method is being used by GLPK to solve the LP problem. My call is: model = Model(GLPK.Optimizer) #…

---

## [How to define a lower triangular variable WITHOUT the main diagonal elements](https://discourse.julialang.org/t/how-to-define-a-lower-triangular-variable-without-the-main-diagonal-elements/92112)

<div class="topic-metadata">

**Author:** [@ivzktch99](https://discourse.julialang.org/u/ivzktch99)\
**Replies:** 3\
**Last updated:** [December 27, 2022, 5:53pm UTC](https://discourse.julialang.org/t/how-to-define-a-lower-triangular-variable-without-the-main-diagonal-elements/92112 "2022-12-27T17:53:26Z")

</div>

Searching here I found the following way of defining a lower triangular variable in JuMP: using JuMP import LinearAlgebra model = Model() @variable(model, A\[1:3,1:3\], Symmetric) Al = LinearAlgebra.LowerTriangular(A) ju…

---

## [Adding Flexibility/Storage to Matpower case files in PowerModel](https://discourse.julialang.org/t/adding-flexibility-storage-to-matpower-case-files-in-powermodel/92067)

<div class="topic-metadata">

**Author:** [@Wahee01](https://discourse.julialang.org/u/Wahee01)\
**Replies:** 3\
**Last updated:** [December 24, 2022, 9:48pm UTC](https://discourse.julialang.org/t/adding-flexibility-storage-to-matpower-case-files-in-powermodel/92067 "2022-12-24T21:48:13Z")

</div>

Hello, I’m attempting to add flexibility/battery to several nodes in the Matpower IEEE9 bus case file. With this method “% hours mpc.time\_elapsed = 1.0 %% storage data % storage\_bus ps qs energy energy\_rating cha…

---

## [Discrepancy in DiffEqParamEstim](https://discourse.julialang.org/t/discrepancy-in-diffeqparamestim/86300)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [December 24, 2022, 6:34am UTC](https://discourse.julialang.org/t/discrepancy-in-diffeqparamestim/86300 "2022-12-24T06:34:23Z")

</div>

Before I open a bug report on the official repo, just want to make sure I am on the right path. Consider a simple 2 parameter estimation of an ODE. using DifferentialEquations using DiffEqParamEstim using Optim # some …

---

## [Difficulty with utilizing PowerModels.update data! function](https://discourse.julialang.org/t/difficulty-with-utilizing-powermodels-update-data-function/91906)

<div class="topic-metadata">

**Author:** [@Wahee01](https://discourse.julialang.org/u/Wahee01)\
**Replies:** 5\
**Last updated:** [December 23, 2022, 4:25pm UTC](https://discourse.julialang.org/t/difficulty-with-utilizing-powermodels-update-data-function/91906 "2022-12-23T16:25:03Z")

</div>

Hello to everyone. I apologize if my inquiry is too simple. Julia is a programming language that I am learning. For optimal power flow and power flow problems, I use the PowerModels toolkit. PowerModels.update data! is a…

---

## [Constraints tolerance IPNewton in Optim.jl](https://discourse.julialang.org/t/constraints-tolerance-ipnewton-in-optim-jl/92038)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 0\
**Last updated:** [December 23, 2022, 8:56am UTC](https://discourse.julialang.org/t/constraints-tolerance-ipnewton-in-optim-jl/92038 "2022-12-23T08:56:01Z")

</div>

Hello, I was wondering if it is possible to specify up to which tolerance the equality constraints are satisfied in Optim.jl using IPNewton method. Currently, the optimization stops because x\_tol or f\_tol are satisfied…

---

## [Constraint set with max function](https://discourse.julialang.org/t/constraint-set-with-max-function/91997)

<div class="topic-metadata">

**Author:** [@baprata](https://discourse.julialang.org/u/baprata)\
**Replies:** 2\
**Last updated:** [December 23, 2022, 9:59am UTC](https://discourse.julialang.org/t/constraint-set-with-max-function/91997 "2022-12-23T09:59:13Z")

</div>

Concerning the constraint set I am having problem with the last term of the constraint (?): @constraint(model, \[m in 1:machines, j in 1:jobs\], PT\[m,j\] == SET\[m\] \* Z\[m,j\] + VT\[m\]\*(sum(v\[i\] \* X\[m,j,i\] for i in 1:parts)…

---

## [Use or not functions in JuMP](https://discourse.julialang.org/t/use-or-not-functions-in-jump/92003)

<div class="topic-metadata">

**Author:** [@lara](https://discourse.julialang.org/u/lara)\
**Replies:** 1\
**Last updated:** [December 22, 2022, 4:45pm UTC](https://discourse.julialang.org/t/use-or-not-functions-in-jump/92003 "2022-12-22T16:45:13Z")

</div>

Hey, guys. This is my first time working with both Julia and JuMP. It has been an adventure (and a lot of mistakes). Right now I accomplished to do the base code to work as I need and I am trying to put it inside the J…

---

## [How to Approach Parameter Estimation with Non-Linear Optimizers](https://discourse.julialang.org/t/how-to-approach-parameter-estimation-with-non-linear-optimizers/91985)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 3\
**Last updated:** [December 21, 2022, 11:25pm UTC](https://discourse.julialang.org/t/how-to-approach-parameter-estimation-with-non-linear-optimizers/91985 "2022-12-21T23:25:12Z")

</div>

Hello, I am trying to estimate the parameters of an ODE given discrete data x(t) that is the solution to that ODE. The ODE is: m\\ddot{x}=f(x,\\theta) where \\theta is some vector of parameters. I can estimate the paramete…

---

## [How to get non-trivial solution with SDP in SCS?](https://discourse.julialang.org/t/how-to-get-non-trivial-solution-with-sdp-in-scs/91896)

<div class="topic-metadata">

**Author:** [@ivzktch99](https://discourse.julialang.org/u/ivzktch99)\
**Replies:** 9\
**Last updated:** [December 21, 2022, 9:53pm UTC](https://discourse.julialang.org/t/how-to-get-non-trivial-solution-with-sdp-in-scs/91896 "2022-12-21T21:53:29Z")

</div>

I am trying to solve the following, but I want to find the nonzero solution (right now it returns only trivial solutions). Is there anyway to do that? Basically I want to find matrix G (symmetric and PSD) and matrix D (…

---

## [Construct a JuMP model from smaller models](https://discourse.julialang.org/t/construct-a-jump-model-from-smaller-models/91929)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 4\
**Last updated:** [December 21, 2022, 8:18pm UTC](https://discourse.julialang.org/t/construct-a-jump-model-from-smaller-models/91929 "2022-12-21T20:18:52Z")

</div>

Hey guys, I’m quite curious about the JuMP model object. Once I construct a JuMP model where all variables and expressions are organized into one model instance which goes through many scripts and it worked. It could be …

---

## [Best way to use Cgl within JuMP?](https://discourse.julialang.org/t/best-way-to-use-cgl-within-jump/91900)

<div class="topic-metadata">

**Author:** [@Maxime](https://discourse.julialang.org/u/Maxime)\
**Replies:** 2\
**Last updated:** [December 20, 2022, 8:24pm UTC](https://discourse.julialang.org/t/best-way-to-use-cgl-within-jump/91900 "2022-12-20T20:24:38Z")

</div>

Hi, I need to use the Cgl cut generation library GitHub - coin-or/Cgl: Cut Generator Library from within JuMP. In particular I want to generate KnapsackCover cuts. I managed to install Cgl, however I’m struggling beca…

---

## [Accessing backend of Model](https://discourse.julialang.org/t/accessing-backend-of-model/91689)

<div class="topic-metadata">

**Author:** [@Maxime](https://discourse.julialang.org/u/Maxime)\
**Replies:** 3\
**Last updated:** [December 20, 2022, 3:08pm UTC](https://discourse.julialang.org/t/accessing-backend-of-model/91689 "2022-12-20T15:08:44Z")

</div>

Hi, I have a usecase where I have to copy models. I also need to access the solver backend. However it seems that I can either use direct\_model(), so I have access to the backend, but can’t copy the model, or i can use …

---

## [Confused about how Zygote pullback handles tuple-valued loss functions](https://discourse.julialang.org/t/confused-about-how-zygote-pullback-handles-tuple-valued-loss-functions/91899)

<div class="topic-metadata">

**Author:** [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Replies:** 2\
**Last updated:** [December 20, 2022, 3:05pm UTC](https://discourse.julialang.org/t/confused-about-how-zygote-pullback-handles-tuple-valued-loss-functions/91899 "2022-12-20T15:05:07Z")

</div>

I noticed something odd (or at least that I don’t understand) with the Zygote.pullback method. Let’s consider a very simple test case: using Zygote losses, back = Zygote.pullback(x -\> (sum(x), sum(x)), \[1.0,1.0\]) Her…

---

## [How to save a file with the log of Gurobi solver in JuMP](https://discourse.julialang.org/t/how-to-save-a-file-with-the-log-of-gurobi-solver-in-jump/91874)

<div class="topic-metadata">

**Author:** [@Luiz\_Monteiro](https://discourse.julialang.org/u/Luiz_Monteiro)\
**Replies:** 2\
**Last updated:** [December 20, 2022, 12:55am UTC](https://discourse.julialang.org/t/how-to-save-a-file-with-the-log-of-gurobi-solver-in-jump/91874 "2022-12-20T00:55:20Z")

</div>

Hi, I’m running a MIP model using JuMP with solver Gurobi and need to save the solution log as a file. I tryed to read Gurobi documentation bur couldnt find how to do this in Julia. Is there a way to do it? Thanks in …

---

## [Comparison of Automatic Differentiation (AD)?](https://discourse.julialang.org/t/comparison-of-automatic-differentiation-ad/91544)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 6\
**Last updated:** [December 14, 2022, 11:05pm UTC](https://discourse.julialang.org/t/comparison-of-automatic-differentiation-ad/91544 "2022-12-14T23:05:22Z")

</div>

Hello! Has there been a recent study (within the past year) that compares the speed/performance of difference Automatic Differentiation packages (Zygote, ReverseDiff, etc.)?

---

## [DenseAxisArray not working as expected with single dimensional](https://discourse.julialang.org/t/denseaxisarray-not-working-as-expected-with-single-dimensional/91646)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 2\
**Last updated:** [December 14, 2022, 6:04pm UTC](https://discourse.julialang.org/t/denseaxisarray-not-working-as-expected-with-single-dimensional/91646 "2022-12-14T18:04:13Z")

</div>

I’m trying to set some values on slices of a DenseAxisArray and am getting an error when setting on a single dimensional DenseAxisArray. The following code works exactly as expected: using JuMP.Containers D = DenseAxi…

---

## [Problems with LsqFit on an ODE-based model](https://discourse.julialang.org/t/problems-with-lsqfit-on-an-ode-based-model/91642)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 2\
**Last updated:** [December 14, 2022, 5:48pm UTC](https://discourse.julialang.org/t/problems-with-lsqfit-on-an-ode-based-model/91642 "2022-12-14T17:48:06Z")

</div>

I have a 1D experimental dataset and an ODE-based model. The model is able to describe experimental data reasonably well by manual fitting of the parameter: The next step now is using LsqFit, at first trying to fit ju…

---

## [How exactly do optimizers reject infinity loss?](https://discourse.julialang.org/t/how-exactly-do-optimizers-reject-infinity-loss/91597)

<div class="topic-metadata">

**Author:** [@fanny1](https://discourse.julialang.org/u/fanny1)\
**Replies:** 4\
**Last updated:** [December 14, 2022, 10:31am UTC](https://discourse.julialang.org/t/how-exactly-do-optimizers-reject-infinity-loss/91597 "2022-12-14T10:31:54Z")

</div>

Hi, I was reading the documentation and on this page Frequently Asked Questions of DifferentialEquations.jl, in the Stability and Divergence section, it says: if you see these instability warnings during a parameter es…

---

## [Plotting sets using natural mathematical set expressions](https://discourse.julialang.org/t/plotting-sets-using-natural-mathematical-set-expressions/91582)

<div class="topic-metadata">

**Author:** [@tapyu](https://discourse.julialang.org/u/tapyu)\
**Replies:** 10\
**Last updated:** [December 13, 2022, 11:10pm UTC](https://discourse.julialang.org/t/plotting-sets-using-natural-mathematical-set-expressions/91582 "2022-12-13T23:10:10Z")

</div>

In convex optimization, it is quite common to come across a n-dimensional set formally written like that, for example, C = \\left\\{ (x\_1, x\_2, \\cdots, x\_n, t) \\in \\mathbb{R}^{n+1} \\mid \\mathbf{x} \\in \\mathbb{R}^{n}, \\lV…

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

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