# Modelling & Simulations

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

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

**Page:** 59

---

## [Solving vector field PDE with DiffEqOperators.jl](https://discourse.julialang.org/t/solving-vector-field-pde-with-diffeqoperators-jl/50391)

<div class="topic-metadata">

**Author:** [@jarias9](https://discourse.julialang.org/u/jarias9)\
**Replies:** 1\
**Last updated:** [November 18, 2020, 7:19pm UTC](https://discourse.julialang.org/t/solving-vector-field-pde-with-diffeqoperators-jl/50391 "2020-11-18T19:19:52Z")

</div>

Hello all, I am wondering if there is a workaround to solving a vector field for lets say Maxwell’s equations such as \\frac{\\partial \\mathbf{E}}{\\partial t} = \\frac{1}{\\varepsilon\_0} \\times \\mathbf{H} \\frac{\\partial…

---

## [Help with using ModellingToolkit.jl for evolutionary analysis](https://discourse.julialang.org/t/help-with-using-modellingtoolkit-jl-for-evolutionary-analysis/45943)

<div class="topic-metadata">

**Author:** [@SanAlphaTau](https://discourse.julialang.org/u/SanAlphaTau)\
**Replies:** 7\
**Last updated:** [November 14, 2020, 5:25pm UTC](https://discourse.julialang.org/t/help-with-using-modellingtoolkit-jl-for-evolutionary-analysis/45943 "2020-11-14T17:25:15Z")

</div>

Spawned from earlier question here: SymPy vs Sympy.jl and/or symengine.jl Hello all. I am working on a converting a model written in python using sympy into julia. I posted a previous thread on packages I should use but…

---

## [Strange MaxIters (numeric instability?) occured when solving certain SDE](https://discourse.julialang.org/t/strange-maxiters-numeric-instability-occured-when-solving-certain-sde/49392)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 10\
**Last updated:** [November 14, 2020, 3:50pm UTC](https://discourse.julialang.org/t/strange-maxiters-numeric-instability-occured-when-solving-certain-sde/49392 "2020-11-14T15:50:06Z")

</div>

I’ve been solving this equation for a lot of different parameters, but suddenly I am getting occasional ┌ Warning: Interrupted. Larger maxiters is needed. └ @ DiffEqBase /home/torkelloman/.julia/packages/DiffEqBase/V7P1…

---

## [Coulomb and static friction with ModelingToolkit.jl and DifferentialEquations.jl](https://discourse.julialang.org/t/coulomb-and-static-friction-with-modelingtoolkit-jl-and-differentialequations-jl/49802)

<div class="topic-metadata">

**Author:** [@contradict](https://discourse.julialang.org/u/contradict)\
**Replies:** 14\
**Last updated:** [November 13, 2020, 7:24pm UTC](https://discourse.julialang.org/t/coulomb-and-static-friction-with-modelingtoolkit-jl-and-differentialequations-jl/49802 "2020-11-13T19:24:47Z")

</div>

I am trying to create a model of a damped oscillator with friction. It works fine with only Coulomb friction, but all my attempts to add a static friction term have failed so far. Below is the most promising, but I can’t…

---

## [Using velocity profiles with DiffEqOperators.jl for 2D convection-diffusion problem](https://discourse.julialang.org/t/using-velocity-profiles-with-diffeqoperators-jl-for-2d-convection-diffusion-problem/49243)

<div class="topic-metadata">

**Author:** [@jarias9](https://discourse.julialang.org/u/jarias9)\
**Replies:** 4\
**Last updated:** [November 13, 2020, 3:51pm UTC](https://discourse.julialang.org/t/using-velocity-profiles-with-diffeqoperators-jl-for-2d-convection-diffusion-problem/49243 "2020-11-13T15:51:13Z")

</div>

Hello all. I am trying to discretize and solve the following PDE using DiffEqOperators.jl \\frac{\\partial C}{\\partial t} = D\\nabla^2 C - \\vec{v} \\cdot \\nabla C + R for solving non-steady convection diffusion of a gene…

---

## [Conditional Branching of Parameter in Turing.jl](https://discourse.julialang.org/t/conditional-branching-of-parameter-in-turing-jl/50019)

<div class="topic-metadata">

**Author:** [@nyubachi](https://discourse.julialang.org/u/nyubachi)\
**Replies:** 10\
**Last updated:** [November 13, 2020, 3:07pm UTC](https://discourse.julialang.org/t/conditional-branching-of-parameter-in-turing-jl/50019 "2020-11-13T15:07:16Z")

</div>

I’m new to the Julia language and to modeling, so I may ask a strange question. When estimating parameters in Turing.jl, is it possible to conditionally branch for one parameter with another variable? For example, in t…

---

## [Using DifferentialEquations.jl Fminbox with multiple parameters](https://discourse.julialang.org/t/using-differentialequations-jl-fminbox-with-multiple-parameters/49829)

<div class="topic-metadata">

**Author:** [@claudio20497](https://discourse.julialang.org/u/claudio20497)\
**Replies:** 7\
**Last updated:** [November 10, 2020, 11:23pm UTC](https://discourse.julialang.org/t/using-differentialequations-jl-fminbox-with-multiple-parameters/49829 "2020-11-10T23:23:57Z")

</div>

Hello, I’m using the following SIRD eipdemiological model. This model takes into account 16 age classes. The last dD\_tot compartment, an array of 16 components all equal is a trick to later calibrate with respect to cu…

---

## [Integrating ODE system over gridded data](https://discourse.julialang.org/t/integrating-ode-system-over-gridded-data/49853)

<div class="topic-metadata">

**Author:** [@archermarx](https://discourse.julialang.org/u/archermarx)\
**Replies:** 1\
**Last updated:** [November 9, 2020, 8:32pm UTC](https://discourse.julialang.org/t/integrating-ode-system-over-gridded-data/49853 "2020-11-09T20:32:24Z")

</div>

Hi all, I’m trying to use the julia DifferentialEquations package to integrate an ODE system over gridded data. The system is something like the following: \\frac{dU\_1}{dx} = f(\\underline{U}, \\vec{\\underline{Y}}, \\under…

---

## [Simulating a stopping time in SDE without using a fixed time span?](https://discourse.julialang.org/t/simulating-a-stopping-time-in-sde-without-using-a-fixed-time-span/45608)

<div class="topic-metadata">

**Author:** [@tzxiong](https://discourse.julialang.org/u/tzxiong)\
**Replies:** 6\
**Last updated:** [November 9, 2020, 9:27am UTC](https://discourse.julialang.org/t/simulating-a-stopping-time-in-sde-without-using-a-fixed-time-span/45608 "2020-11-09T09:27:44Z")

</div>

Hi everyone, I am trying to simulate a stochastic process on \[0,1\] that will hit the boundary with probability 1 in a finite amount of time. The package I am using is the SDE solver in DifferentialEquation.jl. However, …

---

## [Component-based modelling in ModelingToolkit.jl with nonsingular mass matrix](https://discourse.julialang.org/t/component-based-modelling-in-modelingtoolkit-jl-with-nonsingular-mass-matrix/49140)

<div class="topic-metadata">

**Author:** [@Dhruva2](https://discourse.julialang.org/u/Dhruva2)\
**Replies:** 13\
**Last updated:** [November 6, 2020, 8:51pm UTC](https://discourse.julialang.org/t/component-based-modelling-in-modelingtoolkit-jl-with-nonsingular-mass-matrix/49140 "2020-11-06T20:51:04Z")

</div>

Hi, I essentially want to solve an easier version of the copy-paste example provided in the docs here. Instead of connecting the two lorenz systems via an algebraic equality, I want to add the state of one system as a ti…

---

## [How to calibrate age-structured SIR model on mono-dimensional data?](https://discourse.julialang.org/t/how-to-calibrate-age-structured-sir-model-on-mono-dimensional-data/49532)

<div class="topic-metadata">

**Author:** [@PietroMonticone](https://discourse.julialang.org/u/PietroMonticone)\
**Replies:** 1\
**Last updated:** [November 3, 2020, 6:56pm UTC](https://discourse.julialang.org/t/how-to-calibrate-age-structured-sir-model-on-mono-dimensional-data/49532 "2020-11-03T18:56:59Z")

</div>

Consider the following age-structured SIR model I’ve written in the DifferentialEquations.jl framework: # Import using DifferentialEquations, DiffEqBayes # Model parameters β = \[0.1, 0.2, 0.3\] γ = 0.15 𝒫 = vcat(\[β, γ\]…

---

## [When ForwardDiff-ing through an ODE is unstable](https://discourse.julialang.org/t/when-forwarddiff-ing-through-an-ode-is-unstable/49484)

<div class="topic-metadata">

**Author:** [@Dhruva2](https://discourse.julialang.org/u/Dhruva2)\
**Replies:** 6\
**Last updated:** [November 3, 2020, 1:06pm UTC](https://discourse.julialang.org/t/when-forwarddiff-ing-through-an-ode-is-unstable/49484 "2020-11-03T13:06:01Z")

</div>

DiffEqSensitivity and DiffEqFlux have a selection of great tools to backpropagate in various ways through differential equations, to get gradients with respect to DE parameters. The documentation discusses the numerical …

---

## [Best options to simplify?](https://discourse.julialang.org/t/best-options-to-simplify/49492)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 2\
**Last updated:** [November 3, 2020, 4:01am UTC](https://discourse.julialang.org/t/best-options-to-simplify/49492 "2020-11-03T04:01:34Z")

</div>

What are some packages that work well to simplify? I could not find simplification in SymEngine, and from what I read, none was built as of 2017. SymbolUtilities and ModelingToolkit, do a certain amount of arithmetic bu…

---

## [How to vectorize a SIR Model to add age-stratification with the DifferentialEquations.jl package?](https://discourse.julialang.org/t/how-to-vectorize-a-sir-model-to-add-age-stratification-with-the-differentialequations-jl-package/49375)

<div class="topic-metadata">

**Author:** [@PietroMonticone](https://discourse.julialang.org/u/PietroMonticone)\
**Replies:** 3\
**Last updated:** [October 31, 2020, 6:07pm UTC](https://discourse.julialang.org/t/how-to-vectorize-a-sir-model-to-add-age-stratification-with-the-differentialequations-jl-package/49375 "2020-10-31T18:07:31Z")

</div>

Consider the following simple SIR model I’ve written in the DifferentialEquations.jl framework: # Import using DifferentialEquations # Parameter 𝒫 = \[0.1,0.2\] # Model Parameters ℬ = \[0.8,0.1, 0.0\] # Initial …

---

## [Visualizing the grid JuAFEM](https://discourse.julialang.org/t/visualizing-the-grid-juafem/49052)

<div class="topic-metadata">

**Author:** [@Hrishikesh\_Das](https://discourse.julialang.org/u/Hrishikesh_Das)\
**Replies:** 1\
**Last updated:** [October 26, 2020, 3:50pm UTC](https://discourse.julialang.org/t/visualizing-the-grid-juafem/49052 "2020-10-26T15:50:44Z")

</div>

I am new to Julia. Cn someone tell me how to visualize the grid I have generated?

---

## [Array multiplication](https://discourse.julialang.org/t/array-multiplication/48610)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 4\
**Last updated:** [October 20, 2020, 7:57pm UTC](https://discourse.julialang.org/t/array-multiplication/48610 "2020-10-20T19:57:03Z")

</div>

Why does this generate DimensionMismatch? The dimensions seem to be the same size when I break them out into individual vectors u,v,w. ### A Pluto.jl notebook ### # v0.12.4 using Markdown using InteractiveUtils # ╔…

---

## [Jump Solving stops jumping weirdly, something recognizable?](https://discourse.julialang.org/t/jump-solving-stops-jumping-weirdly-something-recognizable/48525)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 0\
**Last updated:** [October 16, 2020, 10:37pm UTC](https://discourse.julialang.org/t/jump-solving-stops-jumping-weirdly-something-recognizable/48525 "2020-10-16T22:37:58Z")

</div>

I simulated a JumpProblem, and I simulate it many times (100) using the ensemble functionality. Very rarely (like 1 time out of 100) the solution suddenly stops changing, see this plot of example: (the green line) Th…

---

## [BinaryHeap Error in DifferentialEquations](https://discourse.julialang.org/t/binaryheap-error-in-differentialequations/48308)

<div class="topic-metadata">

**Author:** [@khannay](https://discourse.julialang.org/u/khannay)\
**Replies:** 19\
**Last updated:** [October 14, 2020, 9:33pm UTC](https://discourse.julialang.org/t/binaryheap-error-in-differentialequations/48308 "2020-10-14T21:33:31Z")

</div>

Hello, I am having a lot of problems trying to resolve an issue with DifferentialEquations.jl in a package I am developing. For the example code from the docs using DifferentialEquations, Plots function lorenz!(du,u,…

---

## [Obscure multiplication method error when using sciml\_train](https://discourse.julialang.org/t/obscure-multiplication-method-error-when-using-sciml-train/45906)

<div class="topic-metadata">

**Author:** [@told](https://discourse.julialang.org/u/told)\
**Replies:** 7\
**Last updated:** [October 7, 2020, 5:28pm UTC](https://discourse.julialang.org/t/obscure-multiplication-method-error-when-using-sciml-train/45906 "2020-10-07T17:28:26Z")

</div>

Julia newbie here. I solve a convection diffusion reaction problem in tow variables where the reaction term is replaced with an ANN with two inputs and one output. This should be trained against measured data c\_true. D…

---

## [Estimating the parameters of ODEs with multiple initial conditions using Bayesian methods](https://discourse.julialang.org/t/estimating-the-parameters-of-odes-with-multiple-initial-conditions-using-bayesian-methods/47903)

<div class="topic-metadata">

**Author:** [@nyubachi](https://discourse.julialang.org/u/nyubachi)\
**Replies:** 2\
**Last updated:** [October 7, 2020, 2:45am UTC](https://discourse.julialang.org/t/estimating-the-parameters-of-odes-with-multiple-initial-conditions-using-bayesian-methods/47903 "2020-10-07T02:45:15Z")

</div>

Hello. https://tutorials.sciml.ai/html/ode\_extras/04-monte\_carlo\_parameter\_estim.html In the above tutorial, MonteCarloProblem() is used to estimate the parameters for ODEs with multiple initial conditions. I would li…

---

## [Hierarchical Component Models in ModelingToolkit, How to Connect](https://discourse.julialang.org/t/hierarchical-component-models-in-modelingtoolkit-how-to-connect/47626)

<div class="topic-metadata">

**Author:** [@mefob](https://discourse.julialang.org/u/mefob)\
**Replies:** 2\
**Last updated:** [October 2, 2020, 5:20pm UTC](https://discourse.julialang.org/t/hierarchical-component-models-in-modelingtoolkit-how-to-connect/47626 "2020-10-02T17:20:49Z")

</div>

I am trying to build a hierarchical model of groups of Lorenz oscillators. I am following the tutorial, but instead of solving the pair of coupled oscillators, I’d like to solve a set of many pairs of coupled oscillators…

---

## [Returning a value calculated inside the ODE function](https://discourse.julialang.org/t/returning-a-value-calculated-inside-the-ode-function/47529)

<div class="topic-metadata">

**Author:** [@fkrauer](https://discourse.julialang.org/u/fkrauer)\
**Replies:** 1\
**Last updated:** [September 30, 2020, 12:52pm UTC](https://discourse.julialang.org/t/returning-a-value-calculated-inside-the-ode-function/47529 "2020-09-30T12:52:20Z")

</div>

Hi I am using julia via R to simulate compartmental epidemic ODE models. Is there a way to return a value that is calculated inside the ODE function for every step of the integration? So far it only returns the states. …

---

## [DiffEqFlux Autodifferentiating inside loss function](https://discourse.julialang.org/t/diffeqflux-autodifferentiating-inside-loss-function/47203)

<div class="topic-metadata">

**Author:** [@Axlrsn](https://discourse.julialang.org/u/Axlrsn)\
**Replies:** 6\
**Last updated:** [September 29, 2020, 3:03pm UTC](https://discourse.julialang.org/t/diffeqflux-autodifferentiating-inside-loss-function/47203 "2020-09-29T15:03:25Z")

</div>

Hello, I am new to Julia and especially the way Zygote works. For a project in physics informed machine learning I have a neural network NN(x) approximating a function f(x). I want to take the gradient of the neural net…

---

## [I'm learning Julia through developing a project, feel free to review!](https://discourse.julialang.org/t/im-learning-julia-through-developing-a-project-feel-free-to-review/46979)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 3\
**Last updated:** [September 21, 2020, 8:30am UTC](https://discourse.julialang.org/t/im-learning-julia-through-developing-a-project-feel-free-to-review/46979 "2020-09-21T08:30:33Z")

</div>

Hi all, Just wanted to put myself out there through advertising one of the projects I’m working on. I’m not sure if this is an appropriate place to promote this, if so feel free to remove this post. In just a few month…

---

## [\[ANN\] DiscreteEvents 0.3: discrete event generation and simulation](https://discourse.julialang.org/t/ann-discreteevents-0-3-discrete-event-generation-and-simulation/46477)

<div class="topic-metadata">

**Author:** [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Replies:** 1\
**Last updated:** [September 16, 2020, 4:03pm UTC](https://discourse.julialang.org/t/ann-discreteevents-0-3-discrete-event-generation-and-simulation/46477 "2020-09-16T16:03:35Z")

</div>

A Julia package for discrete event generation and simulation I’m pleased to announce that DiscreteEvents 0.3 is now available from the Julia registry. It has been renamed from Simulate 0.2 following the discussion on Di…

---

## [DiffEqParamEstim TypeAssert problem with forward AD](https://discourse.julialang.org/t/diffeqparamestim-typeassert-problem-with-forward-ad/46553)

<div class="topic-metadata">

**Author:** [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Replies:** 3\
**Last updated:** [September 14, 2020, 7:08am UTC](https://discourse.julialang.org/t/diffeqparamestim-typeassert-problem-with-forward-ad/46553 "2020-09-14T07:08:00Z")

</div>

I am getting a typeassert problem when I use the build\_objective\_function in combination with forward AD. Optimization is via Optim. It works if I use finite differencing or e.g. Tsit5() instead of Rosenbrock23() as the …

---

## [Certain callback does not seem to have an effect when solving JumpProblem](https://discourse.julialang.org/t/certain-callback-does-not-seem-to-have-an-effect-when-solving-jumpproblem/46415)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [September 12, 2020, 9:34am UTC](https://discourse.julialang.org/t/certain-callback-does-not-seem-to-have-an-effect-when-solving-jumpproblem/46415 "2020-09-12T09:34:41Z")

</div>

I am trying to solve a jump problem. As a part of it, mid simulation, I change a parameter. This is basically an input being triggered into the system. This does not seem to have much effect though, and I am unsure why: …

---

## [Callback problem with DifferentialEquations](https://discourse.julialang.org/t/callback-problem-with-differentialequations/46057)

<div class="topic-metadata">

**Author:** [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Replies:** 10\
**Last updated:** [September 11, 2020, 12:40pm UTC](https://discourse.julialang.org/t/callback-problem-with-differentialequations/46057 "2020-09-11T12:40:24Z")

</div>

I am stuck with a problem considering a SavingCallback from the DifferentialEquations suite. I could not create a MWE, thus I will explain the problem. I have an ODEProblem where I use a SavingCallback for the calculat…

---

## [Diffeq.jl problem terminology](https://discourse.julialang.org/t/diffeq-jl-problem-terminology/46024)

<div class="topic-metadata">

**Author:** [@pkairys](https://discourse.julialang.org/u/pkairys)\
**Replies:** 3\
**Last updated:** [September 8, 2020, 8:09pm UTC](https://discourse.julialang.org/t/diffeq-jl-problem-terminology/46024 "2020-09-08T20:09:03Z")

</div>

I’m trying to clarify a bit of terminology that is popping up in the DifferentialEquations.jl documentation relating to the “problem size” and “large systems.” I have a linear matrix differential equation like \\partial\_…

---

## [Recording entry and exit time of state space sets with DifferentialEquations.jl](https://discourse.julialang.org/t/recording-entry-and-exit-time-of-state-space-sets-with-differentialequations-jl/46029)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 14\
**Last updated:** [September 4, 2020, 11:05pm UTC](https://discourse.julialang.org/t/recording-entry-and-exit-time-of-state-space-sets-with-differentialequations-jl/46029 "2020-09-04T23:05:55Z")

</div>

I am trying to estimate entry and exit times in sets of the state space, as functionality for DynamicalSystems.jl. I have a working implementation for discrete systems but for continuous it turns out it is much harder. O…

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

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