# Modelling & Simulations

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

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

**Page:** 7

---

## [DAE simulation fails even when all derivatives are zero](https://discourse.julialang.org/t/dae-simulation-fails-even-when-all-derivatives-are-zero/132927)

<div class="topic-metadata">

**Author:** [@ctessum](https://discourse.julialang.org/u/ctessum)\
**Replies:** 7\
**Last updated:** [October 7, 2025, 6:41pm UTC](https://discourse.julialang.org/t/dae-simulation-fails-even-when-all-derivatives-are-zero/132927 "2025-10-07T18:41:16Z")

</div>

Hello! I have this system: using ModelingToolkit using ModelingToolkit: t\_nounits, D\_nounits using OrdinaryDiffEqRosenbrock, OrdinaryDiffEqNonlinearSolve @variables begin cation1m(t\_nounits), \[guess=1.0\] anion…

---

## [Is there a migration from DifferentialEquations.jl to subpackages cheat sheet?](https://discourse.julialang.org/t/is-there-a-migration-from-differentialequations-jl-to-subpackages-cheat-sheet/132852)

<div class="topic-metadata">

**Author:** [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)\
**Replies:** 3\
**Last updated:** [October 4, 2025, 4:25am UTC](https://discourse.julialang.org/t/is-there-a-migration-from-differentialequations-jl-to-subpackages-cheat-sheet/132852 "2025-10-04T04:25:56Z")

</div>

I use a lot of different functionality in DifferentialEquations.jl, so to date I’ve been mostly happy just using this omnipackage. However, compile times are now quite long and I rarely need all the functionality in the …

---

## [ModelingToolkit + matrix variables: defaults & 1×1 scalars](https://discourse.julialang.org/t/modelingtoolkit-matrix-variables-defaults-1x1-scalars/132825)

<div class="topic-metadata">

**Author:** [@rasmuskovacs](https://discourse.julialang.org/u/rasmuskovacs)\
**Replies:** 4\
**Last updated:** [October 3, 2025, 12:34pm UTC](https://discourse.julialang.org/t/modelingtoolkit-matrix-variables-defaults-1x1-scalars/132825 "2025-10-03T12:34:13Z")

</div>

Hi! I’m trying to use ModelingToolkit with matrix variables/parameters. I’ve got it working, but I need to be very careful about how I define things, and a couple behaviors feel non-intuitive. I’m wondering if I’m missin…

---

## [Dyad Builder, FMUs](https://discourse.julialang.org/t/dyad-builder-fmus/132792)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [October 2, 2025, 6:12am UTC](https://discourse.julialang.org/t/dyad-builder-fmus/132792 "2025-10-02T06:12:03Z")

</div>

I attended a webinar from Juliahub today on the topic of creating functional mockup units (FMUs) using Julia and Dyad. Questions: Is this feature available for academic users of Dyad Studio? Is the graphical model edi…

---

## [How to implement a FFT based 2D laplacian in SciMLOperators.jl?](https://discourse.julialang.org/t/how-to-implement-a-fft-based-2d-laplacian-in-scimloperators-jl/132143)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 1\
**Last updated:** [September 30, 2025, 4:51pm UTC](https://discourse.julialang.org/t/how-to-implement-a-fft-based-2d-laplacian-in-scimloperators-jl/132143 "2025-09-30T16:51:58Z")

</div>

Hello! I was trying to implement a FFT based 2D laplacian in SciMLOperators.jl, but I ran into some trouble. Here is my attempt, which was based in this example in the docs: using SciMLOperators using LinearAlgebra, FF…

---

## [Relationship between OptimalControl.jl and ControlSystems.jl](https://discourse.julialang.org/t/relationship-between-optimalcontrol-jl-and-controlsystems-jl/116959)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [September 30, 2025, 12:20pm UTC](https://discourse.julialang.org/t/relationship-between-optimalcontrol-jl-and-controlsystems-jl/116959 "2025-09-30T12:20:38Z")

</div>

At JuliaCon 2024 I learned about the package OptimalControl.jl and related. To install them, you need to add a custom registry: pkg\> registry add https://github.com/control-toolbox/ct-registry.git pkg\> add OptimalContr…

---

## [Constructing a chemical reaction network from an ode system](https://discourse.julialang.org/t/constructing-a-chemical-reaction-network-from-an-ode-system/132682)

<div class="topic-metadata">

**Author:** [@adhalanay](https://discourse.julialang.org/u/adhalanay)\
**Replies:** 1\
**Last updated:** [September 26, 2025, 8:02pm UTC](https://discourse.julialang.org/t/constructing-a-chemical-reaction-network-from-an-ode-system/132682 "2025-09-26T20:02:36Z")

</div>

The so called Hungarian Lemma states that a system of ODEs with polynomial RHS x'\_j =f\_j(x),j=\\overline{1,n} comes from a mass-action chemical reaction network if and only if all the negative monomials of f\_f have x\_j …

---

## [ForwardDiff with Rosenbrock in DifferentialEquations.jl](https://discourse.julialang.org/t/forwarddiff-with-rosenbrock-in-differentialequations-jl/132605)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 2\
**Last updated:** [September 23, 2025, 8:51pm UTC](https://discourse.julialang.org/t/forwarddiff-with-rosenbrock-in-differentialequations-jl/132605 "2025-09-23T20:51:39Z")

</div>

Hello all. I am having an issue using Rosenbrock methods in DifferentialEquations.jl. Below is a MWE. My general problem is that I am trying to optimize parameters of a stiff system of ODEs. This is a relatively small pr…

---

## [Discretization of semi-coupled wave and diffusion equations fails for step size of pi/(25n) using MethodOfLines.jl](https://discourse.julialang.org/t/discretization-of-semi-coupled-wave-and-diffusion-equations-fails-for-step-size-of-pi-25n-using-methodoflines-jl/106091)

<div class="topic-metadata">

**Author:** [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Replies:** 6\
**Last updated:** [September 22, 2025, 5:53pm UTC](https://discourse.julialang.org/t/discretization-of-semi-coupled-wave-and-diffusion-equations-fails-for-step-size-of-pi-25n-using-methodoflines-jl/106091 "2025-09-22T17:53:04Z")

</div>

Intro I’m using a semi-coupled system of wave and diffusion equations to simulate a string whose mass/speed of sound diffuses (as a toy to familiarize myself with MethodOfLines.jl for my master’s thesis in high-performan…

---

## [Changing struct fields to a different sub-type during run time](https://discourse.julialang.org/t/changing-struct-fields-to-a-different-sub-type-during-run-time/132346)

<div class="topic-metadata">

**Author:** [@stevenhughes](https://discourse.julialang.org/u/stevenhughes)\
**Replies:** 19\
**Last updated:** [September 20, 2025, 6:06pm UTC](https://discourse.julialang.org/t/changing-struct-fields-to-a-different-sub-type-during-run-time/132346 "2025-09-20T18:06:27Z")

</div>

Hello everyone, I am working on an aerospace system and as I am developing more complex use cases, I need to change fields on structs to a new type during a simulation. For example, when a spacecraft leaves the Earth s…

---

## [Solving the Boltzmann transport equation using Trixi.jl](https://discourse.julialang.org/t/solving-the-boltzmann-transport-equation-using-trixi-jl/132509)

<div class="topic-metadata">

**Author:** [@drandran12](https://discourse.julialang.org/u/drandran12)\
**Replies:** 4\
**Last updated:** [September 19, 2025, 12:35pm UTC](https://discourse.julialang.org/t/solving-the-boltzmann-transport-equation-using-trixi-jl/132509 "2025-09-19T12:35:58Z")

</div>

I need to solve the two spatial dimensional Boltzmann transport equation of the form: \\left\[\\partial\_t+\\vec{k} \\cdot \\vec{\\nabla}\_x-\\vec{\\nabla}\_x V \\cdot \\vec{\\nabla}\_k\\right\] n(\\vec{x}, t, \\vec{k})=-4 \\Gamma\_a \\int \\…

---

## [@mtkmodel ODE Confusion, DiffEqParamEstim](https://discourse.julialang.org/t/mtkmodel-ode-confusion-diffeqparamestim/132228)

<div class="topic-metadata">

**Author:** [@jdm204](https://discourse.julialang.org/u/jdm204)\
**Replies:** 1\
**Last updated:** [September 18, 2025, 11:37pm UTC](https://discourse.julialang.org/t/mtkmodel-ode-confusion-diffeqparamestim/132228 "2025-09-18T23:37:19Z")

</div>

Apologies, I think I have a basic misunderstanding somewhere, I’ve been stuck for a few days. I’m struggling to understand how I should use @mtkmodel defined ODEs, I ran into the problem trying to use DiffEqParamEstim. I…

---

## [SteadyStateProblem solved result problem](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511)

<div class="topic-metadata">

**Author:** [@hzgzh](https://discourse.julialang.org/u/hzgzh)\
**Replies:** 26\
**Last updated:** [September 18, 2025, 11:39am UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511 "2025-09-18T11:39:39Z")

</div>

My problem as code using ModelingToolkit @variables t x(t) # independent and dependent variables @parameters τ # parameters D = Differential(t) # define an operator for the differentiation w.r.t. time # your f…

---

## [Integrating large systems of ODEs](https://discourse.julialang.org/t/integrating-large-systems-of-odes/132428)

<div class="topic-metadata">

**Author:** [@PersiaJK](https://discourse.julialang.org/u/PersiaJK)\
**Replies:** 1\
**Last updated:** [September 16, 2025, 8:08am UTC](https://discourse.julialang.org/t/integrating-large-systems-of-odes/132428 "2025-09-16T08:08:25Z")

</div>

Hello! I am pretty new to Julia and I am looking for some answers and suggestions for a project of mine. I am translating a code from C to Julia because I would like to divide the code in modules and possibly take advan…

---

## [MTK not simplifying simple system](https://discourse.julialang.org/t/mtk-not-simplifying-simple-system/132327)

<div class="topic-metadata">

**Author:** [@rob-five-0-seven](https://discourse.julialang.org/u/rob-five-0-seven)\
**Replies:** 1\
**Last updated:** [September 15, 2025, 11:29am UTC](https://discourse.julialang.org/t/mtk-not-simplifying-simple-system/132327 "2025-09-15T11:29:57Z")

</div>

I want to use MTK to model some steady, compressible flow problems. Essentially solving problems at the boundaries of different components. The problems are all nonlinear for now; however, I’m testing the waters by playi…

---

## [MethodOfLines: How can I compute the Jacobian of the system of ODEs?](https://discourse.julialang.org/t/methodoflines-how-can-i-compute-the-jacobian-of-the-system-of-odes/132127)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 7\
**Last updated:** [September 12, 2025, 12:28pm UTC](https://discourse.julialang.org/t/methodoflines-how-can-i-compute-the-jacobian-of-the-system-of-odes/132127 "2025-09-12T12:28:29Z")

</div>

How can I compute the Jacobian of the system of ODEs obtained by spatially discretising a linear advection equation? A MWE follows: using OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets @independent\_variable…

---

## [Error using delay\_fnn](https://discourse.julialang.org/t/error-using-delay-fnn/132297)

<div class="topic-metadata">

**Author:** [@dylanmcn](https://discourse.julialang.org/u/dylanmcn)\
**Replies:** 3\
**Last updated:** [September 11, 2025, 9:41pm UTC](https://discourse.julialang.org/t/error-using-delay-fnn/132297 "2025-09-11T21:41:28Z")

</div>

Hello, I am trying to use the delay\_fnn function in the DynamicalSystems package and I keep getting the following error: ERROR: MethodError: no method matching StateSpaceSet{2, Float64, SVector{2, Float64}, Nothing}(::…

---

## [Accessing df\_agent in agents.jl](https://discourse.julialang.org/t/accessing-df-agent-in-agents-jl/132285)

<div class="topic-metadata">

**Author:** [@geoffD](https://discourse.julialang.org/u/geoffD)\
**Replies:** 0\
**Last updated:** [September 11, 2025, 1:59pm UTC](https://discourse.julialang.org/t/accessing-df-agent-in-agents-jl/132285 "2025-09-11T13:59:50Z")

</div>

Hi, all. I am noticing that upon running simulations with Agents.jl, the agent dataframe (adf) and presumably the underlying agent data stored in df\_agent contain one record per agent per timestep. For one of my models,…

---

## [Bifurcation Analysis of large nonlinear system](https://discourse.julialang.org/t/bifurcation-analysis-of-large-nonlinear-system/132184)

<div class="topic-metadata">

**Author:** [@AlirezaMiraliakbar](https://discourse.julialang.org/u/AlirezaMiraliakbar)\
**Replies:** 4\
**Last updated:** [September 8, 2025, 4:35pm UTC](https://discourse.julialang.org/t/bifurcation-analysis-of-large-nonlinear-system/132184 "2025-09-08T16:35:52Z")

</div>

Hi, I am new to Julia and BifurcationKit. I am trying to perform a bifurcation analysis for a kinetic model I am using to model a chemical plant. The plant’s nonlinear algebraic system of equation is quite large with 67 …

---

## [\`NeuralPDE.jl\`: How to impose Dirichlet boundary conditions as hard constraints?](https://discourse.julialang.org/t/neuralpde-jl-how-to-impose-dirichlet-boundary-conditions-as-hard-constraints/132007)

<div class="topic-metadata">

**Author:** [@Sigmund](https://discourse.julialang.org/u/Sigmund)\
**Replies:** 1\
**Last updated:** [September 6, 2025, 10:24pm UTC](https://discourse.julialang.org/t/neuralpde-jl-how-to-impose-dirichlet-boundary-conditions-as-hard-constraints/132007 "2025-09-06T22:24:28Z")

</div>

Im solving a coupled PDE-problem using NeuralPDE.jl, the boundary conditions are now set by the penalization method. Instead I want to apply these as hard boundary constraints, or as an output transformation, as it is d…

---

## [Best practices for modeling systems that evolve over time — mutability, patterns, and performance?](https://discourse.julialang.org/t/best-practices-for-modeling-systems-that-evolve-over-time-mutability-patterns-and-performance/128626)

<div class="topic-metadata">

**Author:** [@stevenhughes](https://discourse.julialang.org/u/stevenhughes)\
**Replies:** 26\
**Last updated:** [September 6, 2025, 12:06pm UTC](https://discourse.julialang.org/t/best-practices-for-modeling-systems-that-evolve-over-time-mutability-patterns-and-performance/128626 "2025-09-06T12:06:54Z")

</div>

Hi everyone — I’m new to Julia. I’ve known about the language for years but only recently started using it seriously. I’m prototyping a space systems modeling tool — something that propagates orbits and performs optimiz…

---

## [Best practices for large model composition in ModelingToolkit.jl](https://discourse.julialang.org/t/best-practices-for-large-model-composition-in-modelingtoolkit-jl/131680)

<div class="topic-metadata">

**Author:** [@mxp](https://discourse.julialang.org/u/mxp)\
**Replies:** 7\
**Last updated:** [September 3, 2025, 11:25pm UTC](https://discourse.julialang.org/t/best-practices-for-large-model-composition-in-modelingtoolkit-jl/131680 "2025-09-03T23:25:50Z")

</div>

I’m building fairly large models with ModelingToolkit.jl. While I think the library is very cool, I’m stumbling through how to set up large models effectively, both from a numerical perspective and from a developer persp…

---

## [Show solver steps in Symbolics.jl](https://discourse.julialang.org/t/show-solver-steps-in-symbolics-jl/131851)

<div class="topic-metadata">

**Author:** [@HiramTheHero](https://discourse.julialang.org/u/HiramTheHero)\
**Replies:** 2\
**Last updated:** [August 26, 2025, 8:06am UTC](https://discourse.julialang.org/t/show-solver-steps-in-symbolics-jl/131851 "2025-08-26T08:06:42Z")

</div>

Sorry if is this is a repeat post. I couldn’t find anything in the Symbolics.jl docs nor in some cursory Google searching. I have the following code: using Symbolics, Nemo @variables r P K symbolic\_solve(0 ~ r \* P \* …

---

## [MTK - solve: weird error message](https://discourse.julialang.org/t/mtk-solve-weird-error-message/131638)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [August 24, 2025, 7:28am UTC](https://discourse.julialang.org/t/mtk-solve-weird-error-message/131638 "2025-08-24T07:28:05Z")

</div>

I’m on Julia v1.11.6 on Windows 11 64bit, using MTK v10.19.0, OrdinaryDiffEq v6.101.0. I try to use Clapeyron v0.6.15 with the code. My code worked without a flaw (except some warnings related to arrays and Clapeyron) i…

---

## [How to use Autodiff in Gridap.jl](https://discourse.julialang.org/t/how-to-use-autodiff-in-gridap-jl/131652)

<div class="topic-metadata">

**Author:** [@Sigmund](https://discourse.julialang.org/u/Sigmund)\
**Replies:** 4\
**Last updated:** [August 23, 2025, 5:45pm UTC](https://discourse.julialang.org/t/how-to-use-autodiff-in-gridap-jl/131652 "2025-08-23T17:45:57Z")

</div>

TLDR: I want to solve an optimal control problem using automatic differentiation (Gridap uses ForwardDiff.jl), but i get an error when i try to find the gradient of the objective function. The objective function depends …

---

## [Catalyst.jl - what's the best way to extract interpolation from the reaction\_network](https://discourse.julialang.org/t/catalyst-jl-whats-the-best-way-to-extract-interpolation-from-the-reaction-network/130171)

<div class="topic-metadata">

**Author:** [@Mindy](https://discourse.julialang.org/u/Mindy)\
**Replies:** 7\
**Last updated:** [August 21, 2025, 3:22pm UTC](https://discourse.julialang.org/t/catalyst-jl-whats-the-best-way-to-extract-interpolation-from-the-reaction-network/130171 "2025-08-21T15:22:11Z")

</div>

Hi! If I want to extract and plot the interpolating variable - $d\_rate (temporal dynamic profile) from this example code, does catalyst.jl have any built-in function so that I can extract the results directly, instead o…

---

## [ODE solver takes 10x more steps without tstops](https://discourse.julialang.org/t/ode-solver-takes-10x-more-steps-without-tstops/131682)

<div class="topic-metadata">

**Author:** [@mleseach](https://discourse.julialang.org/u/mleseach)\
**Replies:** 2\
**Last updated:** [August 19, 2025, 10:28am UTC](https://discourse.julialang.org/t/ode-solver-takes-10x-more-steps-without-tstops/131682 "2025-08-19T10:28:21Z")

</div>

Hi everyone, I’m experiencing what seems like counterintuitive performance behavior with RDPK3Sp35() and I’m wondering if this is expected or worth investigating as a potential bug. I’m solving the same ODE with RDPK3…

---

## [libTracyClient Bad Image Popup](https://discourse.julialang.org/t/libtracyclient-bad-image-popup/131691)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 0\
**Last updated:** [August 18, 2025, 7:16pm UTC](https://discourse.julialang.org/t/libtracyclient-bad-image-popup/131691 "2025-08-18T19:16:17Z")

</div>

I was going through some tutorials on SciML.ai website and for the second tutorial when I tried \] add DifferentialEquations I get a julia.exe - Bad Image popup. It says “C:.…julia\\artifacts\\f91…\\bin\\libTractClient.dll …

---

## [Complex Piecewise function](https://discourse.julialang.org/t/complex-piecewise-function/131681)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 1\
**Last updated:** [August 18, 2025, 3:48pm UTC](https://discourse.julialang.org/t/complex-piecewise-function/131681 "2025-08-18T15:48:06Z")

</div>

Hello, Can I add this function using Symbolics.jl? I know about ifelse, but I haven’t found any examples with multiple conditions. Thanks for your help

---

## [Recording data from model\_step in Agents.jl](https://discourse.julialang.org/t/recording-data-from-model-step-in-agents-jl/131543)

<div class="topic-metadata">

**Author:** [@geoffD](https://discourse.julialang.org/u/geoffD)\
**Replies:** 0\
**Last updated:** [August 12, 2025, 3:05am UTC](https://discourse.julialang.org/t/recording-data-from-model-step-in-agents-jl/131543 "2025-08-12T03:05:25Z")

</div>

Hi, I am trying to increment a few pieces of data on every model step in Agents.jl. Data are structured as Dict entries. The code appears to be incrementing appropriately when I examine the values from within model\_step!…

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

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