# Modelling & Simulations

**URL:** https://discourse.julialang.org/c/domain/models/21.md?page=4

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

**Page:** 5

---

## [ModelingToolkit fails to precompile on Julia 1.12 (UndefVarError: ODESystem not defined in ModelingToolkit)](https://discourse.julialang.org/t/modelingtoolkit-fails-to-precompile-on-julia-1-12-undefvarerror-odesystem-not-defined-in-modelingtoolkit/134133)

<div class="topic-metadata">

**Author:** [@junmorenodi99](https://discourse.julialang.org/u/junmorenodi99)\
**Replies:** 11\
**Last updated:** [November 27, 2025, 7:56am UTC](https://discourse.julialang.org/t/modelingtoolkit-fails-to-precompile-on-julia-1-12-undefvarerror-odesystem-not-defined-in-modelingtoolkit/134133 "2025-11-27T07:56:46Z")

</div>

Hi everyone, I’m having trouble with ModelingToolkit precompilation on Julia 1.12 on Windows, and I can’t figure out what’s triggering it. In my project I’m just adding some libraries (including ModelingToolkit) : usi…

---

## [ModelingToolkit: How to interpret "ERROR: Cyclic guesses detected in the system" during initialization?](https://discourse.julialang.org/t/modelingtoolkit-how-to-interpret-error-cyclic-guesses-detected-in-the-system-during-initialization/134146)

<div class="topic-metadata">

**Author:** [@NicholasHemenway](https://discourse.julialang.org/u/NicholasHemenway)\
**Replies:** 2\
**Last updated:** [November 26, 2025, 10:52pm UTC](https://discourse.julialang.org/t/modelingtoolkit-how-to-interpret-error-cyclic-guesses-detected-in-the-system-during-initialization/134146 "2025-11-26T22:52:07Z")

</div>

I’ve got a simple RC circuit with two series resistors: using ModelingToolkit, DifferentialEquations using ModelingToolkitStandardLibrary.Electrical using ModelingToolkitStandardLibrary.Blocks @mtkmodel Circuit begin …

---

## [Use of global variables for defining default values in ModelingToolkit bad?](https://discourse.julialang.org/t/use-of-global-variables-for-defining-default-values-in-modelingtoolkit-bad/134123)

<div class="topic-metadata">

**Author:** [@NicholasHemenway](https://discourse.julialang.org/u/NicholasHemenway)\
**Replies:** 3\
**Last updated:** [November 26, 2025, 4:52pm UTC](https://discourse.julialang.org/t/use-of-global-variables-for-defining-default-values-in-modelingtoolkit-bad/134123 "2025-11-26T16:52:48Z")

</div>

I’m not sure how scoping is handled when constructing and subsequently simulating a ModelingToolkit model. Would the following code be “bad practice” since the default references a globally scoped variable? Or is only th…

---

## [ContinuousCallback in DifferentialEquations.jl for the The Izhikevich Model](https://discourse.julialang.org/t/continuouscallback-in-differentialequations-jl-for-the-the-izhikevich-model/133883)

<div class="topic-metadata">

**Author:** [@mongi](https://discourse.julialang.org/u/mongi)\
**Replies:** 7\
**Last updated:** [November 25, 2025, 2:52pm UTC](https://discourse.julialang.org/t/continuouscallback-in-differentialequations-jl-for-the-the-izhikevich-model/133883 "2025-11-25T14:52:52Z")

</div>

Greetings, Is it possible to get the The Izhikevich Model to work with ContinuousCallback as the DiscreteCallback is not accurate near the zero-crossing. # function reset!(integrator) # @show integrator.u\[1\], integr…

---

## [How does ModelingToolkit handle time-varying, but purely algebraic problems?](https://discourse.julialang.org/t/how-does-modelingtoolkit-handle-time-varying-but-purely-algebraic-problems/134092)

<div class="topic-metadata">

**Author:** [@NicholasHemenway](https://discourse.julialang.org/u/NicholasHemenway)\
**Replies:** 2\
**Last updated:** [November 25, 2025, 8:18am UTC](https://discourse.julialang.org/t/how-does-modelingtoolkit-handle-time-varying-but-purely-algebraic-problems/134092 "2025-11-25T08:18:16Z")

</div>

I’ve constructed a simple resistive circuit with a quadratically increasing voltage using ModelingToolkit. The following diagram gives a graphical depiction of the code below: using ModelingToolkit using ModelingTool…

---

## [Is discourse the proper place to suggest improvements for ModelingToolkit?](https://discourse.julialang.org/t/is-discourse-the-proper-place-to-suggest-improvements-for-modelingtoolkit/134087)

<div class="topic-metadata">

**Author:** [@NicholasHemenway](https://discourse.julialang.org/u/NicholasHemenway)\
**Replies:** 1\
**Last updated:** [November 24, 2025, 4:25pm UTC](https://discourse.julialang.org/t/is-discourse-the-proper-place-to-suggest-improvements-for-modelingtoolkit/134087 "2025-11-24T16:25:19Z")

</div>

I’m relatively new to Julia and am currently learning ModelingToolkit. I have some suggestions that I believe would improve the documentation for newcomers but don’t know where to voice them. Is Discourse the proper aven…

---

## [Microkinetic simulations yield negative concentrations using Catalyst.jl](https://discourse.julialang.org/t/microkinetic-simulations-yield-negative-concentrations-using-catalyst-jl/133874)

<div class="topic-metadata">

**Author:** [@lisa-schmoltzi](https://discourse.julialang.org/u/lisa-schmoltzi)\
**Replies:** 9\
**Last updated:** [November 17, 2025, 4:28am UTC](https://discourse.julialang.org/t/microkinetic-simulations-yield-negative-concentrations-using-catalyst-jl/133874 "2025-11-17T04:28:52Z")

</div>

I use Catalyst.jl to model kinetic data of a chemical reaction network. Somehow, for some specific sets of initial concentrations, the resulting time-concentration course results in negative concentrations. Can anyone e…

---

## [Using MTK when I \*import\* ModelingToolkit?](https://discourse.julialang.org/t/using-mtk-when-i-import-modelingtoolkit/133681)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 42\
**Last updated:** [November 13, 2025, 9:18am UTC](https://discourse.julialang.org/t/using-mtk-when-i-import-modelingtoolkit/133681 "2025-11-13T09:18:20Z")

</div>

I have some ModelingToolkit model that works when importing via using. Because of a name conflict, I need to import MTK as import ModelingToolkit as mtk instead. The following code works with using.... What modifications…

---

## [Operator-split chemistry solve in GPU-resident CFD code using DiffEqGPU](https://discourse.julialang.org/t/operator-split-chemistry-solve-in-gpu-resident-cfd-code-using-diffeqgpu/133687)

<div class="topic-metadata">

**Author:** [@ColinTowery](https://discourse.julialang.org/u/ColinTowery)\
**Replies:** 5\
**Last updated:** [November 12, 2025, 7:57pm UTC](https://discourse.julialang.org/t/operator-split-chemistry-solve-in-gpu-resident-cfd-code-using-diffeqgpu/133687 "2025-11-12T19:57:24Z")

</div>

Hi, I’m looking to see if there is any way I could solve an ensemble of ODEs similar to using the low-level API of EnsembleGPUKernel in DiffEqGPU, but where the ensemble trajectories are pulled from a multi-dimensional …

---

## [Wrap my function in an MTK component](https://discourse.julialang.org/t/wrap-my-function-in-an-mtk-component/133767)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 7\
**Last updated:** [November 12, 2025, 2:22am UTC](https://discourse.julialang.org/t/wrap-my-function-in-an-mtk-component/133767 "2025-11-12T02:22:13Z")

</div>

I am trying to wrap an arbitrary function in an MTK component and I am a bit lost in all the possibilities available these days. Right now I have: seconds\_to\_datetime(t, t0::DateTime) = t0 + Millisecond(round(Int, t \* …

---

## [MTK & units](https://discourse.julialang.org/t/mtk-units/133795)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [November 11, 2025, 6:14pm UTC](https://discourse.julialang.org/t/mtk-units/133795 "2025-11-11T18:14:21Z")

</div>

In the past, I have more or less converted units manually, but have now started to use Unitful.jl – which also ties into Plots.jl and gives convenient typesetting of units along the axes. To me, there are at least 3 rea…

---

## [Simulate ModelingToolkit system with different parameters](https://discourse.julialang.org/t/simulate-modelingtoolkit-system-with-different-parameters/133791)

<div class="topic-metadata">

**Author:** [@JaviJR](https://discourse.julialang.org/u/JaviJR)\
**Replies:** 7\
**Last updated:** [November 11, 2025, 3:51pm UTC](https://discourse.julialang.org/t/simulate-modelingtoolkit-system-with-different-parameters/133791 "2025-11-11T15:51:08Z")

</div>

Hi all, In the past day, I have been reading the documentation on efficiently simulating ModelingToolkit models with different parameters. However, I find the documentation somewhat complex, especially for new users. In…

---

## [Modelling toolkit for simulating aerodynamics?](https://discourse.julialang.org/t/modelling-toolkit-for-simulating-aerodynamics/133739)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [November 9, 2025, 4:26pm UTC](https://discourse.julialang.org/t/modelling-toolkit-for-simulating-aerodynamics/133739 "2025-11-09T16:26:14Z")

</div>

Not so clear to me: What is the domain of MTK where using MTK to create models is a good choice? In particular, we have a package for modelling aerodynamic forces and moments of 3D wings: GitHub - OpenSourceAWE/VortexSt…

---

## [Issue with SS.solve using DynamicSS method in SteadyStateDiffEq](https://discourse.julialang.org/t/issue-with-ss-solve-using-dynamicss-method-in-steadystatediffeq/133712)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 3\
**Last updated:** [November 7, 2025, 5:13pm UTC](https://discourse.julialang.org/t/issue-with-ss-solve-using-dynamicss-method-in-steadystatediffeq/133712 "2025-11-07T17:13:21Z")

</div>

I have a quick question about using SteadyStateDiffEq.jl. I am getting error behavior when trying to use the DynamicSS method (following Steady State Solvers · DifferentialEquations.jl). Below is a MWE. I 1) define a sta…

---

## [Electric Field Simulation Cyclotron](https://discourse.julialang.org/t/electric-field-simulation-cyclotron/133708)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 0\
**Last updated:** [November 6, 2025, 12:48pm UTC](https://discourse.julialang.org/t/electric-field-simulation-cyclotron/133708 "2025-11-06T12:48:57Z")

</div>

Hi there! I recently gave a tutorial for a physics course, where we discussed how a cyclotron works. Often one reads that in the gap between the electrodes the electric field is uniform, similar to a plate capacitor and…

---

## [Basic Molly questions](https://discourse.julialang.org/t/basic-molly-questions/133282)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 35\
**Last updated:** [November 6, 2025, 10:33am UTC](https://discourse.julialang.org/t/basic-molly-questions/133282 "2025-11-06T10:33:29Z")

</div>

I’m playing around with Molly.jl. Not really my field, but some colleagues worked with molecule simulations in the 1990s, so I have been exposed to the basic ideas. I also simulated a set of 5 Argon molecules in 2D, boxe…

---

## [Boundary Value Problems in ModelingToolkit](https://discourse.julialang.org/t/boundary-value-problems-in-modelingtoolkit/133491)

<div class="topic-metadata">

**Author:** [@bradyelster](https://discourse.julialang.org/u/bradyelster)\
**Replies:** 5\
**Last updated:** [November 4, 2025, 6:45pm UTC](https://discourse.julialang.org/t/boundary-value-problems-in-modelingtoolkit/133491 "2025-11-04T18:45:43Z")

</div>

Is it currently possible to symbolically setup and then numerically solve boundary-value problems using ModelingToolkit? This issue tells me this is possible through the dynamic optimization interface but I’m not sure ho…

---

## [Electrostatics in Julia](https://discourse.julialang.org/t/electrostatics-in-julia/41633)

<div class="topic-metadata">

**Author:** [@jarvist](https://discourse.julialang.org/u/jarvist)\
**Replies:** 32\
**Last updated:** [November 3, 2025, 5:38pm UTC](https://discourse.julialang.org/t/electrostatics-in-julia/41633 "2025-11-03T17:38:40Z")

</div>

Does anyone know of Julia libraries implementing electrostatic summations in Julia? (e.g. Ewald, Particle Mesh Ewald, Fast Multipole Method…) I haven’t been able to find much by googling: A fairly complex bio orienta…

---

## [Molly.jl - trying to understand di-atomic example](https://discourse.julialang.org/t/molly-jl-trying-to-understand-di-atomic-example/133430)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 19\
**Last updated:** [November 2, 2025, 5:41pm UTC](https://discourse.julialang.org/t/molly-jl-trying-to-understand-di-atomic-example/133430 "2025-11-02T17:41:47Z")

</div>

Thanks for lots of help on previous Molly.jl questions. I’m trying to understand the " Simulating diatomic molecules example. I have re-structured the example to attempt to figure out the key ideas. See below (I skipped…

---

## [Modelling collisions of agents with the environment in discrete time](https://discourse.julialang.org/t/modelling-collisions-of-agents-with-the-environment-in-discrete-time/133229)

<div class="topic-metadata">

**Author:** [@simonsteiger](https://discourse.julialang.org/u/simonsteiger)\
**Replies:** 1\
**Last updated:** [November 2, 2025, 2:00pm UTC](https://discourse.julialang.org/t/modelling-collisions-of-agents-with-the-environment-in-discrete-time/133229 "2025-11-02T14:00:09Z")

</div>

Hi everyone, I am new to agent-based modelling and have recently started using Agents.jl for a research project. Thanks a lot for this great package! The model should simulate how (for example) coconuts disperse throug…

---

## [Examples of dynamical physical systems with exogenous inputs described by UDEs](https://discourse.julialang.org/t/examples-of-dynamical-physical-systems-with-exogenous-inputs-described-by-udes/133373)

<div class="topic-metadata">

**Author:** [@Emil\_Martinsen](https://discourse.julialang.org/u/Emil_Martinsen)\
**Replies:** 4\
**Last updated:** [October 31, 2025, 12:55pm UTC](https://discourse.julialang.org/t/examples-of-dynamical-physical-systems-with-exogenous-inputs-described-by-udes/133373 "2025-10-31T12:55:21Z")

</div>

Can anyone point me to some good examples (code, papers, tutorials) of a dynamical physical system that are modelled with UDEs, i.e., ODEs where parts are known and other parts are unknown and modelled by a neural networ…

---

## [AD of UDEs - how to set it up?](https://discourse.julialang.org/t/ad-of-udes-how-to-set-it-up/133461)

<div class="topic-metadata">

**Author:** [@Emil\_Martinsen](https://discourse.julialang.org/u/Emil_Martinsen)\
**Replies:** 13\
**Last updated:** [October 31, 2025, 7:13am UTC](https://discourse.julialang.org/t/ad-of-udes-how-to-set-it-up/133461 "2025-10-31T07:13:44Z")

</div>

Hi! Im new to Julia and SciML but I am really curious to see how combining ODE’s with neural network could improve the predictive performance of the model we are developing for solvent-based CO2 capture. My current setu…

---

## [Lumped beam model](https://discourse.julialang.org/t/lumped-beam-model/128512)

<div class="topic-metadata">

**Author:** [@yjr](https://discourse.julialang.org/u/yjr)\
**Replies:** 8\
**Last updated:** [October 30, 2025, 10:52pm UTC](https://discourse.julialang.org/t/lumped-beam-model/128512 "2025-10-30T22:52:45Z")

</div>

Hello, I’m trying to implement a 2D lumped beam model with modelingtoolkit. Using the small angle approximation, I managed to have something working with 5 elements. But increasing the number of elements to 6 make ODEPr…

---

## [Memory issues for long SSA simulations with mass action jumps](https://discourse.julialang.org/t/memory-issues-for-long-ssa-simulations-with-mass-action-jumps/133530)

<div class="topic-metadata">

**Author:** [@jworsfold](https://discourse.julialang.org/u/jworsfold)\
**Replies:** 1\
**Last updated:** [October 30, 2025, 10:53am UTC](https://discourse.julialang.org/t/memory-issues-for-long-ssa-simulations-with-mass-action-jumps/133530 "2025-10-30T10:53:39Z")

</div>

I’m trying to find the stationary distribution of a Master Equation where the state space is bounded but can be too large to solve using FiniteStateProjection.jl so I’m left with running Gillespie simulations. Running l…

---

## [ModelingToolkit Symbolics maxiters not enough](https://discourse.julialang.org/t/modelingtoolkit-symbolics-maxiters-not-enough/133463)

<div class="topic-metadata">

**Author:** [@AlirezaMiraliakbar](https://discourse.julialang.org/u/AlirezaMiraliakbar)\
**Replies:** 2\
**Last updated:** [October 28, 2025, 7:08pm UTC](https://discourse.julialang.org/t/modelingtoolkit-symbolics-maxiters-not-enough/133463 "2025-10-28T19:08:48Z")

</div>

Hi, I am trying to model a chemical process with modeling toolkit and I have set 4 of my variables to irreducible = true. However, with doing this, I get the warning message from Symbolics that: Warning: Did not converg…

---

## [Automatic symbolic function barrier generation](https://discourse.julialang.org/t/automatic-symbolic-function-barrier-generation/133487)

<div class="topic-metadata">

**Author:** [@sablonl](https://discourse.julialang.org/u/sablonl)\
**Replies:** 0\
**Last updated:** [October 28, 2025, 4:00pm UTC](https://discourse.julialang.org/t/automatic-symbolic-function-barrier-generation/133487 "2025-10-28T16:00:10Z")

</div>

Hi, I’m working with ModelingToolkit.jl and I have an issue with complex symbolic expressions, on which mtkcompile takes a lot of time. I discovered that I can hide expressions behind a function barrier using @register…

---

## [Molly.jl - Shear Viscosity Notebook - Questions](https://discourse.julialang.org/t/molly-jl-shear-viscosity-notebook-questions/133466)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 2\
**Last updated:** [October 28, 2025, 11:35am UTC](https://discourse.julialang.org/t/molly-jl-shear-viscosity-notebook-questions/133466 "2025-10-28T11:35:09Z")

</div>

This post concerns the tutorial at SINEQ Shear Viscosity. Q1: To what extend is the result obtained for the shear viscosity independent of the number of particles in the simulation? Q2: What happens in case that the nu…

---

## [How to couple different wind farm models?](https://discourse.julialang.org/t/how-to-couple-different-wind-farm-models/133464)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [October 27, 2025, 5:08pm UTC](https://discourse.julialang.org/t/how-to-couple-different-wind-farm-models/133464 "2025-10-27T17:08:10Z")

</div>

We are brainstorming how to best couple different scale models, e.g., fast small-scale models with meso-scale models, for example, Floridyn.jl with a Julia version of TFSO-software / WAYVE · GitLab . I guess both models…

---

## [Robust resampling/interpolation method](https://discourse.julialang.org/t/robust-resampling-interpolation-method/132665)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 25\
**Last updated:** [October 27, 2025, 1:15pm UTC](https://discourse.julialang.org/t/robust-resampling-interpolation-method/132665 "2025-10-27T13:15:54Z")

</div>

I am working on a system identification problem with poor quality input data. The data describes a heating system, with thermostat temperatures, thermal power inputs, supply/return water temperatures etc. Some issues w…

---

## [Solving SemilinearODE without using automatic differentiation](https://discourse.julialang.org/t/solving-semilinearode-without-using-automatic-differentiation/133434)

<div class="topic-metadata">

**Author:** [@sanjeev](https://discourse.julialang.org/u/sanjeev)\
**Replies:** 4\
**Last updated:** [October 27, 2025, 2:10am UTC](https://discourse.julialang.org/t/solving-semilinearode-without-using-automatic-differentiation/133434 "2025-10-27T02:10:13Z")

</div>

I have semilinear ODE with the time-dependent linear implicit part as function f1! So, instead of solving (I - γΔt \* J₁) \* u\_{n+1} = rhs, I want to use Krylov method to solve (I - γΔt \* J1) \* u\_{n+1} = rhs, where J1 \* u…

[Previous page](https://discourse.julialang.org/c/domain/models/21.md?page=3)

[Next page](https://discourse.julialang.org/c/domain/models/21.md?page=5)
