# Specific Domains

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

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

**Page:** 227

---

## [Save matrix of color images](https://discourse.julialang.org/t/save-matrix-of-color-images/92170)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 2\
**Last updated:** [December 28, 2022, 10:09am UTC](https://discourse.julialang.org/t/save-matrix-of-color-images/92170 "2022-12-28T10:09:02Z")

</div>

With so much effort I managed to simulate (roughly) an animated version of Gonway’s “Game of Life”. julia\> using Plots,IterTools, Colors julia\> function gol1(n, init=rand(Bool, 10,10)) function gen(m…

---

## [Automatic Differentiation with Polynomials Package, Advanced HMC](https://discourse.julialang.org/t/automatic-differentiation-with-polynomials-package-advanced-hmc/92205)

<div class="topic-metadata">

**Author:** [@Gattu\_Mytraya](https://discourse.julialang.org/u/Gattu_Mytraya)\
**Replies:** 0\
**Last updated:** [December 27, 2022, 11:37pm UTC](https://discourse.julialang.org/t/automatic-differentiation-with-polynomials-package-advanced-hmc/92205 "2022-12-27T23:37:52Z")

</div>

I’m a little tired of debugging code so any easy solution will be greatly appreciated. I’m trying to use the AdvancedHMC package (with Zygote for auto differentiation) to draw samples from a known PDF (from my work). A…

---

## [Solving an ODE which depends on an external function](https://discourse.julialang.org/t/solving-an-ode-which-depends-on-an-external-function/92176)

<div class="topic-metadata">

**Author:** [@minimal\_subs](https://discourse.julialang.org/u/minimal_subs)\
**Replies:** 12\
**Last updated:** [December 27, 2022, 7:11pm UTC](https://discourse.julialang.org/t/solving-an-ode-which-depends-on-an-external-function/92176 "2022-12-27T19:11:16Z")

</div>

Greetings, I’m a relatively new Julia user and have encountered a problem. I’m a bit embarrassed to post it here, since it seems sure to be something really obvious. A brief statement of the problem is as follows. I am t…

---

## [How to define a lower triangular variable WITHOUT the main diagonal elements](https://discourse.julialang.org/t/how-to-define-a-lower-triangular-variable-without-the-main-diagonal-elements/92112)

<div class="topic-metadata">

**Author:** [@ivzktch99](https://discourse.julialang.org/u/ivzktch99)\
**Replies:** 3\
**Last updated:** [December 27, 2022, 5:53pm UTC](https://discourse.julialang.org/t/how-to-define-a-lower-triangular-variable-without-the-main-diagonal-elements/92112 "2022-12-27T17:53:26Z")

</div>

Searching here I found the following way of defining a lower triangular variable in JuMP: using JuMP import LinearAlgebra model = Model() @variable(model, A\[1:3,1:3\], Symmetric) Al = LinearAlgebra.LowerTriangular(A) ju…

---

## [Idea to make Zygote support mutation in easy cases](https://discourse.julialang.org/t/idea-to-make-zygote-support-mutation-in-easy-cases/92118)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 6\
**Last updated:** [December 27, 2022, 4:34pm UTC](https://discourse.julialang.org/t/idea-to-make-zygote-support-mutation-in-easy-cases/92118 "2022-12-27T16:34:21Z")

</div>

Motivation The appeal of automatic differentiation is that you can write a function using ordinary Julia and the gradient is automatically computed. Disallowing mutation in that function seems reasonable on the surface—i…

---

## [How to load BSON file of the model build with Flux@0.12.10 to use with Flux@0.13? Flux.Diagonal deprecated problem](https://discourse.julialang.org/t/how-to-load-bson-file-of-the-model-build-with-flux-0-12-10-to-use-with-flux-0-13-flux-diagonal-deprecated-problem/91588)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 7\
**Last updated:** [December 27, 2022, 4:24pm UTC](https://discourse.julialang.org/t/how-to-load-bson-file-of-the-model-build-with-flux-0-12-10-to-use-with-flux-0-13-flux-diagonal-deprecated-problem/91588 "2022-12-27T16:24:02Z")

</div>

I have a Transformer model that was built using Transformers.jl and Flux@0.12.10. After training the model, I saved it using BSON. Since Flux@0.13, Flux.Diagonal is deprecated and when I try to load model using BSON an…

---

## [Extend findmin/findmax functions in CUDA](https://discourse.julialang.org/t/extend-findmin-findmax-functions-in-cuda/92184)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 0\
**Last updated:** [December 27, 2022, 1:09pm UTC](https://discourse.julialang.org/t/extend-findmin-findmax-functions-in-cuda/92184 "2022-12-27T13:09:41Z")

</div>

Currently the findmin/findmax functions in CUDA are defined for cases where one passes in them only a single CuArray (link), e.g. findmin(a). However, findmin/findmax functions in Base allow to pass in them an additional…

---

## [How to generate random RGB values through which black text is reliably visible?](https://discourse.julialang.org/t/how-to-generate-random-rgb-values-through-which-black-text-is-reliably-visible/92148)

<div class="topic-metadata">

**Author:** [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Replies:** 4\
**Last updated:** [December 26, 2022, 8:40pm UTC](https://discourse.julialang.org/t/how-to-generate-random-rgb-values-through-which-black-text-is-reliably-visible/92148 "2022-12-26T20:40:10Z")

</div>

I’d like to constrain the randomly coloured nodes in my graphplot to light colours through which black font text is reliably visible. The functions in Random do not operate well with RGB since math is not permitted. How …

---

## [Flux on Production enviroment](https://discourse.julialang.org/t/flux-on-production-enviroment/92136)

<div class="topic-metadata">

**Author:** [@shivance](https://discourse.julialang.org/u/shivance)\
**Replies:** 2\
**Last updated:** [December 26, 2022, 12:17pm UTC](https://discourse.julialang.org/t/flux-on-production-enviroment/92136 "2022-12-26T12:17:21Z")

</div>

We came across this thread (which dates back to two years), which pretty much demonstrates the state of Flux in production environment, which remains intact. Julia is indeed provides a tech stack, which a company once ch…

---

## [How to create a new shapefile containing a few points](https://discourse.julialang.org/t/how-to-create-a-new-shapefile-containing-a-few-points/43454)

<div class="topic-metadata">

**Author:** [@rio](https://discourse.julialang.org/u/rio)\
**Replies:** 19\
**Last updated:** [December 26, 2022, 9:15am UTC](https://discourse.julialang.org/t/how-to-create-a-new-shapefile-containing-a-few-points/43454 "2022-12-26T09:15:32Z")

</div>

Hi, I have the latitude and longitude of a few points (in WGS84, EPS 4326) and I would like to save my points in a Esri shapefile. My 5 points have coordinates like Lon = -44 .+ rand(5); Lat = -23 .+ rand(5) Please,…

---

## [Design a parameterized wave speed function](https://discourse.julialang.org/t/design-a-parameterized-wave-speed-function/92111)

<div class="topic-metadata">

**Author:** [@gladisor](https://discourse.julialang.org/u/gladisor)\
**Replies:** 0\
**Last updated:** [December 25, 2022, 7:57pm UTC](https://discourse.julialang.org/t/design-a-parameterized-wave-speed-function/92111 "2022-12-25T19:57:26Z")

</div>

Hello SciML community, I am a new user of some of the packages in this ecosystem in search of some guidance of how to efficiently write code which models the behavior of acoustic waves in two dimensions. So far I have c…

---

## [Translating a TuringGLM model to a Turing model](https://discourse.julialang.org/t/translating-a-turingglm-model-to-a-turing-model/91818)

<div class="topic-metadata">

**Author:** [@PeetoomHeida](https://discourse.julialang.org/u/PeetoomHeida)\
**Replies:** 4\
**Last updated:** [December 25, 2022, 7:31pm UTC](https://discourse.julialang.org/t/translating-a-turingglm-model-to-a-turing-model/91818 "2022-12-25T19:31:59Z")

</div>

I am trying to implement a hierarchical model, and am running into issues getting the model to return the parameters I used to generate a test data set. When I implement the model using TuringGLM I get the parameters I e…

---

## [Bug in CUDA, CuArray, or something I just don't know?](https://discourse.julialang.org/t/bug-in-cuda-cuarray-or-something-i-just-dont-know/92059)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 3\
**Last updated:** [December 25, 2022, 12:03pm UTC](https://discourse.julialang.org/t/bug-in-cuda-cuarray-or-something-i-just-dont-know/92059 "2022-12-25T12:03:33Z")

</div>

Hello! When I run this code to convert a vector of ints into a CuArray, I see something extremely weird… julia\> ListOfInts = collect(1:1\*10^6) 1000000-element Vector{Int64}: 1 2 3 4 5…

---

## [Best practices to reduce startup time for CUDA.jl?](https://discourse.julialang.org/t/best-practices-to-reduce-startup-time-for-cuda-jl/92102)

<div class="topic-metadata">

**Author:** [@parthe](https://discourse.julialang.org/u/parthe)\
**Replies:** 2\
**Last updated:** [December 25, 2022, 9:54am UTC](https://discourse.julialang.org/t/best-practices-to-reduce-startup-time-for-cuda-jl/92102 "2022-12-25T09:54:47Z")

</div>

Github Discussion Hi, I am looking for best practices to load the CUDA.jl package and the first usage of methods such as CUDA.randn from this package. I am running CUDA.jl on a cluster node. I am not sure if I am usin…

---

## [Help with implementing a toy model using continuous space](https://discourse.julialang.org/t/help-with-implementing-a-toy-model-using-continuous-space/92092)

<div class="topic-metadata">

**Author:** [@CosmicSpittle](https://discourse.julialang.org/u/CosmicSpittle)\
**Replies:** 6\
**Last updated:** [December 24, 2022, 11:21pm UTC](https://discourse.julialang.org/t/help-with-implementing-a-toy-model-using-continuous-space/92092 "2022-12-24T23:21:47Z")

</div>

Hello everyone! I’m new to Julia so apologies if I couldn’t figure out to make this more minimal. This is a simple continuous space where a few dolphins (agents with type dolphin) get randomly positioned and at each m…

---

## [Adding Flexibility/Storage to Matpower case files in PowerModel](https://discourse.julialang.org/t/adding-flexibility-storage-to-matpower-case-files-in-powermodel/92067)

<div class="topic-metadata">

**Author:** [@Wahee01](https://discourse.julialang.org/u/Wahee01)\
**Replies:** 3\
**Last updated:** [December 24, 2022, 9:48pm UTC](https://discourse.julialang.org/t/adding-flexibility-storage-to-matpower-case-files-in-powermodel/92067 "2022-12-24T21:48:13Z")

</div>

Hello, I’m attempting to add flexibility/battery to several nodes in the Matpower IEEE9 bus case file. With this method “% hours mpc.time\_elapsed = 1.0 %% storage data % storage\_bus ps qs energy energy\_rating cha…

---

## [Training a neural network within method of lines and ODE solve framework](https://discourse.julialang.org/t/training-a-neural-network-within-method-of-lines-and-ode-solve-framework/86293)

<div class="topic-metadata">

**Author:** [@kaido975](https://discourse.julialang.org/u/kaido975)\
**Replies:** 3\
**Last updated:** [December 24, 2022, 6:15pm UTC](https://discourse.julialang.org/t/training-a-neural-network-within-method-of-lines-and-ode-solve-framework/86293 "2022-12-24T18:15:02Z")

</div>

I am trying to train a neural network which is a part of a PDE, I am solving the PDE with MOL and ODE solve. Below is the forward pass i.e getting the solution with ODE solve which runs fine. import ModelingToolkit: Int…

---

## [A Unified Interface for Rootfinding](https://discourse.julialang.org/t/a-unified-interface-for-rootfinding/698)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 22\
**Last updated:** [December 24, 2022, 1:56pm UTC](https://discourse.julialang.org/t/a-unified-interface-for-rootfinding/698 "2022-12-24T13:56:23Z")

</div>

One of the most useful developments of Julia is the concept of the metapackage. A package management system coupled with multiple dispatch has lead to ecosystems like Plots.jl, DiffEqBase.jl (DifferentialEquations.jl), a…

---

## [In Gplots, draw PNG gplot applies incorrect edge label?](https://discourse.julialang.org/t/in-gplots-draw-png-gplot-applies-incorrect-edge-label/92033)

<div class="topic-metadata">

**Author:** [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Replies:** 3\
**Last updated:** [December 23, 2022, 1:35pm UTC](https://discourse.julialang.org/t/in-gplots-draw-png-gplot-applies-incorrect-edge-label/92033 "2022-12-23T13:35:04Z")

</div>

I’m experimenting with drawing PNG images of graphs. All is well except that when I attempt to use edge weights as edge labels, all the correct weight values appear in the image, but they are on the wrong edges. As I cr…

---

## [OrdinaryDiffEq throws error when using sparse jacobian without specifying linear solver](https://discourse.julialang.org/t/ordinarydiffeq-throws-error-when-using-sparse-jacobian-without-specifying-linear-solver/89141)

<div class="topic-metadata">

**Author:** [@parb](https://discourse.julialang.org/u/parb)\
**Replies:** 3\
**Last updated:** [December 24, 2022, 7:14am UTC](https://discourse.julialang.org/t/ordinarydiffeq-throws-error-when-using-sparse-jacobian-without-specifying-linear-solver/89141 "2022-12-24T07:14:49Z")

</div>

Hi All, I nearly successfully created a sparse ODEProblem by using Symbolics.jacobian\_sparsity, but the solver throws an error unless I use TRBDF2(), (or one of the other linear solvers), coming from OrdinaryDiffEq (her…

---

## [Discrepancy in DiffEqParamEstim](https://discourse.julialang.org/t/discrepancy-in-diffeqparamestim/86300)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [December 24, 2022, 6:34am UTC](https://discourse.julialang.org/t/discrepancy-in-diffeqparamestim/86300 "2022-12-24T06:34:23Z")

</div>

Before I open a bug report on the official repo, just want to make sure I am on the right path. Consider a simple 2 parameter estimation of an ODE. using DifferentialEquations using DiffEqParamEstim using Optim # some …

---

## [ModelingToolkit variable metadata for connectors](https://discourse.julialang.org/t/modelingtoolkit-variable-metadata-for-connectors/92056)

<div class="topic-metadata">

**Author:** [@xlxs4](https://discourse.julialang.org/u/xlxs4)\
**Replies:** 2\
**Last updated:** [December 23, 2022, 9:04pm UTC](https://discourse.julialang.org/t/modelingtoolkit-variable-metadata-for-connectors/92056 "2022-12-23T21:04:03Z")

</div>

Hi! In the MTK documentation, specifically page Contextual Variable Types · ModelingToolkit.jl (sciml.ai) it reads: In many engineering systems some variables act like “flows” while others do not. For example, in circu…

---

## [Mass matrix DAEs](https://discourse.julialang.org/t/mass-matrix-daes/6805)

<div class="topic-metadata">

**Author:** [@FHell](https://discourse.julialang.org/u/FHell)\
**Replies:** 6\
**Last updated:** [December 23, 2022, 8:59pm UTC](https://discourse.julialang.org/t/mass-matrix-daes/6805 "2022-12-23T20:59:16Z")

</div>

Hi, I am trying to run some DAE simulations using DifferentialEquations.jl, and am having some trouble. I am doing a very simple test function: function f!(t, u, du) du\[1\] = u\[2\] du\[2\] = u\[2\] - 1. return end…

---

## [Incorrect lyapunov spectrum DynamicalSystems.jl](https://discourse.julialang.org/t/incorrect-lyapunov-spectrum-dynamicalsystems-jl/91998)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 11\
**Last updated:** [December 23, 2022, 4:48pm UTC](https://discourse.julialang.org/t/incorrect-lyapunov-spectrum-dynamicalsystems-jl/91998 "2022-12-23T16:48:52Z")

</div>

I calculate lyapunov spectrum and it don’t have zero exponent. How i can it fix? I tried change intregrator from RK4 on Tsit5 and Vern9 and it don’t help. Also increase time of integrate don’t help function model(u, p …

---

## [Difficulty with utilizing PowerModels.update data! function](https://discourse.julialang.org/t/difficulty-with-utilizing-powermodels-update-data-function/91906)

<div class="topic-metadata">

**Author:** [@Wahee01](https://discourse.julialang.org/u/Wahee01)\
**Replies:** 5\
**Last updated:** [December 23, 2022, 4:25pm UTC](https://discourse.julialang.org/t/difficulty-with-utilizing-powermodels-update-data-function/91906 "2022-12-23T16:25:03Z")

</div>

Hello to everyone. I apologize if my inquiry is too simple. Julia is a programming language that I am learning. For optimal power flow and power flow problems, I use the PowerModels toolkit. PowerModels.update data! is a…

---

## [Indexing a DataFrame Index](https://discourse.julialang.org/t/indexing-a-dataframe-index/92030)

<div class="topic-metadata">

**Author:** [@wiseac](https://discourse.julialang.org/u/wiseac)\
**Replies:** 12\
**Last updated:** [December 23, 2022, 4:08pm UTC](https://discourse.julialang.org/t/indexing-a-dataframe-index/92030 "2022-12-23T16:08:23Z")

</div>

Hello, I am trying to write a function that takes in a DataFrame that has an index, df\[x:x2,c\], and uses those index numbers for calculations. An example would taking df\[1:100,1\] and then multiplying 1 and 100 by 2. Wh…

---

## [StableRNG in Turing is not producing reproducible output](https://discourse.julialang.org/t/stablerng-in-turing-is-not-producing-reproducible-output/92032)

<div class="topic-metadata">

**Author:** [@Sourish](https://discourse.julialang.org/u/Sourish)\
**Replies:** 12\
**Last updated:** [December 23, 2022, 3:45pm UTC](https://discourse.julialang.org/t/stablerng-in-turing-is-not-producing-reproducible-output/92032 "2022-12-23T15:45:36Z")

</div>

Hi All: In the following code, we are using StableRNGs. However, the results are not reproducing. Can anybody help us? So that we can reproduce the results. using Turing, StableRNGs @model function example(x) m ~ …

---

## [Constraints tolerance IPNewton in Optim.jl](https://discourse.julialang.org/t/constraints-tolerance-ipnewton-in-optim-jl/92038)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 0\
**Last updated:** [December 23, 2022, 8:56am UTC](https://discourse.julialang.org/t/constraints-tolerance-ipnewton-in-optim-jl/92038 "2022-12-23T08:56:01Z")

</div>

Hello, I was wondering if it is possible to specify up to which tolerance the equality constraints are satisfied in Optim.jl using IPNewton method. Currently, the optimization stops because x\_tol or f\_tol are satisfied…

---

## [Automatically naming N similar elements in MTK](https://discourse.julialang.org/t/automatically-naming-n-similar-elements-in-mtk/91888)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 5\
**Last updated:** [December 23, 2022, 11:41am UTC](https://discourse.julialang.org/t/automatically-naming-n-similar-elements-in-mtk/91888 "2022-12-23T11:41:24Z")

</div>

Hi, I’d like a simple way of creating a “vector” of similar elements. I.e. I’d like: @named R = \[Resistor(R=n) for n in 1:10\] to create a vector of Resistors with resistances 1 to 10. These could be named e.g. R\_1…R\_…

---

## [Constraint set with max function](https://discourse.julialang.org/t/constraint-set-with-max-function/91997)

<div class="topic-metadata">

**Author:** [@baprata](https://discourse.julialang.org/u/baprata)\
**Replies:** 2\
**Last updated:** [December 23, 2022, 9:59am UTC](https://discourse.julialang.org/t/constraint-set-with-max-function/91997 "2022-12-23T09:59:13Z")

</div>

Concerning the constraint set I am having problem with the last term of the constraint (?): @constraint(model, \[m in 1:machines, j in 1:jobs\], PT\[m,j\] == SET\[m\] \* Z\[m,j\] + VT\[m\]\*(sum(v\[i\] \* X\[m,j,i\] for i in 1:parts)…

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

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