# Modelling & Simulations

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

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

**Page:** 40

---

## [Plotting only certain trajectories of ensemble solution](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 11:56pm UTC](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288 "2023-01-20T23:56:48Z")

</div>

If I soleve an ensemble problem: using DifferentialEquations using Plots prob = ODEProblem((u,p,t)-\>1.01u,0.5,(0.0,1.0)) function prob\_func(prob,i,repeat) remake(prob,u0=rand()\*prob.u0) end ensemble\_prob = Ensemble…

---

## [Fitting parameters together with initial conditions of an ODE to real data](https://discourse.julialang.org/t/fitting-parameters-together-with-initial-conditions-of-an-ode-to-real-data/93255)

<div class="topic-metadata">

**Author:** [@moeinkh88](https://discourse.julialang.org/u/moeinkh88)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 11:10am UTC](https://discourse.julialang.org/t/fitting-parameters-together-with-initial-conditions-of-an-ode-to-real-data/93255 "2023-01-20T11:10:06Z")

</div>

I want to fit some parameters and some initial conditions of an ODE system to data. I am using Turing based on this tutorial. Example code: @model function fitprob(data) # Prior distributions. σ ~ InverseGamma…

---

## [Finding periodic orbits with BifurcationKit.jl](https://discourse.julialang.org/t/finding-periodic-orbits-with-bifurcationkit-jl/93085)

<div class="topic-metadata">

**Author:** [@rusandris](https://discourse.julialang.org/u/rusandris)\
**Replies:** 5\
**Last updated:** [January 19, 2023, 5:35pm UTC](https://discourse.julialang.org/t/finding-periodic-orbits-with-bifurcationkit-jl/93085 "2023-01-19T17:35:02Z")

</div>

Hi everyone! Currently I’m working on a problem where I have non-standard Hopf-bifurcation points (Hopf-Hopf or degenerate Hopf) which get an “nd” (not documented) mark on my diagrams. Since these are not identified as …

---

## [Failure to enforce boundary conditions with NeuralPDE.jl (for a system with mixed partial derivatives)](https://discourse.julialang.org/t/failure-to-enforce-boundary-conditions-with-neuralpde-jl-for-a-system-with-mixed-partial-derivatives/93178)

<div class="topic-metadata">

**Author:** [@gianmariomanca](https://discourse.julialang.org/u/gianmariomanca)\
**Replies:** 0\
**Last updated:** [January 18, 2023, 6:37pm UTC](https://discourse.julialang.org/t/failure-to-enforce-boundary-conditions-with-neuralpde-jl-for-a-system-with-mixed-partial-derivatives/93178 "2023-01-18T18:37:19Z")

</div>

I’m trying to use NeuralPDE.jl to solve a simple system of PDEs and it seems to completely ignore the boundary conditions. Can someone suggest a modification of the following code that will shows the correct behavior? u…

---

## [Anybody know why this error occurs when trying to define a Catalyst @reaction\_network in Jupyter Notebooks?](https://discourse.julialang.org/t/anybody-know-why-this-error-occurs-when-trying-to-define-a-catalyst-reaction-network-in-jupyter-notebooks/93119)

<div class="topic-metadata">

**Author:** [@jonathanfischer97](https://discourse.julialang.org/u/jonathanfischer97)\
**Replies:** 4\
**Last updated:** [January 19, 2023, 2:19am UTC](https://discourse.julialang.org/t/anybody-know-why-this-error-occurs-when-trying-to-define-a-catalyst-reaction-network-in-jupyter-notebooks/93119 "2023-01-19T02:19:35Z")

</div>

---

## [Poincare map DifferentialEquations.jl](https://discourse.julialang.org/t/poincare-map-differentialequations-jl/92308)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 14\
**Last updated:** [January 18, 2023, 9:02am UTC](https://discourse.julialang.org/t/poincare-map-differentialequations-jl/92308 "2023-01-18T09:02:24Z")

</div>

Hello, i have system: function model(u, p ,t) E, x, u\_, y = u τ, α, τ\_D, J, U0, ΔU0, τ\_y, β, xthr, ythr, I0 = p U(y, U0, ΔU0, ythr) = U0 + ΔU0 / ( 1 + exp( -50 \* ( y - ythr ) ) ) σ(x, xthr)= 1 …

---

## [Unable to use InteractiveDynamics and Agents as Part of my Package](https://discourse.julialang.org/t/unable-to-use-interactivedynamics-and-agents-as-part-of-my-package/78265)

<div class="topic-metadata">

**Author:** [@codekomali](https://discourse.julialang.org/u/codekomali)\
**Replies:** 18\
**Last updated:** [January 17, 2023, 12:56pm UTC](https://discourse.julialang.org/t/unable-to-use-interactivedynamics-and-agents-as-part-of-my-package/78265 "2023-01-17T12:56:55Z")

</div>

I am trying to use the latest InteractiveDynamics v0.20 and Agents v5.0 as part of my project. Since yesterday, I am getting the following error, whenever I try to precompile my package. ERROR: LoadError: UndefVarError:…

---

## [Add agent to random position in 3D GridSpace](https://discourse.julialang.org/t/add-agent-to-random-position-in-3d-gridspace/92847)

<div class="topic-metadata">

**Author:** [@sea\_slug](https://discourse.julialang.org/u/sea_slug)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 12:47pm UTC](https://discourse.julialang.org/t/add-agent-to-random-position-in-3d-gridspace/92847 "2023-01-17T12:47:24Z")

</div>

I am trying to create a 3D ABM using agents.jl. I am stuck with a very simple issue, I cannot add agents to the GridSpace. I just want to give each agent a random starting point in 3D space. I have cannibalised the wolf…

---

## [Defining a history function for Delay Differential Equations using past data points](https://discourse.julialang.org/t/defining-a-history-function-for-delay-differential-equations-using-past-data-points/92935)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 3\
**Last updated:** [January 16, 2023, 3:52pm UTC](https://discourse.julialang.org/t/defining-a-history-function-for-delay-differential-equations-using-past-data-points/92935 "2023-01-16T15:52:58Z")

</div>

I was trying to figure out how to define delay differential equations using DifferentialEquations.jl, but even after reading through the documentation, I am somewhat confused on how to define the history function. I am s…

---

## [Extracting ODEProblem formulas and passing them to JuMP NLExpressions](https://discourse.julialang.org/t/extracting-odeproblem-formulas-and-passing-them-to-jump-nlexpressions/92910)

<div class="topic-metadata">

**Author:** [@zornsllama](https://discourse.julialang.org/u/zornsllama)\
**Replies:** 4\
**Last updated:** [January 16, 2023, 3:52pm UTC](https://discourse.julialang.org/t/extracting-odeproblem-formulas-and-passing-them-to-jump-nlexpressions/92910 "2023-01-16T15:52:21Z")

</div>

I am trying to write a code that extracts a model’s equations from a DiffEq.jl ODEProblem or ModelingToolkit.jl ODESystem and copies them into JuMP.jl NLExpressions for use in nonlinear programming. In particular, I need…

---

## [Interface boundaries Warning in MethodOfLines.jl](https://discourse.julialang.org/t/interface-boundaries-warning-in-methodoflines-jl/92813)

<div class="topic-metadata">

**Author:** [@anh](https://discourse.julialang.org/u/anh)\
**Replies:** 3\
**Last updated:** [January 12, 2023, 3:04pm UTC](https://discourse.julialang.org/t/interface-boundaries-warning-in-methodoflines-jl/92813 "2023-01-12T15:04:46Z")

</div>

Hello, I’m very new to posting questions on here so I apologize in advance for any formatting/convention mistakes or if anything is unclear! I am trying to solve a PDE using MethodOfLines.jl and receive the following wa…

---

## [Matrix-Free Eigensolver in BifurcationKit.jl](https://discourse.julialang.org/t/matrix-free-eigensolver-in-bifurcationkit-jl/92780)

<div class="topic-metadata">

**Author:** [@TKBlarg](https://discourse.julialang.org/u/TKBlarg)\
**Replies:** 11\
**Last updated:** [January 11, 2023, 7:56pm UTC](https://discourse.julialang.org/t/matrix-free-eigensolver-in-bifurcationkit-jl/92780 "2023-01-11T19:56:11Z")

</div>

I have a large-scale continuation problem for which I’m considering using matrix-free methods in Bifurcationkit.jl. To evaluate stability and detect bifurcations, I implemented a matrix-free, shift-inverting eigensolver …

---

## [Extending a system with a constant parameter to allow parameter to vary](https://discourse.julialang.org/t/extending-a-system-with-a-constant-parameter-to-allow-parameter-to-vary/92566)

<div class="topic-metadata">

**Author:** [@ctessum](https://discourse.julialang.org/u/ctessum)\
**Replies:** 5\
**Last updated:** [January 11, 2023, 3:48pm UTC](https://discourse.julialang.org/t/extending-a-system-with-a-constant-parameter-to-allow-parameter-to-vary/92566 "2023-01-11T15:48:56Z")

</div>

Hello! Let’s say I have a ModelingToolkit system that has a constant parameter, for example a falling object with a constant mass: function newton() @parameters g = -9.8 @parameters m = 1.0 @variables t …

---

## [Is it possible to plot gain margin and phase margin on the bode diagram?](https://discourse.julialang.org/t/is-it-possible-to-plot-gain-margin-and-phase-margin-on-the-bode-diagram/89876)

<div class="topic-metadata">

**Author:** [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 3:12pm UTC](https://discourse.julialang.org/t/is-it-possible-to-plot-gain-margin-and-phase-margin-on-the-bode-diagram/89876 "2023-01-10T15:12:39Z")

</div>

I didn’t find anything about this in the documentation.

---

## [MethodOfLines.jl: Obtain Jacobian of MOL semi-discretization](https://discourse.julialang.org/t/methodoflines-jl-obtain-jacobian-of-mol-semi-discretization/92681)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 1:41pm UTC](https://discourse.julialang.org/t/methodoflines-jl-obtain-jacobian-of-mol-semi-discretization/92681 "2023-01-10T13:41:40Z")

</div>

Consider an exemplary PDE with temporal & spatial derivatives \\partial\_t u(t, x) + D\_x f\\big(u(t, x)\\big) = 0 Where D\_x is a general differential operator, like the Laplacian and f is some function. I can use MethodO…

---

## [When to update agent property that depends on moves of all other agents](https://discourse.julialang.org/t/when-to-update-agent-property-that-depends-on-moves-of-all-other-agents/92695)

<div class="topic-metadata">

**Author:** [@SDA](https://discourse.julialang.org/u/SDA)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 11:53am UTC](https://discourse.julialang.org/t/when-to-update-agent-property-that-depends-on-moves-of-all-other-agents/92695 "2023-01-10T11:53:30Z")

</div>

Hi everyone, I’m confused about how an agent property should be best updated within the Agents.jl package. At each time step, each agent does some computation and then moves to a new location. The agent property should…

---

## [Calling chemical kinetics solvers like CHEMKIN or Cantera from Julia](https://discourse.julialang.org/t/calling-chemical-kinetics-solvers-like-chemkin-or-cantera-from-julia/50568)

<div class="topic-metadata">

**Author:** [@R\_Surya\_Narayan](https://discourse.julialang.org/u/R_Surya_Narayan)\
**Replies:** 2\
**Last updated:** [January 9, 2023, 9:46pm UTC](https://discourse.julialang.org/t/calling-chemical-kinetics-solvers-like-chemkin-or-cantera-from-julia/50568 "2023-01-09T21:46:12Z")

</div>

Hello Everyone. I am relatively new to Julia and I am using it to solve a chemically-reacting flow problem that requires extensive reaction-rate and species thermodynamic-data. I came across one such open-source software…

---

## ["No matching function wrapper was found!" with 1.8.4 release of Julia](https://discourse.julialang.org/t/no-matching-function-wrapper-was-found-with-1-8-4-release-of-julia/92638)

<div class="topic-metadata">

**Author:** [@Mikel\_Antonana](https://discourse.julialang.org/u/Mikel_Antonana)\
**Replies:** 4\
**Last updated:** [January 8, 2023, 10:36am UTC](https://discourse.julialang.org/t/no-matching-function-wrapper-was-found-with-1-8-4-release-of-julia/92638 "2023-01-08T10:36:02Z")

</div>

Hi, I have a notebook where the call sol0=solve(prob, alg, dt=dt, adaptive=false); fails with error: “No matching function wrapper was found” with 1.8.4 release but works correctly with 1.6.6 release. The notebook…

---

## [How to solve a partial derivative equation (Navier-Stokes)](https://discourse.julialang.org/t/how-to-solve-a-partial-derivative-equation-navier-stokes/92605)

<div class="topic-metadata">

**Author:** [@Islam\_ZERROUGUI](https://discourse.julialang.org/u/Islam_ZERROUGUI)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 2:59pm UTC](https://discourse.julialang.org/t/how-to-solve-a-partial-derivative-equation-navier-stokes/92605 "2023-01-06T14:59:57Z")

</div>

Hi everyone, I ended up with the following equation, and I want to solve it for the pressure (P) and saturation (s). The two variables are in two dimensions rectangular form with a length of 1 cm and a width of 2cm.

---

## [SavingCallback influences result of ODE problem](https://discourse.julialang.org/t/savingcallback-influences-result-of-ode-problem/91731)

<div class="topic-metadata">

**Author:** [@Pitaevskii](https://discourse.julialang.org/u/Pitaevskii)\
**Replies:** 9\
**Last updated:** [January 3, 2023, 1:27pm UTC](https://discourse.julialang.org/t/savingcallback-influences-result-of-ode-problem/91731 "2023-01-03T13:27:30Z")

</div>

Hello I have some code for simulating complex differential equations of a certain model that used to work fine, but fails after going from Julia 1.7 to 1.8 and updating all the packages. using DifferentialEquations, Di…

---

## [Move\_along\_route! - Not implemented for space type ContinuousSpace](https://discourse.julialang.org/t/move-along-route-not-implemented-for-space-type-continuousspace/92389)

<div class="topic-metadata">

**Author:** [@orectique](https://discourse.julialang.org/u/orectique)\
**Replies:** 0\
**Last updated:** [January 1, 2023, 4:12pm UTC](https://discourse.julialang.org/t/move-along-route-not-implemented-for-space-type-continuousspace/92389 "2023-01-01T16:12:47Z")

</div>

Hello there, First of all, I would like to appreciate the team behind this elegant package. This is my first foray into Agent Based Modelling and Agents.jl has been a great tool. I am trying to create a simple continuo…

---

## [Trying my chances here; anyone knows why particles stick to the wall in my SPH simulation?](https://discourse.julialang.org/t/trying-my-chances-here-anyone-knows-why-particles-stick-to-the-wall-in-my-sph-simulation/91624)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 9\
**Last updated:** [December 31, 2022, 9:22pm UTC](https://discourse.julialang.org/t/trying-my-chances-here-anyone-knows-why-particles-stick-to-the-wall-in-my-sph-simulation/91624 "2022-12-31T21:22:55Z")

</div>

Hello! For fun I’ve been writing a small dam break simulation in SPH. I start with a clump of rectangular water, which correctly moves down due to gravity. I have one issue though which is that the wall which fluid cann…

---

## [CellListMap: How do I loop through its neighbour list in a thread-safe way?](https://discourse.julialang.org/t/celllistmap-how-do-i-loop-through-its-neighbour-list-in-a-thread-safe-way/92143)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 6\
**Last updated:** [December 29, 2022, 3:52pm UTC](https://discourse.julialang.org/t/celllistmap-how-do-i-loop-through-its-neighbour-list-in-a-thread-safe-way/92143 "2022-12-29T15:52:17Z")

</div>

Hello! In the following piece of code, I noticed that adding Threads.@threads would lead to the wrong result. My limited understanding is that it is because my arrays are not “thread-safe” - I want to learn how to make …

---

## [Help with implementing a toy model using continuous space](https://discourse.julialang.org/t/help-with-implementing-a-toy-model-using-continuous-space/92092)

<div class="topic-metadata">

**Author:** [@CosmicSpittle](https://discourse.julialang.org/u/CosmicSpittle)\
**Replies:** 6\
**Last updated:** [December 24, 2022, 11:21pm UTC](https://discourse.julialang.org/t/help-with-implementing-a-toy-model-using-continuous-space/92092 "2022-12-24T23:21:47Z")

</div>

Hello everyone! I’m new to Julia so apologies if I couldn’t figure out to make this more minimal. This is a simple continuous space where a few dolphins (agents with type dolphin) get randomly positioned and at each m…

---

## [OrdinaryDiffEq throws error when using sparse jacobian without specifying linear solver](https://discourse.julialang.org/t/ordinarydiffeq-throws-error-when-using-sparse-jacobian-without-specifying-linear-solver/89141)

<div class="topic-metadata">

**Author:** [@parb](https://discourse.julialang.org/u/parb)\
**Replies:** 3\
**Last updated:** [December 24, 2022, 7:14am UTC](https://discourse.julialang.org/t/ordinarydiffeq-throws-error-when-using-sparse-jacobian-without-specifying-linear-solver/89141 "2022-12-24T07:14:49Z")

</div>

Hi All, I nearly successfully created a sparse ODEProblem by using Symbolics.jacobian\_sparsity, but the solver throws an error unless I use TRBDF2(), (or one of the other linear solvers), coming from OrdinaryDiffEq (her…

---

## [ModelingToolkit variable metadata for connectors](https://discourse.julialang.org/t/modelingtoolkit-variable-metadata-for-connectors/92056)

<div class="topic-metadata">

**Author:** [@xlxs4](https://discourse.julialang.org/u/xlxs4)\
**Replies:** 2\
**Last updated:** [December 23, 2022, 9:04pm UTC](https://discourse.julialang.org/t/modelingtoolkit-variable-metadata-for-connectors/92056 "2022-12-23T21:04:03Z")

</div>

Hi! In the MTK documentation, specifically page Contextual Variable Types · ModelingToolkit.jl (sciml.ai) it reads: In many engineering systems some variables act like “flows” while others do not. For example, in circu…

---

## [Mass matrix DAEs](https://discourse.julialang.org/t/mass-matrix-daes/6805)

<div class="topic-metadata">

**Author:** [@FHell](https://discourse.julialang.org/u/FHell)\
**Replies:** 6\
**Last updated:** [December 23, 2022, 8:59pm UTC](https://discourse.julialang.org/t/mass-matrix-daes/6805 "2022-12-23T20:59:16Z")

</div>

Hi, I am trying to run some DAE simulations using DifferentialEquations.jl, and am having some trouble. I am doing a very simple test function: function f!(t, u, du) du\[1\] = u\[2\] du\[2\] = u\[2\] - 1. return end…

---

## [Incorrect lyapunov spectrum DynamicalSystems.jl](https://discourse.julialang.org/t/incorrect-lyapunov-spectrum-dynamicalsystems-jl/91998)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 11\
**Last updated:** [December 23, 2022, 4:48pm UTC](https://discourse.julialang.org/t/incorrect-lyapunov-spectrum-dynamicalsystems-jl/91998 "2022-12-23T16:48:52Z")

</div>

I calculate lyapunov spectrum and it don’t have zero exponent. How i can it fix? I tried change intregrator from RK4 on Tsit5 and Vern9 and it don’t help. Also increase time of integrate don’t help function model(u, p …

---

## [Automatically naming N similar elements in MTK](https://discourse.julialang.org/t/automatically-naming-n-similar-elements-in-mtk/91888)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 5\
**Last updated:** [December 23, 2022, 11:41am UTC](https://discourse.julialang.org/t/automatically-naming-n-similar-elements-in-mtk/91888 "2022-12-23T11:41:24Z")

</div>

Hi, I’d like a simple way of creating a “vector” of similar elements. I.e. I’d like: @named R = \[Resistor(R=n) for n in 1:10\] to create a vector of Resistors with resistances 1 to 10. These could be named e.g. R\_1…R\_…

---

## [Use of save\_idxs solver option with MethodOfLines/ModelingToolkit](https://discourse.julialang.org/t/use-of-save-idxs-solver-option-with-methodoflines-modelingtoolkit/92023)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 2\
**Last updated:** [December 22, 2022, 10:54pm UTC](https://discourse.julialang.org/t/use-of-save-idxs-solver-option-with-methodoflines-modelingtoolkit/92023 "2022-12-22T22:54:08Z")

</div>

I’m trying to use save\_idxs to facilitate parameter fitting and while I’ve figured out that my solution needs to be accessed after solving as: sol.u\[var1(x,t)\]\[idx1,idx2\] I’m having trouble figuring out how to use the …

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

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