r/Julia • • 1d ago

Which is better design for making a graph

11 Upvotes

Hi there. I am creating Jetelina, please ref here what it is and use plotly.js to create some analyzing graphics: access numbers, API execution speed, ...
The basic rule in Jetelina is to separate the front and the back as much as I can. So, graphics are created by receiving data from backend Julia programs. The below is the API execution speed data graph. I think it can be cooler. I am wondering if it will be the best if Jetelina hires a backend process to create a graph by using Makie.jl, Plots.jl and so on, even if I break the basic rule on Jetelina.
Any advice is appreciated from your experiences.


r/Julia • • 3d ago

Tsit5 stepped over a kink in my ODE and returned Success with the wrong answer. dtmax or a callback?

10 Upvotes

A few weeks ago I asked here about a Julia simulator for small off-grid villages. One piece of it is a plain ODE with four stocks: a battery, a water tank, a food store, a compute buffer. Each flow is clipped with min/max so nothing can take out more than a stock holds or put in more than fits. That makes the right-hand side continuous, but with a bend a little below capacity, where the cap on inflow starts to bite.

On one day the battery should have charged up to full. Instead it went down, even though there was more sun than demand, and ended at 2814.6 kWh instead of 3000, with retcode Success. As far as I can tell, while the battery charges at a steady rate the solution is a straight line, the error estimate is close to zero, and Tsit5 keeps stretching the step until one step covers most of the day. That step starts below the bend and its later stages land past full, where inflow is cut off, so it pulls the battery down and the error estimate doesn't notice.

Here's the day on its own:

using OrdinaryDiffEq   # wrong on OrdinaryDiffEq 7.8.1; on 6.107.0 + OrdinaryDiffEqCore 3.1.0 this day is fine (other days fail there)
τ = 0.05   # days over which a stock can fill or empty at its bounds
caps = [3000.0, 3e5, 9e7, 7200.0]; ins = [1821.6416596454678, 6e4, 9e5, 3600.0]
dems = [1500.0, 45000.0, 750000.0, 2400.0]; loss = [0.001, 0.002, 0.0005, 0.0]
function rate(u, cap, in, dem)
    out = max(0.0, min(dem, in + u/τ))                 # can't take out more than there is
    return max(0.0, min(in, out + (cap - u)/τ)) - out  # can't put in more than fits
end
f!(du, u, p, t) = (du .= rate.(u, caps, ins, dems .+ loss .* max.(0.0, u)))   # in-place; out-of-place passes on this day
u0 = [2854.0445204092402, 299999.9999999993, 7.775874075072253e7, 7199.999999999989]   # every digit matters: 3e5 for the tank passes
sol = solve(ODEProblem(f!, u0, (0.0, 1.0)), Tsit5(); reltol=1e-6, abstol=1e-6)
println(sol.retcode, ", battery at end of day: ", sol.u[end][1])   # should be ~3000

This day is right on the edge, though. Change the last digit of the tank's start value, or write f as out-of-place, and this day comes out at 3000 while some other day in the batch goes wrong instead. The 2814.6 comes from a Mac with an Apple chip (aarch64), while the same code under x86 emulation (Rosetta) gives 3000, and I haven't tried it on a native x86 machine or worked out why it changes (fused multiply-add is my only suspect so far). Across my whole batch it's 9 days out of about 1.2 million, so if you run it and get 3000, that's expected and doesn't mean it's fixed.

I tried two fixes. Capping dtmax at τ fixes that day and held up across a big batch of runs, but it roughly triples the steps over a simulated year. A ContinuousCallback on each bend, with an empty affect! that only makes the step stop there and no dtmax, also fixes that day and costs about the same as doing nothing. But in the bigger batch it still misses a few days, some about as badly as no fix at all. On the days I looked at, the bend condition had the same sign at the start and at the end of the long step.

So is dtmax the right answer for a right-hand side like this, or is there a better way to tell the solver where the bends are when I don't know ahead of time when a stock will hit them? I'm not sure whether that's a bug, a known limit of error control on non-smooth problems, or just me using the solver wrong.


r/Julia • • 11d ago

What are people building beyond conventional LLM agent architectures?

22 Upvotes

I'm working on a Julia-based AI system with its own behavioral processing, persistent state and dynamic code-generation capabilities. It can generate new Julia functions and incorporate them into its available execution tools.

I'm interested in what else is being developed in this space, particularly architectures that combine behavioral systems with dynamic execution.

I'd like to compare approaches and hear some serious technical perspectives.


r/Julia • • 16d ago

How do I get around this "juliaup needs to modify a number of files?"

8 Upvotes

I do have (a version of) julia and it is running on my windows system. But on my mac, I tried to "upgrade" to the latest version. And it seems to be stuck on this needing to modify thing. Is there a simple solution? Thanks


r/Julia • • 18d ago

What are the advantages by using Julia rather than R or Python?

67 Upvotes

More often than not, at work, we are encouraged to create data analysis dashboards using a programming language. Some of my friends have suggested that I use Julia instead of R or Python. Can its libraries, similar to tidyverse in R or pandas in Python, be used to create innovative, useful, and aesthetically pleasing visualizations? What are its advantages? Excuse my ignorance

Thanks in advance!!!


r/Julia • • 18d ago

Help needed in migrating from MATLAB project to Julia

24 Upvotes

Currently, I have a large repository of MATLAB code related to some Radar processing (https://github.com/roopeshor/Radar-Signal-Processing ). I want to try out how Julia performs in this task. However, the current architecture classifies functions into different folders. In MATLAB, a function in a folder +a/fx.m can be simply accessed with a.fx() anywhere within the folder. However replicating such a system was extremely difficult for me due to the import system. My current idea is to organize each folder into modules and then link them all in one large module. But that approach failed. My situation is following:

  • io/reader.m uses struct definition in structs/Data.jl (which was actually a classdef in MATLAB)

  • struct/Obs.jl uses reader function from io/reader.m.

  • functions in algo folder uses struct/Obs.jl.

  • All functions in algo folder need to be packaged in single module algo.

  • All functions in io need to be packaged in single module io

Is there some way to organize the code similar to Matlab? Current implementation with hierarchical organization tends to produce either cyclic dependencies or double import.

I dont know if its a big ask, But any help is appreciated.

Update:

With suggestions from you, I changed some parts of code, now its more cleaner. I decided to not use inheritance. With help of chatGPT and few hours of debugging I got a working code. Thank you


r/Julia • • 21d ago

How to make a GUI in Julia? Recommendations?

36 Upvotes

Hi I'm making a package for visualization and analysis of computational chemistry results. I need interactive graphs that allow me to select atoms, highlight bonds, etc, and toggle visualization options using buttons or sliders. I don't have experience making a GUI, although I managed to make a composite figure with a slider and observables that allow me to switch structures from a trajectory file. But don't know how to go beyond that to an acceptable GUI. Any advice on where to get started is appreciated!! Thank you!!


r/Julia • • 22d ago

Building an open-source survival simulator in Julia: How do you model equipment wear-and-tear alongside daily energy use?

23 Upvotes

We're building an open-source simulator in Julia to stress-test off-grid community designs (solar arrays, water storage, heating) before spending real money on physical hardware.

The part I'm scratching my head over is handling wear and tear.

Daily energy and water use are smooth, continuous flows, and DifferentialEquations.jl handles that part smoothly. But real hardware doesn't degrade smoothly. Inverters overheat and pop, water pumps seize up after 3,000 operating hours, and someone forgets to clean a filter.

If you've built multi-year simulations in Julia, what's the cleanest way to trigger sudden mechanical breakdowns based on accumulated usage hours without slowing down the continuous ODE solver?

Keeping it simple and modular is key. Are there any good patterns or packages you'd recommend for coupling discrete stochastic events with continuous stock-flow equations?


r/Julia • • 24d ago

The Julia programming language repository summary

Post image
7 Upvotes

r/Julia • • 29d ago

PerfChecker.jl tutorial series: benchmarking, profiling, and reproducible performance checks in Julia

26 Upvotes

Hi everyone!

I work on PerfChecker.jl, a Julia package for running repeatable performance checks and comparing results across implementations or package versions.

You define the operation to measure and how to verify its correctness. PerfChecker coordinates benchmarking, profiling and analysis tools—including BenchmarkTools, Profile.Allocs and JET—and saves the results for inspection, comparison and sharing. You can use it to investigate performance problems and prepare regression checks for CI.

I’ve put together an English tutorial series with an introduction and five chapters covering:

  • Installation and a first run.

  • Benchmarks, profiles and analysis tools: what they’re useful for and how to interpret their output.

  • Reproducible suites, correctness checks and CI configuration.

  • VS Code, terminal, Web and Pluto interfaces, plus exporting and sharing results.

  • MCP advice, reviewed code changes and bounded investigations.

The walkthroughs use real interfaces and recorded results. The emphasis is on understanding what each tool tells you and choosing a useful next step.

YouTube playlist

Source code and issues

I’d appreciate feedback on getting started, interpreting results, and workloads you’d like to see covered. Questions, bug reports, documentation improvements and contributions are all welcome.

Thanks to the Julia community and the maintainers of the tools PerfChecker brings together!


r/Julia • • Oct 16 '26

I accidentally a Julia-based inference engine that can run Qwen3.8-27B

30 Upvotes

(There's more to Luminal.jl than this, see the github link for more, but this post focuses on running Qwen3.8-27B)

Serve Qwen3.8-27B (GGUF)

examples/qwen35_server.jl serves a Qwen3.5 / 3.6 / 3.8 GGUF through an OpenAI-compatible API (streaming chat completions, tool calls, reasoning content), for harnesses such as opencode. Weights stay in the GGUF's own quantization on the GPU (LUMINAL_GGUF_NATIVE=1; Q4_K_XL, about 17 GB), and the model's MTP head drafts tokens for speculative decoding.

LUMINAL_GGUF_NATIVE=1 julia -t auto,1 --project=. examples/qwen35_server.jl \
    /path/to/Qwen3.8-27B-UD-Q4_K_XL.gguf --max-seq=262144 --port=8080
  • Use -t auto,1: the server needs the extra interactive thread. The HTTP tasks run on the main thread and the GPU work in a task pinned to another one; without that, nothing is streamed while a prefill or a decode step blocks the main thread.

  • The first start takes a few minutes (reading the GGUF, compiling the graphs). The log prints serving ... when it is ready.

  • --max-seq sets the context and the KV cache allocated up front (Float16, 64 KB per token: 17 GB at 262144). Other flags: --mtp=<gguf> (a separate file with the MTP head), --host, --name (the model id), --no-spec, --int8.

  • Point the client at http://127.0.0.1:8080/v1 (GET /v1/models, GET /health, POST /v1/chat/completions). For opencode, add an @ai-sdk/openai-compatible provider with that baseURL and the --name as the model id. Long prompts can take minutes before the first token, so raise or disable its request timeouts.

  • --reasoning-budget=N limits the thinking: after N reasoning tokens the server closes the <think> block with a short wrap-up and the model answers from what it has (the resume costs a re-prefill of the new turn, about 10-20 s at N = 4096). A request overrides it with thinking_budget (also thinking.budget_tokens, reasoning_budget; 0 = no limit). In opencode, put "thinking_budget": N in the model's options.

  • Prompts are cached: the system prompt, each turn, and state checkpoints every 4096 tokens (LUMINAL_CKPT_EVERY), so a follow-up turn reprocesses only its new tokens. A cold prefill runs at 330-480 tok/s (about 3 minutes for 75k tokens); a warm turn answers in 3-25 s. Decode is 11-15 tok/s at 70-130k tokens of context (2.3-2.9 tokens per speculation cycle).

  • It handles one request at a time, and it needs about 35-60 GB of unified memory at the largest context, depending on how many prompts are cached. The log reports prompt processing, generation speed and speculation per request.

For a one-shot generation from a GGUF, examples/qwen35_gguf.jl <file.gguf> "prompt".

https://github.com/philtomson/Luminal.jl

NOTE: right now I'm only sure that this works well on AMD Strix Halo GPUs. It might work on Nvidia GPUs via CUDA.jl, but I have not tested it.


r/Julia • • Oct 16 '26

How I did Molecular dynamics on a peptide with my own code

Thumbnail
youtu.be
21 Upvotes

This video shows how my molecular dynamics code is composed, and what functionality it has so far. There is also the link to GitHub to download the current version of the code, which requires Molly.jl, Chemfiles.jl and EzXML.jl

If you try the code please leave any suggestions and bugs you find here, in YouTube or in the GitHub repo.


r/Julia • • Oct 13 '26

Necro-Matcher - Early Access Trailer (A game written in Julia)

Thumbnail
youtube.com
37 Upvotes

We are launching our demo for the steam next fest now! Visit: Necro-Matcher on Steam to download and play!
I haven't posted about this on reddit yet, so here's some context: https://discourse.julialang.org/t/im-creating-the-worlds-first-commercial-game-written-in-julia


r/Julia • • Oct 13 '26

October Headline: Julia Returns to the TIOBE Top 20

Thumbnail tiobe.com
71 Upvotes

r/Julia • • Oct 12 '26

Calculus with Julia

Thumbnail jverzani.github.io
43 Upvotes

r/Julia • • Oct 12 '26

juliaTDGL -- a 3D two-band TDGL solver in Julia

11 Upvotes

Hi everyone. I've been working on a solver for the geometric superconducting diode effect in two-gap superconductors (like MgB₂), and I just released v1.1.

It's a 3D two-band time-dependent Ginzburg–Landau solver with:

- self-consistent vector potential (so screening and self-field are part of the model)
- gauge-invariant Josephson voltmeter that counts vortex crossings
- arbitrary 3D shapes from TOML files or a browser editor
- a terminal menu to launch and track runs

v1.1 adds an implicit scheme for the Maxwell term, which gives ~3× speedup at κ=2 and ~100× at κ=25. Same onset brackets, voltages within 0.2%. A production-box run takes minutes on a laptop.

It's standard TDGL (not generalised KWT) on a Cartesian grid, and pyTDGL is better if you need unstructured 2D films. A multiband generalised version is the next step.

Repo: https://github.com/georgeotjg/juliaTDGL

Feedback and issues welcome, especially from anyone working on superconducting devices.


r/Julia • • Oct 11 '26

Contact mechanics in Julia, directly from the weak form

Thumbnail
gallery
48 Upvotes

I've been working on contact mechanics in LowLevelFEM.jl and wanted to share a small 2D Hertz-type contact example.

One of my goals is to keep the implementation as close as possible to the mathematical weak form.

For example, the penalty contact stiffness is simply:

G = ContactGap(C)
Kc = ∫(G ⋅ cn ⋅ G; updateFrom=u)

The same contact operator can also be used in a Lagrange-multiplier formulation:

B = ∫(Λ ⋅ ContactGap(C, active=:all))

The figures show the resulting contact pressure, normal gap, and von Mises stress distribution.

The implementation handles closest-point contact detection at Gauss points and currently supports both 2D and 3D problems. I've also been working on multithreaded sparse assembly and lightweight geometry updates to reduce the cost of nonlinear iterations.

It's still a work in progress, particularly for more advanced contact laws, but the basic framework seems promising.

I'm curious how others working with FEM in Julia approach contact mechanics, especially the balance between a readable weak-form formulation and efficient contact search and assembly.


r/Julia • • Oct 07 '26

SimCore.jl & SimDES.jl: Discrete-event simulation with analytical queueing benchmarks, conveyor kinematics, and Makie visualization

9 Upvotes

Hi everyone, I’ve been working on discrete-event simulation in Julia and wanted to share an early release of two packages: SimCore.jl and SimDES.jl.

  • SimCore.jl provides foundational event scheduling primitives (FutureEventList, virtual clocks, and $O(1)$-memory streaming statistics).

  • SimDES.jl builds on top of SimCore to model queueing networks, material handling, and physical conveyor kinematics.

  • GitHub: SimDES.jl | SimCore.jl


Motivation & Where This Fits in the Ecosystem

Julia already has great simulation packages, and I want to acknowledge them upfront:

  • If you prefer process-oriented simulation (SimPy-style coroutines with @resumable and @yield), ConcurrentSim.jl is mature and well-suited for that workflow.

  • If your problem revolves around agent-based modeling with complex spatial interactions, Agents.jl is the standard and far more established.

  • For clock-based discrete event generation, DiscreteEvents.jl offers a clean, native approach. Why SimCore and SimDES?
    My work required a specific combination of needs that led me to build this framework:

  1. Automated Verification Against Queueing Theory: I wanted the engine's test suite to continuously assert empirical simulation results against closed-form queueing equations ($M/M/1$, $M/M/c$, $M/M/1/K$, Pollaczek-Khinchine for $M/G/1$, open Jackson product-form networks, and Little's Law invariance).

  2. Physical Conveyor Accumulation (ZPA): In material handling, items have physical dimensions and cannot overlap. I needed deterministic 1D conveyor kinematics where items queue up behind obstacles (Zero-Pressure Accumulation), observe safety gaps, and respect optical sensor interlocks without needing a heavy continuous physics engine.

  3. Constant-Memory Streaming Statistics: To run long simulations without blowing up RAM, SimCore integrates single-pass Welford variance, Jain-Chlamtac $P2$ streaming quantiles ($P_{50}, P_{95}, P_{99}$), and Welch moving-average warmup detection in $O(1)$ memory.

  4. Decoupled Visualizations: The core engine has zero graphics dependencies, but optionally connects to Makie (CairoMakie for vector reports, or GLMakie for interactive desktop GUIs with live observable streaming).


Quick Example: M/M/1 Queue

using Pkg
Pkg.add(["SimCore", "SimDES"])
using SimDES, Distributions
# 1. Setup simulation world with an arrival source and single server
world = SimWorld()
source_id = register_zone!(world, ZoneConfig(name = "Arrivals", arrival_dist = Exponential(1.0 / 2.0)))
server_id = register_zone!(world, ZoneConfig(name = "Server", capacity = 1, service_dist = Exponential(1.0 / 4.0)))
connect_zones!(world, source_id, server_id)
# 2. Run simulation
run_sim!(world; t_end = 1000.0)
# 3. Inspect results
stats = get_zone_stats(world, server_id)
println("Utilization ρ: ", stats.utilization)       # Expected ≈ 0.50
println("Mean System Time W: ", stats.mean_sojourn) # Expected ≈ 0.50

There is also an interactive physical conveyor example in the repo (examples/06_interactive_conveyor_makie.jl) that demonstrates dynamic package routing, optical interlock gating, and ZPA queuing in GLMakie (an animated GIF of this is also embedded in the README).

Current Limitations & Honest Caveats

This is an early v0.1.0 release, and there are several limitations worth noting:

  • Early API: While the underlying queueing math passes all automated test suites, the public API may still evolve as we receive feedback.

  • Paradigm: It is based on explicit event scheduling and state transitions rather than coroutine-based yielding. If your mental model relies heavily on SimPy-style generators, ConcurrentSim.jl might feel more natural.

  • Documentation: More work towrads tutorials and real-world industrial case studies is required .


Feedback Welcome!

If you work in operations research, queueing theory, industrial engineering, or discrete-event modeling, I would be very grateful if you could try running your models or take a look at the code. Any feedback, critique of the API design, bug reports, or feature suggestions on our GitHub Issues would be immensely appreciated. Thank you!


r/Julia • • Oct 07 '26

Molecular Dynamics with Julia: First peptide MD!!

Thumbnail
youtu.be
29 Upvotes

I am finally able to do MD on a peptide. This does not mean that all parameters are correctly assigned, still some work to be done, but at least the program can assign most of the atom types present in this molecule. Very happy about this small milestone!


r/Julia • • Oct 05 '26

Nine small Julia programs, one per result, behind a book of the maths that shapes the world

10 Upvotes

I have been building a book of advanced mathematics where every formula keeps its originator's name on the page. The part that might interest people here is that no result in it is allowed to be a picture. Each one has to come with a small Julia program that recomputes it, and the nine machines are in the repo under site/machines.

They are:

- galaxy_rotation.jl, rotation curves against the visible mass

- eddington.jl, the luminosity where radiation pressure balances gravity

- jeans_mass.jl, the mass at which a cloud collapses

- schechter.jl, the galaxy luminosity function

- hubble_tension.jl, the two measurements of H0 that will not agree

- three_body.jl, the figure eight orbit

- lorenz.jl, because it is the honest example

- phyllotaxis.jl, the golden angle in a sunflower

- rubik_group_order.jl, the cube group at 43,252,003,274,489,856,000

Each one is standalone, no package, runs from a terminal, and prints what it claims with the numbers attached. The rule i set myself is that a plate ships only if its machine reproduces the number on the page.

I would genuinely like review on the numerical choices: tolerances on the three body integrator, whether the Schechter fit should carry its errors on the page, and whether the cube group order should be a computation or a lookup. Repo is at github.com/Mascottz/Codex-Naturalis, machines are the only folder you need.


r/Julia • • Oct 02 '26

Molecular Dynamics with Julia - Automatic Detection of Aromatic Rings

Thumbnail
youtu.be
17 Upvotes

I have been improving the functionality of my JuliaMD program, and made a routine to detect aromatic rings. I also added more atom types which can be detected and assigned GAFF types, so more types of molecules can be simulated.


r/Julia • • Sep 30 '26

Julia Molecular Dynamics project

5 Upvotes

Small update of my project of molecular dynamics with Julia (2 min Video)

https://youtube.com/shorts/6kZmMTnoI_0?feature=share


r/Julia • • Sep 29 '26

Need help with this code

1 Upvotes

I'm doing an assignment, and I need help with basically everything. My code refuses to run in Julia, it just comes out blank. For context, I have never ever coded in my life, and our lecturer didn't teach us anything, it is also not in our curriculum. I'm very lost. If you are norwegian that would help a lot more.

Other info I was provided before the code is(translated with google translate):

Here is the recipe for another variant of the Fibonacci numbers that allows for randomness. To calculate each number, a random number (r) is first drawn from [0, 1]. If r < 0.2 (we call the number 0.2 the threshold value(tv) here) and we have generated at least three numbers in the F-vector, we use the update F(k) = F(k − 1) – F(k − 3). Otherwise (i.e. if r >= 0.2) the next number is calculated using the usual Fibonacci rule F(k) = F(k-1) + F(k – 2).

and that after the code was done being filled out then we are supposed to use this

n = 20;
V = Fibonacci_vri(n)
println(V)


using Plots
plot(V, label="", xlabel = "steg", ylabel = "F")

I was provided with a code that wasn't finished yet, so I filled in the blanks which is k >= 3, F[k] = F[k-1] - F[k-3], F[k] = F[k-1] + F[k-2] and return F This is what I tried to run:

function Fibonacci_vri(n)
    tv = 0.2;
    F = zeros(Int, n)
    F[1] = 1;
    F[2] = 1; 
    for k = 3:n
        r = rand();
        if r < tv && k >= 3
            F[k] = F[k-1] - F[k-3];
        else
            F[k] = F[k-1] + F[k-2];
        end
    end
    return F

n = 20;
V = Fibonacci_vri(n)
println(V)


using Plots
plot(V, label="", xlabel = "steg", ylabel = "F")