# Modelling & Simulations

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

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

**Page:** 22

---

## [ModelingToolkit for nonlinear circuits and interface with fixed time-step simulators](https://discourse.julialang.org/t/modelingtoolkit-for-nonlinear-circuits-and-interface-with-fixed-time-step-simulators/115628)

<div class="topic-metadata">

**Author:** [@kevjzheng](https://discourse.julialang.org/u/kevjzheng)\
**Replies:** 4\
**Last updated:** [June 15, 2024, 9:51pm UTC](https://discourse.julialang.org/t/modelingtoolkit-for-nonlinear-circuits-and-interface-with-fixed-time-step-simulators/115628 "2024-06-15T21:51:48Z")

</div>

Hi all, I am relatively new to Julia and believe MTK offers an efficient way to model nonlinear circuits/communication channels for an existing link simulation framework I am building. As shown in the picture, most …

---

## [Problems with reverse mode automatic diff (e.g. zygote) with NeuralSDEs](https://discourse.julialang.org/t/problems-with-reverse-mode-automatic-diff-e-g-zygote-with-neuralsdes/113501)

<div class="topic-metadata">

**Author:** [@agelgazzar](https://discourse.julialang.org/u/agelgazzar)\
**Replies:** 2\
**Last updated:** [June 15, 2024, 11:17am UTC](https://discourse.julialang.org/t/problems-with-reverse-mode-automatic-diff-e-g-zygote-with-neuralsdes/113501 "2024-06-15T11:17:57Z")

</div>

Hello, I am having difficulty computing gradients of a neural sdes (either custom or in DiffeqFlux) using Zygote or ReverseDiff. I think it has to do with the shape of the noise during the backward pass but I am not su…

---

## [PDE with neural network and derivative of NN using MethodOfLines](https://discourse.julialang.org/t/pde-with-neural-network-and-derivative-of-nn-using-methodoflines/114673)

<div class="topic-metadata">

**Author:** [@jenrei](https://discourse.julialang.org/u/jenrei)\
**Replies:** 2\
**Last updated:** [June 15, 2024, 11:15am UTC](https://discourse.julialang.org/t/pde-with-neural-network-and-derivative-of-nn-using-methodoflines/114673 "2024-06-15T11:15:09Z")

</div>

I want to solve the energy equation where the potential energy is expressed by a neural network and then solved for a prescribed energy (actually temperature) profile. So a very simplified version of my problem would loo…

---

## [MTK - instantiate \*vectors\* of models?](https://discourse.julialang.org/t/mtk-instantiate-vectors-of-models/113487)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [June 15, 2024, 10:34am UTC](https://discourse.julialang.org/t/mtk-instantiate-vectors-of-models/113487 "2024-06-15T10:34:15Z")

</div>

Is it possible to instantiate vectors of models in MTK? What I mean is the following. I have created a re-usable “class” which I have named Well. In the past, I have instantiated several copies of this model and used th…

---

## [MTK system based on symbolic arrays fails: type Array has no field lhs](https://discourse.julialang.org/t/mtk-system-based-on-symbolic-arrays-fails-type-array-has-no-field-lhs/110455)

<div class="topic-metadata">

**Author:** [@fabianmueller](https://discourse.julialang.org/u/fabianmueller)\
**Replies:** 2\
**Last updated:** [June 14, 2024, 4:48pm UTC](https://discourse.julialang.org/t/mtk-system-based-on-symbolic-arrays-fails-type-array-has-no-field-lhs/110455 "2024-06-14T16:48:22Z")

</div>

I struggle a little bit with a relatively simple MTK model that contains matrix vector multiplications. My example code is the following: using ModelingToolkit Am = \[1 0 3; 2 0 1; 0 1 4\] Bm = \[4 5; 3 2; 1 4\] @paramete…

---

## [ModellingToolkit issue with creating ODEProblem](https://discourse.julialang.org/t/modellingtoolkit-issue-with-creating-odeproblem/115560)

<div class="topic-metadata">

**Author:** [@rveynde](https://discourse.julialang.org/u/rveynde)\
**Replies:** 2\
**Last updated:** [June 14, 2024, 7:02am UTC](https://discourse.julialang.org/t/modellingtoolkit-issue-with-creating-odeproblem/115560 "2024-06-14T07:02:33Z")

</div>

Hi all, I have encountered the same error multiple times when building a model, and I am not sure whether it is a bug or whether I am building the model wrong. Below is an example of the type of model that I am trying t…

---

## [Has anyone tranlated the TE Process to Julia?](https://discourse.julialang.org/t/has-anyone-tranlated-the-te-process-to-julia/115614)

<div class="topic-metadata">

**Author:** [@RGonTheNoble](https://discourse.julialang.org/u/RGonTheNoble)\
**Replies:** 0\
**Last updated:** [June 13, 2024, 6:41pm UTC](https://discourse.julialang.org/t/has-anyone-tranlated-the-te-process-to-julia/115614 "2024-06-13T18:41:42Z")

</div>

I remember using a MATLAB-Simulink model for the Tennessee-Eastman (TE) process back in grad school to test some algorithms; and I also remember that using this simulator was a horrible experience. Apparently a lot of pe…

---

## [Custom loss in DiffEqParamEstim](https://discourse.julialang.org/t/custom-loss-in-diffeqparamestim/115580)

<div class="topic-metadata">

**Author:** [@Piyush](https://discourse.julialang.org/u/Piyush)\
**Replies:** 3\
**Last updated:** [June 13, 2024, 11:20am UTC](https://discourse.julialang.org/t/custom-loss-in-diffeqparamestim/115580 "2024-06-13T11:20:50Z")

</div>

How to add first differencing term in custom loss function as included in the inbuilt L2Loss function? Is there a way I can access the documentation for the same?

---

## [Extracting base symbol from array of symbols](https://discourse.julialang.org/t/extracting-base-symbol-from-array-of-symbols/115476)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 1\
**Last updated:** [June 11, 2024, 2:45pm UTC](https://discourse.julialang.org/t/extracting-base-symbol-from-array-of-symbols/115476 "2024-06-11T14:45:25Z")

</div>

I am having trouble creating a dictionary from symbols to numbers for defining an ODEProblem. In essence, the problem boils down to having to extract the “base” symbol from a symbolic array. My code is structured in such…

---

## [GSOC Periodic Orbits](https://discourse.julialang.org/t/gsoc-periodic-orbits/115440)

<div class="topic-metadata">

**Author:** [@JonasKoziorek](https://discourse.julialang.org/u/JonasKoziorek)\
**Replies:** 0\
**Last updated:** [June 10, 2024, 4:27pm UTC](https://discourse.julialang.org/t/gsoc-periodic-orbits/115440 "2024-06-10T16:27:04Z")

</div>

Hi community! My name is Jonas Koziorek and I am one of the Google summer of code (GSOC) contributors for the Julia Language organization this year. I am contributing to DynamicalSystems.jl under guidance of my mentor G…

---

## [Multi-component pendulum becomes unstable](https://discourse.julialang.org/t/multi-component-pendulum-becomes-unstable/115319)

<div class="topic-metadata">

**Author:** [@natlampen](https://discourse.julialang.org/u/natlampen)\
**Replies:** 2\
**Last updated:** [June 9, 2024, 5:30pm UTC](https://discourse.julialang.org/t/multi-component-pendulum-becomes-unstable/115319 "2024-06-09T17:30:06Z")

</div>

Hi everyone, I have started my journey into using ModelingToolkit. So far it has been working quite well and I am very impressed. I am going down the component-based path. I have a somewhat complex system in mind but I…

---

## [Interacting\_pairs() for EventQueueABM](https://discourse.julialang.org/t/interacting-pairs-for-eventqueueabm/115332)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [June 7, 2024, 1:28pm UTC](https://discourse.julialang.org/t/interacting-pairs-for-eventqueueabm/115332 "2024-06-07T13:28:22Z")

</div>

Hello, I’m trying to modify interacting\_pairs() function for EventQueueABM model which only looks for true pairs. As EventQueueABM doesn’t have Scheduler. So, I replaced it with allids(model). Now this does give pairs b…

---

## [Nearest\_neighbor() and euclidean\_distance in Agents](https://discourse.julialang.org/t/nearest-neighbor-and-euclidean-distance-in-agents/115270)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 2\
**Last updated:** [June 6, 2024, 9:15am UTC](https://discourse.julialang.org/t/nearest-neighbor-and-euclidean-distance-in-agents/115270 "2024-06-06T09:15:29Z")

</div>

Hey, Im working with interaction\_pair() function which uses nearest\_neighbor() to find a pair. Now while applying this function I feel that doesn’t matter how small r value we give in nearest\_neighbor(model\[2\], model, 1…

---

## [Jump Process with Drift](https://discourse.julialang.org/t/jump-process-with-drift/115166)

<div class="topic-metadata">

**Author:** [@Mieszko](https://discourse.julialang.org/u/Mieszko)\
**Replies:** 4\
**Last updated:** [June 5, 2024, 9:47pm UTC](https://discourse.julialang.org/t/jump-process-with-drift/115166 "2024-06-05T21:47:37Z")

</div>

Hey, I am trying to simulate with the use of JumpProcesses.jl the following stochastic differential equation: dX\_t = -X\_tdt + dN\_t. Do you know, if there is any straightforward way of defining the f (drift) function in…

---

## [MTK & structural\_parameters](https://discourse.julialang.org/t/mtk-structural-parameters/115239)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [June 5, 2024, 7:00pm UTC](https://discourse.julialang.org/t/mtk-structural-parameters/115239 "2024-06-05T19:00:17Z")

</div>

I have a gas model where I want to compare two cases: using a fixed “compressibility factor” z computing z from an EoS \[Equation of State\] The idea is to compare the dynamic behavior. So my idea is to add a structural…

---

## [Modifying interaction\_pairs() for EventQueueABM](https://discourse.julialang.org/t/modifying-interaction-pairs-for-eventqueueabm/115233)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [June 5, 2024, 2:27pm UTC](https://discourse.julialang.org/t/modifying-interaction-pairs-for-eventqueueabm/115233 "2024-06-05T14:27:31Z")

</div>

Hello everyone, I’m trying to modify inbuild function interaction\_pairs() to make it usable for EventQueueABM model too. Any suggestion will be helpful… :slight\_smile: Here is original code : function interacting\_pair…

---

## [Elastic collision for particle pairs in 3d EventQueueABM model](https://discourse.julialang.org/t/elastic-collision-for-particle-pairs-in-3d-eventqueueabm-model/115231)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [June 5, 2024, 12:57pm UTC](https://discourse.julialang.org/t/elastic-collision-for-particle-pairs-in-3d-eventqueueabm-model/115231 "2024-06-05T12:57:55Z")

</div>

Hello everyone, I’m trying to make a model where 2 particles in 3d cubical space when comes to certain distance they do elastic collision. Now major issues are that Elastic collision function is just for 2d in Agents.…

---

## [Integration within ModelingToolkit Models](https://discourse.julialang.org/t/integration-within-modelingtoolkit-models/115015)

<div class="topic-metadata">

**Author:** [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Replies:** 6\
**Last updated:** [June 5, 2024, 7:26am UTC](https://discourse.julialang.org/t/integration-within-modelingtoolkit-models/115015 "2024-06-05T07:26:22Z")

</div>

Hello, Sorry I am asking so many questions on here. I would like to be able to integrate part of an equation within a MTK model so that each time step the integration is performed with the current variables and paramete…

---

## [Specify names of states and parameters in ODEProblem?](https://discourse.julialang.org/t/specify-names-of-states-and-parameters-in-odeproblem/115145)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 6\
**Last updated:** [June 5, 2024, 6:24am UTC](https://discourse.julialang.org/t/specify-names-of-states-and-parameters-in-odeproblem/115145 "2024-06-05T06:24:46Z")

</div>

Here’s a simple problem I have where I couldn’t find any documentation; I’d like to specify the parameter names of the states and parameters to SciML’s ODEFunction e.g. using Dict(:u =\> \[:S, :I, :R\], :p =\> \[:β, :c, :γ\]).…

---

## [ModelingToolkit doesn't precompile any more](https://discourse.julialang.org/t/modelingtoolkit-doesnt-precompile-any-more/114548)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [June 4, 2024, 9:26pm UTC](https://discourse.julialang.org/t/modelingtoolkit-doesnt-precompile-any-more/114548 "2024-06-04T21:26:55Z")

</div>

A few days ago, I installed some new packages (AbstractAlgebra, Nemo, Groebner). I also tried to install Oscar. When I tried to compile Oscar, I was told it doesn’t run on Windows, and I removed it. Since then, Modeling…

---

## [Simultaneous movement of agents with EventQueueABM?](https://discourse.julialang.org/t/simultaneous-movement-of-agents-with-eventqueueabm/115168)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 1:15pm UTC](https://discourse.julialang.org/t/simultaneous-movement-of-agents-with-eventqueueabm/115168 "2024-06-04T13:15:24Z")

</div>

For my current output it seems particles movements are sequential in nature though I want it to be simultaneously. It looks like they are stepping rather then floating. Main thing you would want to look into my move!…

---

## [Continuous time (EventQueueABM) Agent based model - Method Error](https://discourse.julialang.org/t/continuous-time-eventqueueabm-agent-based-model-method-error/115163)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 11:41am UTC](https://discourse.julialang.org/t/continuous-time-eventqueueabm-agent-based-model-method-error/115163 "2024-06-04T11:41:54Z")

</div>

Hello, Im working on this following example where I want particles to just move around and thats all to get started. Though I got Error even before a proper start. Will be helpful if someone can point cause. Im sure its …

---

## [ModelEvent in continous time model?](https://discourse.julialang.org/t/modelevent-in-continous-time-model/115153)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 5\
**Last updated:** [June 4, 2024, 8:54am UTC](https://discourse.julialang.org/t/modelevent-in-continous-time-model/115153 "2024-06-04T08:54:06Z")

</div>

Hello, I have been working with discrete model type in agents.jl. There we have agent\_step and model\_step functions to work at model or agent level. Now I want to switch to continous time models. i was checking example …

---

## [Interpolation Package that works within Symbolics/MTK](https://discourse.julialang.org/t/interpolation-package-that-works-within-symbolics-mtk/114970)

<div class="topic-metadata">

**Author:** [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Replies:** 2\
**Last updated:** [May 30, 2024, 3:56pm UTC](https://discourse.julialang.org/t/interpolation-package-that-works-within-symbolics-mtk/114970 "2024-05-30T15:56:30Z")

</div>

Hello, I have a use case that requires an interpolation to be used from within a Modeling Toolkit Model as well as Symbolics Num’s. From what I understand the only package that can do this is DataInterpolations.jl, at l…

---

## [Indentify parameters in an ODEProblem](https://discourse.julialang.org/t/indentify-parameters-in-an-odeproblem/114784)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 17\
**Last updated:** [May 30, 2024, 6:00am UTC](https://discourse.julialang.org/t/indentify-parameters-in-an-odeproblem/114784 "2024-05-30T06:00:19Z")

</div>

Hello, I have specified a model in Turing.jl as follows: using Turing @model function LGDS(x::AbstractArray, prob, params::Dict, t\_int) # prior distributions σ ~ InverseGamma(2, 3) lC ~ MvNormal(params\[:…

---

## [Using Symbolics to compute Hessian of a large objective function](https://discourse.julialang.org/t/using-symbolics-to-compute-hessian-of-a-large-objective-function/93805)

<div class="topic-metadata">

**Author:** [@zornsllama](https://discourse.julialang.org/u/zornsllama)\
**Replies:** 1\
**Last updated:** [May 28, 2024, 8:17pm UTC](https://discourse.julialang.org/t/using-symbolics-to-compute-hessian-of-a-large-objective-function/93805 "2024-05-28T20:17:50Z")

</div>

Hi all, I’m trying to use Symbolics.jl to compute the Hessian of a large sum-of-squares type objective function, e.g. something like \\sum\_{i=i}^{N-2} f(x\_i, x\_{i+1}, x\_{i+2})^2 where f is some nonlinear function. I have…

---

## [Issue with updating ModelingToolkit and remake command](https://discourse.julialang.org/t/issue-with-updating-modelingtoolkit-and-remake-command/112164)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 3\
**Last updated:** [May 28, 2024, 6:50pm UTC](https://discourse.julialang.org/t/issue-with-updating-modelingtoolkit-and-remake-command/112164 "2024-05-28T18:50:25Z")

</div>

I am trying to run the following code but I get the following error when I run the remake command at the end: ERROR: MethodError: Cannot convert an object of type Pair{SymbolicUtils.BasicSymbolic{Real}, Float64} to an …

---

## [DifferentialEquations v7.13.0 FunctionWrappersWrappers Error](https://discourse.julialang.org/t/differentialequations-v7-13-0-functionwrapperswrappers-error/114612)

<div class="topic-metadata">

**Author:** [@rebetz](https://discourse.julialang.org/u/rebetz)\
**Replies:** 7\
**Last updated:** [May 28, 2024, 12:36am UTC](https://discourse.julialang.org/t/differentialequations-v7-13-0-functionwrapperswrappers-error/114612 "2024-05-28T00:36:10Z")

</div>

Hello, I have existing code that uses the DifferentialEquations package that was working fine yesterday, but when run today (23/5/2024) it is giving a message from the solver code: ERROR: FunctionWrappersWrappers.NoFun…

---

## [Is solving a PDE using ParallelStencil an explicit method?](https://discourse.julialang.org/t/is-solving-a-pde-using-parallelstencil-an-explicit-method/114785)

<div class="topic-metadata">

**Author:** [@jdm204](https://discourse.julialang.org/u/jdm204)\
**Replies:** 2\
**Last updated:** [May 27, 2024, 2:39pm UTC](https://discourse.julialang.org/t/is-solving-a-pde-using-parallelstencil-an-explicit-method/114785 "2024-05-27T14:39:11Z")

</div>

Hi all, I’m trying to implement diffusion in my 3D Agents.jl agent-based model. The “agents” produce or consume substance at each time step, thus changing the local concentration at their grid position x,y,z. I then run …

---

## [Issues while installing ApproxBayes.jl or KissABC.jl](https://discourse.julialang.org/t/issues-while-installing-approxbayes-jl-or-kissabc-jl/114781)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [May 27, 2024, 12:50pm UTC](https://discourse.julialang.org/t/issues-while-installing-approxbayes-jl-or-kissabc-jl/114781 "2024-05-27T12:50:31Z")

</div>

Hello everyone, I’m facing some issue while installing ApproxBayes or KissABC package. Issue is related to conflict among versions of dependencies I think. Below you can see error that I got. It will be very helpful if …

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

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