# Optimization (Mathematical)

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

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

**Page:** 117

---

## [Stepwise logistic regress - GLM - non-callable --\> callable (Non-call expression encountered)](https://discourse.julialang.org/t/stepwise-logistic-regress-glm-non-callable-callable-non-call-expression-encountered/16087)

<div class="topic-metadata">

**Author:** [@tobi](https://discourse.julialang.org/u/tobi)\
**Replies:** 7\
**Last updated:** [October 10, 2018, 12:11pm UTC](https://discourse.julialang.org/t/stepwise-logistic-regress-glm-non-callable-callable-non-call-expression-encountered/16087 "2018-10-10T12:11:18Z")

</div>

Hello, I am trying to write a loop for a logistic regession. I have a dataframe with about 20 columns and I would like to use one of the columns after each other and print the coeftable afterwards. In the end I am aimin…

---

## [Singular exception when it shouldn't happen, tol for inv?](https://discourse.julialang.org/t/singular-exception-when-it-shouldnt-happen-tol-for-inv/16043)

<div class="topic-metadata">

**Author:** [@Zhiye\_Xia](https://discourse.julialang.org/u/Zhiye_Xia)\
**Replies:** 1\
**Last updated:** [October 8, 2018, 9:15pm UTC](https://discourse.julialang.org/t/singular-exception-when-it-shouldnt-happen-tol-for-inv/16043 "2018-10-08T21:15:48Z")

</div>

x = somevector X = hcat(ones(length(x)), x, x.^2) inv(X'\* X) Result: SingularException(3) somevector may be a random vector with multiple zeros but more than 2 non-zero & non-equal elements are ensured to make X to be…

---

## [Error to show a JuMP model in v0.7/1.0](https://discourse.julialang.org/t/error-to-show-a-jump-model-in-v0-7-1-0/15972)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 4\
**Last updated:** [October 8, 2018, 8:16pm UTC](https://discourse.julialang.org/t/error-to-show-a-jump-model-in-v0-7-1-0/15972 "2018-10-08T20:16:27Z")

</div>

julia\> m = Model(solver=ClpSolver()) Feasibility problem with: \* 0 linear constraints \* 0 variables Solver is Error showing value of type Model: ERROR: BoundsError: attempt to access 1-element Array{SubString{String},1…

---

## [JuMP is slow \*before\* creating model](https://discourse.julialang.org/t/jump-is-slow-before-creating-model/16024)

<div class="topic-metadata">

**Author:** [@fa-bien](https://discourse.julialang.org/u/fa-bien)\
**Replies:** 6\
**Last updated:** [October 8, 2018, 8:01pm UTC](https://discourse.julialang.org/t/jump-is-slow-before-creating-model/16024 "2018-10-08T20:01:48Z")

</div>

I have a function, say A(), that calls a function B(). B() creates a JuMP model (using Gurobi) and returns a mutable struct containing the model and other things. All JuMP macro calls are in B(). A() is called from the t…

---

## [Gettting RHS range for shadow prices](https://discourse.julialang.org/t/gettting-rhs-range-for-shadow-prices/16026)

<div class="topic-metadata">

**Author:** [@Prashant\_Chintapalli](https://discourse.julialang.org/u/Prashant_Chintapalli)\
**Replies:** 0\
**Last updated:** [October 8, 2018, 3:23pm UTC](https://discourse.julialang.org/t/gettting-rhs-range-for-shadow-prices/16026 "2018-10-08T15:23:40Z")

</div>

Hi, I am using getdual() function to fetch the shadow prices. However, I am unable to find a function to get the range of RHS of the constraints for which the shadow prices are valid. Does any one know about such a func…

---

## [Change to improve JuMP compatibility with PackageCompiler](https://discourse.julialang.org/t/change-to-improve-jump-compatibility-with-packagecompiler/15944)

<div class="topic-metadata">

**Author:** [@jwveysey](https://discourse.julialang.org/u/jwveysey)\
**Replies:** 8\
**Last updated:** [October 8, 2018, 2:56pm UTC](https://discourse.julialang.org/t/change-to-improve-jump-compatibility-with-packagecompiler/15944 "2018-10-08T14:56:17Z")

</div>

Hi, JuMP community - I have a suggestion for improving the compatibility of JuMP with PackageCompiler. I hope I’m using the right means to convey it; I haven’t contributed to the community before and am trying to follo…

---

## [Extending OBBT in PowerModels](https://discourse.julialang.org/t/extending-obbt-in-powermodels/15856)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 6\
**Last updated:** [October 8, 2018, 1:11pm UTC](https://discourse.julialang.org/t/extending-obbt-in-powermodels/15856 "2018-10-08T13:11:31Z")

</div>

I want to extend the current version of OBBT approach in PowerModels by tightening “Voltage Magnitude Differences” besides the “Voltage Magnitude” and “Voltage Angle Dffference” variables. In this connection, I have modi…

---

## [Problems with a picewise quadratic problem](https://discourse.julialang.org/t/problems-with-a-picewise-quadratic-problem/7728)

<div class="topic-metadata">

**Author:** [@gcabrera](https://discourse.julialang.org/u/gcabrera)\
**Replies:** 6\
**Last updated:** [October 7, 2018, 8:51pm UTC](https://discourse.julialang.org/t/problems-with-a-picewise-quadratic-problem/7728 "2018-10-07T20:51:58Z")

</div>

Hi Guys, I need to model the following optimization problem \\sum\_{j=1}^{N} (\\alpha \* w\_j (d\_j(x)-p\_j)^2) where \\alpha = 1 when (d\_j(x)-p\_j) \> 0 and \\alpha = 0 otherwise I’ve been through the JuMP’s documentation with…

---

## [JuMP's new contributor recognition goes to Issam Tahiri](https://discourse.julialang.org/t/jumps-new-contributor-recognition-goes-to-issam-tahiri/15955)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 2\
**Last updated:** [October 8, 2018, 3:58am UTC](https://discourse.julialang.org/t/jumps-new-contributor-recognition-goes-to-issam-tahiri/15955 "2018-10-08T03:58:09Z")

</div>

The JuMP steering committee would like to recognize Issam Tahiri both for his leadership and service as a local organizer for the JuMP-dev workshop at the University of Bordeaux this year, and for his technical contri…

---

## [SCS Warning: (column pointers) not strictly increasing](https://discourse.julialang.org/t/scs-warning-column-pointers-not-strictly-increasing/12563)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 7\
**Last updated:** [October 6, 2018, 3:48pm UTC](https://discourse.julialang.org/t/scs-warning-column-pointers-not-strictly-increasing/12563 "2018-10-06T15:48:26Z")

</div>

Does anyone know what would cause a JuMP (v0.18) model to result in SCS providing the following warning, “WARN: A-\>p (column pointers) not strictly increasing, column 1 empty”?

---

## [Extract inverse Hessian representation used by L-BFGS](https://discourse.julialang.org/t/extract-inverse-hessian-representation-used-by-l-bfgs/15948)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [October 6, 2018, 8:20am UTC](https://discourse.julialang.org/t/extract-inverse-hessian-representation-used-by-l-bfgs/15948 "2018-10-06T08:20:51Z")

</div>

Is it possible to extract the inverse Hessian representation used by L-BFGS after convergence? I would like to use this approximate implicit representation for some further calculations. I am currently using Optim or NL…

---

## [\[ANN\] LinearFractional.jl](https://discourse.julialang.org/t/ann-linearfractional-jl/12653)

<div class="topic-metadata">

**Author:** [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Replies:** 1\
**Last updated:** [October 5, 2018, 6:27pm UTC](https://discourse.julialang.org/t/ann-linearfractional-jl/12653 "2018-10-05T18:27:16Z")

</div>

I’d like to introduce the package LinearFractional: GitHub - nexteraanalytics/LinearFractional.jl: Linear fractional programming with Julia and JuMP. LinearFractional is an extension to JuMP and applies the Charnes-Coo…

---

## [Broadcasting for in-place operations on polynomials (blog post)](https://discourse.julialang.org/t/broadcasting-for-in-place-operations-on-polynomials-blog-post/15754)

<div class="topic-metadata">

**Author:** [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Replies:** 4\
**Last updated:** [October 4, 2018, 5:12pm UTC](https://discourse.julialang.org/t/broadcasting-for-in-place-operations-on-polynomials-blog-post/15754 "2018-10-04T17:12:13Z")

</div>

Some of you may be interested in this post that I just published: TL;DR: I used the new broadcasting feature (thanks @mbauman + others!) to get a significant performance optimization in a setting without axes and indic…

---

## [Error Precompiling AmplNLWriter](https://discourse.julialang.org/t/error-precompiling-amplnlwriter/15836)

<div class="topic-metadata">

**Author:** [@muriloasouza](https://discourse.julialang.org/u/muriloasouza)\
**Replies:** 1\
**Last updated:** [October 3, 2018, 6:58pm UTC](https://discourse.julialang.org/t/error-precompiling-amplnlwriter/15836 "2018-10-03T18:58:36Z")

</div>

I’m starting to use Julia 1.0.1 today. I saw that the CouenneNL package only works on 0.6, so i went back to using the AmplNLWriter package. julia\> Pkg.add("AmplNLWriter") WARNING: Base.Pkg is deprecated, run \`using Pkg…

---

## [Modify power flow equation in PowerModels.jl](https://discourse.julialang.org/t/modify-power-flow-equation-in-powermodels-jl/15807)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 2\
**Last updated:** [October 3, 2018, 6:53pm UTC](https://discourse.julialang.org/t/modify-power-flow-equation-in-powermodels-jl/15807 "2018-10-03T18:53:59Z")

</div>

I want to implement a different form of power flow equation, which is based on one trigonometric term instead of two, in PowerModels. In this connection, I have defined new envelopes for trig functions, and could easily …

---

## [UndefVarError in JuMP constraint](https://discourse.julialang.org/t/undefvarerror-in-jump-constraint/15701)

<div class="topic-metadata">

**Author:** [@chisquared](https://discourse.julialang.org/u/chisquared)\
**Replies:** 4\
**Last updated:** [October 3, 2018, 9:20am UTC](https://discourse.julialang.org/t/undefvarerror-in-jump-constraint/15701 "2018-10-03T09:20:22Z")

</div>

I’m using the dev version of JuMP (primarily for compatibility with Julia 1.0) with GLPK, and I encountered this error which I can’t figure out: ERROR: LoadError: UndefVarError: ##366 not defined Stacktrace: \[1\] macro …

---

## [Does anyone know how to retrieve the number of generated cuts in the informational callback?](https://discourse.julialang.org/t/does-anyone-know-how-to-retrieve-the-number-of-generated-cuts-in-the-informational-callback/15370)

<div class="topic-metadata">

**Author:** [@CBongiova](https://discourse.julialang.org/u/CBongiova)\
**Replies:** 9\
**Last updated:** [October 2, 2018, 9:44am UTC](https://discourse.julialang.org/t/does-anyone-know-how-to-retrieve-the-number-of-generated-cuts-in-the-informational-callback/15370 "2018-10-02T09:44:40Z")

</div>

Hi, I would like to retrieve the information contained at the end of the Gurobi log (the summary section MIP Logging) In particular, I am interested in saving the number of cuts applied to my MIP (MIP\_CUTCNT : http://w…

---

## [Convert external to internal indexing in PowerModels.jl](https://discourse.julialang.org/t/convert-external-to-internal-indexing-in-powermodels-jl/15630)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 1\
**Last updated:** [September 28, 2018, 7:49pm UTC](https://discourse.julialang.org/t/convert-external-to-internal-indexing-in-powermodels-jl/15630 "2018-09-28T19:49:52Z")

</div>

Some Matpower test systems have their own indexing feature (e.g., nesta\_case73\_ieee\_rts) in which bus indexing is not compatible with actual bus number. Matpower has provided the ext2int script which converts the test ca…

---

## [\[JuMP\] Sectionwise definition of matrix with @expression](https://discourse.julialang.org/t/jump-sectionwise-definition-of-matrix-with-expression/15639)

<div class="topic-metadata">

**Author:** [@korpuskel](https://discourse.julialang.org/u/korpuskel)\
**Replies:** 0\
**Last updated:** [September 28, 2018, 7:21pm UTC](https://discourse.julialang.org/t/jump-sectionwise-definition-of-matrix-with-expression/15639 "2018-09-28T19:21:52Z")

</div>

I need to define an expression/variable that resembles a matrix. This matrix is defined sectionwise, so I tried: @expression(m, O\[b=1:n, i=1:n, j=1:n\], 0) @expression(m, O\[b=1:n, i=n+1, j=1:n\], 0.5T\_i\[b\]\[j\]) @expres…

---

## [Generic code, iterative methods and automatic differentiation](https://discourse.julialang.org/t/generic-code-iterative-methods-and-automatic-differentiation/15528)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 3\
**Last updated:** [September 28, 2018, 4:37pm UTC](https://discourse.julialang.org/t/generic-code-iterative-methods-and-automatic-differentiation/15528 "2018-09-28T16:37:08Z")

</div>

In Julia it is quite easy to write generic code that can be used with many numbers type (eg BigFloat) or many automatic differentiation algorithms. However if this code contains some iterative parts eg such as: find t s…

---

## [Memory usage in JuMP model](https://discourse.julialang.org/t/memory-usage-in-jump-model/15475)

<div class="topic-metadata">

**Author:** [@Reza](https://discourse.julialang.org/u/Reza)\
**Replies:** 1\
**Last updated:** [September 27, 2018, 2:54am UTC](https://discourse.julialang.org/t/memory-usage-in-jump-model/15475 "2018-09-27T02:54:52Z")

</div>

Hi I am using JuMP model calling CPLEX 12.6 solver for my problem. My problem is like that I am running a loop and at each iteration, I am solving a convex optimization problem by calling CPLEX in JuMP. At each iteratio…

---

## [Getting variable values in PowerModels.jl](https://discourse.julialang.org/t/getting-variable-values-in-powermodels-jl/15192)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 20\
**Last updated:** [September 26, 2018, 11:39pm UTC](https://discourse.julialang.org/t/getting-variable-values-in-powermodels-jl/15192 "2018-09-26T23:39:48Z")

</div>

Does anyone know how I can get the value of the lifted variables (e.g., \_td) in PowerModels.jl? Thanks in advance!

---

## [Optim.jl returns \`Stopped by an increasing objective: true\`](https://discourse.julialang.org/t/optim-jl-returns-stopped-by-an-increasing-objective-true/15428)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 5\
**Last updated:** [September 26, 2018, 11:54am UTC](https://discourse.julialang.org/t/optim-jl-returns-stopped-by-an-increasing-objective-true/15428 "2018-09-26T11:54:56Z")

</div>

Hi, Under exactly what conditions does optimize in Optim.jl return Stopped by an increasing objective: true? I have a fairly complicated optimisation problem using LBFGS which terminates at some point with this stateme…

---

## [Mosek returns Unknown status](https://discourse.julialang.org/t/mosek-returns-unknown-status/15189)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 4:45pm UTC](https://discourse.julialang.org/t/mosek-returns-unknown-status/15189 "2018-09-20T16:45:50Z")

</div>

I got “unknown status” when I run the following code using MultivariatePolynomials using JuMP using PolyJuMP using SumOfSquares using DynamicPolynomials using Mosek using SemialgebraicSets @polyvar x m = SOSModel(solv…

---

## [JuMP installation error](https://discourse.julialang.org/t/jump-installation-error/15198)

<div class="topic-metadata">

**Author:** [@ssriram1992](https://discourse.julialang.org/u/ssriram1992)\
**Replies:** 5\
**Last updated:** [September 20, 2018, 3:42pm UTC](https://discourse.julialang.org/t/jump-installation-error/15198 "2018-09-20T15:42:17Z")

</div>

I use Julia 1.0 and when I get an error when I try to install JuMP julia\> Pkg.add("JuMP") Resolving package versions... Updating \`~/.julia/environments/v1.1/Project.toml\` \[4076af6c\] + JuMP v0.18.2 Updating \`~/.ju…

---

## [Sum() syntax](https://discourse.julialang.org/t/sum-syntax/14589)

<div class="topic-metadata">

**Author:** [@muriloasouza](https://discourse.julialang.org/u/muriloasouza)\
**Replies:** 19\
**Last updated:** [September 20, 2018, 12:10pm UTC](https://discourse.julialang.org/t/sum-syntax/14589 "2018-09-20T12:10:38Z")

</div>

Hello, from the JuMP quick guide, i’ve seen i can use the sum() function with a condition, like this: sum(expression for i = I1, j = I2 if cond) is the same as: a = zero(AffExpr) for i = I1 for j = I2 ... …

---

## [Install Mosek.jl](https://discourse.julialang.org/t/install-mosek-jl/15083)

<div class="topic-metadata">

**Author:** [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Replies:** 14\
**Last updated:** [September 18, 2018, 1:57am UTC](https://discourse.julialang.org/t/install-mosek-jl/15083 "2018-09-18T01:57:08Z")

</div>

I tried Pkg.add(“Mosek”) to add Mosek package but I got the following error " unknown package Mosek". I have no idea why I have received this error. Please let me know if you have been in the same situation.

---

## [JuMP: solver errors in reformulating Complex NLP to Real NLP](https://discourse.julialang.org/t/jump-solver-errors-in-reformulating-complex-nlp-to-real-nlp/14977)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 0\
**Last updated:** [September 14, 2018, 8:25pm UTC](https://discourse.julialang.org/t/jump-solver-errors-in-reformulating-complex-nlp-to-real-nlp/14977 "2018-09-14T20:25:46Z")

</div>

I’m trying to convert the following complex NLP to a real NLP and I think I have a formulation issue. Complex problem: \\underset{v, m, f, a} {min} \\quad v^H Q v + f^T f + c\_1^T \\log(m) + c\_2^T a s.t. \\qquad v = m \\ti…

---

## [Adding JuMP variable via list of tuples (Specify dimensions using tuples)](https://discourse.julialang.org/t/adding-jump-variable-via-list-of-tuples-specify-dimensions-using-tuples/14867)

<div class="topic-metadata">

**Author:** [@skam](https://discourse.julialang.org/u/skam)\
**Replies:** 1\
**Last updated:** [September 14, 2018, 4:05am UTC](https://discourse.julialang.org/t/adding-jump-variable-via-list-of-tuples-specify-dimensions-using-tuples/14867 "2018-09-14T04:05:12Z")

</div>

Hi, I was wondering whether there is a smart solution for adding variables with “nonsquare” dimensions. A minimal example: using JuMP testset=\[("a","b"), ("c","d")\] indices=\["a","b","c","d"\] m = Model() v=@variable…

---

## [JuMP: AffExpr error](https://discourse.julialang.org/t/jump-affexpr-error/14921)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 2\
**Last updated:** [September 13, 2018, 11:21pm UTC](https://discourse.julialang.org/t/jump-affexpr-error/14921 "2018-09-13T23:21:28Z")

</div>

I’m using Julia v0.6.4 on Ubuntu (14.04) and am getting an affine expression error in the following toy model: using JuMP using Ipopt model = Model(solver=IpoptSolver()) ## params N = 5 idx1 = \[1, 2\] idx2 = \[5, 4\] ##…

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

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