# Optimization (Mathematical)

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

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

**Page:** 128

---

## [Cannot collect variables with index not starting from 1 in a vector](https://discourse.julialang.org/t/cannot-collect-variables-with-index-not-starting-from-1-in-a-vector/2739)

<div class="topic-metadata">

**Author:** [@Wei\_Wang](https://discourse.julialang.org/u/Wei_Wang)\
**Replies:** 5\
**Last updated:** [March 22, 2017, 8:51pm UTC](https://discourse.julialang.org/t/cannot-collect-variables-with-index-not-starting-from-1-in-a-vector/2739 "2017-03-22T20:51:09Z")

</div>

Hi, I am trying to create anonymous variables and collect them in a vector. But only those with index starting from 1 can be collected. Others will result in error. Is there any method to push those variables into a vec…

---

## [An elegant way to construct recursive objective?](https://discourse.julialang.org/t/an-elegant-way-to-construct-recursive-objective/2503)

<div class="topic-metadata">

**Author:** [@xqrongm](https://discourse.julialang.org/u/xqrongm)\
**Replies:** 5\
**Last updated:** [March 20, 2017, 4:33am UTC](https://discourse.julialang.org/t/an-elegant-way-to-construct-recursive-objective/2503 "2017-03-20T04:33:51Z")

</div>

I need to fit a model on a vector f of length n, where f\[i\] is recursively calculated from f\[i-1\]. There is another vector d of length n related to f in the following way: f\[i\] = f0 + d\[i\] d\[1\] = d0 + k \* log(1 + d0 / k…

---

## [Issue with Julia MPC Out of Bounds Error](https://discourse.julialang.org/t/issue-with-julia-mpc-out-of-bounds-error/2720)

<div class="topic-metadata">

**Author:** [@Angshuman\_Goswami](https://discourse.julialang.org/u/Angshuman_Goswami)\
**Replies:** 1\
**Last updated:** [March 16, 2017, 10:57pm UTC](https://discourse.julialang.org/t/issue-with-julia-mpc-out-of-bounds-error/2720 "2017-03-16T22:57:57Z")

</div>

\#!/usr/bin/env julia #= \*\* Licensing Information: You are free to use or extend these projects for \*\* \*\* education or research purposes provided that (1) you retain this notice\*\* \*\* and (2) you provide clear attribut…

---

## [Issue Solving BQPs with JuMP+CPLEX](https://discourse.julialang.org/t/issue-solving-bqps-with-jump-cplex/2624)

<div class="topic-metadata">

**Author:** [@omalled](https://discourse.julialang.org/u/omalled)\
**Replies:** 8\
**Last updated:** [March 14, 2017, 5:17pm UTC](https://discourse.julialang.org/t/issue-solving-bqps-with-jump-cplex/2624 "2017-03-14T17:17:34Z")

</div>

I am having some trouble solving binary quadratic programs with JuMP and CPLEX. Here is some code that illustrates the problem: import JuMP import CPLEX function bqp(Q, c) m = JuMP.Model(solver=CPLEX.CplexSolver()) @…

---

## [Modeling large dense LP with jump](https://discourse.julialang.org/t/modeling-large-dense-lp-with-jump/2557)

<div class="topic-metadata">

**Author:** [@Pierre-Louis\_Poirion](https://discourse.julialang.org/u/Pierre-Louis_Poirion)\
**Replies:** 1\
**Last updated:** [March 9, 2017, 10:29pm UTC](https://discourse.julialang.org/t/modeling-large-dense-lp-with-jump/2557 "2017-03-09T22:29:30Z")

</div>

Hi I am solve large dense LP (10^5 variables almost all coeff are non-zero) with jump and cplex. Now i am modeling the problem with the matrix: @constraint(m, A\*x==b) But it takes some time to create the model. Is t…

---

## [New to Optimization - Guidance](https://discourse.julialang.org/t/new-to-optimization-guidance/2527)

<div class="topic-metadata">

**Author:** [@andrewg](https://discourse.julialang.org/u/andrewg)\
**Replies:** 5\
**Last updated:** [March 9, 2017, 9:49am UTC](https://discourse.julialang.org/t/new-to-optimization-guidance/2527 "2017-03-09T09:49:06Z")

</div>

Hi, I’m trying to implement an algorithm from a paper\[1\] which includes a nonlinear optimization. I’ve never done any optimization before, aside from fitting curves with inverting matrices. I’m struggling to work out wh…

---

## [Staffjoy Scheduling Algorithm in Julia, Now Open Source](https://discourse.julialang.org/t/staffjoy-scheduling-algorithm-in-julia-now-open-source/2468)

<div class="topic-metadata">

**Author:** [@philipithomas](https://discourse.julialang.org/u/philipithomas)\
**Replies:** 0\
**Last updated:** [March 5, 2017, 6:57am UTC](https://discourse.julialang.org/t/staffjoy-scheduling-algorithm-in-julia-now-open-source/2468 "2017-03-05T06:57:54Z")

</div>

Hi all - about three years ago, I discovered Julia and the JuliaOpt community, which rekindled an interest in applying optimization mathematics to workforce scheduling problems. Previously, I had worked on such problems …

---

## [solvePnP in JuMP (Pose Estimation)](https://discourse.julialang.org/t/solvepnp-in-jump-pose-estimation/2408)

<div class="topic-metadata">

**Author:** [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Replies:** 3\
**Last updated:** [March 3, 2017, 3:18pm UTC](https://discourse.julialang.org/t/solvepnp-in-jump-pose-estimation/2408 "2017-03-03T15:18:08Z")

</div>

first steps in JuMP How can I solve the PnP problem using JuMP? I have a set of labeled 2d points with the corresponding 3d points. The camera matrix K is known. For any given R(3-element unit quaternion representing…

---

## [Read cplex .sol and match to JUmP variables](https://discourse.julialang.org/t/read-cplex-sol-and-match-to-jump-variables/2388)

<div class="topic-metadata">

**Author:** [@sshrabah](https://discourse.julialang.org/u/sshrabah)\
**Replies:** 0\
**Last updated:** [March 1, 2017, 4:45pm UTC](https://discourse.julialang.org/t/read-cplex-sol-and-match-to-jump-variables/2388 "2017-03-01T16:45:54Z")

</div>

I am using the writeLP to export my jump model. I import generated .lp file in a remote cplex, then i export the solution the a .sol file. is there function to read and match the variable to JUmP’s exp readSol(file.so…

---

## [How to create a JuMP constraint with coeffs and rhs?](https://discourse.julialang.org/t/how-to-create-a-jump-constraint-with-coeffs-and-rhs/2328)

<div class="topic-metadata">

**Author:** [@bbrunaud](https://discourse.julialang.org/u/bbrunaud)\
**Replies:** 2\
**Last updated:** [March 1, 2017, 6:12am UTC](https://discourse.julialang.org/t/how-to-create-a-jump-constraint-with-coeffs-and-rhs/2328 "2017-03-01T06:12:20Z")

</div>

Hello. I’m trying to run an algorithm generating Gomory cuts. I managed to get the right tableau row. Now I would like to add the cut to the JuMP model having a vector of indices, coeffs, sense and rhs. So far I could o…

---

## [Announcement: JuMP 0.16 released](https://discourse.julialang.org/t/announcement-jump-0-16-released/2289)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 0\
**Last updated:** [February 24, 2017, 10:17pm UTC](https://discourse.julialang.org/t/announcement-jump-0-16-released/2289 "2017-02-24T22:17:01Z")

</div>

We’re pleased to announce the release of JuMP 0.16. The release has three breaking changes that may affect many users, so keep reading. JuMP’s method for loading default solvers was a source of confusion and not compa…

---

## [Newbie Looking for Help - Code failing after adjusting constraints](https://discourse.julialang.org/t/newbie-looking-for-help-code-failing-after-adjusting-constraints/2230)

<div class="topic-metadata">

**Author:** [@Pigskinablanket](https://discourse.julialang.org/u/Pigskinablanket)\
**Replies:** 1\
**Last updated:** [February 22, 2017, 10:42am UTC](https://discourse.julialang.org/t/newbie-looking-for-help-code-failing-after-adjusting-constraints/2230 "2017-02-22T10:42:57Z")

</div>

Background - I am new at this and I didnt stay at a Holiday Inn Express last night, so I am struggling. I am using Julia/Jump code to Optimize lineup for Daily Fatasy Hockey with moderate success. I am working to conver…

---

## [Newbie Q: printing solver progress to console](https://discourse.julialang.org/t/newbie-q-printing-solver-progress-to-console/2189)

<div class="topic-metadata">

**Author:** [@Sam-H](https://discourse.julialang.org/u/Sam-H)\
**Replies:** 2\
**Last updated:** [February 21, 2017, 6:04pm UTC](https://discourse.julialang.org/t/newbie-q-printing-solver-progress-to-console/2189 "2017-02-21T18:04:37Z")

</div>

I’m using Atom and having trouble getting it to print solver progress to the console. I’ve tried changing the ‘verbose’ parameter of the Cbc solver, and the STREAM\_MSG and STREAM\_LOG parameters of Mosek (free trial licen…

---

## [Avoiding a nonlinear expression in JuMP](https://discourse.julialang.org/t/avoiding-a-nonlinear-expression-in-jump/2190)

<div class="topic-metadata">

**Author:** [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Replies:** 2\
**Last updated:** [February 20, 2017, 5:26pm UTC](https://discourse.julialang.org/t/avoiding-a-nonlinear-expression-in-jump/2190 "2017-02-20T17:26:47Z")

</div>

Hello, I have formulated a flow conservation constraint in JuMP for a linear model. @constraint(SPF\_IM, cons5\[t in aggList, c in t.VNFChains, n in subGraph.nodes\], sum((fI\[t.ID,c.ID,e.ID\] - fO\[t.ID,c.ID…

---

## [Copy nonlinear models](https://discourse.julialang.org/t/copy-nonlinear-models/2111)

<div class="topic-metadata">

**Author:** [@Yankai\_Cao](https://discourse.julialang.org/u/Yankai_Cao)\
**Replies:** 1\
**Last updated:** [February 15, 2017, 3:08pm UTC](https://discourse.julialang.org/t/copy-nonlinear-models/2111 "2017-02-15T15:08:33Z")

</div>

Is there any function to copy a nonlinear model? Also, I want to know how to combine two models, e.g., I want to combine the variables and constriants from two models into a new model and create a new objective using th…

---

## [Linear parameter](https://discourse.julialang.org/t/linear-parameter/2112)

<div class="topic-metadata">

**Author:** [@Yankai\_Cao](https://discourse.julialang.org/u/Yankai_Cao)\
**Replies:** 2\
**Last updated:** [February 15, 2017, 1:49pm UTC](https://discourse.julialang.org/t/linear-parameter/2112 "2017-02-15T13:49:49Z")

</div>

I want to define a parameter so that the model will change if I set a different value for the parameter. The following is an example, while the real problem is much more complicated. using JuMP model = Model() @variab…

---

## [Getting constraint values using JuMP](https://discourse.julialang.org/t/getting-constraint-values-using-jump/1996)

<div class="topic-metadata">

**Author:** [@huckl3b3rry87](https://discourse.julialang.org/u/huckl3b3rry87)\
**Replies:** 6\
**Last updated:** [February 15, 2017, 1:48am UTC](https://discourse.julialang.org/t/getting-constraint-values-using-jump/1996 "2017-02-15T01:48:39Z")

</div>

I am interested in getting the values of my constraints evaluated at a particular spot in the design space. Here is an example to explain what I am trying to do: using JuMP m = Model() @variable(m, x, start = 0.0) @vari…

---

## [Using Adaptive variables in JuMPeR](https://discourse.julialang.org/t/using-adaptive-variables-in-jumper/2083)

<div class="topic-metadata">

**Author:** [@gavelasq](https://discourse.julialang.org/u/gavelasq)\
**Replies:** 0\
**Last updated:** [February 13, 2017, 2:31pm UTC](https://discourse.julialang.org/t/using-adaptive-variables-in-jumper/2083 "2017-02-13T14:31:39Z")

</div>

Hi, is there a way to know the actual adaptive policy when using adaptive variables (as in Ben-Tal et al. 2004)? What I mean with the adaptive policy is the values of the auxiliary variables that define the policy. I do …

---

## [How to leverage Convex Optimization for Portfolio Optimization in Julia](https://discourse.julialang.org/t/how-to-leverage-convex-optimization-for-portfolio-optimization-in-julia/1765)

<div class="topic-metadata">

**Author:** [@bjenkinsgit](https://discourse.julialang.org/u/bjenkinsgit)\
**Replies:** 9\
**Last updated:** [February 12, 2017, 4:08pm UTC](https://discourse.julialang.org/t/how-to-leverage-convex-optimization-for-portfolio-optimization-in-julia/1765 "2017-02-12T16:08:57Z")

</div>

I’m trying to use Julia (0.5) and Convex.jl (with ECOS solver) to figure out, given a portfolio of 2 stocks, how can I distribute my allocations (in percent) across both stocks such that I maximize my portfolio return an…

---

## [New organization for Optim+family](https://discourse.julialang.org/t/new-organization-for-optim-family/2037)

<div class="topic-metadata">

**Author:** [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Replies:** 7\
**Last updated:** [February 12, 2017, 6:22am UTC](https://discourse.julialang.org/t/new-organization-for-optim-family/2037 "2017-02-12T06:22:36Z")

</div>

I just wanted to bring people’s attention to https://github.com/JuliaOpt/Optim.jl/issues/358 . Now, let me say upfront: we’re not doing a popular vote, I just wanted to let people have a chance to comment. Basically, Ju…

---

## [Can't run JuMP sample code](https://discourse.julialang.org/t/cant-run-jump-sample-code/2015)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Replies:** 2\
**Last updated:** [February 10, 2017, 2:36am UTC](https://discourse.julialang.org/t/cant-run-jump-sample-code/2015 "2017-02-10T02:36:16Z")

</div>

I am trying to run the MLE sample code from the JuMP documentation at the bottom of this message under Windows. With Julia 0.5.0 I get this error ERROR: LoadError: ReadOnlyMemoryError() in solveProblem(::Ipopt.IpoptPr…

---

## [Remove SDP variable in JuMP](https://discourse.julialang.org/t/remove-sdp-variable-in-jump/1999)

<div class="topic-metadata">

**Author:** [@MarioSouto](https://discourse.julialang.org/u/MarioSouto)\
**Replies:** 1\
**Last updated:** [February 9, 2017, 12:55pm UTC](https://discourse.julialang.org/t/remove-sdp-variable-in-jump/1999 "2017-02-09T12:55:18Z")

</div>

Dear all, I’m doing some experiments by solving the semidefinite relaxation of a MIP. To do so, I need to include an SDP variable but I’m having some trouble to remove such variable after solving the relaxation. Is ther…

---

## [Indicator constraints in JuMP](https://discourse.julialang.org/t/indicator-constraints-in-jump/1858)

<div class="topic-metadata">

**Author:** [@bbrunaud](https://discourse.julialang.org/u/bbrunaud)\
**Replies:** 4\
**Last updated:** [February 7, 2017, 9:22pm UTC](https://discourse.julialang.org/t/indicator-constraints-in-jump/1858 "2017-02-07T21:22:45Z")

</div>

Hello Gurobi added indicator constraints since version 7.0. CPLEX already had them a few versions ago. What would it take to get indicator constraints in JuMP. I know that Gurobi.jl should wrap the function but I don’t …

---

## [Alternatives to @expression for complex model constriction](https://discourse.julialang.org/t/alternatives-to-expression-for-complex-model-constriction/1829)

<div class="topic-metadata">

**Author:** [@adowling2](https://discourse.julialang.org/u/adowling2)\
**Replies:** 4\
**Last updated:** [February 7, 2017, 12:24am UTC](https://discourse.julialang.org/t/alternatives-to-expression-for-complex-model-constriction/1829 "2017-02-07T00:24:17Z")

</div>

I have created a rather complex set of Julia functions to assemble versions of an optimization problem. With a certain set of user inputs, I need to define “x” in my problem. For other inputs, I know that “x” can be remo…

---

## [Gurobi.jl after switching to 702](https://discourse.julialang.org/t/gurobi-jl-after-switching-to-702/1878)

<div class="topic-metadata">

**Author:** [@kkmann](https://discourse.julialang.org/u/kkmann)\
**Replies:** 2\
**Last updated:** [February 6, 2017, 12:42pm UTC](https://discourse.julialang.org/t/gurobi-jl-after-switching-to-702/1878 "2017-02-06T12:42:30Z")

</div>

Hi, after refreshing my Gurobi installation to 702 i get the error ‘error compiling #GurobiMathProgModel#8: error compiling Type: could not load library “gurobi65” The specified module could not be found.’ when running …

---

## [Is the "set" conept in the roadmap (or is it not needed at all..)?](https://discourse.julialang.org/t/is-the-set-conept-in-the-roadmap-or-is-it-not-needed-at-all/1746)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [February 4, 2017, 6:33pm UTC](https://discourse.julialang.org/t/is-the-set-conept-in-the-roadmap-or-is-it-not-needed-at-all/1746 "2017-02-04T18:33:26Z")

</div>

Hello, is the implementation of the “set” concept, as known in ampl/gams languages, somewhere in the roadmap of JuMP development, or do you believe that the core Julia indexing is enought and there is no need for it ? I…

---

## [Convex optimisation over complex variables](https://discourse.julialang.org/t/convex-optimisation-over-complex-variables/1388)

<div class="topic-metadata">

**Author:** [@Jedrek](https://discourse.julialang.org/u/Jedrek)\
**Replies:** 4\
**Last updated:** [February 3, 2017, 11:38am UTC](https://discourse.julialang.org/t/convex-optimisation-over-complex-variables/1388 "2017-02-03T11:38:51Z")

</div>

Hello Everyone, I’ve just installed Julia and Convex.jl (package for convex optimisation) and things work fine as long as my variables are real, e.g. using Convex using SCS x = Variable() And then I can optimise. H…

---

## [If there a getvariable() equivalent for expressions?](https://discourse.julialang.org/t/if-there-a-getvariable-equivalent-for-expressions/1857)

<div class="topic-metadata">

**Author:** [@adowling2](https://discourse.julialang.org/u/adowling2)\
**Replies:** 2\
**Last updated:** [February 3, 2017, 12:56am UTC](https://discourse.julialang.org/t/if-there-a-getvariable-equivalent-for-expressions/1857 "2017-02-03T00:56:56Z")

</div>

I like to build modular optimization models using functions. Occasionally, I will add a variable in one function and then bring it into scope in another function using getvariable(). Is there an equivalent feature for ex…

---

## [ANN: CUTEst.jl v0.1.0](https://discourse.julialang.org/t/ann-cutest-jl-v0-1-0/1796)

<div class="topic-metadata">

**Author:** [@abelsiqueira](https://discourse.julialang.org/u/abelsiqueira)\
**Replies:** 2\
**Last updated:** [February 2, 2017, 6:23pm UTC](https://discourse.julialang.org/t/ann-cutest-jl-v0-1-0/1796 "2017-02-02T18:23:03Z")

</div>

Hello everyone, we’re happy to announce that CUTEst.jl has had its first release: v0.1.0. CUTEst is the third installment of the Constrained and Unconstrained Testing Environment for nonlinear optimization problems. Th…

---

## [ANN: NLPModels.jl v0.1.0](https://discourse.julialang.org/t/ann-nlpmodels-jl-v0-1-0/1795)

<div class="topic-metadata">

**Author:** [@abelsiqueira](https://discourse.julialang.org/u/abelsiqueira)\
**Replies:** 7\
**Last updated:** [February 2, 2017, 6:19pm UTC](https://discourse.julialang.org/t/ann-nlpmodels-jl-v0-1-0/1795 "2017-02-02T18:19:25Z")

</div>

Hello everyone, we’re happy to announce NLPModels.jl v0.1.0, a package providing ways to create Nonlinear Programming Models with a standardized API. This allows the creation of algorithms that can rely on that API to a…

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

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