# Optimization (Mathematical)

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

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

**Page:** 89

---

## [Using Julia to solve the student final project allocation problem](https://discourse.julialang.org/t/using-julia-to-solve-the-student-final-project-allocation-problem/51019)

<div class="topic-metadata">

**Author:** [@sui](https://discourse.julialang.org/u/sui)\
**Replies:** 7\
**Last updated:** [December 2, 2020, 8:56am UTC](https://discourse.julialang.org/t/using-julia-to-solve-the-student-final-project-allocation-problem/51019 "2020-12-02T08:56:26Z")

</div>

I am doing a project that I have to use Julia code to solve a student’s final project allocation problem. I am kind of new to this kind of coding and new for Julia. I need some help with this. Start with the problem, I …

---

## [Why do I get this error "UndefVarError: cov not defined"](https://discourse.julialang.org/t/why-do-i-get-this-error-undefvarerror-cov-not-defined/50239)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 16\
**Last updated:** [November 30, 2020, 6:42pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-undefvarerror-cov-not-defined/50239 "2020-11-30T18:42:28Z")

</div>

Could someone help me solve the error: UndefVarError: cov not defined of the test code taken from the site JuMPeR - Robust Optimization with JuMP — JuMPeR -- Julia for Mathematical Programming 0.0 documentation Did thi…

---

## [Not sure how to generate ForwardDiff function](https://discourse.julialang.org/t/not-sure-how-to-generate-forwarddiff-function/51030)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 1\
**Last updated:** [December 1, 2020, 6:01am UTC](https://discourse.julialang.org/t/not-sure-how-to-generate-forwarddiff-function/51030 "2020-12-01T06:01:21Z")

</div>

I try to run this, but it says there is a format problem, I think with line 3 (fp(x)) using ForwardDiff f(x)=x^6-2 fp(x) = x-\>ForwardDiff.derivative(f, x) x=1.5 x=x-(f(x)/fp(x))

---

## [BoundsError: attempt to access Float64 using ModelingToolkit.jl and AutoOptimize.jl to optimize a DifferentialEquations.jl model](https://discourse.julialang.org/t/boundserror-attempt-to-access-float64-using-modelingtoolkit-jl-and-autooptimize-jl-to-optimize-a-differentialequations-jl-model/51000)

<div class="topic-metadata">

**Author:** [@claudio20497](https://discourse.julialang.org/u/claudio20497)\
**Replies:** 1\
**Last updated:** [December 1, 2020, 4:35am UTC](https://discourse.julialang.org/t/boundserror-attempt-to-access-float64-using-modelingtoolkit-jl-and-autooptimize-jl-to-optimize-a-differentialequations-jl-model/51000 "2020-12-01T04:35:19Z")

</div>

Hello, I’m trying to optimize the code and finding the best solve algorithm for an epidemiological model. Anyway, I get an error that due to my inexperience I cannot solve. So below is a simplified verison of the model…

---

## [Optim, Forward Differentiation and OnceDifferentiable with MLE](https://discourse.julialang.org/t/optim-forward-differentiation-and-oncedifferentiable-with-mle/16320)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 18\
**Last updated:** [November 28, 2020, 8:52pm UTC](https://discourse.julialang.org/t/optim-forward-differentiation-and-oncedifferentiable-with-mle/16320 "2020-11-28T20:52:36Z")

</div>

Hi guys, I am estimating a model by Maximum Likelihood. So far, I’ve been using Nelder-Mead as the optimization method where I don’t need to provide any gradient or Hessian. Convergence has been somewhat slow, and I usu…

---

## [Question about JuMP](https://discourse.julialang.org/t/question-about-jump/50675)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 3\
**Last updated:** [November 26, 2020, 6:52am UTC](https://discourse.julialang.org/t/question-about-jump/50675 "2020-11-26T06:52:42Z")

</div>

there is something wrong with my JuMP! It used to work!why? :persevere: thank you!

---

## [Pass optional parameters to model in DifferentialEquations.jl](https://discourse.julialang.org/t/pass-optional-parameters-to-model-in-differentialequations-jl/50718)

<div class="topic-metadata">

**Author:** [@claudio20497](https://discourse.julialang.org/u/claudio20497)\
**Replies:** 2\
**Last updated:** [November 25, 2020, 8:59am UTC](https://discourse.julialang.org/t/pass-optional-parameters-to-model-in-differentialequations-jl/50718 "2020-11-25T08:59:51Z")

</div>

Hello, I would like to pass optional arguments to a DifferentialEquations.jl ODE model at ODEProblem time. Those optional arguments are meant to alter the model without using the p argument which I would like to save fo…

---

## [Unable to retrieve solution after solving JuMP model](https://discourse.julialang.org/t/unable-to-retrieve-solution-after-solving-jump-model/50720)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 2\
**Last updated:** [November 25, 2020, 1:41am UTC](https://discourse.julialang.org/t/unable-to-retrieve-solution-after-solving-jump-model/50720 "2020-11-25T01:41:58Z")

</div>

I have a large code that solves an optimization model. To keep the code clean I am trying to move the part that calls the optimizer and retrieve solution to a separate function. Even though I am able to solve the model t…

---

## [JuMP: Register arbitary number of functions and use as constraints](https://discourse.julialang.org/t/jump-register-arbitary-number-of-functions-and-use-as-constraints/19692)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 7\
**Last updated:** [November 24, 2020, 10:01pm UTC](https://discourse.julialang.org/t/jump-register-arbitary-number-of-functions-and-use-as-constraints/19692 "2020-11-24T22:01:29Z")

</div>

I am doing some optimisation, the problems all look the same but the number of variables differ. I am trying to create a function which will do the optimisation problem in one line (optimise\_this(some\_problem)). The prob…

---

## [Abc\_inference with parallel = true gives error in DifferentialEquations.jl](https://discourse.julialang.org/t/abc-inference-with-parallel-true-gives-error-in-differentialequations-jl/50681)

<div class="topic-metadata">

**Author:** [@claudio20497](https://discourse.julialang.org/u/claudio20497)\
**Replies:** 2\
**Last updated:** [November 24, 2020, 3:56pm UTC](https://discourse.julialang.org/t/abc-inference-with-parallel-true-gives-error-in-differentialequations-jl/50681 "2020-11-24T15:56:59Z")

</div>

Hello, I get a strange error when setting parallel = true in abc\_inference. So I start by opening a julia REPL, enable julia to use multiple cores and launch jupyterlab: |julia\> ENV\["JULIA\_NUM\_THREADS"\] = 5 5 |julia\> …

---

## [Error: JuMP model variable not defined](https://discourse.julialang.org/t/error-jump-model-variable-not-defined/50670)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 5\
**Last updated:** [November 24, 2020, 12:22pm UTC](https://discourse.julialang.org/t/error-jump-model-variable-not-defined/50670 "2020-11-24T12:22:24Z")

</div>

I am trying to use the package Dualization.jl, to reformulate a primal problem and solving the dual model separately. However, after solving I am not able to access the solution (the variable values) as they don’t seem t…

---

## [Ipopt Fails in ver. 1.5.3!](https://discourse.julialang.org/t/ipopt-fails-in-ver-1-5-3/50600)

<div class="topic-metadata">

**Author:** [@Amirrezz94](https://discourse.julialang.org/u/Amirrezz94)\
**Replies:** 13\
**Last updated:** [November 23, 2020, 10:57pm UTC](https://discourse.julialang.org/t/ipopt-fails-in-ver-1-5-3/50600 "2020-11-23T22:57:56Z")

</div>

Hi, I just updated the julia to version 1.5.3 on windows 10 and I faced the this error when I tried to solve an optimization problem with JuMP and Ipopt: “EXIT: Restoration Failed!”. Even I tried a very basic problem l…

---

## [Binary integer variable returned as float64](https://discourse.julialang.org/t/binary-integer-variable-returned-as-float64/50647)

<div class="topic-metadata">

**Author:** [@bvilmann](https://discourse.julialang.org/u/bvilmann)\
**Replies:** 4\
**Last updated:** [November 23, 2020, 10:53pm UTC](https://discourse.julialang.org/t/binary-integer-variable-returned-as-float64/50647 "2020-11-23T22:53:39Z")

</div>

I have a mixed-integer optimization problem with two variables: A binary integer, x, and a float, P\_G I was a little surprised that the value matrix of the binary integer variable was of type float64 and not int64: jul…

---

## [Improving performance (Stochastic Path + Ipopt/Jump Optim on 32 cores/132RAM)](https://discourse.julialang.org/t/improving-performance-stochastic-path-ipopt-jump-optim-on-32-cores-132ram/50510)

<div class="topic-metadata">

**Author:** [@Bruno](https://discourse.julialang.org/u/Bruno)\
**Replies:** 6\
**Last updated:** [November 23, 2020, 3:37am UTC](https://discourse.julialang.org/t/improving-performance-stochastic-path-ipopt-jump-optim-on-32-cores-132ram/50510 "2020-11-23T03:37:51Z")

</div>

Hello! I’ve created a gist with some Julia code. Basically I generate a path of a stochastic process (size 1000 array) and use it to analytically estimate one of the parameters (via nonlinear optim on a max likelihood su…

---

## [Unusual JuMP and NLopt problem](https://discourse.julialang.org/t/unusual-jump-and-nlopt-problem/50595)

<div class="topic-metadata">

**Author:** [@optimist](https://discourse.julialang.org/u/optimist)\
**Replies:** 4\
**Last updated:** [November 22, 2020, 11:59pm UTC](https://discourse.julialang.org/t/unusual-jump-and-nlopt-problem/50595 "2020-11-22T23:59:13Z")

</div>

This is a rather unusual problem for JuMP as I am using it to find roots of a function. I have tried Optim and Roots packages but I find them frequently failing-most likely due to the way I use them! IntervalRootFinding …

---

## [Get infeasibility certificate in CPLEX or Gurobi](https://discourse.julialang.org/t/get-infeasibility-certificate-in-cplex-or-gurobi/50506)

<div class="topic-metadata">

**Author:** [@pkienscherf](https://discourse.julialang.org/u/pkienscherf)\
**Replies:** 3\
**Last updated:** [November 20, 2020, 7:18pm UTC](https://discourse.julialang.org/t/get-infeasibility-certificate-in-cplex-or-gurobi/50506 "2020-11-20T19:18:09Z")

</div>

Hi, I’m trying to retrieve an extreme/dual infeasibility ray from a JuMP Model. I tried to do so with the GLPK, CPLEX, and Gurobi Solvers. I currently have the following versions installed: \[a076750e\] CPLEX v0.7.3 …

---

## [Query root relaxation values with JuMP](https://discourse.julialang.org/t/query-root-relaxation-values-with-jump/50465)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 2\
**Last updated:** [November 20, 2020, 2:23pm UTC](https://discourse.julialang.org/t/query-root-relaxation-values-with-jump/50465 "2020-11-20T14:23:42Z")

</div>

Whats the easiest way to query root relaxation value with JuMP? I’m reoptimizing and setting “NodeLimit” parameter to 1.

---

## [Overnight a ERROR: StackOverflowError: in unchanged code](https://discourse.julialang.org/t/overnight-a-error-stackoverflowerror-in-unchanged-code/50449)

<div class="topic-metadata">

**Author:** [@GerhardTotschnig](https://discourse.julialang.org/u/GerhardTotschnig)\
**Replies:** 3\
**Last updated:** [November 19, 2020, 9:22pm UTC](https://discourse.julialang.org/t/overnight-a-error-stackoverflowerror-in-unchanged-code/50449 "2020-11-19T21:22:43Z")

</div>

Up to yesterday I had no problem with the code: https://github.com/GerhardTotschnig/Seasonal I think the code is unchanged. And the code still works on other computers. Starting from the REPL julia\>include("SeasUL.jl…

---

## [Redundant and non-redundant constraints](https://discourse.julialang.org/t/redundant-and-non-redundant-constraints/50314)

<div class="topic-metadata">

**Author:** [@kat\_mt](https://discourse.julialang.org/u/kat_mt)\
**Replies:** 5\
**Last updated:** [November 19, 2020, 9:20pm UTC](https://discourse.julialang.org/t/redundant-and-non-redundant-constraints/50314 "2020-11-19T21:20:14Z")

</div>

Hello! I need to solve a LP model with CPLEX and find which of constraints are non redundant. After solving, it gives me the following message: Tried aggregator 1 time. LP Presolve eliminated 22 rows and 0 columns. R…

---

## [New Gurobi.jl syntax trouble](https://discourse.julialang.org/t/new-gurobi-jl-syntax-trouble/50344)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 2\
**Last updated:** [November 18, 2020, 1:04pm UTC](https://discourse.julialang.org/t/new-gurobi-jl-syntax-trouble/50344 "2020-11-18T13:04:16Z")

</div>

Hi all I’ve got some issues in adapting to the new Gurobi.jl syntax. For example, this is a callback that I made in the old syntax: function cb(cb\_data, cb\_where) if cb\_where == CB\_MIPNODE #first node …

---

## [Sum-Of-Squares SOC constraint in JuMP](https://discourse.julialang.org/t/sum-of-squares-soc-constraint-in-jump/50091)

<div class="topic-metadata">

**Author:** [@andrewrosemberg](https://discourse.julialang.org/u/andrewrosemberg)\
**Replies:** 5\
**Last updated:** [November 16, 2020, 8:52am UTC](https://discourse.julialang.org/t/sum-of-squares-soc-constraint-in-jump/50091 "2020-11-16T08:52:04Z")

</div>

I’m trying to add a constraint of type (x'Ax \<= b) in JuMP to be interpreted as SOC by the solver. A is Positive definite. Seems to be the same error as presented in this issue, but A+A' has positive eigenvalues: eigv…

---

## [JuMP model Polyhedron](https://discourse.julialang.org/t/jump-model-polyhedron/50108)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 11\
**Last updated:** [November 18, 2020, 1:33am UTC](https://discourse.julialang.org/t/jump-model-polyhedron/50108 "2020-11-18T01:33:34Z")

</div>

Hi, I am trying to plot the feasible set of a JuMP model as a 3D figure. I have used the syntax provided in Polyhedra.jl documentation to create a polyhedron: Optimization · Polyhedra A simple example is given below: …

---

## [Float64 error when using ForwardDiff.gradient for nested functions](https://discourse.julialang.org/t/float64-error-when-using-forwarddiff-gradient-for-nested-functions/50343)

<div class="topic-metadata">

**Author:** [@yips](https://discourse.julialang.org/u/yips)\
**Replies:** 0\
**Last updated:** [November 17, 2020, 11:22pm UTC](https://discourse.julialang.org/t/float64-error-when-using-forwarddiff-gradient-for-nested-functions/50343 "2020-11-17T23:22:54Z")

</div>

I am trying to use ForwardDiff.gradient find the gradient of the following function: function loss\_test(x::Array{T,2},SecreteFuncs,pInf::Array{T,2},cmat::Array{T,2}) where {T \<: Real} cmat\_sol = Findcss(x,SecreteFuncs…

---

## [Optimization of Curves](https://discourse.julialang.org/t/optimization-of-curves/50312)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 8\
**Last updated:** [November 17, 2020, 8:50pm UTC](https://discourse.julialang.org/t/optimization-of-curves/50312 "2020-11-17T20:50:55Z")

</div>

What is a good option for finding the x value of a tangent point of a curve (such as matching price and value), or finding the minimum or maximum of a curve.

---

## [Error with JuMP.model function](https://discourse.julialang.org/t/error-with-jump-model-function/50190)

<div class="topic-metadata">

**Author:** [@erikbjornerem](https://discourse.julialang.org/u/erikbjornerem)\
**Replies:** 2\
**Last updated:** [November 16, 2020, 11:34am UTC](https://discourse.julialang.org/t/error-with-jump-model-function/50190 "2020-11-16T11:34:12Z")

</div>

Hi, I’m relatively new to Julia and the JuMP package. The other day I also got the MathOptInterface package in order to export my LP model as a LP-file to be used in LPsolve by a fellow student. However after doing so I…

---

## [JuMP: defining objective function uses matrix multiplication](https://discourse.julialang.org/t/jump-defining-objective-function-uses-matrix-multiplication/50169)

<div class="topic-metadata">

**Author:** [@kausban](https://discourse.julialang.org/u/kausban)\
**Replies:** 4\
**Last updated:** [November 15, 2020, 10:52pm UTC](https://discourse.julialang.org/t/jump-defining-objective-function-uses-matrix-multiplication/50169 "2020-11-15T22:52:24Z")

</div>

Hi I am trying to recreate a relatively simple optimization function that I have working with python using (casadi + ipopt). I am having some trouble figuring out how I can describe the objective function since it invol…

---

## [Study of robust optimization](https://discourse.julialang.org/t/study-of-robust-optimization/50062)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 0\
**Last updated:** [November 12, 2020, 6:35pm UTC](https://discourse.julialang.org/t/study-of-robust-optimization/50062 "2020-11-12T18:35:55Z")

</div>

I am studying about robust optimization models in Julia, I found some good examples but they are still not clear to me. Could someone help me by putting a simple example on the reformulation method and on the cut plan m…

---

## [Optim.jl : ParticleSwarm Multithreading at the function level](https://discourse.julialang.org/t/optim-jl-particleswarm-multithreading-at-the-function-level/50117)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 9\
**Last updated:** [November 14, 2020, 9:04pm UTC](https://discourse.julialang.org/t/optim-jl-particleswarm-multithreading-at-the-function-level/50117 "2020-11-14T21:04:16Z")

</div>

Hi, I’m using the PSO algorithm in Optim.jl to minimise a certain loss function, which is a positive multinomial of very high degree (over a constraint domain, a product of several simplexes), and the optimisation is do…

---

## [Solve minimization problem where constraint is the system of linear inequation with MathOptInterface efficiently](https://discourse.julialang.org/t/solve-minimization-problem-where-constraint-is-the-system-of-linear-inequation-with-mathoptinterface-efficiently/23571)

<div class="topic-metadata">

**Author:** [@Yuya-Furusawa](https://discourse.julialang.org/u/Yuya-Furusawa)\
**Replies:** 11\
**Last updated:** [November 12, 2020, 10:29pm UTC](https://discourse.julialang.org/t/solve-minimization-problem-where-constraint-is-the-system-of-linear-inequation-with-mathoptinterface-efficiently/23571 "2020-11-12T22:29:21Z")

</div>

I want to solve min cx s.t. Ax + b \< 0 with MathOptInterface, where A is a matrix and b and c are vectors. However, I couldn’t understand the documentation of MathOptInterface. Currently, my code is as follows: (No…

---

## [Using Generalized Likelihood with one dimesional time series as data in DifferentialEquations.jl](https://discourse.julialang.org/t/using-generalized-likelihood-with-one-dimesional-time-series-as-data-in-differentialequations-jl/49989)

<div class="topic-metadata">

**Author:** [@claudio20497](https://discourse.julialang.org/u/claudio20497)\
**Replies:** 1\
**Last updated:** [November 12, 2020, 10:20am UTC](https://discourse.julialang.org/t/using-generalized-likelihood-with-one-dimesional-time-series-as-data-in-differentialequations-jl/49989 "2020-11-12T10:20:36Z")

</div>

I anticipate that this question could be down to my ignorance in statistics. I’m trying to apply the DifferentialEquations.jl tutorial on how to use Generalized Likelihood to a particular case in which the data is a one…

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

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