# Optimization (Mathematical)

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

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

**Page:** 82

---

## [Help: policy iteration](https://discourse.julialang.org/t/help-policy-iteration/59685)

<div class="topic-metadata">

**Author:** [@ZettEff](https://discourse.julialang.org/u/ZettEff)\
**Replies:** 0\
**Last updated:** [April 20, 2021, 6:29pm UTC](https://discourse.julialang.org/t/help-policy-iteration/59685 "2021-04-20T18:29:36Z")

</div>

I am struggling with the implementation of an (toy) optimization problem using dynamic programming. Although this is not a pure Julia question, I hope someone can help me with this. Being new to dynamic programming / re…

---

## [ERROR: Unable to locate KNITRO installation, please check your environment variable KNITRODIR](https://discourse.julialang.org/t/error-unable-to-locate-knitro-installation-please-check-your-environment-variable-knitrodir/59619)

<div class="topic-metadata">

**Author:** [@yecyn](https://discourse.julialang.org/u/yecyn)\
**Replies:** 1\
**Last updated:** [April 19, 2021, 11:12pm UTC](https://discourse.julialang.org/t/error-unable-to-locate-knitro-installation-please-check-your-environment-variable-knitrodir/59619 "2021-04-19T23:12:04Z")

</div>

Hello, I’ve downloaded KNITRO from Artelys, and I have unpacked the zip file and have a folder named “knitro-12.3.0-MacOS-64” under my home file. However, while I was running the using KNITRO in jupyter notebook, I got…

---

## [Bounding Correlation Coefficients with JuMP](https://discourse.julialang.org/t/bounding-correlation-coefficients-with-jump/59589)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 2\
**Last updated:** [April 19, 2021, 7:52pm UTC](https://discourse.julialang.org/t/bounding-correlation-coefficients-with-jump/59589 "2021-04-19T19:52:54Z")

</div>

New to julia and this discussion group so I’m sorry if this is not a typical discussion topic or if I am breaching any norms here. I will do my best to pick up on things as I go. In “Convex Optimization” by Boyd there i…

---

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

<div class="topic-metadata">

**Author:** [@mjanun](https://discourse.julialang.org/u/mjanun)\
**Replies:** 4\
**Last updated:** [April 19, 2021, 7:30am UTC](https://discourse.julialang.org/t/scip-solver/59497 "2021-04-19T07:30:30Z")

</div>

How do we set number of threads for integer problems (MINLP or MILP) in SCIP? This code returns an error and I am not 100% sure that parallel\_maxnthreads is the right parameter to use. optimizer = SCIP.Optimizer(parall…

---

## [Modifying solver parameters in JuMP after building the model](https://discourse.julialang.org/t/modifying-solver-parameters-in-jump-after-building-the-model/59509)

<div class="topic-metadata">

**Author:** [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Replies:** 3\
**Last updated:** [April 18, 2021, 8:44pm UTC](https://discourse.julialang.org/t/modifying-solver-parameters-in-jump-after-building-the-model/59509 "2021-04-18T20:44:30Z")

</div>

I was working on a heuristic where I modify an ILP within a loop and solve it for a certain iterations. As of now, within the loop, I build the model repeatedly during each iteration which is costing me more time. Is the…

---

## [Getting problem data from jump model (semidefinite programming, etc.)](https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 2\
**Last updated:** [April 18, 2021, 7:42am UTC](https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327 "2021-04-18T07:42:53Z")

</div>

Hi everyone, after a quick search here and the API, I have not seen this question addressed to my liking so let me raise it: How to get the problem data in canonical form min dot(C,x) subject to Ax=b, that is from a mo…

---

## [Gradient not updating in call to optimize (Optim.jl)](https://discourse.julialang.org/t/gradient-not-updating-in-call-to-optimize-optim-jl/59448)

<div class="topic-metadata">

**Author:** [@marcus-waldman](https://discourse.julialang.org/u/marcus-waldman)\
**Replies:** 2\
**Last updated:** [April 17, 2021, 4:03pm UTC](https://discourse.julialang.org/t/gradient-not-updating-in-call-to-optimize-optim-jl/59448 "2021-04-17T16:03:57Z")

</div>

I’m trying to use the optimize function as part of the Optim.jl package with gradients that I provide. The problem I am having is that the function isn’t actually iterating–it simply computes the objective function once …

---

## [Julia contour lines issue](https://discourse.julialang.org/t/julia-contour-lines-issue/59333)

<div class="topic-metadata">

**Author:** [@safhjkas](https://discourse.julialang.org/u/safhjkas)\
**Replies:** 1\
**Last updated:** [April 15, 2021, 11:33am UTC](https://discourse.julialang.org/t/julia-contour-lines-issue/59333 "2021-04-15T11:33:51Z")

</div>

i am trying to sketch a contour lines plot by the code, but it shows “ERROR: UndefVarError: K not defined” can anyone help on how to define the K? xvec = GradientDescent(\[1;1\]) plot!(xvec\[1,1:1:K\], xvec\[2,1:1:K\], lw = …

---

## [Updating expressions for indicator constraints in JuMP](https://discourse.julialang.org/t/updating-expressions-for-indicator-constraints-in-jump/59059)

<div class="topic-metadata">

**Author:** [@Maria95](https://discourse.julialang.org/u/Maria95)\
**Replies:** 7\
**Last updated:** [April 14, 2021, 9:28pm UTC](https://discourse.julialang.org/t/updating-expressions-for-indicator-constraints-in-jump/59059 "2021-04-14T21:28:20Z")

</div>

Hello, I am trying to implement a constraint with a conditional statement that I am making piecewise affine by introducing binary variables and using the big M method. I know that JuMP supports indicator constraints but …

---

## [Gurobi with StochasticPrograms.jl](https://discourse.julialang.org/t/gurobi-with-stochasticprograms-jl/59139)

<div class="topic-metadata">

**Author:** [@arfuentes97](https://discourse.julialang.org/u/arfuentes97)\
**Replies:** 8\
**Last updated:** [April 14, 2021, 4:31pm UTC](https://discourse.julialang.org/t/gurobi-with-stochasticprograms-jl/59139 "2021-04-14T16:31:35Z")

</div>

Hi there, I’m trying to use Gurobi solver to optimize the farmer problem proposed in StochasticPrograms.jl and I get the following error message: ERROR: MethodError: no method matching all\_decisions(::DeterministicEqui…

---

## [Use Dictionary value in objective function](https://discourse.julialang.org/t/use-dictionary-value-in-objective-function/59119)

<div class="topic-metadata">

**Author:** [@rox](https://discourse.julialang.org/u/rox)\
**Replies:** 8\
**Last updated:** [April 13, 2021, 2:46pm UTC](https://discourse.julialang.org/t/use-dictionary-value-in-objective-function/59119 "2021-04-13T14:46:29Z")

</div>

Hello, I’m trying to be able to use values put in a Dictionary to weight the variables that are going to be minimized in a JuMP objective function. The dictionnary is implemented as follow : Dicopond = Dict(0=\> 1, 1 …

---

## [JuMP 0.21.7 released](https://discourse.julialang.org/t/jump-0-21-7-released/59131)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 0\
**Last updated:** [April 12, 2021, 8:42pm UTC](https://discourse.julialang.org/t/jump-0-21-7-released/59131 "2021-04-12T20:42:18Z")

</div>

Dear all, We are happy to announce the release of JuMP 0.21.7. This should be a non-breaking release, please let us know if this isn’t the case by opening a Github issue or joining the developer chatroom. A key feature…

---

## [JuMP Space Shuttle example failing](https://discourse.julialang.org/t/jump-space-shuttle-example-failing/58971)

<div class="topic-metadata">

**Author:** [@sinom](https://discourse.julialang.org/u/sinom)\
**Replies:** 1\
**Last updated:** [April 10, 2021, 9:51am UTC](https://discourse.julialang.org/t/jump-space-shuttle-example-failing/58971 "2021-04-10T09:51:12Z")

</div>

Hello all, first let me say I’m just starting out with Julia and I’m already super impressed with what can be achieved. It’s really such a well designed language as far as I can tell. I’m still using mostly Python for …

---

## [How to use interior point algorithm in GLPK](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 5\
**Last updated:** [April 9, 2021, 5:32pm UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904 "2021-04-09T17:32:14Z")

</div>

What param and value to use to set GLPK to use interior point. via set\_optimizer\_attribute Thanks Manoj

---

## [Type Stability with Named Constraints in JuMP](https://discourse.julialang.org/t/type-stability-with-named-constraints-in-jump/58878)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 12:55pm UTC](https://discourse.julialang.org/t/type-stability-with-named-constraints-in-jump/58878 "2021-04-09T12:55:27Z")

</div>

I’ve got a Nash equilibrium calculation running through JuMP that names a constraint on the row player so that the column player can be extracted (see Efficient Nash Equilibria using JuMP - #6 by Ian\_Slagle) . function …

---

## [Multiple dimensional sampling with first element string](https://discourse.julialang.org/t/multiple-dimensional-sampling-with-first-element-string/58863)

<div class="topic-metadata">

**Author:** [@GraceMabele](https://discourse.julialang.org/u/GraceMabele)\
**Replies:** 33\
**Last updated:** [April 9, 2021, 5:44am UTC](https://discourse.julialang.org/t/multiple-dimensional-sampling-with-first-element-string/58863 "2021-04-09T05:44:41Z")

</div>

Hi, My equation g below is a function of the variable d which is indexed by s,n. I would like to sampling points to be of d\[s,n\]. how do I create the correct lb and ub. using DataStructures using JuMP using Surrogates …

---

## [ArgumentError: invalid index: "s1" of type String](https://discourse.julialang.org/t/argumenterror-invalid-index-s1-of-type-string/58738)

<div class="topic-metadata">

**Author:** [@GraceMabele](https://discourse.julialang.org/u/GraceMabele)\
**Replies:** 11\
**Last updated:** [April 8, 2021, 4:41pm UTC](https://discourse.julialang.org/t/argumenterror-invalid-index-s1-of-type-string/58738 "2021-04-08T16:41:16Z")

</div>

Hi, Here is a MWE of my problem that is returning the same error. I cannot seem to understand why. using DataStructures using JuMP using TaylorSeries S = \["s1","s2","s3","s4"\] N = \[1:10\] price = OrderedDict( "s1" =\> …

---

## [Existing package to convert LP to standard form?](https://discourse.julialang.org/t/existing-package-to-convert-lp-to-standard-form/19398)

<div class="topic-metadata">

**Author:** [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Replies:** 10\
**Last updated:** [April 7, 2021, 10:27pm UTC](https://discourse.julialang.org/t/existing-package-to-convert-lp-to-standard-form/19398 "2021-04-07T22:27:12Z")

</div>

I’m working towards implementing a new type of solver for MILPs based on ADMM. This solver requires that the problem be specified as an LP in standard form (+ MI constraints). Before I go re-inventing the wheel, are th…

---

## [JuMP mutually exclusive indices iterated over the same set](https://discourse.julialang.org/t/jump-mutually-exclusive-indices-iterated-over-the-same-set/58198)

<div class="topic-metadata">

**Author:** [@Paris\_Pijuan](https://discourse.julialang.org/u/Paris_Pijuan)\
**Replies:** 5\
**Last updated:** [April 7, 2021, 5:05pm UTC](https://discourse.julialang.org/t/jump-mutually-exclusive-indices-iterated-over-the-same-set/58198 "2021-04-07T17:05:01Z")

</div>

Hello, I am new here and a relatively new Julia user. I have a constraint in a model I am writing where I have variables twice indexed over the same set, but I need the indices to iterate mutually exclusively. The code …

---

## [Odd behavior from ControlSystemIdentification and JuMP on version 1.6](https://discourse.julialang.org/t/odd-behavior-from-controlsystemidentification-and-jump-on-version-1-6/58714)

<div class="topic-metadata">

**Author:** [@jcert](https://discourse.julialang.org/u/jcert)\
**Replies:** 4\
**Last updated:** [April 7, 2021, 4:58am UTC](https://discourse.julialang.org/t/odd-behavior-from-controlsystemidentification-and-jump-on-version-1-6/58714 "2021-04-07T04:58:14Z")

</div>

Hello, I am preparing a short tutorial on how to use Julia for Control Systems and I was using Julia 1.5 and it was working ok. Then I decided to test version 1.6 to see if it would make it load faster (considering that …

---

## [Powermodels.jl SDP relaxation](https://discourse.julialang.org/t/powermodels-jl-sdp-relaxation/57165)

<div class="topic-metadata">

**Author:** [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Replies:** 9\
**Last updated:** [April 6, 2021, 7:29pm UTC](https://discourse.julialang.org/t/powermodels-jl-sdp-relaxation/57165 "2021-04-06T19:29:17Z")

</div>

Dears I have a question regrading the Powermodels.jl package. Does it support the SDP relaxation? I have seen that it was mentioned in the documentation that it is supported (SDPWRMPowerModel). However, it didn’t work e…

---

## [Using Gurobi with PowerModels](https://discourse.julialang.org/t/using-gurobi-with-powermodels/58688)

<div class="topic-metadata">

**Author:** [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Replies:** 1\
**Last updated:** [April 6, 2021, 7:28pm UTC](https://discourse.julialang.org/t/using-gurobi-with-powermodels/58688 "2021-04-06T19:28:35Z")

</div>

Dears How to use Gurobi to solve optimization problems for PowerModels? Regards

---

## [Type unstability with container generation in JuMP](https://discourse.julialang.org/t/type-unstability-with-container-generation-in-jump/58433)

<div class="topic-metadata">

**Author:** [@etienne\_dg](https://discourse.julialang.org/u/etienne_dg)\
**Replies:** 4\
**Last updated:** [April 6, 2021, 5:55pm UTC](https://discourse.julialang.org/t/type-unstability-with-container-generation-in-jump/58433 "2021-04-06T17:55:24Z")

</div>

Hi, julia\> model = Model(Gurobi.Optimizer) julia\> @variable(model, a\[x in 1:10; x \< 5\], Bin) JuMP.Containers.SparseAxisArray{VariableRef, 1, Tuple{Int64}} with 4 entries: julia\> @variable(model, b\[x in 1:10; x \> 15\], …

---

## [Lazy constraint callback issue with GLPK](https://discourse.julialang.org/t/lazy-constraint-callback-issue-with-glpk/58345)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 5\
**Last updated:** [April 5, 2021, 11:28pm UTC](https://discourse.julialang.org/t/lazy-constraint-callback-issue-with-glpk/58345 "2021-04-05T23:28:07Z")

</div>

Hi , The callback is not working in GLPK. The below code is working in fine Gurobi. using JuMP, Gurobi,MathOptInterface,GLPK model = Model(Gurobi.Optimizer) set\_optimizer\_attribute(model, "OutputFlag", 0) …

---

## [Design preconditioner for unconstrained optimization problem](https://discourse.julialang.org/t/design-preconditioner-for-unconstrained-optimization-problem/58650)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 0\
**Last updated:** [April 5, 2021, 10:35pm UTC](https://discourse.julialang.org/t/design-preconditioner-for-unconstrained-optimization-problem/58650 "2021-04-05T22:35:33Z")

</div>

Hello, I am working on the greedy algorithm developed in Baptista et al. (https://arxiv.org/pdf/2009.10303.pdf) to approximate the components of a transport map S (aka normalizing flow) that pushes forward a target den…

---

## [Obtaining Irreducible Inconsistent Subsystem (IIS) with JumP - Gurobi](https://discourse.julialang.org/t/obtaining-irreducible-inconsistent-subsystem-iis-with-jump-gurobi/58491)

<div class="topic-metadata">

**Author:** [@priantop](https://discourse.julialang.org/u/priantop)\
**Replies:** 2\
**Last updated:** [April 5, 2021, 9:27pm UTC](https://discourse.julialang.org/t/obtaining-irreducible-inconsistent-subsystem-iis-with-jump-gurobi/58491 "2021-04-05T21:27:11Z")

</div>

Hi, I am kind of new to Julia (+/- 3 months of usage) I am trying to find which constraints are members of IIS of an Infeasible or Unbounded optimisation problem. For example, I have the following script using JuMP, G…

---

## [How to get ticks elapsed by CPLEX solver with JuMP?](https://discourse.julialang.org/t/how-to-get-ticks-elapsed-by-cplex-solver-with-jump/58619)

<div class="topic-metadata">

**Author:** [@Antell](https://discourse.julialang.org/u/Antell)\
**Replies:** 1\
**Last updated:** [April 5, 2021, 4:04pm UTC](https://discourse.julialang.org/t/how-to-get-ticks-elapsed-by-cplex-solver-with-jump/58619 "2021-04-05T16:04:43Z")

</div>

I would like to call the getDetTime function from IBM Documentation on a model, in order to get the amount of deterministic ticks that have elapsed during a call to optimize!. I cannot figure out how to use the new CPLEX…

---

## [JuMP optimize! call will very rarely violate model's time limit parameters by huge factors?](https://discourse.julialang.org/t/jump-optimize-call-will-very-rarely-violate-models-time-limit-parameters-by-huge-factors/58061)

<div class="topic-metadata">

**Author:** [@Antell](https://discourse.julialang.org/u/Antell)\
**Replies:** 18\
**Last updated:** [April 5, 2021, 2:50pm UTC](https://discourse.julialang.org/t/jump-optimize-call-will-very-rarely-violate-models-time-limit-parameters-by-huge-factors/58061 "2021-04-05T14:50:41Z")

</div>

I am doing research that involves incrementally loosening the relative parameter setting of a MIPS optimizer, in order to enable faster termination. Normally, this strategy works quite well. However, very rarely a call t…

---

## [How to fix Error: Method error: objects of type GenericAffExpr{Float64, VariableRef} are not callable](https://discourse.julialang.org/t/how-to-fix-error-method-error-objects-of-type-genericaffexpr-float64-variableref-are-not-callable/58495)

<div class="topic-metadata">

**Author:** [@GraceMabele](https://discourse.julialang.org/u/GraceMabele)\
**Replies:** 3\
**Last updated:** [April 5, 2021, 12:40pm UTC](https://discourse.julialang.org/t/how-to-fix-error-method-error-objects-of-type-genericaffexpr-float64-variableref-are-not-callable/58495 "2021-04-05T12:40:13Z")

</div>

I would like to create a Taylor expansion of an objective function but I am having trouble as the objective function is a Generic affline expression. Is there a way to use the convert () to convert the form? This is the…

---

## [SymPy function with 2 variables](https://discourse.julialang.org/t/sympy-function-with-2-variables/58538)

<div class="topic-metadata">

**Author:** [@statspy](https://discourse.julialang.org/u/statspy)\
**Replies:** 4\
**Last updated:** [April 4, 2021, 7:02pm UTC](https://discourse.julialang.org/t/sympy-function-with-2-variables/58538 "2021-04-04T19:02:22Z")

</div>

i am trying: julia\> a=Equality(x^2 + y^3, 31) i would like to get x=2 and y=3. How ca i do it? I tried solve(a,\[x,y\]) and solve(a) but i am getting: (-sqrt(31 - y^3), y) (sqrt(31 - y^3), y)

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

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