# Modelling & Simulations

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

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

**Page:** 37

---

## [Sensitivity fail on DAEs](https://discourse.julialang.org/t/sensitivity-fail-on-daes/98205)

<div class="topic-metadata">

**Author:** [@Guido\_Ballabio](https://discourse.julialang.org/u/Guido_Ballabio)\
**Replies:** 4\
**Last updated:** [May 3, 2023, 1:49pm UTC](https://discourse.julialang.org/t/sensitivity-fail-on-daes/98205 "2023-05-03T13:49:44Z")

</div>

I am trying to use DiffEq and SciML sensitivity to build NN controllers for physical systems. Usually everything works, however when i explicitly call adjoint\_sensitivities from SciML-sensitivity to get the gradient of …

---

## [Vector equations LHS/RHS missing with MTK and MethodOfLines](https://discourse.julialang.org/t/vector-equations-lhs-rhs-missing-with-mtk-and-methodoflines/97230)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 14\
**Last updated:** [April 12, 2023, 3:21am UTC](https://discourse.julialang.org/t/vector-equations-lhs-rhs-missing-with-mtk-and-methodoflines/97230 "2023-04-12T03:21:50Z")

</div>

I’ve been trying to generate a system of equations in vector format using MTK and MOL, and I keep getting errors related to broadcast-created equations missing LHS/RHS. I’ve adapted a tutorial problem to show the issue. …

---

## [Mixing set of continuous ODEs with probabilistic binary states](https://discourse.julialang.org/t/mixing-set-of-continuous-odes-with-probabilistic-binary-states/98209)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 2\
**Last updated:** [May 2, 2023, 4:12pm UTC](https://discourse.julialang.org/t/mixing-set-of-continuous-odes-with-probabilistic-binary-states/98209 "2023-05-02T16:12:31Z")

</div>

Say I have state vectors X1 and X2. X1 contains N1 continuous variables and X2 contains N2 binary (0 or 1) variables. X1 evolves in time according to function f1(X1,X2) and the binary variables in X2 have a probablity pe…

---

## [Microsimulation with Agents?](https://discourse.julialang.org/t/microsimulation-with-agents/98119)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 3\
**Last updated:** [April 30, 2023, 1:10pm UTC](https://discourse.julialang.org/t/microsimulation-with-agents/98119 "2023-04-30T13:10:46Z")

</div>

Is it possible to do a micro-simulation using Agents.jl? Some software pretend to do ABM and micro-simulation. Can it be real? What would be the right packages to do it in Julia?

---

## [Performance of Interpolations in Modeling toolkit](https://discourse.julialang.org/t/performance-of-interpolations-in-modeling-toolkit/97997)

<div class="topic-metadata">

**Author:** [@HamzaKh99](https://discourse.julialang.org/u/HamzaKh99)\
**Replies:** 1\
**Last updated:** [April 27, 2023, 2:51pm UTC](https://discourse.julialang.org/t/performance-of-interpolations-in-modeling-toolkit/97997 "2023-04-27T14:51:51Z")

</div>

Hello, I’m trying to create a lookup table function in modeling toolkit, for that I used Interpolations.jl to make an interpolation between elements of a table, my code is working perfectly fine but the problem is in th…

---

## [Passing array as parameter to a PDESystem](https://discourse.julialang.org/t/passing-array-as-parameter-to-a-pdesystem/97407)

<div class="topic-metadata">

**Author:** [@Mixpap](https://discourse.julialang.org/u/Mixpap)\
**Replies:** 12\
**Last updated:** [April 27, 2023, 12:08pm UTC](https://discourse.julialang.org/t/passing-array-as-parameter-to-a-pdesystem/97407 "2023-04-27T12:08:41Z")

</div>

Hello, I am trying to solve an inverse diffusion+source problem based on some data on the surface of a cylinder. I already tried several PINN implementations I have used before but with no luck. What I am trying to do i…

---

## [Estimating some parameters of DDEs with callbacks](https://discourse.julialang.org/t/estimating-some-parameters-of-ddes-with-callbacks/97614)

<div class="topic-metadata">

**Author:** [@pascal](https://discourse.julialang.org/u/pascal)\
**Replies:** 13\
**Last updated:** [April 25, 2023, 12:00pm UTC](https://discourse.julialang.org/t/estimating-some-parameters-of-ddes-with-callbacks/97614 "2023-04-25T12:00:28Z")

</div>

Hi, I have a delay differential equation model with 3 model parameters and a drug perturbation with one parameter (alpha). I’ve set up the simulation as: using DifferentialEquations using DataFrames, DataFramesMeta usi…

---

## [\[SciMLOperators\] Idiomatic way to define a stateful FunctionOperator](https://discourse.julialang.org/t/scimloperators-idiomatic-way-to-define-a-stateful-functionoperator/97821)

<div class="topic-metadata">

**Author:** [@sbrisard](https://discourse.julialang.org/u/sbrisard)\
**Replies:** 0\
**Last updated:** [April 23, 2023, 4:06pm UTC](https://discourse.julialang.org/t/scimloperators-idiomatic-way-to-define-a-stateful-functionoperator/97821 "2023-04-23T16:06:03Z")

</div>

Hi, I’m trying to implement the 2D laplacian of a scalar field as a SciMLOperators.FunctionOperator, using centered finite differences. The op function needs to know the physical size of the grid (Lx, Ly) as well as the…

---

## [SDEProblem driven by two different NoiseProcess(es)](https://discourse.julialang.org/t/sdeproblem-driven-by-two-different-noiseprocess-es/97608)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 2\
**Last updated:** [April 19, 2023, 10:37am UTC](https://discourse.julialang.org/t/sdeproblem-driven-by-two-different-noiseprocess-es/97608 "2023-04-19T10:37:20Z")

</div>

How can we pass two different driving noise processes for an SDEProblem? The goal is to simulate a simple system of SDE’s: dX(t) = f(X, Y, t)dt + g(X, Y, t)dZ\_1(t) + h(X, Y, t)dZ\_2(t) dY(t) = \\alpha(Y,t)dt + \\beta(Y,t)…

---

## [Compiling large Symbolics.jl expressions using build\_function](https://discourse.julialang.org/t/compiling-large-symbolics-jl-expressions-using-build-function/97563)

<div class="topic-metadata">

**Author:** [@zornsllama](https://discourse.julialang.org/u/zornsllama)\
**Replies:** 4\
**Last updated:** [April 17, 2023, 11:14pm UTC](https://discourse.julialang.org/t/compiling-large-symbolics-jl-expressions-using-build-function/97563 "2023-04-17T23:14:03Z")

</div>

Hi, I’m using Symbolics.jl to compute derivatives for a nonlinear optimization problem, to be used as part of the Ipopt callback functions. I am ultimately hoping to match the performance of the C++ code generated in th…

---

## [Turing & DifferentialEquations - memory allocation](https://discourse.julialang.org/t/turing-differentialequations-memory-allocation/97570)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [April 17, 2023, 2:28pm UTC](https://discourse.julialang.org/t/turing-differentialequations-memory-allocation/97570 "2023-04-17T14:28:42Z")

</div>

I use Turing for MCMC on a simple DAE, and the computation time is in the order of 4.6 hours with apparently extreme memory allocation. My dynamic model has 3 differential equations and 3 linear algebraic equations – wi…

---

## [Diagonal noise with specified noise process in solve (Ornstein Uhlenbeck)](https://discourse.julialang.org/t/diagonal-noise-with-specified-noise-process-in-solve-ornstein-uhlenbeck/97501)

<div class="topic-metadata">

**Author:** [@nkoch](https://discourse.julialang.org/u/nkoch)\
**Replies:** 3\
**Last updated:** [April 16, 2023, 12:16pm UTC](https://discourse.julialang.org/t/diagonal-noise-with-specified-noise-process-in-solve-ornstein-uhlenbeck/97501 "2023-04-16T12:16:45Z")

</div>

Hello, I am trying to simulate a SDE problem with diagonal noise specifically Orstein Uhlenbeck noise, however I am only able to get scalar noise when specifying the noise process in SDEProblem (i.e. one noise process in…

---

## [Large ManifoldProjection causing memory issues in DifferentialEquations.jl](https://discourse.julialang.org/t/large-manifoldprojection-causing-memory-issues-in-differentialequations-jl/97420)

<div class="topic-metadata">

**Author:** [@chrishalcrow](https://discourse.julialang.org/u/chrishalcrow)\
**Replies:** 2\
**Last updated:** [April 14, 2023, 7:56am UTC](https://discourse.julialang.org/t/large-manifoldprojection-causing-memory-issues-in-differentialequations-jl/97420 "2023-04-14T07:56:05Z")

</div>

Hello, I’m solving a PDE in three spatial dimension where the field takes values in S^3. A convenient way to work with this is to define a four-vector u and project it onto the sphere at each point. So I have u\_i(x,y,z)…

---

## [MTK & missing parameters, MWE](https://discourse.julialang.org/t/mtk-missing-parameters-mwe/96945)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [April 12, 2023, 11:22am UTC](https://discourse.julialang.org/t/mtk-missing-parameters-mwe/96945 "2023-04-12T11:22:39Z")

</div>

OK – I’m trying again – with a MWE. Consider this an observation (I’m not saying this should be changed in MTK). This post is more meant as a request for advice on best practice. Consider the DAE \\frac{dx}{dt} = -b\\cd…

---

## [Memory allocation with Julia 1.8.5 release](https://discourse.julialang.org/t/memory-allocation-with-julia-1-8-5-release/97362)

<div class="topic-metadata">

**Author:** [@Mikel\_Antonana](https://discourse.julialang.org/u/Mikel_Antonana)\
**Replies:** 0\
**Last updated:** [April 11, 2023, 7:22pm UTC](https://discourse.julialang.org/t/memory-allocation-with-julia-1-8-5-release/97362 "2023-04-11T19:22:17Z")

</div>

In a new implementation of an ODE solver, we have a problem with memory allocations with Julia version 1.8.5: 1- With version 1.6.6, the memory allocations are correct, that is, they are constant and independent of the …

---

## [Problem combining Unitful and MonteCarloMeasurements](https://discourse.julialang.org/t/problem-combining-unitful-and-montecarlomeasurements/35418)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 12\
**Last updated:** [April 11, 2023, 10:32am UTC](https://discourse.julialang.org/t/problem-combining-unitful-and-montecarlomeasurements/35418 "2023-04-11T10:32:39Z")

</div>

Consider the functions f1 and f2: using MonteCarloMeasurements using Unitful function f1(Vi) if Vi ≤ 0.0 return 0.0 elseif Vi ≥ 1.0 return 1.0 else Vi end end function f2(Vi) …

---

## [Catalyst.jl VariableRateJump](https://discourse.julialang.org/t/catalyst-jl-variableratejump/97127)

<div class="topic-metadata">

**Author:** [@arnold-c](https://discourse.julialang.org/u/arnold-c)\
**Replies:** 5\
**Last updated:** [April 7, 2023, 1:48pm UTC](https://discourse.julialang.org/t/catalyst-jl-variableratejump/97127 "2023-04-07T13:48:02Z")

</div>

I’m trying to code up a JumpProcess of an SIR-style model that includes a VariableRateJump e.g. the transmission parameter varies throughout the year in a sinusoidal fashion. I have what I think is working code manually …

---

## [Why is ModelingToolkit simplifying this way?](https://discourse.julialang.org/t/why-is-modelingtoolkit-simplifying-this-way/96872)

<div class="topic-metadata">

**Author:** [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Replies:** 5\
**Last updated:** [April 2, 2023, 11:16am UTC](https://discourse.julialang.org/t/why-is-modelingtoolkit-simplifying-this-way/96872 "2023-04-02T11:16:54Z")

</div>

I created a pretty simple composed system: using OrdinaryDiffEq, ModelingToolkit, Plots @parameters t d\_dt = Differential(t) function Cart(; init\_pos, init\_vel, mass, name=:cart) @variables pos(t)=init\_pos vel(t)=ini…

---

## [MTK -- removing parameters from model?](https://discourse.julialang.org/t/mtk-removing-parameters-from-model/96887)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 2:56pm UTC](https://discourse.julialang.org/t/mtk-removing-parameters-from-model/96887 "2023-03-31T14:56:44Z")

</div>

My MTK implementation of a DAE for doing Monte Carlo study of parameter uncertainty doesn’t work. I think it has to do with how MTK removes parameters that do not show up explicitly in the model equations. Here is some …

---

## [Accuracy of method of integration DifferentialEquations.jl](https://discourse.julialang.org/t/accuracy-of-method-of-integration-differentialequations-jl/96833)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 8\
**Last updated:** [March 30, 2023, 3:40pm UTC](https://discourse.julialang.org/t/accuracy-of-method-of-integration-differentialequations-jl/96833 "2023-03-30T15:40:26Z")

</div>

I have limit cycle in phase space, when i scale trajectory in phase space i see different lines. This is due to the accuracy of the integration method or this is problem of CairoMakie? Code: function Res(u, p, t)…

---

## [Multipliers of limit cycles](https://discourse.julialang.org/t/multipliers-of-limit-cycles/96827)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 4\
**Last updated:** [March 30, 2023, 8:18am UTC](https://discourse.julialang.org/t/multipliers-of-limit-cycles/96827 "2023-03-30T08:18:07Z")

</div>

Hello Are there packages for computing multipliers of limit cycles? I know about that i can calculate Poincare map with package DynamicalSystems, but how can i get multipliers of limit cycles?

---

## [JumpProblem: controlling saving behavior](https://discourse.julialang.org/t/jumpproblem-controlling-saving-behavior/96716)

<div class="topic-metadata">

**Author:** [@lmshk](https://discourse.julialang.org/u/lmshk)\
**Replies:** 7\
**Last updated:** [March 29, 2023, 3:57pm UTC](https://discourse.julialang.org/t/jumpproblem-controlling-saving-behavior/96716 "2023-03-29T15:57:12Z")

</div>

I have a JumpProcesses.JumpProblem that I am stepping through piecewise (using integrator = init(...)/step!(integrator, dt, true)) and I would like to save states only during some of these intervals according to a fixed …

---

## [Indexing symbolic arrays inside Differential Equation solution](https://discourse.julialang.org/t/indexing-symbolic-arrays-inside-differential-equation-solution/96764)

<div class="topic-metadata">

**Author:** [@Daniel\_Doyle](https://discourse.julialang.org/u/Daniel_Doyle)\
**Replies:** 4\
**Last updated:** [March 29, 2023, 2:34pm UTC](https://discourse.julialang.org/t/indexing-symbolic-arrays-inside-differential-equation-solution/96764 "2023-03-29T14:34:43Z")

</div>

Hello, I was running into an issue with indexing symbolic arrays from a solution and was wondering if anyone had some insight. Below is a simplified example: using ModelingToolkit, StochasticDiffEq using Plots @variab…

---

## [Questions on the DynamicalODE integrators](https://discourse.julialang.org/t/questions-on-the-dynamicalode-integrators/96721)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 5\
**Last updated:** [March 29, 2023, 2:44am UTC](https://discourse.julialang.org/t/questions-on-the-dynamicalode-integrators/96721 "2023-03-29T02:44:06Z")

</div>

Hi! I have a question about the integrators in the differential equation community. The integrators for DynamicalODEProblem are listed in Dynamical, Hamiltonian, and 2nd Order ODE Solvers · DifferentialEquations.jl. Whi…

---

## [ModelingToolkit & DifferentialEquations -- \`save\_idxs\`?](https://discourse.julialang.org/t/modelingtoolkit-differentialequations-save-idxs/96709)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [March 28, 2023, 1:15pm UTC](https://discourse.julialang.org/t/modelingtoolkit-differentialequations-save-idxs/96709 "2023-03-28T13:15:41Z")

</div>

Coding my own models using DifferentialEquations solvers, it is possible to specify keyword save\_idxs to specify which variables are saved. What if I write the model using MTK instead? Will save\_idxs only work with a …

---

## [Tips on (sort of) creating a new Problem type in SciML, derived from an existing type](https://discourse.julialang.org/t/tips-on-sort-of-creating-a-new-problem-type-in-sciml-derived-from-an-existing-type/95749)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 3\
**Last updated:** [March 25, 2023, 11:25am UTC](https://discourse.julialang.org/t/tips-on-sort-of-creating-a-new-problem-type-in-sciml-derived-from-an-existing-type/95749 "2023-03-25T11:25:37Z")

</div>

Hi everyone, I’m trying to define what is in effect a new Problem in SciML, but what actually is a special case of an existing Problem. As I can’t derive from an instantiated type, I’m making a new type with an instance…

---

## [Passing vectors of data into MTK/MoL problem as parameter](https://discourse.julialang.org/t/passing-vectors-of-data-into-mtk-mol-problem-as-parameter/96578)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 11:05pm UTC](https://discourse.julialang.org/t/passing-vectors-of-data-into-mtk-mol-problem-as-parameter/96578 "2023-03-24T23:05:26Z")

</div>

I have been able to use vectors of data that I’ve passed through DataInterpolations as inputs/boundary conditions to a ModelingToolkit/MethodOfLines problem, but I would like to use the data vectors as MTK parameters to …

---

## [Attractors.basins\_fractions throws "ArgumentError: range must be non-empty"](https://discourse.julialang.org/t/attractors-basins-fractions-throws-argumenterror-range-must-be-non-empty/96531)

<div class="topic-metadata">

**Author:** [@cjoshliu](https://discourse.julialang.org/u/cjoshliu)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 10:06am UTC](https://discourse.julialang.org/t/attractors-basins-fractions-throws-argumenterror-range-must-be-non-empty/96531 "2023-03-24T10:06:02Z")

</div>

Hi, I’m trying to find basin fractions of an s-species (s-dimensional) generalized Lotka-Volterra model using DynamicalSystems. My model is d\_t\\vec{u}=\\vec{\\lambda}+\\vec{r}\\cdot\\vec{u}\\cdot (1-\\hat{\\alpha}\\vec{u}) wher…

---

## [Accessing agent- and model-data in combination](https://discourse.julialang.org/t/accessing-agent-and-model-data-in-combination/96517)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 7:46am UTC](https://discourse.julialang.org/t/accessing-agent-and-model-data-in-combination/96517 "2023-03-24T07:46:47Z")

</div>

Hi. I want to use abm\_exploration to display data that requires access to both agents and model, something like this: function demo() model = initialise\_model() params = Dict( :reaction\_norm =\> 0:0.01:1, ) plotkwa…

---

## [Interpolation problem](https://discourse.julialang.org/t/interpolation-problem/96530)

<div class="topic-metadata">

**Author:** [@PaulN](https://discourse.julialang.org/u/PaulN)\
**Replies:** 2\
**Last updated:** [March 23, 2023, 11:47pm UTC](https://discourse.julialang.org/t/interpolation-problem/96530 "2023-03-23T23:47:27Z")

</div>

I am learning how to use DifferentialEquations.jl, and wrote a simple first piece to code to simulate an undamped SHO. When I solve for the motion and plot the x and v curves using DifferentialEquations.jl, I get a beaut…

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

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