# Optimization (Mathematical)

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

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

**Page:** 71

---

## [Different results when registering the log-likelihood function vs pasting its contents](https://discourse.julialang.org/t/different-results-when-registering-the-log-likelihood-function-vs-pasting-its-contents/73214)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 3\
**Last updated:** [December 16, 2021, 7:27pm UTC](https://discourse.julialang.org/t/different-results-when-registering-the-log-likelihood-function-vs-pasting-its-contents/73214 "2021-12-16T19:27:37Z")

</div>

I’m trying to optimize this log-likelihood function: -log(σ^2) / 2 - ϵ^2 / 2 + log( 2Φ(a \* ϵ) ) Here ϵ depends on data and some more parameters. I’m trying to optimize this in two ways: Put the sum of these likelih…

---

## [Future of COIN-OR (Cbc, Clp, Ipopt)](https://discourse.julialang.org/t/future-of-coin-or-cbc-clp-ipopt/73223)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 0\
**Last updated:** [December 16, 2021, 7:07pm UTC](https://discourse.julialang.org/t/future-of-coin-or-cbc-clp-ipopt/73223 "2021-12-16T19:07:59Z")

</div>

Dear all, If you use any of the COIN-OR solvers (Cbc, Clp, Ipopt, Bonmin, or Couenne), please take a moment to read: Oscar

---

## [Serialized and deserialized JuMP CPLEX models are not the same](https://discourse.julialang.org/t/serialized-and-deserialized-jump-cplex-models-are-not-the-same/73194)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 1\
**Last updated:** [December 16, 2021, 5:36pm UTC](https://discourse.julialang.org/t/serialized-and-deserialized-jump-cplex-models-are-not-the-same/73194 "2021-12-16T17:36:57Z")

</div>

I want to run some long simulations with JuMP. After the simulations ends, I will start with the metaanalysis. So what I wanted to do is store the solved model in the filesystem and analyze it afterwards. During my pre-…

---

## [MethodError: no method matching isless(::Int64, ::AffExpr)](https://discourse.julialang.org/t/methoderror-no-method-matching-isless-int64-affexpr/69731)

<div class="topic-metadata">

**Author:** [@Ali9266](https://discourse.julialang.org/u/Ali9266)\
**Replies:** 6\
**Last updated:** [December 16, 2021, 8:37am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-isless-int64-affexpr/69731 "2021-12-16T08:37:56Z")

</div>

I’m receiving an error MethodError: no method matching isless(::Int64, ::AffExpr) while trying to run my code in the constraints “@constraint(model, con8\[k in 1:n,i in 1:m; i==m\], T\_k\[k\]==max(C\_ki\[k,i\]-U\_k\[k\],0))”

---

## [Quadratic Program solver](https://discourse.julialang.org/t/quadratic-program-solver/73125)

<div class="topic-metadata">

**Author:** [@FH96](https://discourse.julialang.org/u/FH96)\
**Replies:** 3\
**Last updated:** [December 15, 2021, 12:36pm UTC](https://discourse.julialang.org/t/quadratic-program-solver/73125 "2021-12-15T12:36:36Z")

</div>

Is there a list of available solvers for QP which can be used in julia? Googling and finding one by one is taking a lot of time SCS and OSQP are not accurate enough , COSMO doesn’t work for my problem… By the way can …

---

## [Entropy maximization with nonlinear constraint](https://discourse.julialang.org/t/entropy-maximization-with-nonlinear-constraint/73104)

<div class="topic-metadata">

**Author:** [@mvsoom](https://discourse.julialang.org/u/mvsoom)\
**Replies:** 4\
**Last updated:** [December 14, 2021, 11:55pm UTC](https://discourse.julialang.org/t/entropy-maximization-with-nonlinear-constraint/73104 "2021-12-14T23:55:50Z")

</div>

I’m trying to solve the following entropy maximization problem: \\max\_p -\\sum\_{ij} p\_{ij} \\log p\_{ij} s.t. p \\in \\mathbb{R}^{n \\times n} \\\\ p\_{ij} = p\_{ji} \\\\ 0 \\leq p\_{ij} \\leq 1 ~ \\forall (i,j) \\\\ \\sum\_{ij} p\_{ij} …

---

## [Create variable based on array](https://discourse.julialang.org/t/create-variable-based-on-array/73070)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 4:59pm UTC](https://discourse.julialang.org/t/create-variable-based-on-array/73070 "2021-12-14T16:59:43Z")

</div>

I have a tuple that contains pairs and I want to create a variable based on these pairs as follows E = \[(1, 2), (10, 16), (18, 24), (32, 33), (12, 10), (19, 18), (31, 30), (17, 36)\] for (i,j) in E @variable(model,x\[i…

---

## [User MIP start did not produce a new incumbent solution](https://discourse.julialang.org/t/user-mip-start-did-not-produce-a-new-incumbent-solution/72269)

<div class="topic-metadata">

**Author:** [@ZHEN\_LIN](https://discourse.julialang.org/u/ZHEN_LIN)\
**Replies:** 5\
**Last updated:** [December 14, 2021, 1:57pm UTC](https://discourse.julialang.org/t/user-mip-start-did-not-produce-a-new-incumbent-solution/72269 "2021-12-14T13:57:09Z")

</div>

I have a mixed integer optimization to be solved with Gurobi in JuMP. I am trying to give a warm start to Gurobi, but it gives me the following message User MIP start did not produce a new incumbent solution Processed M…

---

## [Teaching-Learning-based Optimization](https://discourse.julialang.org/t/teaching-learning-based-optimization/73014)

<div class="topic-metadata">

**Author:** [@Hans\_W\_Borchers](https://discourse.julialang.org/u/Hans_W_Borchers)\
**Replies:** 3\
**Last updated:** [December 14, 2021, 9:02am UTC](https://discourse.julialang.org/t/teaching-learning-based-optimization/73014 "2021-12-14T09:02:39Z")

</div>

Is there an implementation of the Teaching-Learning-Based Optimization (TLBO) algorithm in a Julia package or somewhere on Github? I found a MATLAB toolbox, but all searches for Julia were not successful. See Teaching …

---

## [Writing a multi-objective MPS file](https://discourse.julialang.org/t/writing-a-multi-objective-mps-file/73058)

<div class="topic-metadata">

**Author:** [@gleyland](https://discourse.julialang.org/u/gleyland)\
**Replies:** 2\
**Last updated:** [December 14, 2021, 5:59am UTC](https://discourse.julialang.org/t/writing-a-multi-objective-mps-file/73058 "2021-12-14T05:59:29Z")

</div>

Hi, We’re using JuMP with Gurobi, and specifically Gurobi’s multi-objective support (which is more sequential objectives than multi-objective, but that works because in this case that’s what we want). It would be handy…

---

## [Problem with implementing the objective function with minimum and maximum functions simultaneously!](https://discourse.julialang.org/t/problem-with-implementing-the-objective-function-with-minimum-and-maximum-functions-simultaneously/72917)

<div class="topic-metadata">

**Author:** [@Sahar](https://discourse.julialang.org/u/Sahar)\
**Replies:** 2\
**Last updated:** [December 11, 2021, 2:31pm UTC](https://discourse.julialang.org/t/problem-with-implementing-the-objective-function-with-minimum-and-maximum-functions-simultaneously/72917 "2021-12-11T14:31:49Z")

</div>

Hi Good morning! I am working on an optimization problem and it has a user defined objective function. the problem is now working well with a simple cost objective function, but I am not able to change it to the attach…

---

## [Accesing Lagrange multipliers while using Ipopt from Nonconvex.jl](https://discourse.julialang.org/t/accesing-lagrange-multipliers-while-using-ipopt-from-nonconvex-jl/72841)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 2\
**Last updated:** [December 10, 2021, 4:35am UTC](https://discourse.julialang.org/t/accesing-lagrange-multipliers-while-using-ipopt-from-nonconvex-jl/72841 "2021-12-10T04:35:53Z")

</div>

I was trying Nonconvex.jl using Ipopt. Is there a way in which I can access Lagrange multipliers?

---

## [JuMP variable container with repeated index](https://discourse.julialang.org/t/jump-variable-container-with-repeated-index/72782)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 2\
**Last updated:** [December 9, 2021, 10:58am UTC](https://discourse.julialang.org/t/jump-variable-container-with-repeated-index/72782 "2021-12-09T10:58:44Z")

</div>

I wonder how JuMP experts would create an SDP variable over some index matrix constrained during creation. From the docs, it is recommended to constraint variable upon creation if possible. Can the following be improved …

---

## [Convert VariableRef to String](https://discourse.julialang.org/t/convert-variableref-to-string/72803)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 2\
**Last updated:** [December 9, 2021, 9:40am UTC](https://discourse.julialang.org/t/convert-variableref-to-string/72803 "2021-12-09T09:40:07Z")

</div>

We can use string(variable) to convert integer variable to string. Can we convert VariableRef to string? VariableRef we are getting from math model. I tried with parse(AbstractString,VariableRef) or string(VariableRef)…

---

## [Gurobi not running the right version?](https://discourse.julialang.org/t/gurobi-not-running-the-right-version/72808)

<div class="topic-metadata">

**Author:** [@Marc\_Sevaux](https://discourse.julialang.org/u/Marc_Sevaux)\
**Replies:** 4\
**Last updated:** [December 9, 2021, 9:20am UTC](https://discourse.julialang.org/t/gurobi-not-running-the-right-version/72808 "2021-12-09T09:20:31Z")

</div>

Hi, I’ve installed the latest version of gurobi solver (9.5.0) and reinstalled the Gurobi package. When I try to solve a ILP model, it seems that the gurobi solver is still using a previous version (9.1.2). Did I miss…

---

## [Read MPS file using MathOptInterface and extract each variable from MOI](https://discourse.julialang.org/t/read-mps-file-using-mathoptinterface-and-extract-each-variable-from-moi/72753)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 2\
**Last updated:** [December 8, 2021, 1:28pm UTC](https://discourse.julialang.org/t/read-mps-file-using-mathoptinterface-and-extract-each-variable-from-moi/72753 "2021-12-08T13:28:42Z")

</div>

Please read the below code. It can read MPS file. How can I get each variable from m? Please share the code. using JuMP using GLPK using MathOptInterface const MOI = MathOptInterface mathoptformat\_model = MOI.FileFo…

---

## [Optimal model creation (and garbage collection)](https://discourse.julialang.org/t/optimal-model-creation-and-garbage-collection/72619)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 20\
**Last updated:** [December 7, 2021, 11:25pm UTC](https://discourse.julialang.org/t/optimal-model-creation-and-garbage-collection/72619 "2021-12-07T23:25:46Z")

</div>

Hi! I’m rather new to JuMP (and Julia) and I’m trying to compare the speed of creating a model using JuMP to an existing Python project (trying to decide whether it would be beneficial to switch to JuMP, now that 1.0 is …

---

## [GalactimOptim + AutoForwardDiff + IPNewton problem](https://discourse.julialang.org/t/galactimoptim-autoforwarddiff-ipnewton-problem/72508)

<div class="topic-metadata">

**Author:** [@mottelet](https://discourse.julialang.org/u/mottelet)\
**Replies:** 6\
**Last updated:** [December 6, 2021, 3:44pm UTC](https://discourse.julialang.org/t/galactimoptim-autoforwarddiff-ipnewton-problem/72508 "2021-12-06T15:44:41Z")

</div>

Hi, I am trying to solve a parameter fitting problem in a stiff biological ODE. The problem solves with correct precision in Matlab (with fmincon/IP) using the complex-step technique to compute the gradient, but since I…

---

## [Understanding DCP in Convex.jl and the difference of elapsed time](https://discourse.julialang.org/t/understanding-dcp-in-convex-jl-and-the-difference-of-elapsed-time/72626)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 8\
**Last updated:** [December 6, 2021, 2:38am UTC](https://discourse.julialang.org/t/understanding-dcp-in-convex-jl-and-the-difference-of-elapsed-time/72626 "2021-12-06T02:38:06Z")

</div>

Hi, there! I’d like to understand why the following elapsed times to solve the following two problems are significantly different. Here is my code and the result (to avoid high latency due to JIT compile, the results a…

---

## [NLP parameters inside a multithreaded loop](https://discourse.julialang.org/t/nlp-parameters-inside-a-multithreaded-loop/72622)

<div class="topic-metadata">

**Author:** [@Joao\_Guilherme\_Santo](https://discourse.julialang.org/u/Joao_Guilherme_Santo)\
**Replies:** 2\
**Last updated:** [December 6, 2021, 12:06am UTC](https://discourse.julialang.org/t/nlp-parameters-inside-a-multithreaded-loop/72622 "2021-12-06T00:06:51Z")

</div>

I am not sure if this is a JuMP or NLopt issue but whenever I try to do a loop with a NLP inside defining a parameter in each iteration, it only works if I am using a single thread. For example, the code below does not …

---

## [Parallel pre-calculation of optimization model](https://discourse.julialang.org/t/parallel-pre-calculation-of-optimization-model/72547)

<div class="topic-metadata">

**Author:** [@kchnkrml](https://discourse.julialang.org/u/kchnkrml)\
**Replies:** 8\
**Last updated:** [December 5, 2021, 10:45pm UTC](https://discourse.julialang.org/t/parallel-pre-calculation-of-optimization-model/72547 "2021-12-05T22:45:54Z")

</div>

I have got a rather large optimization problem, where creating the model (and writing an .lp file or passing it to a solver) takes a substantial amount of time (a few days), while solving it is (comparatively) quick. Sin…

---

## [Relaxation of MIP in order to use getdual](https://discourse.julialang.org/t/relaxation-of-mip-in-order-to-use-getdual/72529)

<div class="topic-metadata">

**Author:** [@max](https://discourse.julialang.org/u/max)\
**Replies:** 6\
**Last updated:** [December 4, 2021, 9:14am UTC](https://discourse.julialang.org/t/relaxation-of-mip-in-order-to-use-getdual/72529 "2021-12-04T09:14:03Z")

</div>

Hey everyone, I have a modular optimisation problem that can be LP or MIP depending on the setting. To get the shadow price I query via JuMP.has\_duals(model) whether I can receive the shadow price with the corresponding…

---

## [Mosek and Ipopt](https://discourse.julialang.org/t/mosek-and-ipopt/72334)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 4\
**Last updated:** [December 2, 2021, 2:13am UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334 "2021-12-02T02:13:57Z")

</div>

when I use Ipopt as folows: m = Model(Ipopt.Optimizer) set\_optimizer\_attributes(m, "LOG" =\> 0) ... g\_p\_max\_soc=vcat(node\[i\].p̅ - g\_p\[i\],arg\_p) @constraint(m, g\_p\_max\_soc in SecondOrderCone()) there are errors as below: …

---

## [ACOPF Problem](https://discourse.julialang.org/t/acopf-problem/72375)

<div class="topic-metadata">

**Author:** [@priod](https://discourse.julialang.org/u/priod)\
**Replies:** 2\
**Last updated:** [December 1, 2021, 7:40pm UTC](https://discourse.julialang.org/t/acopf-problem/72375 "2021-12-01T19:40:38Z")

</div>

I am trying to run an ACOPF (Alternating current optimal power flow) in the two-node network for a variable load in time “t”. The result of the model is just the zero values and nothing else. Can someone suggest to me a …

---

## [How to find dimesion of a polyhedron](https://discourse.julialang.org/t/how-to-find-dimesion-of-a-polyhedron/72383)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 2\
**Last updated:** [December 1, 2021, 4:36pm UTC](https://discourse.julialang.org/t/how-to-find-dimesion-of-a-polyhedron/72383 "2021-12-01T16:36:14Z")

</div>

K = polyhedron(vrep(\[Ray(\[0.0,0.0,1.0\])\] )) let say we have K polyhedron is there any function like dim(k) which give the dimension of k if no how to find dimesion? using LinearAlgebra using Combinatorics using Poly…

---

## [Changing Ipopt options](https://discourse.julialang.org/t/changing-ipopt-options/72156)

<div class="topic-metadata">

**Author:** [@FH96](https://discourse.julialang.org/u/FH96)\
**Replies:** 8\
**Last updated:** [December 1, 2021, 12:28pm UTC](https://discourse.julialang.org/t/changing-ipopt-options/72156 "2021-12-01T12:28:37Z")

</div>

I have a nonlinear program which Ipopt finds the optimal solution for it, with adding some changes into the problem the solver can not find the optimal solution anymore and iterates till the maximum number of iterations…

---

## [Error in solving simple SDP in Mosek+JuMP after updating related Julia packages (previously worked)](https://discourse.julialang.org/t/error-in-solving-simple-sdp-in-mosek-jump-after-updating-related-julia-packages-previously-worked/72308)

<div class="topic-metadata">

**Author:** [@Shuvomoy\_Das\_Gupta](https://discourse.julialang.org/u/Shuvomoy_Das_Gupta)\
**Replies:** 3\
**Last updated:** [November 30, 2021, 7:14pm UTC](https://discourse.julialang.org/t/error-in-solving-simple-sdp-in-mosek-jump-after-updating-related-julia-packages-previously-worked/72308 "2021-11-30T19:14:30Z")

</div>

Dear All, I recently updated some of my Julia packages related to optimization as follows: \[4076af6c\] ↑ JuMP v0.21.10 ⇒ v0.22.1 \[b8f27783\] ↑ MathOptInterface v0.9.22 ⇒ v0.10.6 \[1ec41992\] ↑ MosekTools v0.9.4 ⇒ v0.10.0 \[…

---

## [Finding multiple fixed points of a non-linear problem](https://discourse.julialang.org/t/finding-multiple-fixed-points-of-a-non-linear-problem/72292)

<div class="topic-metadata">

**Author:** [@Joseph\_Bradley](https://discourse.julialang.org/u/Joseph_Bradley)\
**Replies:** 3\
**Last updated:** [November 30, 2021, 1:50pm UTC](https://discourse.julialang.org/t/finding-multiple-fixed-points-of-a-non-linear-problem/72292 "2021-11-30T13:50:25Z")

</div>

Hi! I’m looking for some Julia code that will find all the fixed points of a non-linear problem. Specifically, I’m looking for all the solutions of this fixed point problem: m = tanh(am + b) where a and b are paramete…

---

## [Unable to use lagrange to solve 2 varable functions in modeling toolkit](https://discourse.julialang.org/t/unable-to-use-lagrange-to-solve-2-varable-functions-in-modeling-toolkit/72043)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 29\
**Last updated:** [November 29, 2021, 2:12pm UTC](https://discourse.julialang.org/t/unable-to-use-lagrange-to-solve-2-varable-functions-in-modeling-toolkit/72043 "2021-11-29T14:12:33Z")

</div>

@parameters x\_1 x\_2 @variables u eqs = \[ 0 ~ u - (x\_1+2)\*(x\_2+1), 130 ~ 4\*x\_1+6\*x\_2\] @named sys = NonlinearSystem(eqs, \[x\_1, x\_2\],\[\]) prob = NonlinearProblem(structural\_simplify(sys),\[x\_1=\>1.0,x\_2=\>1.0,u=\>max\]) …

---

## [Set Ipot (with JuMP) to terminate only if max time is reached](https://discourse.julialang.org/t/set-ipot-with-jump-to-terminate-only-if-max-time-is-reached/72160)

<div class="topic-metadata">

**Author:** [@cricci](https://discourse.julialang.org/u/cricci)\
**Replies:** 3\
**Last updated:** [November 29, 2021, 12:28am UTC](https://discourse.julialang.org/t/set-ipot-with-jump-to-terminate-only-if-max-time-is-reached/72160 "2021-11-29T00:28:31Z")

</div>

I would like to do the following: setting the Ipopt optimizer (used via JuMP) to terminate ONLY when max\_cpu\_time is reached. Is it possible? motivation for doing such a stupid thing: I need to run multiple optimizatio…

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

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