# Specific Domains

**URL:** https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=273

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

**Page:** 274

---

## [How to write a constraint Julia-jump](https://discourse.julialang.org/t/how-to-write-a-constraint-julia-jump/82513)

<div class="topic-metadata">

**Author:** [@lausilvag](https://discourse.julialang.org/u/lausilvag)\
**Replies:** 2\
**Last updated:** [June 10, 2022, 3:12pm UTC](https://discourse.julialang.org/t/how-to-write-a-constraint-julia-jump/82513 "2022-06-10T15:12:07Z")

</div>

Hi guys, i am new in julia and i need to write this constraint @FOR(pilotos(i): @for(vuelos(j): @for(vuelos(k) j#ne#k #and# dia(j)#eq#dia(k) #and# inicio(j)#le#inicio(k) #and# fin(j)#gt#inicio(k) : x(i,j)+x(i,k)\<=1))); …

---

## [\[solved\] A case where dijkstra\_shortest\_paths fails (due to the negative weight)](https://discourse.julialang.org/t/solved-a-case-where-dijkstra-shortest-paths-fails-due-to-the-negative-weight/82564)

<div class="topic-metadata">

**Author:** [@HanBBer](https://discourse.julialang.org/u/HanBBer)\
**Replies:** 4\
**Last updated:** [June 10, 2022, 2:25pm UTC](https://discourse.julialang.org/t/solved-a-case-where-dijkstra-shortest-paths-fails-due-to-the-negative-weight/82564 "2022-06-10T14:25:32Z")

</div>

I’m unsure if the Dijkstra algorithm should quit for any proper case. But it got stuck during my work, and attached belong is a code for reproducing. using Graphs node1 = \[1 1 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 8 8 8 8 9 …

---

## [Adding Threads](https://discourse.julialang.org/t/adding-threads/36011)

<div class="topic-metadata">

**Author:** [@marouane1994](https://discourse.julialang.org/u/marouane1994)\
**Replies:** 4\
**Last updated:** [June 10, 2022, 2:01pm UTC](https://discourse.julialang.org/t/adding-threads/36011 "2022-06-10T14:01:24Z")

</div>

i’m newbie parallel computing and i’m trying to practice it a little bit and when i want to add threads: set JULIA\_NUM\_THREADS =4 i get this Error and i don’t get if i should add something or what: ERROR: syntax: extra t…

---

## [I have an INLP and a linear relaxation; I want to steal someone else's branch-and-bound algorithm](https://discourse.julialang.org/t/i-have-an-inlp-and-a-linear-relaxation-i-want-to-steal-someone-elses-branch-and-bound-algorithm/82472)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 5\
**Last updated:** [June 10, 2022, 7:04am UTC](https://discourse.julialang.org/t/i-have-an-inlp-and-a-linear-relaxation-i-want-to-steal-someone-elses-branch-and-bound-algorithm/82472 "2022-06-10T07:04:56Z")

</div>

Suppose I have a binary optimization problem of the form maximize f(x) (1) subject to Ax ≤ b x binary Here f(x) is a disgusting, nonlinear, nonconcave black bo…

---

## [Exponentiation and machine precision](https://discourse.julialang.org/t/exponentiation-and-machine-precision/79024)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 18\
**Last updated:** [June 8, 2022, 9:16am UTC](https://discourse.julialang.org/t/exponentiation-and-machine-precision/79024 "2022-06-08T09:16:10Z")

</div>

In some simulations I am encountering a problem due to machine precision. I have to conduct an exponentiation operation on a number that lies in (0, 1). That number comes from a random number generator, while the exponen…

---

## [How do I extract a trace of the optimization steps in JuMP](https://discourse.julialang.org/t/how-do-i-extract-a-trace-of-the-optimization-steps-in-jump/82328)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 8\
**Last updated:** [June 10, 2022, 12:43am UTC](https://discourse.julialang.org/t/how-do-i-extract-a-trace-of-the-optimization-steps-in-jump/82328 "2022-06-10T00:43:50Z")

</div>

During optimization via some interior point method or similar the solver will compute the value of the objective and probably a bunch of other things. And one should see it going down Is there a standard way to captur…

---

## [GLM.jl LogisticRegression errors: matrix is not positive definite; Cholesky factorization failed](https://discourse.julialang.org/t/glm-jl-logisticregression-errors-matrix-is-not-positive-definite-cholesky-factorization-failed/28981)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 14\
**Last updated:** [June 9, 2022, 10:04pm UTC](https://discourse.julialang.org/t/glm-jl-logisticregression-errors-matrix-is-not-positive-definite-cholesky-factorization-failed/28981 "2022-06-09T22:04:16Z")

</div>

The following errors: using DataFrames, GLM df = DataFrame(x1=\[1,2,3,4\], x2=\[1,2,3,4\], y=\[1,1,0,0\]) mdl = glm(@formula(y~x1+x2), df, Binomial(), LogitLink()) predict(mdl, df\[:, \[:x1, :x2\]\]) ERROR: LoadError: PosDef…

---

## [Solving symbolic system of equations using Ax = b](https://discourse.julialang.org/t/solving-symbolic-system-of-equations-using-ax-b/82454)

<div class="topic-metadata">

**Author:** [@jpro](https://discourse.julialang.org/u/jpro)\
**Replies:** 9\
**Last updated:** [June 9, 2022, 8:29pm UTC](https://discourse.julialang.org/t/solving-symbolic-system-of-equations-using-ax-b/82454 "2022-06-09T20:29:55Z")

</div>

I’m attempting to solve a system of 8 vector equations with 8 unknown vectors symbolically in Julia using Ax = b. The matrix is 24\*24 (due to 3-dimensional vectors) of variables I’ve defined using @ vars After defining …

---

## [Add Dollar Signs to Axis](https://discourse.julialang.org/t/add-dollar-signs-to-axis/82524)

<div class="topic-metadata">

**Author:** [@gjh](https://discourse.julialang.org/u/gjh)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 8:14pm UTC](https://discourse.julialang.org/t/add-dollar-signs-to-axis/82524 "2022-06-09T20:14:59Z")

</div>

I want to add dollar signs to the x and y-axis (e.g., $10K). I’m sure I am missing something simple. Thank you for any help!!! using Gadfly, Printf plot(x=rand(10)\*10\_000, y=rand(10)\*10\_000, Scale.x\_continuous(labels…

---

## [How to put a single marker on a heatmap](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447)

<div class="topic-metadata">

**Author:** [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Replies:** 12\
**Last updated:** [June 9, 2022, 8:05pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447 "2022-06-09T20:05:03Z")

</div>

I’m using CairoMakie to make a heatmap in Julia 1.7.3 I’d like to add a single smiley face (or really any marker) in the very center of the heatmap, at say 50 x 50. This seems like a super simple task, but I’ve been lo…

---

## [Speed up Gaussian Process model](https://discourse.julialang.org/t/speed-up-gaussian-process-model/82315)

<div class="topic-metadata">

**Author:** [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Replies:** 16\
**Last updated:** [June 9, 2022, 7:43pm UTC](https://discourse.julialang.org/t/speed-up-gaussian-process-model/82315 "2022-06-09T19:43:42Z")

</div>

Hi all I am interested in implementing a latent variable Gaussian process regression model with a pre-calculated (phylogenetic) distance matrix. The below model (mostly copied from here and based on this runs, and get’s…

---

## [A minimal CUDA-compatible and differentiable GP implementation](https://discourse.julialang.org/t/a-minimal-cuda-compatible-and-differentiable-gp-implementation/80099)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.julialang.org/u/Red-Portal)\
**Replies:** 11\
**Last updated:** [June 9, 2022, 3:22pm UTC](https://discourse.julialang.org/t/a-minimal-cuda-compatible-and-differentiable-gp-implementation/80099 "2022-06-09T15:22:07Z")

</div>

Hi folks, I was really frustrated last week because it seems there isn’t a way to implement Gaussian processes with both CUDA acceleration and differentiation. Because of this, I had to roll my own CUDA kernels that did…

---

## [Solving an analytical ODE \*slower\* than numerical?](https://discourse.julialang.org/t/solving-an-analytical-ode-slower-than-numerical/82499)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 2:51pm UTC](https://discourse.julialang.org/t/solving-an-analytical-ode-slower-than-numerical/82499 "2022-06-09T14:51:17Z")

</div>

The documentation (Composing Ordinary Differential Equations · ModelingToolkit.jl) gives the following example to show symbolic derivatives result in higher performance vs. numerical approximation: using BenchmarkTools …

---

## [Dispatch on the last layer type in Flux](https://discourse.julialang.org/t/dispatch-on-the-last-layer-type-in-flux/82481)

<div class="topic-metadata">

**Author:** [@DoktorMike](https://discourse.julialang.org/u/DoktorMike)\
**Replies:** 3\
**Last updated:** [June 9, 2022, 11:07am UTC](https://discourse.julialang.org/t/dispatch-on-the-last-layer-type-in-flux/82481 "2022-06-09T11:07:01Z")

</div>

I’m making an implementation of a Evidential Deep Learning model in Flux and I would like to have a function predict(model, x) where x is input data. The model is a Chain which consists possibly of many layers. I want th…

---

## [Non-Diagonal SDE with matrix variables](https://discourse.julialang.org/t/non-diagonal-sde-with-matrix-variables/82351)

<div class="topic-metadata">

**Author:** [@thobili](https://discourse.julialang.org/u/thobili)\
**Replies:** 1\
**Last updated:** [June 7, 2022, 11:07am UTC](https://discourse.julialang.org/t/non-diagonal-sde-with-matrix-variables/82351 "2022-06-07T11:07:57Z")

</div>

I was trying to apply the method described at https://diffeq.sciml.ai/stable/tutorials/sde\_example/#Example-4:-Systems-of-SDEs-with-Non-Diagonal-Noise for a matrix valued variable, e.g. f(du,u,p,t) = du .= 1.01u funct…

---

## [How to fix the x axis for a histogram in Julia](https://discourse.julialang.org/t/how-to-fix-the-x-axis-for-a-histogram-in-julia/82453)

<div class="topic-metadata">

**Author:** [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Replies:** 5\
**Last updated:** [June 9, 2022, 6:13am UTC](https://discourse.julialang.org/t/how-to-fix-the-x-axis-for-a-histogram-in-julia/82453 "2022-06-09T06:13:10Z")

</div>

I’m trying to make a histogram in Julia using hist command from Makie, as detailed here: I would like to control the xlimits, i.e. force the x range to go from 0 to 5. I can’t seem to find anywhere how to do this onl…

---

## [ModelingToolkit.jl performance for large models with similar components](https://discourse.julialang.org/t/modelingtoolkit-jl-performance-for-large-models-with-similar-components/82442)

<div class="topic-metadata">

**Author:** [@Sciemon](https://discourse.julialang.org/u/Sciemon)\
**Replies:** 4\
**Last updated:** [June 8, 2022, 8:59pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-performance-for-large-models-with-similar-components/82442 "2022-06-08T20:59:37Z")

</div>

I cannot make sense of conflicting information about the performance of ModelingToolkit.jl for very large models. On the one hand, it seems to be performant according to the workshop at JuliaCon for example. On the other…

---

## [Converting and applying MATLAB lsqnonlin function in Julia with multiple function arguments](https://discourse.julialang.org/t/converting-and-applying-matlab-lsqnonlin-function-in-julia-with-multiple-function-arguments/82440)

<div class="topic-metadata">

**Author:** [@JannisHoch](https://discourse.julialang.org/u/JannisHoch)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 6:05pm UTC](https://discourse.julialang.org/t/converting-and-applying-matlab-lsqnonlin-function-in-julia-with-multiple-function-arguments/82440 "2022-06-08T18:05:57Z")

</div>

I am trying to convert some MATLAB code into Julia. For the largest part this went pretty smooth, but I am now stuck with converting the MATLAB \[lsqnonlin\]\[1\] function. After scanning available options, I think that the…

---

## [Best way to compute eigenvalues of As + i Bs where As and Bs are symmetric?](https://discourse.julialang.org/t/best-way-to-compute-eigenvalues-of-as-i-bs-where-as-and-bs-are-symmetric/82428)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 5:41pm UTC](https://discourse.julialang.org/t/best-way-to-compute-eigenvalues-of-as-i-bs-where-as-and-bs-are-symmetric/82428 "2022-06-08T17:41:58Z")

</div>

I’m trying to compute the eigenvalues of a matrix M = As + im \* Bs, where As and Bs are real, symmetric matrices (and don’t commute in general). I realize that the eigenvalues will be complex in general, with the real pa…

---

## [Cholesky factorization in JuMP](https://discourse.julialang.org/t/cholesky-factorization-in-jump/82227)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 3:31pm UTC](https://discourse.julialang.org/t/cholesky-factorization-in-jump/82227 "2022-06-08T15:31:30Z")

</div>

I want to solve a SDP optimization problem using a nonlinear solver. Specifically I want to use Cholesky factorization to enforce positive definiteness of some decision variable A. That is I want to find a lower triangu…

---

## [\[AlgebraOfGraphics.jl\] place legend inside figure](https://discourse.julialang.org/t/algebraofgraphics-jl-place-legend-inside-figure/81991)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 9\
**Last updated:** [June 8, 2022, 3:07pm UTC](https://discourse.julialang.org/t/algebraofgraphics-jl-place-legend-inside-figure/81991 "2022-06-08T15:07:44Z")

</div>

Is it possible to place legends inside figures with AlgebraOfGraphics.jl? I am looking for a functionality similar to what Makie.jl’s axislegend function provides.

---

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

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 5\
**Last updated:** [June 8, 2022, 2:46pm UTC](https://discourse.julialang.org/t/question-about-jump/82432 "2022-06-08T14:46:29Z")

</div>

What’s wrong with this problem? julia\> using JuMP julia\> using Ipopt julia\> model = Model(Ipopt.Optimizer) A JuMP Model Feasibility problem with: Variables: 0 Model mode: AUTOMATIC CachingOptimizer state: EMPTY\_OPTIMI…

---

## [Statsplots dendrogram - how to have clustered coloring](https://discourse.julialang.org/t/statsplots-dendrogram-how-to-have-clustered-coloring/50768)

<div class="topic-metadata">

**Author:** [@alailink](https://discourse.julialang.org/u/alailink)\
**Replies:** 12\
**Last updated:** [June 8, 2022, 2:32pm UTC](https://discourse.julialang.org/t/statsplots-dendrogram-how-to-have-clustered-coloring/50768 "2022-06-08T14:32:13Z")

</div>

I’m new to Julia, but already impressed by it’s syntax and by statsplots. However, some functionality is still missing that I miss from Python/R. Specifically for this post, I would like to color-code the output of clus…

---

## [How to retrieve gradient value in custom Flux training loop?](https://discourse.julialang.org/t/how-to-retrieve-gradient-value-in-custom-flux-training-loop/82435)

<div class="topic-metadata">

**Author:** [@BatyLeo](https://discourse.julialang.org/u/BatyLeo)\
**Replies:** 3\
**Last updated:** [June 8, 2022, 2:16pm UTC](https://discourse.julialang.org/t/how-to-retrieve-gradient-value-in-custom-flux-training-loop/82435 "2022-06-08T14:16:42Z")

</div>

Hello, I have a few questions about custom training loops in Flux. According to the documentation, I should write something like that : function my\_custom\_train!(loss, ps, data, opt) ps = Params(ps) for d in data …

---

## [How to use lm inside a for loop for different variables](https://discourse.julialang.org/t/how-to-use-lm-inside-a-for-loop-for-different-variables/82391)

<div class="topic-metadata">

**Author:** [@Juan\_Mac\_Donagh](https://discourse.julialang.org/u/Juan_Mac_Donagh)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 1:34pm UTC](https://discourse.julialang.org/t/how-to-use-lm-inside-a-for-loop-for-different-variables/82391 "2022-06-08T13:34:51Z")

</div>

Hi all, I’ve been trying to work around this problem, and I need a little bit of help. I have a datarme that looks something like this: |Y|X1|X2|X3|X4|X5| |----------------| |1|22|23|25|98|23| |8|52|23|15|28|63| And s…

---

## [Gradient of sum of singular values of a matrix with CUDA.jl](https://discourse.julialang.org/t/gradient-of-sum-of-singular-values-of-a-matrix-with-cuda-jl/55390)

<div class="topic-metadata">

**Author:** [@ymtoo](https://discourse.julialang.org/u/ymtoo)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 10:19am UTC](https://discourse.julialang.org/t/gradient-of-sum-of-singular-values-of-a-matrix-with-cuda-jl/55390 "2022-06-08T10:19:16Z")

</div>

Any idea on why it doesn’t work with CUDA julia\> using Flux, LinearAlgebra julia\> x = randn(10, 10); julia\> xgpu = gpu(x); julia\> gradient(x -\> sum(svd(x).S), xgpu) ERROR: MethodError: no method matching svd\_rev(::CU…

---

## [Large number of @variables in ModelingToolkit](https://discourse.julialang.org/t/large-number-of-variables-in-modelingtoolkit/82399)

<div class="topic-metadata">

**Author:** [@QuantumWorm](https://discourse.julialang.org/u/QuantumWorm)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 10:01am UTC](https://discourse.julialang.org/t/large-number-of-variables-in-modelingtoolkit/82399 "2022-06-08T10:01:38Z")

</div>

https://neuralpde.sciml.ai/stable/pinn/system/ When I need several variables I can write @parameters t, x @variables u1(…), u2(…), u3(…) and in solver use @named pde\_system = PDESystem(eqs,bcs,domains,\[t,x\],\[u1(t, x…

---

## [Assigning a concentrated load to a specific point in the boundary](https://discourse.julialang.org/t/assigning-a-concentrated-load-to-a-specific-point-in-the-boundary/82419)

<div class="topic-metadata">

**Author:** [@refauhx](https://discourse.julialang.org/u/refauhx)\
**Replies:** 0\
**Last updated:** [June 8, 2022, 9:27am UTC](https://discourse.julialang.org/t/assigning-a-concentrated-load-to-a-specific-point-in-the-boundary/82419 "2022-06-08T09:27:05Z")

</div>

Hi everyone, I am a beginner in Julia and I want to assign a concentrated load pointed downwards into the middle point of the boundary of my model. Unfortunately, this code gives me some results just when my tag used is…

---

## [Ability to move past unstable points in parameter space](https://discourse.julialang.org/t/ability-to-move-past-unstable-points-in-parameter-space/82272)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 8\
**Last updated:** [June 8, 2022, 8:54am UTC](https://discourse.julialang.org/t/ability-to-move-past-unstable-points-in-parameter-space/82272 "2022-06-08T08:54:50Z")

</div>

Hi, This is a fairly general question but I can provide some more concrete code if needed. Say I have 100 samples in a n dimensional parameter space between upper and lower bounds these bounds say 30% away from a “trut…

---

## [How to solve \`no method matching real(::String)\` when solving ODEs?](https://discourse.julialang.org/t/how-to-solve-no-method-matching-real-string-when-solving-odes/82294)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 4\
**Last updated:** [June 8, 2022, 5:50am UTC](https://discourse.julialang.org/t/how-to-solve-no-method-matching-real-string-when-solving-odes/82294 "2022-06-08T05:50:11Z")

</div>

Hello, I am simulating a microbial consortium (2 bacteria, 2 phages) but I get a MethodError during the solving step. Since I have duplicated items (two growth rates, two infection rates etc) I used vectors of 2 element…

[Previous page](https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=272)

[Next page](https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=274)
