# Modelling & Simulations

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

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

**Page:** 48

---

## [Benchmarks for our own new differential equation solver](https://discourse.julialang.org/t/benchmarks-for-our-own-new-differential-equation-solver/81109)

<div class="topic-metadata">

**Author:** [@Mikel\_Antonana](https://discourse.julialang.org/u/Mikel_Antonana)\
**Replies:** 2\
**Last updated:** [May 16, 2022, 5:31pm UTC](https://discourse.julialang.org/t/benchmarks-for-our-own-new-differential-equation-solver/81109 "2022-05-16T17:31:11Z")

</div>

Hi everyone, We are developing a new differential equation solver, function DiffEqBase.\_\_solve(prob::DiffEqBase.AbstractODEProblem{uType,tType,isinplace}, alg::IRKAlgorithm, udim::Array{floatType,dim},args...; …

---

## [Disable instability checks in OrdinaryDiffEq](https://discourse.julialang.org/t/disable-instability-checks-in-ordinarydiffeq/80799)

<div class="topic-metadata">

**Author:** [@AndreaRH](https://discourse.julialang.org/u/AndreaRH)\
**Replies:** 2\
**Last updated:** [May 16, 2022, 1:58pm UTC](https://discourse.julialang.org/t/disable-instability-checks-in-ordinarydiffeq/80799 "2022-05-16T13:58:56Z")

</div>

Hi, I have a small network of 3 neurons and I’m using OrdinaryDiffEq to solve the ode system describing their interconnected dynamics. Since this problem is stiff, I’m using an adaptive solver that can handle it and thi…

---

## [Jump process with multiple jumps, which jump occurs?](https://discourse.julialang.org/t/jump-process-with-multiple-jumps-which-jump-occurs/81122)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 1\
**Last updated:** [May 16, 2022, 9:21am UTC](https://discourse.julialang.org/t/jump-process-with-multiple-jumps-which-jump-occurs/81122 "2022-05-16T09:21:08Z")

</div>

If we construct a jump process, say one with an underlying ODE and 5 jumps are defined with differing affects. We then pass the jumps, say j1,j2, j3, j4 and j5 to the JumpProblem constructor. How is which jump occurs im…

---

## [How retrieve the best result from sampling? Turing.jl](https://discourse.julialang.org/t/how-retrieve-the-best-result-from-sampling-turing-jl/81077)

<div class="topic-metadata">

**Author:** [@BinaryBot](https://discourse.julialang.org/u/BinaryBot)\
**Replies:** 0\
**Last updated:** [May 14, 2022, 10:26pm UTC](https://discourse.julialang.org/t/how-retrieve-the-best-result-from-sampling-turing-jl/81077 "2022-05-14T22:26:12Z")

</div>

https://turing.ml/dev/tutorials/10-bayesian-differential-equations/ I followed this tutorial to model my own ode problem and estimate parameters. When calling sample(model, NUTS(0.65), MCMCThreads(), 1000, 3) I get bac…

---

## [How to make an environment with julia, for my RL agent?](https://discourse.julialang.org/t/how-to-make-an-environment-with-julia-for-my-rl-agent/81049)

<div class="topic-metadata">

**Author:** [@matic\_lauko](https://discourse.julialang.org/u/matic_lauko)\
**Replies:** 9\
**Last updated:** [May 14, 2022, 3:37pm UTC](https://discourse.julialang.org/t/how-to-make-an-environment-with-julia-for-my-rl-agent/81049 "2022-05-14T15:37:04Z")

</div>

I want to make an environment for Agents with julia, what are some packages to do that? I’m thinking of GameZero.jl and Makie.jl. Are there any others? Could I use Unreal Engine or Unity, but create Agents using Julia? …

---

## [Compensated Jump process](https://discourse.julialang.org/t/compensated-jump-process/81038)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 10\
**Last updated:** [May 14, 2022, 8:43am UTC](https://discourse.julialang.org/t/compensated-jump-process/81038 "2022-05-14T08:43:40Z")

</div>

I have been familiarizing myself with DifferentialEquations.jl I was trying to find an example of an SDE simulation such that the SDE is a jump-diffusion such that the jumps are of the compensated (Poisson) form. Is th…

---

## [SDE simulation error: ERROR: BoundsError: attempt to access 3-element Vector{Float64} at index \[1, 2\]](https://discourse.julialang.org/t/sde-simulation-error-error-boundserror-attempt-to-access-3-element-vector-float64-at-index-1-2/81045)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 6\
**Last updated:** [May 14, 2022, 2:30am UTC](https://discourse.julialang.org/t/sde-simulation-error-error-boundserror-attempt-to-access-3-element-vector-float64-at-index-1-2/81045 "2022-05-14T02:30:11Z")

</div>

I am getting the following error trying to run a simulation ERROR: BoundsError: attempt to access 3-element Vector{Float64} at index \[1, 2\] My code is as follows using DifferentialEquations using Plots; plotly() fun…

---

## [How to solve implicitly a 2D Heat diffusion equation / ParallelStencil / DifferentialEquation /](https://discourse.julialang.org/t/how-to-solve-implicitly-a-2d-heat-diffusion-equation-parallelstencil-differentialequation/80542)

<div class="topic-metadata">

**Author:** [@Eurel](https://discourse.julialang.org/u/Eurel)\
**Replies:** 17\
**Last updated:** [May 13, 2022, 7:25pm UTC](https://discourse.julialang.org/t/how-to-solve-implicitly-a-2d-heat-diffusion-equation-parallelstencil-differentialequation/80542 "2022-05-13T19:25:29Z")

</div>

Context I am no simulation nor numerical expert and am absolutely not familiar with differential Equations. So I am trying to simulate heat diffusion in a 2D non uniform material on a Cartesian rectilinear mesh (varyi…

---

## [CellmlToolkit.jl: A model not readable](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 3\
**Last updated:** [May 13, 2022, 5:58pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918 "2022-05-13T17:58:11Z")

</div>

Hi, Trying to read in the Smith et al 2004 model Minimal haemodynamic system model including ventricular interaction and valve dynamics. — Physiome Model Repository using the code ml = CellModel("/home/harry/Desktop/P…

---

## [Controls variables for ODESystem](https://discourse.julialang.org/t/controls-variables-for-odesystem/78204)

<div class="topic-metadata">

**Author:** [@jedforrest](https://discourse.julialang.org/u/jedforrest)\
**Replies:** 1\
**Last updated:** [May 13, 2022, 6:31am UTC](https://discourse.julialang.org/t/controls-variables-for-odesystem/78204 "2022-05-13T06:31:08Z")

</div>

Hi all, I’m looking through the documentation on ODESystems in ModelingToolkit and came across the ctrls (control parameters) argument for ODESystems: ctrls Control parameters (some subset of ps ). This sounds lik…

---

## [Surprising error on example code from ModelingToolkit documentation!](https://discourse.julialang.org/t/surprising-error-on-example-code-from-modelingtoolkit-documentation/80867)

<div class="topic-metadata">

**Author:** [@ap2013](https://discourse.julialang.org/u/ap2013)\
**Replies:** 2\
**Last updated:** [May 13, 2022, 5:22am UTC](https://discourse.julialang.org/t/surprising-error-on-example-code-from-modelingtoolkit-documentation/80867 "2022-05-13T05:22:15Z")

</div>

I am having some issues with ModelingTookit. I tried to run the example copy-paste code from the documentation. Component-Based Modeling a Spring-Mass System · ModelingToolkit.jl using ModelingToolkit, Plots, Different…

---

## [SDAE for Stochastic SIR](https://discourse.julialang.org/t/sdae-for-stochastic-sir/80778)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 9:43pm UTC](https://discourse.julialang.org/t/sdae-for-stochastic-sir/80778 "2022-05-11T21:43:35Z")

</div>

I am fairly new at Julia and still learning the ropes. DifferentialEquations.jl package is my primary interest at preset. I want to model/plot a stochastic SIR model using SDAE. The reason my model is in terms of percent…

---

## [How to review your own enviroment in reinforce.jl](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807)

<div class="topic-metadata">

**Author:** [@Hupdup](https://discourse.julialang.org/u/Hupdup)\
**Replies:** 4\
**Last updated:** [May 11, 2022, 3:32pm UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807 "2022-05-11T15:32:28Z")

</div>

Hello all, I have written a custom enviroment in reinforce.jl and now I want to check if it is correct (i.e. if the actions and the step function work as thought). For this I wanted to call the functions one by one in …

---

## [Issue in ModellingToolkit using Flux.destructure](https://discourse.julialang.org/t/issue-in-modellingtoolkit-using-flux-destructure/80876)

<div class="topic-metadata">

**Author:** [@ap2013](https://discourse.julialang.org/u/ap2013)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 2:21pm UTC](https://discourse.julialang.org/t/issue-in-modellingtoolkit-using-flux-destructure/80876 "2022-05-11T14:21:35Z")

</div>

After updating the packages on my project, I am getting an unexpected error. The project builds an ODE system composed of multiple systems. The ODE system that is raising the error is function MLP\_controller(nn; n=:MLP…

---

## [Numbers sampled from exponential distribution seems to be incorrect](https://discourse.julialang.org/t/numbers-sampled-from-exponential-distribution-seems-to-be-incorrect/80810)

<div class="topic-metadata">

**Author:** [@efJerryYang](https://discourse.julialang.org/u/efJerryYang)\
**Replies:** 4\
**Last updated:** [May 10, 2022, 1:40pm UTC](https://discourse.julialang.org/t/numbers-sampled-from-exponential-distribution-seems-to-be-incorrect/80810 "2022-05-10T13:40:22Z")

</div>

I am running a simulation task which is supposed to sample data from an exponential distribution, but the results are always larger than correct ones. I converted my julia code to matlab and it produced correct results (…

---

## [Parameter Estimation using Least Squares with missing data](https://discourse.julialang.org/t/parameter-estimation-using-least-squares-with-missing-data/80797)

<div class="topic-metadata">

**Author:** [@BinaryBot](https://discourse.julialang.org/u/BinaryBot)\
**Replies:** 2\
**Last updated:** [May 10, 2022, 12:21pm UTC](https://discourse.julialang.org/t/parameter-estimation-using-least-squares-with-missing-data/80797 "2022-05-10T12:21:36Z")

</div>

I am trying to estimate 4 parameters for an ode that outputs as solution 4 values at any given time point. I have actual data for 2 of those values. I would like to preform parameter estimation using the available incomp…

---

## [\`mul\_float: types of a and b must match\` error in ModelingToolkit](https://discourse.julialang.org/t/mul-float-types-of-a-and-b-must-match-error-in-modelingtoolkit/77485)

<div class="topic-metadata">

**Author:** [@anandpathak31](https://discourse.julialang.org/u/anandpathak31)\
**Replies:** 7\
**Last updated:** [May 10, 2022, 12:16pm UTC](https://discourse.julialang.org/t/mul-float-types-of-a-and-b-must-match-error-in-modelingtoolkit/77485 "2022-05-10T12:16:20Z")

</div>

I am getting the mul\_float: types of a and b must match error in my code that uses ModelingToolkit in which I am solving an ODAEProblem costructed from ODESystem in a loop. In each iteration I am modifying the ODESystem …

---

## [Including a Julia model in Simulink](https://discourse.julialang.org/t/including-a-julia-model-in-simulink/80627)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 16\
**Last updated:** [May 8, 2022, 4:50am UTC](https://discourse.julialang.org/t/including-a-julia-model-in-simulink/80627 "2022-05-08T04:50:57Z")

</div>

I wrote a nice dynamic model in Julia (https://github.com/ufechner7/KiteModels.jl) and now get the request to include it in Simulink because some people prefer to do control design with Simulink. Any idea what would be t…

---

## [Agents.jl: Introductory Tutorial - Error](https://discourse.julialang.org/t/agents-jl-introductory-tutorial-error/80658)

<div class="topic-metadata">

**Author:** [@Floyd\_Gartner](https://discourse.julialang.org/u/Floyd_Gartner)\
**Replies:** 6\
**Last updated:** [May 7, 2022, 3:19pm UTC](https://discourse.julialang.org/t/agents-jl-introductory-tutorial-error/80658 "2022-05-07T15:19:36Z")

</div>

Hello everybody, I’m trying to work through the Youtube Tutorial for Agents.jl (https://www.youtube.com/watch?v=fgwAfAa4kt0) but I got stuck. When I tried plotting the model it worked fine but when I tried to change th…

---

## [The reasons why ABM is not a parameterized type in Agents.jl?](https://discourse.julialang.org/t/the-reasons-why-abm-is-not-a-parameterized-type-in-agents-jl/80538)

<div class="topic-metadata">

**Author:** [@Atiyah](https://discourse.julialang.org/u/Atiyah)\
**Replies:** 4\
**Last updated:** [May 7, 2022, 5:39am UTC](https://discourse.julialang.org/t/the-reasons-why-abm-is-not-a-parameterized-type-in-agents-jl/80538 "2022-05-07T05:39:14Z")

</div>

I am new to Julia and therefore my curiosity in some implementation details. In the package Agents.jl, the type constructor of Agents.AgentBasedModel is expecting a type as its first argument (specifically an AgentType \<…

---

## [Time Series sensitivity analysis for multiple outputs](https://discourse.julialang.org/t/time-series-sensitivity-analysis-for-multiple-outputs/80631)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 1\
**Last updated:** [May 6, 2022, 7:54pm UTC](https://discourse.julialang.org/t/time-series-sensitivity-analysis-for-multiple-outputs/80631 "2022-05-06T19:54:43Z")

</div>

Hi, function circ\_local\_time(x) \_prob = remake(prob,u0=x\[1:3\],p=x\[4:end\]) sol = solve(\_prob,Tsit5(), reltol=1e-6, abstol=1e-6,saveat=savetime) sol\[LV.p\] end St = ForwardDiff.jacobian(circ\_local\_time,\[u0;p\])…

---

## [Which parameter estimation technique should I learn?](https://discourse.julialang.org/t/which-parameter-estimation-technique-should-i-learn/80378)

<div class="topic-metadata">

**Author:** [@BinaryBot](https://discourse.julialang.org/u/BinaryBot)\
**Replies:** 5\
**Last updated:** [May 6, 2022, 5:28pm UTC](https://discourse.julialang.org/t/which-parameter-estimation-technique-should-i-learn/80378 "2022-05-06T17:28:32Z")

</div>

I would like to ask the Julia community which Parameter Estimation package should I learn/use for my following problem: I have defined a ODE that has over 20 fixed parameters and there is 4 I would like to optimise. I …

---

## [Best Practices for Debugging DiffEqFlux Errors](https://discourse.julialang.org/t/best-practices-for-debugging-diffeqflux-errors/80618)

<div class="topic-metadata">

**Author:** [@jbu](https://discourse.julialang.org/u/jbu)\
**Replies:** 1\
**Last updated:** [May 6, 2022, 4:26pm UTC](https://discourse.julialang.org/t/best-practices-for-debugging-diffeqflux-errors/80618 "2022-05-06T16:26:19Z")

</div>

What are best practices for debugging when encountering errors with DiffEqFlux problems? I’m working on creating a differentiable ODE simulator with DiffEqFlux. It’s an amazing and powerful tool! However, debugging taki…

---

## [I want to make an hospital emergency department model](https://discourse.julialang.org/t/i-want-to-make-an-hospital-emergency-department-model/80608)

<div class="topic-metadata">

**Author:** [@Floyd\_Gartner](https://discourse.julialang.org/u/Floyd_Gartner)\
**Replies:** 2\
**Last updated:** [May 6, 2022, 1:06pm UTC](https://discourse.julialang.org/t/i-want-to-make-an-hospital-emergency-department-model/80608 "2022-05-06T13:06:30Z")

</div>

Hi everybody, I’m super new to Julia and still don’t know how to get started. I want to make a model that simulates an emergency department in a hospital. More specifically I want to show the patient assignment to free…

---

## [Custom simplifying of ModelingToolkit ODESystem equations](https://discourse.julialang.org/t/custom-simplifying-of-modelingtoolkit-odesystem-equations/80531)

<div class="topic-metadata">

**Author:** [@jedforrest](https://discourse.julialang.org/u/jedforrest)\
**Replies:** 1\
**Last updated:** [May 5, 2022, 9:40am UTC](https://discourse.julialang.org/t/custom-simplifying-of-modelingtoolkit-odesystem-equations/80531 "2022-05-05T09:40:16Z")

</div>

When converting my ODESystem into an ODEProblem to be solved, I find that the full equations are not simplified enough, leading to numerical errors. In particular, one part of the equations looks like this: Differential…

---

## [Julia expression to AbstractTree-like structure in Symbolics](https://discourse.julialang.org/t/julia-expression-to-abstracttree-like-structure-in-symbolics/80289)

<div class="topic-metadata">

**Author:** [@mbesancon](https://discourse.julialang.org/u/mbesancon)\
**Replies:** 2\
**Last updated:** [April 30, 2022, 7:27pm UTC](https://discourse.julialang.org/t/julia-expression-to-abstracttree-like-structure-in-symbolics/80289 "2022-04-30T19:27:10Z")

</div>

I was looking at the different possibilities for Expr to tree-like structure in Julia and thought of the Symbolics ecosystem as the natural modern place for it I found an old post and GitHub - dfdx/Espresso.jl: Expressi…

---

## [Plot model stability region depending on parameters](https://discourse.julialang.org/t/plot-model-stability-region-depending-on-parameters/79584)

<div class="topic-metadata">

**Author:** [@Sciemon](https://discourse.julialang.org/u/Sciemon)\
**Replies:** 8\
**Last updated:** [May 3, 2022, 10:23am UTC](https://discourse.julialang.org/t/plot-model-stability-region-depending-on-parameters/79584 "2022-05-03T10:23:27Z")

</div>

I would like to plot the stability region of a (linearized) dynamic model at a certain operating point depending on model parameters. For example, assume that a model has parameters A and B. What I want is a plot that sh…

---

## [Comparing ODE's](https://discourse.julialang.org/t/comparing-odes/79994)

<div class="topic-metadata">

**Author:** [@BinaryBot](https://discourse.julialang.org/u/BinaryBot)\
**Replies:** 4\
**Last updated:** [May 2, 2022, 5:01pm UTC](https://discourse.julialang.org/t/comparing-odes/79994 "2022-05-02T17:01:35Z")

</div>

I would like to compare the simulation result of multiple version of ODE solvers (i.e compare different tolerance values and use different solvers). Is there a way that I can create a dictionary of the algorithms and the…

---

## [Lasso fit with non-negative coefficients](https://discourse.julialang.org/t/lasso-fit-with-non-negative-coefficients/79923)

<div class="topic-metadata">

**Author:** [@Aminath\_Shausan](https://discourse.julialang.org/u/Aminath_Shausan)\
**Replies:** 4\
**Last updated:** [April 26, 2022, 1:40am UTC](https://discourse.julialang.org/t/lasso-fit-with-non-negative-coefficients/79923 "2022-04-26T01:40:49Z")

</div>

Hi I am using a Lasso model for feature selection. At present I use the function lassoFit = fit(LassoPath, X\_train, Y\_train, λ = lamGrid, maxncoef=maxncoef) I have the following question. (1) Some estimated coefficie…

---

## [ModelingToolkit example macro appears not to work](https://discourse.julialang.org/t/modelingtoolkit-example-macro-appears-not-to-work/79981)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 2\
**Last updated:** [April 25, 2022, 1:38pm UTC](https://discourse.julialang.org/t/modelingtoolkit-example-macro-appears-not-to-work/79981 "2022-04-25T13:38:17Z")

</div>

Hi! I am trying to set up an ODE System similar to the very first example in ModelingToolkit. When I try to run e.g the code from the first example I get the error \`UndefVarError: @named not defined’. Anyone know what …

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

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