# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=219

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

**Page:** 220

---

## [Solving a system of matrix differential equations using DifferentialEquations.jl](https://discourse.julialang.org/t/solving-a-system-of-matrix-differential-equations-using-differentialequations-jl/107663)

<div class="topic-metadata">

**Author:** [@Aleksandr\_Mikheev](https://discourse.julialang.org/u/Aleksandr_Mikheev)\
**Replies:** 5\
**Last updated:** [December 16, 2023, 7:56pm UTC](https://discourse.julialang.org/t/solving-a-system-of-matrix-differential-equations-using-differentialequations-jl/107663 "2023-12-16T19:56:11Z")

</div>

How shall I initialize my initial condition for the system of matrix differential equations using DifferentialEquations.jl? As a simple example, suppose I want to solve the following trivial system of equations: functio…

---

## [Chebyshev Transform using FFTW and FastTransforms.jl Speed](https://discourse.julialang.org/t/chebyshev-transform-using-fftw-and-fasttransforms-jl-speed/107387)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 6\
**Last updated:** [December 16, 2023, 6:18pm UTC](https://discourse.julialang.org/t/chebyshev-transform-using-fftw-and-fasttransforms-jl-speed/107387 "2023-12-16T18:18:38Z")

</div>

I’m looking into spectral methods for some PDEs. For the discrete Chebyshev Transform, it is basically a discrete cosine transform: I’ve looked at FastTransforms.jl as they have a Chebyshev Transform which can be used…

---

## [Why function names starting with '\_'?](https://discourse.julialang.org/t/why-function-names-starting-with/107696)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 5\
**Last updated:** [December 16, 2023, 5:14pm UTC](https://discourse.julialang.org/t/why-function-names-starting-with/107696 "2023-12-16T17:14:29Z")

</div>

I see many functions named like ‘\_my\_fun1’ in some package. What is the purpose of such naming? I guess it is a standard practice in programing, right?

---

## [Not being able to update](https://discourse.julialang.org/t/not-being-able-to-update/107703)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 0\
**Last updated:** [December 16, 2023, 9:34am UTC](https://discourse.julialang.org/t/not-being-able-to-update/107703 "2023-12-16T09:34:36Z")

</div>

What’s wrong here? Thanks. (@v1.7) pkg\> up IntelVectorMath Updating registry at \`C:\\Users\\ytian\\.julia\\registries\\General.toml\` ┌ Warning: could not download https://pkg.julialang.org/registries │ exception = HTTP…

---

## [Why does this really simple linear SDE diverge?](https://discourse.julialang.org/t/why-does-this-really-simple-linear-sde-diverge/107640)

<div class="topic-metadata">

**Author:** [@George\_Stepaniants](https://discourse.julialang.org/u/George_Stepaniants)\
**Replies:** 5\
**Last updated:** [December 16, 2023, 12:15am UTC](https://discourse.julialang.org/t/why-does-this-really-simple-linear-sde-diverge/107640 "2023-12-16T00:15:12Z")

</div>

using DifferentialEquations using LinearAlgebra N = 5 conn = -Matrix{Float64}(I, N, N) sigma = Matrix{Float64}(I, N, N) f(v, p, t) = conn \* v g(v, p, t) = sigma Nt = 200 T = 100.0 # measured in seconds prob = SDEProbl…

---

## [Updating the same plot window with multiple panes in a loop](https://discourse.julialang.org/t/updating-the-same-plot-window-with-multiple-panes-in-a-loop/107690)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 0\
**Last updated:** [December 15, 2023, 11:20pm UTC](https://discourse.julialang.org/t/updating-the-same-plot-window-with-multiple-panes-in-a-loop/107690 "2023-12-15T23:20:31Z")

</div>

I am trying to update the same plot window in loop, with the window having multiple (in this case, two is sufficient) panes. But this code doesn’t update the window. How do I go about doing this? EDIT: It is fine even …

---

## [Benchmarking Symbolics.jl against SymEngine.jl](https://discourse.julialang.org/t/benchmarking-symbolics-jl-against-symengine-jl/103744)

<div class="topic-metadata">

**Author:** [@certik](https://discourse.julialang.org/u/certik)\
**Replies:** 8\
**Last updated:** [December 15, 2023, 9:47pm UTC](https://discourse.julialang.org/t/benchmarking-symbolics-jl-against-symengine-jl/103744 "2023-12-15T21:47:26Z")

</div>

I finally found time to benchmark the Symbolics.jl against SymEngine.jl. Here are the results: Am I doing anything wrong with how I run them? So far on my computer Symbolics.jl seems slower. I want to make sure that I…

---

## [Executing code blocks with REPL workspace](https://discourse.julialang.org/t/executing-code-blocks-with-repl-workspace/107572)

<div class="topic-metadata">

**Author:** [@kealme](https://discourse.julialang.org/u/kealme)\
**Replies:** 13\
**Last updated:** [December 15, 2023, 6:54pm UTC](https://discourse.julialang.org/t/executing-code-blocks-with-repl-workspace/107572 "2023-12-15T18:54:14Z")

</div>

Hi, I have a very basic question about Julia: I’ve written a function in julia and im trying to debug the code. I can mark a block of code and execute it using Shift+Enter. However, when executing the code like this, t…

---

## [How to build a matrix where each element is a vector](https://discourse.julialang.org/t/how-to-build-a-matrix-where-each-element-is-a-vector/107674)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 4\
**Last updated:** [December 15, 2023, 5:02pm UTC](https://discourse.julialang.org/t/how-to-build-a-matrix-where-each-element-is-a-vector/107674 "2023-12-15T17:02:49Z")

</div>

Hi all, I’m looking for the best way to construct a matrix where each element is an actual vector. More specifically, if I have: fs = 10 # Sampling Frequnecy \[Hz\] 𝑓 = 1e-3 # Forcing frequency \[Hz\] t\_end = 10^4 t = col…

---

## [How to get information about symbol scoping in Julia while compilation?](https://discourse.julialang.org/t/how-to-get-information-about-symbol-scoping-in-julia-while-compilation/107643)

<div class="topic-metadata">

**Author:** [@Akhil\_Akkapelli](https://discourse.julialang.org/u/Akhil_Akkapelli)\
**Replies:** 3\
**Last updated:** [December 15, 2023, 4:01pm UTC](https://discourse.julialang.org/t/how-to-get-information-about-symbol-scoping-in-julia-while-compilation/107643 "2023-12-15T16:01:50Z")

</div>

I’m interested in understanding how Julia determines the scope of each symbol during compilation. I’d like to get detailed information about the scope of every symbol instance in the code, ideally as output from the comp…

---

## [Documenter.jl: Link to Source not working](https://discourse.julialang.org/t/documenter-jl-link-to-source-not-working/107673)

<div class="topic-metadata">

**Author:** [@kealme](https://discourse.julialang.org/u/kealme)\
**Replies:** 0\
**Last updated:** [December 15, 2023, 3:22pm UTC](https://discourse.julialang.org/t/documenter-jl-link-to-source-not-working/107673 "2023-12-15T15:22:54Z")

</div>

Hi, I’m using Documenter.jl to create my documentation. However, the “Link to Source”, which is available in every HTML-page, where i reference to some function of my package, is broken. It actually appears, but just li…

---

## [Fieldnames for a user-defined struct](https://discourse.julialang.org/t/fieldnames-for-a-user-defined-struct/107661)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [December 15, 2023, 3:03pm UTC](https://discourse.julialang.org/t/fieldnames-for-a-user-defined-struct/107661 "2023-12-15T15:03:37Z")

</div>

Suppose I have a variable ‘x’ which is of type ‘mydatatype’ which is a user-defined struct. When I tried fieldnames(x) I got a method error. Is it because I need a method of ‘fieldnames’ for my self-defined datatype? …

---

## [Fields of a struct](https://discourse.julialang.org/t/fields-of-a-struct/107664)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 5\
**Last updated:** [December 15, 2023, 2:03pm UTC](https://discourse.julialang.org/t/fields-of-a-struct/107664 "2023-12-15T14:03:27Z")

</div>

julia\> fieldnames(typeof(state)) (:hamiltonian, :replicas, :maxlength, :r\_strat, :s\_strat, :τ\_strat, :post\_step, :replica) julia\> state.step 5000 julia\> state.laststep 5000 It is strange that while the variable ‘state…

---

## [Adding Plotly package](https://discourse.julialang.org/t/adding-plotly-package/107658)

<div class="topic-metadata">

**Author:** [@soo\_y](https://discourse.julialang.org/u/soo_y)\
**Replies:** 0\
**Last updated:** [December 15, 2023, 11:54am UTC](https://discourse.julialang.org/t/adding-plotly-package/107658 "2023-12-15T11:54:52Z")

</div>

I am trying to install Plotly. But it has been like below for hours and hours and no progress. Is there something going on with this package? \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) …

---

## [How to break down string into chunk of n Kb while maintaining meaning](https://discourse.julialang.org/t/how-to-break-down-string-into-chunk-of-n-kb-while-maintaining-meaning/107629)

<div class="topic-metadata">

**Author:** [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Replies:** 1\
**Last updated:** [December 14, 2023, 11:45pm UTC](https://discourse.julialang.org/t/how-to-break-down-string-into-chunk-of-n-kb-while-maintaining-meaning/107629 "2023-12-14T23:45:22Z")

</div>

I am sending string to AWS Translate but I need to respect the 10000Kb limit for the string. in case I have longer strings, I am using this approach my\_long\_string = "some very long text...." # AWS limit aws\_limit = 10…

---

## [Issue with BifurcationKit.continuation and arbitrary ODE system - MethodErrors (Convert, ambiguous, Incorrect matrix dimensions...)](https://discourse.julialang.org/t/issue-with-bifurcationkit-continuation-and-arbitrary-ode-system-methoderrors-convert-ambiguous-incorrect-matrix-dimensions/107636)

<div class="topic-metadata">

**Author:** [@Mahnoor\_Pop](https://discourse.julialang.org/u/Mahnoor_Pop)\
**Replies:** 0\
**Last updated:** [December 14, 2023, 10:44pm UTC](https://discourse.julialang.org/t/issue-with-bifurcationkit-continuation-and-arbitrary-ode-system-methoderrors-convert-ambiguous-incorrect-matrix-dimensions/107636 "2023-12-14T22:44:28Z")

</div>

Hi all! I’m trying to set up a pipeline for creating an ODE system based on a network of interactions. As a simple example, the corresponding system for the following network would be as such: \\frac{dA}{dt}=-A+\\Phi(FB…

---

## [Why Turing.jl does not work with NUTS() and HMC() samplers?](https://discourse.julialang.org/t/why-turing-jl-does-not-work-with-nuts-and-hmc-samplers/107616)

<div class="topic-metadata">

**Author:** [@josimar](https://discourse.julialang.org/u/josimar)\
**Replies:** 2\
**Last updated:** [December 14, 2023, 7:19pm UTC](https://discourse.julialang.org/t/why-turing-jl-does-not-work-with-nuts-and-hmc-samplers/107616 "2023-12-14T19:19:50Z")

</div>

I am experimenting with the Turing.jl package. I am trying to run the example model below but I get an error messagge when I try to use the NUTS() or the HMC() samplers. The error only occurs when I try to slice the arra…

---

## [Julia packages with Singularity](https://discourse.julialang.org/t/julia-packages-with-singularity/19883)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 19\
**Last updated:** [December 14, 2023, 6:14pm UTC](https://discourse.julialang.org/t/julia-packages-with-singularity/19883 "2023-12-14T18:14:15Z")

</div>

How do we create Singularity containers which contains a reproducible set of packages which are installed at countainer build time? Singularity https://www.sylabs.io/ This discussion should follow on from a thread on t…

---

## [How do I change the dimension of an array](https://discourse.julialang.org/t/how-do-i-change-the-dimension-of-an-array/107623)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 3\
**Last updated:** [December 14, 2023, 5:47pm UTC](https://discourse.julialang.org/t/how-do-i-change-the-dimension-of-an-array/107623 "2023-12-14T17:47:25Z")

</div>

If I have an array with the size of 33x180x360, how do I change it to the size of 33x360x180? Thank you.

---

## [How to combine two gridded data?](https://discourse.julialang.org/t/how-to-combine-two-gridded-data/107621)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 2\
**Last updated:** [December 14, 2023, 5:07pm UTC](https://discourse.julialang.org/t/how-to-combine-two-gridded-data/107621 "2023-12-14T17:07:42Z")

</div>

I have a variable A with the size of 33x168x360. The 2nd dimension is latitude with a range of -77.5 to 89.5. My goal is to expand it to the size of 33x180x360, with the latitude range between -89.5 to 89.5 prefilled wit…

---

## [Compile-time vs run-time](https://discourse.julialang.org/t/compile-time-vs-run-time/107606)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [December 14, 2023, 1:26pm UTC](https://discourse.julialang.org/t/compile-time-vs-run-time/107606 "2023-12-14T13:26:27Z")

</div>

I saw people use ‘Val’ in their codes. help?\> ntuple search: ntuple NTuple NamedTuple @NamedTuple UnitUpperTriangular ntuple(f::Function, n::Integer) Create a tuple of length n, computing each element as f(i), whe…

---

## [UndefVarError when using \`EnsembleDistributed()\` to solve \`ODEProblem\`](https://discourse.julialang.org/t/undefvarerror-when-using-ensembledistributed-to-solve-odeproblem/107434)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 1\
**Last updated:** [December 14, 2023, 10:34am UTC](https://discourse.julialang.org/t/undefvarerror-when-using-ensembledistributed-to-solve-odeproblem/107434 "2023-12-14T10:34:22Z")

</div>

I am trying to solve relatively large systems of coupled ODEs, but I cannot seem to solve an EnsembleProblem(..) when the ODEProblem is generated using the @reaction\_network macro of Catalyst.jl (or, more specifically, w…

---

## [Parallelize double nested loop using Dagger for Montecarlo](https://discourse.julialang.org/t/parallelize-double-nested-loop-using-dagger-for-montecarlo/107493)

<div class="topic-metadata">

**Author:** [@matinator](https://discourse.julialang.org/u/matinator)\
**Replies:** 5\
**Last updated:** [December 14, 2023, 9:59am UTC](https://discourse.julialang.org/t/parallelize-double-nested-loop-using-dagger-for-montecarlo/107493 "2023-12-14T09:59:34Z")

</div>

Hello everyone, I am trying to parallelize this montecarlo function that I have created for measuring an option price using the BlackScholes model and I would like to improve its performance by parallelizing the double …

---

## [Best strategy to choose the number of gc threads on a cluster](https://discourse.julialang.org/t/best-strategy-to-choose-the-number-of-gc-threads-on-a-cluster/107596)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [December 14, 2023, 9:45am UTC](https://discourse.julialang.org/t/best-strategy-to-choose-the-number-of-gc-threads-on-a-cluster/107596 "2023-12-14T09:45:04Z")

</div>

I have a multithreaded code that I am running on a cluster using Julia v1.10, and it allocates many temporary arrays. The computation is quite linear algebra heavy, and I would like to keep freeing memory from time to ti…

---

## [Passing struct by value in static compiling](https://discourse.julialang.org/t/passing-struct-by-value-in-static-compiling/107597)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 2\
**Last updated:** [December 14, 2023, 5:28am UTC](https://discourse.julialang.org/t/passing-struct-by-value-in-static-compiling/107597 "2023-12-14T05:28:07Z")

</div>

We know in Julia structs are passed by reference, and this is also the case in StaticCompiler.jl: using StaticTools using StaticCompiler struct StudentInfo name::StaticString id::Cint end id(student::StudentI…

---

## [Custom data structure for repeatedly partial sorting constant-size array](https://discourse.julialang.org/t/custom-data-structure-for-repeatedly-partial-sorting-constant-size-array/107594)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 1\
**Last updated:** [December 14, 2023, 2:10am UTC](https://discourse.julialang.org/t/custom-data-structure-for-repeatedly-partial-sorting-constant-size-array/107594 "2023-12-14T02:10:35Z")

</div>

I have an application where, as a subroutine, I need to (partial) sort a specific n-dimensional vector repeatedly (for n\>10^7). Given initial data x^{(0)} and some perturbation \\epsilon^{(i)} in step i, I want to obtain x…

---

## [I want to use a PriorityQueue equivalent with duplicate keys](https://discourse.julialang.org/t/i-want-to-use-a-priorityqueue-equivalent-with-duplicate-keys/107534)

<div class="topic-metadata">

**Author:** [@Lee\_Phillips](https://discourse.julialang.org/u/Lee_Phillips)\
**Replies:** 4\
**Last updated:** [December 14, 2023, 2:09am UTC](https://discourse.julialang.org/t/i-want-to-use-a-priorityqueue-equivalent-with-duplicate-keys/107534 "2023-12-14T02:09:08Z")

</div>

Hey All I have some code pasted below making use of PriorityQueue from DataStructures package I’d like to store key value pairs in a sorted manner to easily retrieve the lowest key from the set. I need to be able to u…

---

## [Installing Plots](https://discourse.julialang.org/t/installing-plots/107593)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [December 14, 2023, 12:31am UTC](https://discourse.julialang.org/t/installing-plots/107593 "2023-12-14T00:31:25Z")

</div>

I tried to install the ‘Plots’ package. But it always failed. (@v1.9) pkg\> add Plots Resolving package versions... Downloaded artifact: GR Downloaded artifact: GR Downloaded artifact: LERC Downloaded artifact…

---

## [Generating random numbers in Julia in different machines](https://discourse.julialang.org/t/generating-random-numbers-in-julia-in-different-machines/107589)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 2\
**Last updated:** [December 13, 2023, 10:50pm UTC](https://discourse.julialang.org/t/generating-random-numbers-in-julia-in-different-machines/107589 "2023-12-13T22:50:24Z")

</div>

Dear all, I want to generate reproductive random numbers in Julia. I have used the code: using Random rng = MersenneTwister(2024); z = round.(100 .+ 200\*rand(rng),digits=3) That’s ok, works very well. However, When …

---

## [Pkg extensions backwards compatibility + Aqua = failed test](https://discourse.julialang.org/t/pkg-extensions-backwards-compatibility-aqua-failed-test/107578)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 3\
**Last updated:** [December 13, 2023, 9:13pm UTC](https://discourse.julialang.org/t/pkg-extensions-backwards-compatibility-aqua-failed-test/107578 "2023-12-13T21:13:20Z")

</div>

I have a package that I’m trying to test with Aqua. This package has some extensions that I want to support on older Julia versions. So, as recommended here in the Pkg docs I have the lines if !isdefined(Base, :get\_ex…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=218)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=220)
