# Modelling & Simulations

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

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

**Page:** 57

---

## [How to use \`ordered\` keyword equals to \`true\` with \`StatsBase.sample()\` function when sampling 2 or more dimensional array from a population?](https://discourse.julialang.org/t/how-to-use-ordered-keyword-equals-to-true-with-statsbase-sample-function-when-sampling-2-or-more-dimensional-array-from-a-population/57796)

<div class="topic-metadata">

**Author:** [@shubh\_b](https://discourse.julialang.org/u/shubh_b)\
**Replies:** 8\
**Last updated:** [March 24, 2021, 4:05am UTC](https://discourse.julialang.org/t/how-to-use-ordered-keyword-equals-to-true-with-statsbase-sample-function-when-sampling-2-or-more-dimensional-array-from-a-population/57796 "2021-03-24T04:05:01Z")

</div>

I was using sample() function from StatsBase module for sampling with replacement from a population a and sampling probabilities weight vector wv as below: a = \[31, 12, 29, 9, 15\] wv = weights(\[0.1, 0.4, 0.2, 0.1, 0.2\])…

---

## [Using EnsembleThreads in DifferentialEquations.jl fails for SDEs with trajectories \> nthreads](https://discourse.julialang.org/t/using-ensemblethreads-in-differentialequations-jl-fails-for-sdes-with-trajectories-nthreads/57831)

<div class="topic-metadata">

**Author:** [@Junkiejim](https://discourse.julialang.org/u/Junkiejim)\
**Replies:** 3\
**Last updated:** [March 24, 2021, 3:19am UTC](https://discourse.julialang.org/t/using-ensemblethreads-in-differentialequations-jl-fails-for-sdes-with-trajectories-nthreads/57831 "2021-03-24T03:19:33Z")

</div>

I’m trying to run some stochastic simulations for a research problem using DifferentialEquations.jl. I’ve had no problem setting up my differential equation, and solving it is fine until I try to setup an ensembleproblem…

---

## [\[differentialequations.jl\] stuck at initial value when using function](https://discourse.julialang.org/t/differentialequations-jl-stuck-at-initial-value-when-using-function/57716)

<div class="topic-metadata">

**Author:** [@DCT](https://discourse.julialang.org/u/DCT)\
**Replies:** 3\
**Last updated:** [March 22, 2021, 2:58pm UTC](https://discourse.julialang.org/t/differentialequations-jl-stuck-at-initial-value-when-using-function/57716 "2021-03-22T14:58:09Z")

</div>

Hi all, Being new to Julia, I started playing around a bit with differential equations. I started with a simple system, du = A \* u where A is an n\*n array, and u a vector of length n. when I set up the system as f(u…

---

## [Boundary Value Problem with ModellingToolkit or DiffEqOperators](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656)

<div class="topic-metadata">

**Author:** [@kkakosim](https://discourse.julialang.org/u/kkakosim)\
**Replies:** 3\
**Last updated:** [March 21, 2021, 8:45pm UTC](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656 "2021-03-21T20:45:00Z")

</div>

At first I thought that there was a bug in the packages but probably I am doing something (completely wrong). I am trying to run the bellow spherical coordinates system with Boundary Values. But not sure if it even makes…

---

## [Stff System](https://discourse.julialang.org/t/stff-system/57569)

<div class="topic-metadata">

**Author:** [@Manisha\_07](https://discourse.julialang.org/u/Manisha_07)\
**Replies:** 2\
**Last updated:** [March 19, 2021, 10:52pm UTC](https://discourse.julialang.org/t/stff-system/57569 "2021-03-19T22:52:04Z")

</div>

I am very new to Julia While solving ODE i have come across Stiff system Wat does the Stiff system means.

---

## [Constant linear equation d/dt x=Ax with DifferentialEquations.jl](https://discourse.julialang.org/t/constant-linear-equation-d-dt-x-ax-with-differentialequations-jl/57532)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 4\
**Last updated:** [March 19, 2021, 12:57pm UTC](https://discourse.julialang.org/t/constant-linear-equation-d-dt-x-ax-with-differentialequations-jl/57532 "2021-03-19T12:57:31Z")

</div>

In Non-autonomous Linear ODE / Lie Group ODE Solvers · DifferentialEquations.jl are examples for solving d/dt x = A(t) x, time-dependent A, or state dependent A(x), d/dt x = A(x)x, but no example for just constant A. How…

---

## [Save additional quantities using DifferentialEquations.jl pkg](https://discourse.julialang.org/t/save-additional-quantities-using-differentialequations-jl-pkg/34011)

<div class="topic-metadata">

**Author:** [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Replies:** 26\
**Last updated:** [March 18, 2021, 7:44pm UTC](https://discourse.julialang.org/t/save-additional-quantities-using-differentialequations-jl-pkg/34011 "2021-03-18T19:44:25Z")

</div>

Within my ODE function additional quantities are calculated which I would like to save to extract them later for e.g. inspection or plotting. There is the approach with the SavingCallback; however, the save\_func(u, t, i…

---

## [Expression manipulation in Symbolics](https://discourse.julialang.org/t/expression-manipulation-in-symbolics/57486)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 4\
**Last updated:** [March 18, 2021, 7:05pm UTC](https://discourse.julialang.org/t/expression-manipulation-in-symbolics/57486 "2021-03-18T19:05:54Z")

</div>

Playing with Symbolics like so: julia\> @variables a b c (a, b, c) julia\> par(x,y) = 1/(1/x+1/y) par (generic function with 1 method) julia\> ex1 = par(a, par(b,c)) (a^-1 + ((b^-1 + c^-1)^-1)^-1)^-1 julia\> simplify(ex1…

---

## [How to debug IDA](https://discourse.julialang.org/t/how-to-debug-ida/54643)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [March 18, 2021, 6:26pm UTC](https://discourse.julialang.org/t/how-to-debug-ida/54643 "2021-03-18T18:26:07Z")

</div>

I have a large DAE problem (102 variables) and have trouble finding consistent initial conditions. I always get: \[IDAS ERROR\] IDACalcIC Newton/Linesearch algorithm failed to converge. Is there a way to debug this?

---

## [Yet Another Component Example](https://discourse.julialang.org/t/yet-another-component-example/57318)

<div class="topic-metadata">

**Author:** [@lungd](https://discourse.julialang.org/u/lungd)\
**Replies:** 1\
**Last updated:** [March 18, 2021, 12:13pm UTC](https://discourse.julialang.org/t/yet-another-component-example/57318 "2021-03-18T12:13:47Z")

</div>

As far as I know, there are some WIP tutorials describing how to create components and how they can be merged. I was not sure where to put the following, maybe it would fit better into an existing github issue (e.g. Conn…

---

## [Neuroscientists using DifferentialEquations.jl ecosystem?](https://discourse.julialang.org/t/neuroscientists-using-differentialequations-jl-ecosystem/31871)

<div class="topic-metadata">

**Author:** [@wsphillips](https://discourse.julialang.org/u/wsphillips)\
**Replies:** 25\
**Last updated:** [March 18, 2021, 11:32am UTC](https://discourse.julialang.org/t/neuroscientists-using-differentialequations-jl-ecosystem/31871 "2021-03-18T11:32:44Z")

</div>

I am curious who might be working with the DiffEq packages to do single neuron cell modeling up to small network simulations using Hodgkin Huxley or similar models, either single or multi-compartment, etc. If you’re out…

---

## [Accessing variables in a ModelingToolkit system](https://discourse.julialang.org/t/accessing-variables-in-a-modelingtoolkit-system/57249)

<div class="topic-metadata">

**Author:** [@Dhruva2](https://discourse.julialang.org/u/Dhruva2)\
**Replies:** 9\
**Last updated:** [March 18, 2021, 5:59am UTC](https://discourse.julialang.org/t/accessing-variables-in-a-modelingtoolkit-system/57249 "2021-03-18T05:59:12Z")

</div>

First off, the new functionality for connecting systems in ModelingToolkit is really powerful, awesome job! I have a few issues with it that I can’t solve, however… Suppose I have a ModelingToolkit ODESystem od::ODESy…

---

## [ModelingToolkit.jl cryptic error](https://discourse.julialang.org/t/modelingtoolkit-jl-cryptic-error/57308)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [March 16, 2021, 7:38pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-cryptic-error/57308 "2021-03-16T19:38:35Z")

</div>

I was trying to model a thermo-fluid system with ModelingToolkit.jl, however I encountered this: julia\> prob = ODAEProblem(sys, Pair\[\], (0.0, 10.0)) ERROR: AssertionError: !(isalgvar(s, var)) What does it mean? Th…

---

## [ModelingToolkit.jl hydraulic model](https://discourse.julialang.org/t/modelingtoolkit-jl-hydraulic-model/57084)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 8\
**Last updated:** [March 15, 2021, 3:36pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-hydraulic-model/57084 "2021-03-15T15:36:49Z")

</div>

@ChrisRackauckas Thx for ModelingToolkit.jl I really like it! I tried to model a simple hydraulic system. However, I soon ran into some problems. Consider the following example (adaptation of the RC example): using Mo…

---

## [Nicer parameter indexing](https://discourse.julialang.org/t/nicer-parameter-indexing/50704)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [March 12, 2021, 5:21pm UTC](https://discourse.julialang.org/t/nicer-parameter-indexing/50704 "2021-03-12T17:21:29Z")

</div>

Consider the following example: import Plots using ModelingToolkit, DifferentialEquations @parameters t σ ρ β @variables x(t) y(t) z(t) @derivatives D'~t eqs = \[D(x) ~ σ \* (y - x), D(y) ~ x \* (ρ - z) - y, …

---

## [Question on ODE system with inhomogeneous coefficients, parameters, code design](https://discourse.julialang.org/t/question-on-ode-system-with-inhomogeneous-coefficients-parameters-code-design/56849)

<div class="topic-metadata">

**Author:** [@Ininterrompue](https://discourse.julialang.org/u/Ininterrompue)\
**Replies:** 5\
**Last updated:** [March 10, 2021, 6:08am UTC](https://discourse.julialang.org/t/question-on-ode-system-with-inhomogeneous-coefficients-parameters-code-design/56849 "2021-03-10T06:08:38Z")

</div>

Hi, I have a question relating to code design. I’m using some ODE solvers to calculate a system of ODEs with time-varying coefficients which I am interested in. They take on the form F, G, and dG in the MWE and depend o…

---

## [Is there a tool for 3D Delaunay and Voronoi tessellations?](https://discourse.julialang.org/t/is-there-a-tool-for-3d-delaunay-and-voronoi-tessellations/19503)

<div class="topic-metadata">

**Author:** [@afas](https://discourse.julialang.org/u/afas)\
**Replies:** 12\
**Last updated:** [March 9, 2021, 7:47am UTC](https://discourse.julialang.org/t/is-there-a-tool-for-3d-delaunay-and-voronoi-tessellations/19503 "2021-03-09T07:47:44Z")

</div>

I am currently migrating all my research software to Julia, and so far I am very pleased with the experience and the relative easiness in transporting code. I have, however, reached a bottleneck cause I can’t seem to be…

---

## [How would you handle reproduction in this Agent Based Model?](https://discourse.julialang.org/t/how-would-you-handle-reproduction-in-this-agent-based-model/56442)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 8\
**Last updated:** [March 5, 2021, 7:03pm UTC](https://discourse.julialang.org/t/how-would-you-handle-reproduction-in-this-agent-based-model/56442 "2021-03-05T19:03:35Z")

</div>

Hello all, I’m building an agent-based model of avian populations in the presence of brood parasites\*. The simulation aims to recreate solution concepts from evolutionary game theory that can be found analytically using …

---

## [Reaction rate laws of chemical reaction networks](https://discourse.julialang.org/t/reaction-rate-laws-of-chemical-reaction-networks/56049)

<div class="topic-metadata">

**Author:** [@Nino-42](https://discourse.julialang.org/u/Nino-42)\
**Replies:** 7\
**Last updated:** [March 3, 2021, 10:12am UTC](https://discourse.julialang.org/t/reaction-rate-laws-of-chemical-reaction-networks/56049 "2021-03-03T10:12:28Z")

</div>

Hi everyone, I am new in this forum and rather new to coding with julia (I have been using it for a while but more on a surface level). My question concerns the modeling of chemical reaction networks, specifically with …

---

## [LoadError: MethodError: no method matching record although another package with "record" works](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-record-although-another-package-with-record-works/56394)

<div class="topic-metadata">

**Author:** [@meck](https://discourse.julialang.org/u/meck)\
**Replies:** 0\
**Last updated:** [March 3, 2021, 9:55am UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-record-although-another-package-with-record-works/56394 "2021-03-03T09:55:03Z")

</div>

First package using WaterLily using LinearAlgebra: norm2 using Makie function donut\_sim(p=6,Re=1e3) # Define simulation size, velocity, viscosity n,U = 2^p, \[1, 0, 0\] center,R,r = \[n/2,n/2,n/2\], n/4, n/16 …

---

## [Return Noise used in SDE Solution](https://discourse.julialang.org/t/return-noise-used-in-sde-solution/56167)

<div class="topic-metadata">

**Author:** [@jshackle](https://discourse.julialang.org/u/jshackle)\
**Replies:** 1\
**Last updated:** [February 28, 2021, 2:33pm UTC](https://discourse.julialang.org/t/return-noise-used-in-sde-solution/56167 "2021-02-28T14:33:22Z")

</div>

Is there anyway to find what noise terms are used in an SDE solver? I’d like to be able to double check the noise is behaving the way I think it is.

---

## [Error using SplitODEProblem: type GMRESIterable has no field reltol](https://discourse.julialang.org/t/error-using-splitodeproblem-type-gmresiterable-has-no-field-reltol/55661)

<div class="topic-metadata">

**Author:** [@Bastien](https://discourse.julialang.org/u/Bastien)\
**Replies:** 7\
**Last updated:** [February 22, 2021, 12:29am UTC](https://discourse.julialang.org/t/error-using-splitodeproblem-type-gmresiterable-has-no-field-reltol/55661 "2021-02-22T00:29:29Z")

</div>

Hi, I have been trying to use a SplitODEProblem to solve the equations of motion of a pulse propagating along a transmission line but I get the following message: ERROR: LoadError: type GMRESIterable has no field relt…

---

## [ODEProblem error --\> LoadError: UndefVarError: \_derivative not defined](https://discourse.julialang.org/t/odeproblem-error-loaderror-undefvarerror-derivative-not-defined/55038)

<div class="topic-metadata">

**Author:** [@grheadrick](https://discourse.julialang.org/u/grheadrick)\
**Replies:** 2\
**Last updated:** [February 20, 2021, 3:47am UTC](https://discourse.julialang.org/t/odeproblem-error-loaderror-undefvarerror-derivative-not-defined/55038 "2021-02-20T03:47:12Z")

</div>

I am getting an error when solving a system of differential equations. I have made the below example to demonstrate. Julia v1.5.3 ModelingToolkit v5.6.0 OrdinaryDiffEq v5.50.2 using ModelingToolkit, OrdinaryDiffEq, P…

---

## [Query derivative of DAE solution](https://discourse.julialang.org/t/query-derivative-of-dae-solution/55150)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [February 17, 2021, 7:08pm UTC](https://discourse.julialang.org/t/query-derivative-of-dae-solution/55150 "2021-02-17T19:08:03Z")

</div>

Is there a way to query the derivative of the solution when solving a DAE? function f(out, du, u, p, t) out\[1\] = - 0.04u\[1\] + 1e4 \* u\[2\] \* u\[3\] - du\[1\] out\[2\] = + 0.04u\[1\] - 3e7 \* u\[2\]^2 - 1e4 \* u\[2\] \* u\[3\] - du…

---

## [DiffEqCallbacks problem with DDE](https://discourse.julialang.org/t/diffeqcallbacks-problem-with-dde/54921)

<div class="topic-metadata">

**Author:** [@zamk](https://discourse.julialang.org/u/zamk)\
**Replies:** 10\
**Last updated:** [February 16, 2021, 10:50am UTC](https://discourse.julialang.org/t/diffeqcallbacks-problem-with-dde/54921 "2021-02-16T10:50:48Z")

</div>

I have created a SavingCallback which prints out and saves the du, here is my code: prob = DDEProblem(model,u0,h,(0.0,120.0),p) alg = MethodOfSteps(Tsit5()) saved\_values = SavedValues(Float64,Array{Float64}) saving = Sa…

---

## [Choice of the integrator for mixed first-second order system of ODE](https://discourse.julialang.org/t/choice-of-the-integrator-for-mixed-first-second-order-system-of-ode/55330)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 10:40pm UTC](https://discourse.julialang.org/t/choice-of-the-integrator-for-mixed-first-second-order-system-of-ode/55330 "2021-02-15T22:40:04Z")

</div>

I have a system of ODE with the following peculiar functional structure. It is second order for one variable, but first order for another one (actually, A and B are some vectors): A'' = f(A, B) B' = g(A, B) I need the…

---

## [GalacticOptim trips over boundary conditions in DiffEqOperators](https://discourse.julialang.org/t/galacticoptim-trips-over-boundary-conditions-in-diffeqoperators/55060)

<div class="topic-metadata">

**Author:** [@told](https://discourse.julialang.org/u/told)\
**Replies:** 2\
**Last updated:** [February 11, 2021, 2:49pm UTC](https://discourse.julialang.org/t/galacticoptim-trips-over-boundary-conditions-in-diffeqoperators/55060 "2021-02-11T14:49:01Z")

</div>

So I just had time to go back to a project I was working in the past (related to this). Basically I want to solve a Diffusion-Convection problem tracking two phases along a reactor with a source term that is learned by a…

---

## [Solving overdetermined systems in ModelingToolkit.jl](https://discourse.julialang.org/t/solving-overdetermined-systems-in-modelingtoolkit-jl/54366)

<div class="topic-metadata">

**Author:** [@elkaps](https://discourse.julialang.org/u/elkaps)\
**Replies:** 7\
**Last updated:** [February 8, 2021, 10:29pm UTC](https://discourse.julialang.org/t/solving-overdetermined-systems-in-modelingtoolkit-jl/54366 "2021-02-08T22:29:08Z")

</div>

Hi, I’m getting to know ModelingToolkit.jl and I’d like to know if it’s possible to solve a system where there are more equations than variables. For example: @variables x, y julia\> eqs = \[Equation(x + y, 2), Equation…

---

## [EnsembleSummary deprecated?](https://discourse.julialang.org/t/ensemblesummary-deprecated/54570)

<div class="topic-metadata">

**Author:** [@zenkavi](https://discourse.julialang.org/u/zenkavi)\
**Replies:** 1\
**Last updated:** [February 4, 2021, 12:22am UTC](https://discourse.julialang.org/t/ensemblesummary-deprecated/54570 "2021-02-04T00:22:48Z")

</div>

I’m very new to Julia so I might be misinterpreting what’s happening here. The EnsembleSummary function stopped working for me which doesn’t seem to make sense since it is part of SciMLBase so maybe dependencies are mes…

---

## [DDE parameter estimation with unknown constant delay using DiffEqFlux](https://discourse.julialang.org/t/dde-parameter-estimation-with-unknown-constant-delay-using-diffeqflux/54381)

<div class="topic-metadata">

**Author:** [@zamk](https://discourse.julialang.org/u/zamk)\
**Replies:** 2\
**Last updated:** [February 2, 2021, 12:29pm UTC](https://discourse.julialang.org/t/dde-parameter-estimation-with-unknown-constant-delay-using-diffeqflux/54381 "2021-02-02T12:29:14Z")

</div>

I am trying to estimate the parameters for a delay differential equation. One of the parameters that I try to estimate is the (constant) delay itself. Following the tutorial documentation, I wrote the following code: pr…

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

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