# Optimization (Mathematical)

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

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

**Page:** 56

---

## [Cannot warmstart same HiGHS model without rebuilding](https://discourse.julialang.org/t/cannot-warmstart-same-highs-model-without-rebuilding/88816)

<div class="topic-metadata">

**Author:** [@obar](https://discourse.julialang.org/u/obar)\
**Replies:** 2\
**Last updated:** [October 17, 2022, 3:56am UTC](https://discourse.julialang.org/t/cannot-warmstart-same-highs-model-without-rebuilding/88816 "2022-10-17T03:56:00Z")

</div>

Hi, Ran into a bit of a weird issue with trying to use the HiGHS solver for sequential objective optimisation. When trying to use set\_start\_value for warmstarting, it works perfectly fine if the second objective model …

---

## [Not sure how to get this LsqFit working](https://discourse.julialang.org/t/not-sure-how-to-get-this-lsqfit-working/88769)

<div class="topic-metadata">

**Author:** [@Mervyn\_Larrier](https://discourse.julialang.org/u/Mervyn_Larrier)\
**Replies:** 10\
**Last updated:** [October 16, 2022, 12:57am UTC](https://discourse.julialang.org/t/not-sure-how-to-get-this-lsqfit-working/88769 "2022-10-16T00:57:36Z")

</div>

I have some data that I need to fit. All the other functions work, I’m just trying to minimize the cost function model in my code. Assuming you have all the same packages as me (the only errant one may be Underscores.jl)…

---

## [Optimization.jl constraints violated...why?](https://discourse.julialang.org/t/optimization-jl-constraints-violated-why/88269)

<div class="topic-metadata">

**Author:** [@kjohnsen](https://discourse.julialang.org/u/kjohnsen)\
**Replies:** 8\
**Last updated:** [October 14, 2022, 10:38am UTC](https://discourse.julialang.org/t/optimization-jl-constraints-violated-why/88269 "2022-10-14T10:38:34Z")

</div>

I am trying to implement model predictive control using Optimization.jl, with the Optim backend. It seems like it should be straightforward: a quadratic program, with some linear constraints. But the constraints just are…

---

## [Sum of JuMP.value](https://discourse.julialang.org/t/sum-of-jump-value/88673)

<div class="topic-metadata">

**Author:** [@Emma456](https://discourse.julialang.org/u/Emma456)\
**Replies:** 5\
**Last updated:** [October 14, 2022, 2:14am UTC](https://discourse.julialang.org/t/sum-of-jump-value/88673 "2022-10-14T02:14:36Z")

</div>

Hello, I would like to display in an excel document the sum of students assigned for each course: if JuMP.value.(x\[i,j\])==1 for each j, display the sum of x\[i,j\] Could someone help me?

---

## [Gurobi MIP start, calling GRBread to provide starting vector using a \*.mst/ \*.sol file](https://discourse.julialang.org/t/gurobi-mip-start-calling-grbread-to-provide-starting-vector-using-a-mst-sol-file/10610)

<div class="topic-metadata">

**Author:** [@Anton\_Hinneck](https://discourse.julialang.org/u/Anton_Hinneck)\
**Replies:** 6\
**Last updated:** [October 13, 2022, 2:36am UTC](https://discourse.julialang.org/t/gurobi-mip-start-calling-grbread-to-provide-starting-vector-using-a-mst-sol-file/10610 "2022-10-13T02:36:06Z")

</div>

Hi, i am currently developing a mixed integer model and need to pass an initial solution from a previous run to Gurobi. I probably could do it using JuMP’s setvalue() function. It would be much more handy however, to ju…

---

## [Problem with Mosek and JuMP after Update](https://discourse.julialang.org/t/problem-with-mosek-and-jump-after-update/88594)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 6\
**Last updated:** [October 11, 2022, 11:13pm UTC](https://discourse.julialang.org/t/problem-with-mosek-and-jump-after-update/88594 "2022-10-11T23:13:38Z")

</div>

Hi, I just installed Julia v1.8.2 and Mosek 10.0.25 and suddenly a code for an optimization function that I’ve always used stopped working. I provide a MWE using JuMP, Ipopt, LinearAlgebra, Random, Distributions, Bench…

---

## [Juniper doesn't seem to be using all available threads](https://discourse.julialang.org/t/juniper-doesnt-seem-to-be-using-all-available-threads/88568)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 1\
**Last updated:** [October 11, 2022, 10:14am UTC](https://discourse.julialang.org/t/juniper-doesnt-seem-to-be-using-all-available-threads/88568 "2022-10-11T10:14:19Z")

</div>

I run Julia with 8 threads, as verified by Threads.nthreads(), but when I try to solve a problem using Juniper I get the warning Julia was started with less processors than you defined in your options. Start julia with: …

---

## [Efficient way to get the JuMP.value of all variables in a JuMP.Model?](https://discourse.julialang.org/t/efficient-way-to-get-the-jump-value-of-all-variables-in-a-jump-model/88539)

<div class="topic-metadata">

**Author:** [@nlaws](https://discourse.julialang.org/u/nlaws)\
**Replies:** 7\
**Last updated:** [October 11, 2022, 1:01am UTC](https://discourse.julialang.org/t/efficient-way-to-get-the-jump-value-of-all-variables-in-a-jump-model/88539 "2022-10-11T01:01:01Z")

</div>

I wrote a method to get all the variable values in a JuMP Model: function get\_results\_dict(m::JuMP.Model) av = JuMP.all\_variables(m); d = Dict() for v in av # special handling of time series, sub-in…

---

## [Semidefinite programming with BigFloat](https://discourse.julialang.org/t/semidefinite-programming-with-bigfloat/88513)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 1\
**Last updated:** [October 10, 2022, 11:09pm UTC](https://discourse.julialang.org/t/semidefinite-programming-with-bigfloat/88513 "2022-10-10T23:09:52Z")

</div>

I’m looking at the package SDPAFamily.jl which provides access to arbitrary-precision semidefinite programming solvers. The README says that the JuMP interface does not support BigFloat. Is it still possible to somehow u…

---

## [Utilizing LP constraints structure with Tulip?](https://discourse.julialang.org/t/utilizing-lp-constraints-structure-with-tulip/88363)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 2\
**Last updated:** [October 8, 2022, 4:03pm UTC](https://discourse.julialang.org/t/utilizing-lp-constraints-structure-with-tulip/88363 "2022-10-08T16:03:54Z")

</div>

I’m solving many linear optimization problems that differ in variable bounds, but share the same constraints. There is no objective, i.e, I’m just looking for a feasible solution in each case. I’m using MultiFloats.Float…

---

## [Matrix inverse in constraints in \`@NLconstraint\`](https://discourse.julialang.org/t/matrix-inverse-in-constraints-in-nlconstraint/88462)

<div class="topic-metadata">

**Author:** [@Rick](https://discourse.julialang.org/u/Rick)\
**Replies:** 3\
**Last updated:** [October 9, 2022, 3:29am UTC](https://discourse.julialang.org/t/matrix-inverse-in-constraints-in-nlconstraint/88462 "2022-10-09T03:29:13Z")

</div>

Hi, I have a question related to nonlinear optimization. I am trying to impose a nonlinear constraint that involves a matrix inversion. The matrix contains a variable of the optimization model. When I try to do this via…

---

## [Default keyword arguments Optimization.jl](https://discourse.julialang.org/t/default-keyword-arguments-optimization-jl/88271)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 9\
**Last updated:** [October 8, 2022, 10:46pm UTC](https://discourse.julialang.org/t/default-keyword-arguments-optimization-jl/88271 "2022-10-08T22:46:55Z")

</div>

What are the default keyword arguments for Optimization.solve shown here? Can anyone point out to that code in Github?

---

## [Debugging in JuMP](https://discourse.julialang.org/t/debugging-in-jump/88457)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 1\
**Last updated:** [October 8, 2022, 10:39pm UTC](https://discourse.julialang.org/t/debugging-in-jump/88457 "2022-10-08T22:39:44Z")

</div>

(Soft Question): If I try to solve a problem in JuMP, and I get an error or a solution that doesn’t make sense, it usually means I incorrectly coded or misspecified the problem I was trying to solve. I can try to proofr…

---

## [Basic JuMP Question](https://discourse.julialang.org/t/basic-jump-question/88451)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 1\
**Last updated:** [October 8, 2022, 6:43pm UTC](https://discourse.julialang.org/t/basic-jump-question/88451 "2022-10-08T18:43:20Z")

</div>

I’m just trying to get a feel for how to use JuMP. I try model = Model(optimizer\_with\_attributes( Ipopt.Optimizer)) f(x) = x^2 register(model, :f, 1, f; autodiff = true) @variable(model, x) @NLconstrai…

---

## [Fast way to access results in JuMP](https://discourse.julialang.org/t/fast-way-to-access-results-in-jump/88397)

<div class="topic-metadata">

**Author:** [@TBuConst](https://discourse.julialang.org/u/TBuConst)\
**Replies:** 4\
**Last updated:** [October 8, 2022, 12:50pm UTC](https://discourse.julialang.org/t/fast-way-to-access-results-in-jump/88397 "2022-10-08T12:50:15Z")

</div>

Hello everyone, say, I have a (pretty useless - just to illustrate the problem) MIP model in JuMP using JuMP using Cbc model = Model(Cbc.Optimizer) @variable(model, x\[1:100000, 1:10, 1:2\], Bin) @constraint(model, c\[i…

---

## [Constraints not being satisfied while using vector elements as rhs](https://discourse.julialang.org/t/constraints-not-being-satisfied-while-using-vector-elements-as-rhs/88294)

<div class="topic-metadata">

**Author:** [@Gokhan\_Kof](https://discourse.julialang.org/u/Gokhan_Kof)\
**Replies:** 7\
**Last updated:** [October 8, 2022, 4:42am UTC](https://discourse.julialang.org/t/constraints-not-being-satisfied-while-using-vector-elements-as-rhs/88294 "2022-10-08T04:42:47Z")

</div>

Hi, I am trying to solve the model below but the constraints are not being satisfied if I input a vector on the rhs (u\[j\] - 1). But, when I type it with hand (34, 28). It is being satisfied. ap.p 3 ap.n 5 ap.c 3×5×5 Ar…

---

## [How to use a solution as starting point to run my NL model again after modifying something (e.g. a constraint)?](https://discourse.julialang.org/t/how-to-use-a-solution-as-starting-point-to-run-my-nl-model-again-after-modifying-something-e-g-a-constraint/88203)

<div class="topic-metadata">

**Author:** [@Angel127](https://discourse.julialang.org/u/Angel127)\
**Replies:** 2\
**Last updated:** [October 8, 2022, 4:38am UTC](https://discourse.julialang.org/t/how-to-use-a-solution-as-starting-point-to-run-my-nl-model-again-after-modifying-something-e-g-a-constraint/88203 "2022-10-08T04:38:44Z")

</div>

I have a NL model, and it finds a locally optimal solution after two hours. I would like to apply a nested for loop to use the epsilon constrained method. Then, on each iteration, some right-hand side coefficients will b…

---

## [Model creation inside a loop](https://discourse.julialang.org/t/model-creation-inside-a-loop/88183)

<div class="topic-metadata">

**Author:** [@Mariana](https://discourse.julialang.org/u/Mariana)\
**Replies:** 6\
**Last updated:** [October 8, 2022, 4:38am UTC](https://discourse.julialang.org/t/model-creation-inside-a-loop/88183 "2022-10-08T04:38:03Z")

</div>

Hello! I’m using JuMP and Cbc solver to create an optimization model for each parameter p of a parameter set P, so basically, I have a code like this: for p in P model = create\_model(p) optimize! # Store resul…

---

## [Partial tracing on a SDP @variable](https://discourse.julialang.org/t/partial-tracing-on-a-sdp-variable/88123)

<div class="topic-metadata">

**Author:** [@danuzco](https://discourse.julialang.org/u/danuzco)\
**Replies:** 1\
**Last updated:** [October 8, 2022, 4:36am UTC](https://discourse.julialang.org/t/partial-tracing-on-a-sdp-variable/88123 "2022-10-08T04:36:32Z")

</div>

I want to be able of partial tracing the X variable defined below : using ProxSDP, JuMP model = Model(with\_optimizer(ProxSDP.Optimizer, log\_verbose=false)) @variable(model, X\[1:N,1:N\], PSD) where N\>=1. I tried using Qu…

---

## [Anyone developing multinomial logistic regression?](https://discourse.julialang.org/t/anyone-developing-multinomial-logistic-regression/23222)

<div class="topic-metadata">

**Author:** [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Replies:** 19\
**Last updated:** [October 6, 2022, 9:30am UTC](https://discourse.julialang.org/t/anyone-developing-multinomial-logistic-regression/23222 "2022-10-06T09:30:02Z")

</div>

Hi all, I’m looking to write a multinomial logistic regression function (including conditional logit). From what I can see, there is no extant package that can do this. Given the popularity of such a model, I’m surprise…

---

## [NLSolve vs fsolve (matlab): What am I doing wrong?](https://discourse.julialang.org/t/nlsolve-vs-fsolve-matlab-what-am-i-doing-wrong/88095)

<div class="topic-metadata">

**Author:** [@Outeirom](https://discourse.julialang.org/u/Outeirom)\
**Replies:** 5\
**Last updated:** [October 5, 2022, 1:34pm UTC](https://discourse.julialang.org/t/nlsolve-vs-fsolve-matlab-what-am-i-doing-wrong/88095 "2022-10-05T13:34:26Z")

</div>

So, I have a code in matlab and I am trying to translate it to Julia. Can anyone help me an tell me what am I doing wrong? Basically it is a function and I need to use fsolve/ NLSolve. I put first fig below matlab codes…

---

## [New to Julia -- EAGO Nonlinear model works when finding Min but not Max?](https://discourse.julialang.org/t/new-to-julia-eago-nonlinear-model-works-when-finding-min-but-not-max/87757)

<div class="topic-metadata">

**Author:** [@lying\_syrup](https://discourse.julialang.org/u/lying_syrup)\
**Replies:** 8\
**Last updated:** [October 2, 2022, 7:31pm UTC](https://discourse.julialang.org/t/new-to-julia-eago-nonlinear-model-works-when-finding-min-but-not-max/87757 "2022-10-02T19:31:03Z")

</div>

I’m not sure if a question like this fits more here or on the EAGO GitHub. I’m very new to Julia (started using it three days ago), and I’m also not sure if this is EAGO specific. In short, I’m trying to learn to use th…

---

## [Key error when adding a complementarity condition](https://discourse.julialang.org/t/key-error-when-adding-a-complementarity-condition/87810)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 6\
**Last updated:** [September 30, 2022, 8:02pm UTC](https://discourse.julialang.org/t/key-error-when-adding-a-complementarity-condition/87810 "2022-09-30T20:02:22Z")

</div>

I’m working to translate some economics models from GAMS into Julia using the Complementarity package and I’m running into an issue where a variable is defined on a larger set than its complementary equation. Here is a s…

---

## [Get MIPGap in Gurobi callbacks JuMP 0.21](https://discourse.julialang.org/t/get-mipgap-in-gurobi-callbacks-jump-0-21/37232)

<div class="topic-metadata">

**Author:** [@bnarum](https://discourse.julialang.org/u/bnarum)\
**Replies:** 5\
**Last updated:** [September 30, 2022, 7:44pm UTC](https://discourse.julialang.org/t/get-mipgap-in-gurobi-callbacks-jump-0-21/37232 "2022-09-30T19:44:23Z")

</div>

Hi I’ve implemented a model with callbacks in Gurobi and experienced that cbget\_mipsol\_obj and cbget\_mipsol\_objbst returns the same value. Nodes | Current Node | Objective Bounds | Work Expl …

---

## [Parameters in a JuMP model](https://discourse.julialang.org/t/parameters-in-a-jump-model/87986)

<div class="topic-metadata">

**Author:** [@Marc\_D](https://discourse.julialang.org/u/Marc_D)\
**Replies:** 3\
**Last updated:** [September 30, 2022, 7:08am UTC](https://discourse.julialang.org/t/parameters-in-a-jump-model/87986 "2022-09-30T07:08:59Z")

</div>

I am new to Julia and uses JuMP to model optimizations problems. I am trying to model a problem with parameters that I could change. I didn’t how to do this and don’t know if it is actually possible to do. More concrete…

---

## [Blended Objectives/Linear Combination](https://discourse.julialang.org/t/blended-objectives-linear-combination/88016)

<div class="topic-metadata">

**Author:** [@sophiepavia](https://discourse.julialang.org/u/sophiepavia)\
**Replies:** 2\
**Last updated:** [September 30, 2022, 1:08am UTC](https://discourse.julialang.org/t/blended-objectives-linear-combination/88016 "2022-09-30T01:08:08Z")

</div>

I am writing a optimization problem where I have a Utilitarian objective and MaxMin Objective. I want to have a third objective that is a linear combination of the two aka a blended objective. I am using Gurobi. My model…

---

## [Efficient serialization of JuMP results](https://discourse.julialang.org/t/efficient-serialization-of-jump-results/87896)

<div class="topic-metadata">

**Author:** [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Replies:** 5\
**Last updated:** [September 28, 2022, 11:06pm UTC](https://discourse.julialang.org/t/efficient-serialization-of-jump-results/87896 "2022-09-28T23:06:00Z")

</div>

What is a recommended workflow for efficiently serialising results data after solving a JuMP model? The information in the numbers are the important thing, not preserving the Julia object structure. For example, does an…

---

## [Constraints that do not work together](https://discourse.julialang.org/t/constraints-that-do-not-work-together/87482)

<div class="topic-metadata">

**Author:** [@Zizilabg](https://discourse.julialang.org/u/Zizilabg)\
**Replies:** 5\
**Last updated:** [September 28, 2022, 5:26pm UTC](https://discourse.julialang.org/t/constraints-that-do-not-work-together/87482 "2022-09-28T17:26:27Z")

</div>

Hello, I wrote a model about Julia which contains 3 constraints. If I test one constraint at a time, each one works. But if I run the whole program, I get the following error message: Has anyone had this problem bef…

---

## [Why after copying a JuMP model it does not own the initial model variables?](https://discourse.julialang.org/t/why-after-copying-a-jump-model-it-does-not-own-the-initial-model-variables/87922)

<div class="topic-metadata">

**Author:** [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Replies:** 3\
**Last updated:** [September 28, 2022, 6:16pm UTC](https://discourse.julialang.org/t/why-after-copying-a-jump-model-it-does-not-own-the-initial-model-variables/87922 "2022-09-28T18:16:20Z")

</div>

I am working on a MIP problem including two variables y\[1\] and y\[2\]. y\[1\] is a binary y\[2\] is a positive real number First I relax the binary restriction by 0 \<=y\[1\] and -y\[1\] \>= -1 and solve the relaxation. c1…

---

## [Heterogenous running time Ipopt](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 5\
**Last updated:** [September 28, 2022, 12:24pm UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813 "2022-09-28T12:24:33Z")

</div>

I know that the first time running JuMP takes more time due to compilation issues but I was expecting roughly the same running time after that, however as it can be seen below the “variance” is quite high. Does someo…

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

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