# General Usage

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

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

**Page:** 72

---

## [System of differential equations in Julia (BVP)](https://discourse.julialang.org/t/system-of-differential-equations-in-julia-bvp/128059)

<div class="topic-metadata">

**Author:** [@tripo](https://discourse.julialang.org/u/tripo)\
**Replies:** 2\
**Last updated:** [April 14, 2025, 2:37pm UTC](https://discourse.julialang.org/t/system-of-differential-equations-in-julia-bvp/128059 "2025-04-14T14:37:00Z")

</div>

Hello, i’m trying to solve a differential equation using DifferentialEquations.jl. In the end, i’ll try to solve the equation $$ \\ddot{\\lambda} + A\\lambda = f ,\\quad \\dot{\\lambda}(0) = a, \\ \\dot{\\lambda}(1) = b $$ wh…

---

## [LoadError: MethodError: no method matching (::Colon)(::Int64, ::Nothing)](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-colon-int64-nothing/128052)

<div class="topic-metadata">

**Author:** [@Efstein](https://discourse.julialang.org/u/Efstein)\
**Replies:** 4\
**Last updated:** [April 14, 2025, 1:18pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-colon-int64-nothing/128052 "2025-04-14T13:18:22Z")

</div>

Hi Everbody! I’m still quite new to Julia, so I hope I am not missing something obvious here… My task is to solve numerically a system of equations, my working example looks like this: using Optimization, Zygote, Symb…

---

## [Design of efficient lazy broadcastable operator](https://discourse.julialang.org/t/design-of-efficient-lazy-broadcastable-operator/128049)

<div class="topic-metadata">

**Author:** [@Vitor\_Patricio\_Canta](https://discourse.julialang.org/u/Vitor_Patricio_Canta)\
**Replies:** 11\
**Last updated:** [April 14, 2025, 12:29pm UTC](https://discourse.julialang.org/t/design-of-efficient-lazy-broadcastable-operator/128049 "2025-04-14T12:29:09Z")

</div>

Hi, I am designing a bunch of operators I would like to evaluate lazily on sets of points (grid cells). The problem is that my design pattern still allocates a bit more when broadcasting, and involves me extending the b…

---

## [Type conversion](https://discourse.julialang.org/t/type-conversion/128012)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [April 13, 2025, 7:45pm UTC](https://discourse.julialang.org/t/type-conversion/128012 "2025-04-13T19:45:50Z")

</div>

After reading an arrow file I get the following type: julia\> sl.heading 200-element Arrow.Primitive{Float32, Vector{Float32}}: -0.0023596277 -0.004771689 -0.0052604624 ⋮ -0.31095406 -0.33066812 -0.338615 If I w…

---

## [Can juliac increase julia adoption?](https://discourse.julialang.org/t/can-juliac-increase-julia-adoption/127838)

<div class="topic-metadata">

**Author:** [@Anil\_Beniwal](https://discourse.julialang.org/u/Anil_Beniwal)\
**Replies:** 60\
**Last updated:** [April 13, 2025, 6:46pm UTC](https://discourse.julialang.org/t/can-juliac-increase-julia-adoption/127838 "2025-04-13T18:46:44Z")

</div>

rust star history shows exponential trend while julia going towards logrithimic scale towards stagnation.

---

## [Gtk does not work well in VSCode](https://discourse.julialang.org/t/gtk-does-not-work-well-in-vscode/128024)

<div class="topic-metadata">

**Author:** [@gangchern](https://discourse.julialang.org/u/gangchern)\
**Replies:** 1\
**Last updated:** [April 13, 2025, 5:29pm UTC](https://discourse.julialang.org/t/gtk-does-not-work-well-in-vscode/128024 "2025-04-13T17:29:38Z")

</div>

Anybody try Gtk.jl, It works well in Jupyter . But when I try it in VSCode, it generate some errors. using Gtk Gtk.init() # Create a main window win = GtkWindow("TextField and Button Example", 300, 100) # Handle the…

---

## [How to create interdependent widgets in Pluto](https://discourse.julialang.org/t/how-to-create-interdependent-widgets-in-pluto/127774)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [April 13, 2025, 2:56pm UTC](https://discourse.julialang.org/t/how-to-create-interdependent-widgets-in-pluto/127774 "2025-04-13T14:56:53Z")

</div>

Hello, I am trying to make interdependent widgets based on the wind speeds example. Here is what I am trying to do: select a distribution from a Select menu and add a labeled NumberField to the right for each parameter.…

---

## [How to differentiate functions involving arrays with one non-zero element in Zygote](https://discourse.julialang.org/t/how-to-differentiate-functions-involving-arrays-with-one-non-zero-element-in-zygote/127741)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 4\
**Last updated:** [April 13, 2025, 9:27am UTC](https://discourse.julialang.org/t/how-to-differentiate-functions-involving-arrays-with-one-non-zero-element-in-zygote/127741 "2025-04-13T09:27:15Z")

</div>

Hello, I need to differentiate using Zygote.jl a function like using LinearAlgebra function my\_fidelity2(p) ψg = zeros(ComplexF64, 2) ψg\[2\] = 1.0 ψe = zeros(ComplexF64, 2) ψe\[1\] = 1.0 ψgg = kron(ψg, ψg) ψ…

---

## [Type-instability, runtime dispatch, and heap allocations](https://discourse.julialang.org/t/type-instability-runtime-dispatch-and-heap-allocations/127985)

<div class="topic-metadata">

**Author:** [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)\
**Replies:** 3\
**Last updated:** [April 12, 2025, 5:51am UTC](https://discourse.julialang.org/t/type-instability-runtime-dispatch-and-heap-allocations/127985 "2025-04-12T05:51:45Z")

</div>

I wanted to check/improve my understanding of allocations caused by type-instabilities. Consider the following: function f() x = g() y = h(x) z = b(x) end g() = Any\[1\]\[1\] h(::Int) = 1 h(::Any) = Any\[2\]\[1\]…

---

## [What does 0 allocations: #=nonzero=# bytes mean?](https://discourse.julialang.org/t/what-does-0-allocations-nonzero-bytes-mean/127997)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 6\
**Last updated:** [April 12, 2025, 6:03pm UTC](https://discourse.julialang.org/t/what-does-0-allocations-nonzero-bytes-mean/127997 "2025-04-12T18:03:36Z")

</div>

Sometimes BenchmarkTools reports 0 allocations but the number of bytes isn’t 0. It can vary between runs. What does that mean? julia\> using BenchmarkTools julia\> foo() = rand((1.3, 1)) foo (generic function with 1 meth…

---

## [Fix parameter when passing to optimizer](https://discourse.julialang.org/t/fix-parameter-when-passing-to-optimizer/61102)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 26\
**Last updated:** [April 12, 2025, 3:16pm UTC](https://discourse.julialang.org/t/fix-parameter-when-passing-to-optimizer/61102 "2025-04-12T15:16:23Z")

</div>

When doing the optimization step, I often want to fix some parameters of the model. With parameters being a NamedTuple, or ComponentArray, my current solution is to split to organized two sets of parameters (free and fi…

---

## [Ref vs zero-dimensional arrays?](https://discourse.julialang.org/t/ref-vs-zero-dimensional-arrays/24434)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 12\
**Last updated:** [April 12, 2025, 11:42am UTC](https://discourse.julialang.org/t/ref-vs-zero-dimensional-arrays/24434 "2025-04-12T11:42:46Z")

</div>

What is the difference between a zero-dimensional array holding the value x, which you construct using fill(x), and a Ref(x)? In both cases you would access the underlying data via \[\], which can be set or read. And it …

---

## [Is there a julia package that uses Newton-Krylov method for systems of nonlinear equations?](https://discourse.julialang.org/t/is-there-a-julia-package-that-uses-newton-krylov-method-for-systems-of-nonlinear-equations/36520)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 28\
**Last updated:** [April 12, 2025, 11:40am UTC](https://discourse.julialang.org/t/is-there-a-julia-package-that-uses-newton-krylov-method-for-systems-of-nonlinear-equations/36520 "2025-04-12T11:40:28Z")

</div>

IterativeSolvers.jl doesn’t deal with nonlinear equations and NLsolve.jl doesn’t have Krylov methods? What about large sparse nonlinear iterative solvers?

---

## [Ref is not a concrete type - poorly documented?](https://discourse.julialang.org/t/ref-is-not-a-concrete-type-poorly-documented/120375)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 17\
**Last updated:** [April 12, 2025, 10:18am UTC](https://discourse.julialang.org/t/ref-is-not-a-concrete-type-poorly-documented/120375 "2025-04-12T10:18:08Z")

</div>

I just learned from Why are ref's in structs type unstable? that Ref is not a concrete type, and so structs containing a Ref are not type-stable, e.g. struct Foo a::Ref end Instead you have to use, for example, RefVa…

---

## [OpenCascade](https://discourse.julialang.org/t/opencascade/127956)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 1\
**Last updated:** [April 12, 2025, 5:53am UTC](https://discourse.julialang.org/t/opencascade/127956 "2025-04-12T05:53:38Z")

</div>

Hi, Is anyone working on an OpenCascade wrapper for Julia? I just found this automatically generated package GitHub - JuliaBinaryWrappers/OCCT\_jll.jl but I believe that the bindings are still required. Thanks

---

## [Arb\_jll fails to load/precompile dylib after MacOS update](https://discourse.julialang.org/t/arb-jll-fails-to-load-precompile-dylib-after-macos-update/127989)

<div class="topic-metadata">

**Author:** [@hsgg](https://discourse.julialang.org/u/hsgg)\
**Replies:** 4\
**Last updated:** [April 12, 2025, 12:18am UTC](https://discourse.julialang.org/t/arb-jll-fails-to-load-precompile-dylib-after-macos-update/127989 "2025-04-12T00:18:19Z")

</div>

I upgraded MacOS from Sequoia 15.3 to 15.4 this week. I also updated homebrew at the same time. Julia is installed via juliaup and is at 1.11.4. Since the upgrade, julia fails to load Arb\_jll needed by ArbNumerics.jl, w…

---

## [Does \`@distributed\` return an array of futures?](https://discourse.julialang.org/t/does-distributed-return-an-array-of-futures/127992)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 9:54pm UTC](https://discourse.julialang.org/t/does-distributed-return-an-array-of-futures/127992 "2025-04-11T21:54:08Z")

</div>

The Julia manual (Multi-processing and Distributed Computing · The Julia Language) claims that @distributed without a reduction operator returns a an array of Futures: Using “outside” variables in parallel loops is per…

---

## [\`methods\` and \`@which\` give different results](https://discourse.julialang.org/t/methods-and-which-give-different-results/127954)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 7\
**Last updated:** [April 11, 2025, 5:46pm UTC](https://discourse.julialang.org/t/methods-and-which-give-different-results/127954 "2025-04-11T17:46:29Z")

</div>

I have: f(; x) = 0 and I do: f(x = 1) creating one specialized method (MethodInstance?) of f. I can see the specialized method with a @which: julia\> (@which f(x = 1)) |\> Base.specializations Base.MethodSpecializati…

---

## [Function calling @SVector with locally defined range returns UndefVarError](https://discourse.julialang.org/t/function-calling-svector-with-locally-defined-range-returns-undefvarerror/127946)

<div class="topic-metadata">

**Author:** [@Giorgos\_Vretinaris](https://discourse.julialang.org/u/Giorgos_Vretinaris)\
**Replies:** 6\
**Last updated:** [April 11, 2025, 4:58pm UTC](https://discourse.julialang.org/t/function-calling-svector-with-locally-defined-range-returns-undefvarerror/127946 "2025-04-11T16:58:12Z")

</div>

Hello, I am trying to define this small function f(n) = @SVector \[i for i in 1:n\] and I get the following error: ERROR: LoadError: UndefVarError: \`n\` not defined in \`Main\` Suggestion: check for spelling errors or miss…

---

## [How to automatically produce this kind of matrix in Julia?](https://discourse.julialang.org/t/how-to-automatically-produce-this-kind-of-matrix-in-julia/127948)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 1:15pm UTC](https://discourse.julialang.org/t/how-to-automatically-produce-this-kind-of-matrix-in-julia/127948 "2025-04-11T13:15:00Z")

</div>

Hello! I am unsure of how to make a proper MWE, so I will explain what I would like to achieve, which is the automatic construction of this matrix: \[Source: https://dual.sphysics.org/7thworkshop/workshop/program/7DSW…

---

## [Mul! modifying input arrays when using FFTW.jl to compute 2D inverse RFFT](https://discourse.julialang.org/t/mul-modifying-input-arrays-when-using-fftw-jl-to-compute-2d-inverse-rfft/127970)

<div class="topic-metadata">

**Author:** [@jibe](https://discourse.julialang.org/u/jibe)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 12:58pm UTC](https://discourse.julialang.org/t/mul-modifying-input-arrays-when-using-fftw-jl-to-compute-2d-inverse-rfft/127970 "2025-04-11T12:58:16Z")

</div>

I have just encountered what I believe is a bug when using FFTW.jl to compute inverse 2D FFT. As reproduced in the MWE below, the use of mul!(A,P,B) modifies the input array B. using FFTW, LinearAlgebra; N = 1; B = rand…

---

## [Generic generation of functions](https://discourse.julialang.org/t/generic-generation-of-functions/127968)

<div class="topic-metadata">

**Author:** [@Daniel\_Lincke](https://discourse.julialang.org/u/Daniel_Lincke)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 12:45pm UTC](https://discourse.julialang.org/t/generic-generation-of-functions/127968 "2025-04-11T12:45:44Z")

</div>

Hi, imagine the following situation: I have a lot of function that operate on some struct and get a symbol as input (maybe function that do something with a dataframe): function doA(... , s::Symbol) function doB(... , …

---

## [How to execute a bit of Julia code/function from a specific directory](https://discourse.julialang.org/t/how-to-execute-a-bit-of-julia-code-function-from-a-specific-directory/127916)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 9:07am UTC](https://discourse.julialang.org/t/how-to-execute-a-bit-of-julia-code-function-from-a-specific-directory/127916 "2025-04-11T09:07:44Z")

</div>

I have a folder (“MyFolder”) that looks something like: MyFolder: data.ext read\_data.jl next, “read\_data.jl” looks ike this: using DataImporter data = DataImporter.import("data.ext") Somewhere else I then run data…

---

## [Overloading 'getproperty' for arrays with custom element types](https://discourse.julialang.org/t/overloading-getproperty-for-arrays-with-custom-element-types/127962)

<div class="topic-metadata">

**Author:** [@MatthijsCox](https://discourse.julialang.org/u/MatthijsCox)\
**Replies:** 4\
**Last updated:** [April 11, 2025, 8:56am UTC](https://discourse.julialang.org/t/overloading-getproperty-for-arrays-with-custom-element-types/127962 "2025-04-11T08:56:50Z")

</div>

Okay so I wanted to make some quick ways to get data from an array of custom types, but I need some advice to avoid ambiguous method errors. So I have code that does something like this (note that you need to define at …

---

## [Efficient definition of function which uses fixed allocated constants](https://discourse.julialang.org/t/efficient-definition-of-function-which-uses-fixed-allocated-constants/127955)

<div class="topic-metadata">

**Author:** [@UselessAnsatz](https://discourse.julialang.org/u/UselessAnsatz)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 8:21am UTC](https://discourse.julialang.org/t/efficient-definition-of-function-which-uses-fixed-allocated-constants/127955 "2025-04-11T08:21:50Z")

</div>

I need to define a whole group of functions, each of which depends on large heap allocated arrays which do not change run to run. While I could declare these arrays const, this clutters the namespace as the array names u…

---

## [Best way for linear regression problem on product features](https://discourse.julialang.org/t/best-way-for-linear-regression-problem-on-product-features/127786)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 28\
**Last updated:** [April 11, 2025, 12:05am UTC](https://discourse.julialang.org/t/best-way-for-linear-regression-problem-on-product-features/127786 "2025-04-11T00:05:49Z")

</div>

Hi, I need to solve the following least-squares problem efficiently, where X and Z denote two matrices of features. I can transform this into a least-squares problem manually by first creating a feature matrix W by takin…

---

## [Keyword arguments reduce performance](https://discourse.julialang.org/t/keyword-arguments-reduce-performance/127224)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 19\
**Last updated:** [April 10, 2025, 7:49pm UTC](https://discourse.julialang.org/t/keyword-arguments-reduce-performance/127224 "2025-04-10T19:49:21Z")

</div>

I’m running a simulation where I’m collecting data from a graph represented by a sparse matrix. I have a pretty simple function that suffers performance loss just by making an Int32 typed variable a keyword argument inst…

---

## [Error using REPL with custom system image](https://discourse.julialang.org/t/error-using-repl-with-custom-system-image/127940)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [April 10, 2025, 6:46pm UTC](https://discourse.julialang.org/t/error-using-repl-with-custom-system-image/127940 "2025-04-10T18:46:18Z")

</div>

If I create a system image for KiteModels.jl this works. But using it fails with the following error: ufechner@framework:~/repos/KiteModels.jl$ jl Found system image! \[ Info: Precompiling REPL \[3fa0cd96-eef1-5676-8a61-b…

---

## [No superscript q in REPL?](https://discourse.julialang.org/t/no-superscript-q-in-repl/127899)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 6\
**Last updated:** [April 10, 2025, 6:22pm UTC](https://discourse.julialang.org/t/no-superscript-q-in-repl/127899 "2025-04-10T18:22:05Z")

</div>

I noticed that every lowercase letter in the English alphabet can be used as a super script, except q. E.g. typing julia\> \\^abcdefghijklmnop and then pressing tab gives julia\> ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖ I can do the same with …

---

## [Matrix vector multiplication: impact of column major vs row major (M4 Max)](https://discourse.julialang.org/t/matrix-vector-multiplication-impact-of-column-major-vs-row-major-m4-max/127936)

<div class="topic-metadata">

**Author:** [@PetarM](https://discourse.julialang.org/u/PetarM)\
**Replies:** 6\
**Last updated:** [April 10, 2025, 5:19pm UTC](https://discourse.julialang.org/t/matrix-vector-multiplication-impact-of-column-major-vs-row-major-m4-max/127936 "2025-04-10T17:19:31Z")

</div>

Hello! I recently got a Mac Studio M4 Max, and I am having fun exploring its compute capabilities in Julia. In particular, I wanted to see how well it could take advantage of its substantial memory bandwidth (546 GB/s) …

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

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