# Modelling & Simulations

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

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

**Page:** 34

---

## [Is there a way to incorporate time series data into coupled ODE system using DifferentialEquations.jl?](https://discourse.julialang.org/t/is-there-a-way-to-incorporate-time-series-data-into-coupled-ode-system-using-differentialequations-jl/101682)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 3\
**Last updated:** [July 17, 2023, 2:18am UTC](https://discourse.julialang.org/t/is-there-a-way-to-incorporate-time-series-data-into-coupled-ode-system-using-differentialequations-jl/101682 "2023-07-17T02:18:10Z")

</div>

Hi all, If I have a set of coupled ODE: x = f(y, \\dot{y}, \\dot{x}), y = f(x, \\dot{x}, \\dot{y}) and I have a time series data for x, is there a way to implement this constraint into the solver? I was looking at the d…

---

## [How can I use a linear model with NaN parameters due to missing train data?](https://discourse.julialang.org/t/how-can-i-use-a-linear-model-with-nan-parameters-due-to-missing-train-data/101648)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 0\
**Last updated:** [July 15, 2023, 10:09am UTC](https://discourse.julialang.org/t/how-can-i-use-a-linear-model-with-nan-parameters-due-to-missing-train-data/101648 "2023-07-15T10:09:28Z")

</div>

Hi all! I am trying to build a model to predict electrical powers from a sequence of binary computer instructions. I thought to use a multiple linear regression, as from each instruction there are a lot of variables I c…

---

## [OrdinaryDiffEq.jl Buffer for Past Values Through Previous Iterations](https://discourse.julialang.org/t/ordinarydiffeq-jl-buffer-for-past-values-through-previous-iterations/101641)

<div class="topic-metadata">

**Author:** [@mwu](https://discourse.julialang.org/u/mwu)\
**Replies:** 1\
**Last updated:** [July 15, 2023, 2:33am UTC](https://discourse.julialang.org/t/ordinarydiffeq-jl-buffer-for-past-values-through-previous-iterations/101641 "2023-07-15T02:33:39Z")

</div>

I have an ODE system from OrdinaryDiffEq.jl. I want to model a digital filter that needs to know the past 7 values of a particular variable. Essentially, I want a buffer of sorts to keep track of the value of this variab…

---

## [Comparing Plot Outputs for Different Versions of Julia](https://discourse.julialang.org/t/comparing-plot-outputs-for-different-versions-of-julia/101538)

<div class="topic-metadata">

**Author:** [@emmabottomley](https://discourse.julialang.org/u/emmabottomley)\
**Replies:** 3\
**Last updated:** [July 15, 2023, 12:18am UTC](https://discourse.julialang.org/t/comparing-plot-outputs-for-different-versions-of-julia/101538 "2023-07-15T00:18:05Z")

</div>

Hello! I’m working on solving PDEs in julia and producing plots of their solutions for different lengths of time. I was having a lot of issues when using Julia v-1.9.0. When I increased the time in this specific settin…

---

## [Basis functions to approximate the inverse of quadratic function](https://discourse.julialang.org/t/basis-functions-to-approximate-the-inverse-of-quadratic-function/101449)

<div class="topic-metadata">

**Author:** [@EricJohnson](https://discourse.julialang.org/u/EricJohnson)\
**Replies:** 33\
**Last updated:** [July 14, 2023, 10:58pm UTC](https://discourse.julialang.org/t/basis-functions-to-approximate-the-inverse-of-quadratic-function/101449 "2023-07-14T22:58:55Z")

</div>

I have many observations of measuring a physical parameter over time. Each observation is basically a function p(t), t \\in \[t\_1, t\_2\]. I also have the value \\int\_{t\_1}^{t\_2} q (t) dt = Q I have many observations: \\le…

---

## [KeyError: key 'C' not found when using modelingtoolkitize command](https://discourse.julialang.org/t/keyerror-key-c-not-found-when-using-modelingtoolkitize-command/101553)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 3\
**Last updated:** [July 14, 2023, 8:39pm UTC](https://discourse.julialang.org/t/keyerror-key-c-not-found-when-using-modelingtoolkitize-command/101553 "2023-07-14T20:39:47Z")

</div>

I am using the modelingtoolkitize command to convert a large system of ODEs to symbolic expressions in order to perform Structural Identifiability Analysis. However, I am receiving the following error: KeyError: key ‘…

---

## [Bounding variables in a NonlinearSystem using MTK](https://discourse.julialang.org/t/bounding-variables-in-a-nonlinearsystem-using-mtk/101582)

<div class="topic-metadata">

**Author:** [@chris-hampel-CA](https://discourse.julialang.org/u/chris-hampel-CA)\
**Replies:** 3\
**Last updated:** [July 13, 2023, 9:14pm UTC](https://discourse.julialang.org/t/bounding-variables-in-a-nonlinearsystem-using-mtk/101582 "2023-07-13T21:14:02Z")

</div>

Hello, I have a general question about using ModelingToolkit when solving a NonlinearSystem. I noticed when building an OptimizationSystem you can bound your variables. Modeling Optimization Problems · ModelingToolkit.…

---

## [Error with WENO Scheme](https://discourse.julialang.org/t/error-with-weno-scheme/99005)

<div class="topic-metadata">

**Author:** [@emmabottomley](https://discourse.julialang.org/u/emmabottomley)\
**Replies:** 3\
**Last updated:** [July 13, 2023, 8:14pm UTC](https://discourse.julialang.org/t/error-with-weno-scheme/99005 "2023-07-13T20:14:38Z")

</div>

I’m having trouble using the WENO Scheme for my system of PDEs. My system is given as and I have the following code to solve the numerical solution for each equation: using OrdinaryDiffEq, ModelingToolkit, MethodOfL…

---

## [A way to add the iteration number on the callback function of Julia's NeuralPDE?](https://discourse.julialang.org/t/a-way-to-add-the-iteration-number-on-the-callback-function-of-julias-neuralpde/101507)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 2\
**Last updated:** [July 12, 2023, 6:31pm UTC](https://discourse.julialang.org/t/a-way-to-add-the-iteration-number-on-the-callback-function-of-julias-neuralpde/101507 "2023-07-12T18:31:44Z")

</div>

I’m using NeuralPDE.jl to solve a system of nonlinear PDEs, following the example in the docs. I wonder if there is a way to add the iteration number in the callback function, so I will know the progress. The callback …

---

## [Global Sensitivity Analysis in a subset of model parameters](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 4\
**Last updated:** [July 12, 2023, 4:45pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666 "2023-07-12T16:45:41Z")

</div>

Hi everyone. I was wondering if there is a way to perform Global Sensitivity Analysis in a subset of model parameters, because some of them are physically constant. The most naive approach would be to set the lower and u…

---

## [How do I associate a math operation with node of wiring diagram?](https://discourse.julialang.org/t/how-do-i-associate-a-math-operation-with-node-of-wiring-diagram/101503)

<div class="topic-metadata">

**Author:** [@nikit\_goku](https://discourse.julialang.org/u/nikit_goku)\
**Replies:** 0\
**Last updated:** [July 12, 2023, 12:54am UTC](https://discourse.julialang.org/t/how-do-i-associate-a-math-operation-with-node-of-wiring-diagram/101503 "2023-07-12T00:54:59Z")

</div>

Hello, I am trying to associate a mathematical operation with the node of the wiring diagram, for example I may want to pass an integer as an input, and want take a square root of that integer and return the value at the…

---

## [Likelihood of a set of events originating from a set of sources](https://discourse.julialang.org/t/likelihood-of-a-set-of-events-originating-from-a-set-of-sources/101455)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 9:31pm UTC](https://discourse.julialang.org/t/likelihood-of-a-set-of-events-originating-from-a-set-of-sources/101455 "2023-07-10T21:31:25Z")

</div>

I’m hoping there’s a more performant way to do this, but I’m missing something. I’m migrating some MATLAB code that uses reversible-jump MCMC to produce optimal sets of point sources to explain observed events (2d coord…

---

## [Calculating first integral](https://discourse.julialang.org/t/calculating-first-integral/101267)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 2\
**Last updated:** [July 10, 2023, 10:11am UTC](https://discourse.julialang.org/t/calculating-first-integral/101267 "2023-07-10T10:11:31Z")

</div>

Hello! I have an ODE system of 7 equations, and calculating the first integral analytically is a bit difficult for me. Are there packages for calculating the first integral of the ODE system? Thank you for help

---

## [Method of Lines for simple 2D Boussinesq convection?](https://discourse.julialang.org/t/method-of-lines-for-simple-2d-boussinesq-convection/101416)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 3\
**Last updated:** [July 10, 2023, 8:41am UTC](https://discourse.julialang.org/t/method-of-lines-for-simple-2d-boussinesq-convection/101416 "2023-07-10T08:41:51Z")

</div>

Hi everyone, I’m wondering if the method of lines can be used for a simple 2D convection: \\begin{aligned} \\frac{\\partial u}{\\partial x}+\\frac{\\partial w}{\\partial z} & =0 \\\\ \\frac{\\partial p}{\\partial x} & =\\frac{\\par…

---

## [Solving PDE + DAE using method of lines?](https://discourse.julialang.org/t/solving-pde-dae-using-method-of-lines/101370)

<div class="topic-metadata">

**Author:** [@KevinModica](https://discourse.julialang.org/u/KevinModica)\
**Replies:** 3\
**Last updated:** [July 9, 2023, 2:03pm UTC](https://discourse.julialang.org/t/solving-pde-dae-using-method-of-lines/101370 "2023-07-09T14:03:17Z")

</div>

Hello All, I am new to Julia, and I have a lot of difficulty navigating the documentation (especially with functions being imported all at once with “using …”, so I can never tell what function belongs to what). I’m tr…

---

## [How to linearize a model](https://discourse.julialang.org/t/how-to-linearize-a-model/99886)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 14\
**Last updated:** [July 9, 2023, 8:07am UTC](https://discourse.julialang.org/t/how-to-linearize-a-model/99886 "2023-07-09T08:07:54Z")

</div>

What I did so far: I can define a model using ModelingToolkit.jl I can simplify the system of equations I can simulate the step response of the model Now I would like to linearize the model. In theory very easy, just …

---

## [How to implement a Bessel filter with ModelingToolkit?](https://discourse.julialang.org/t/how-to-implement-a-bessel-filter-with-modelingtoolkit/101220)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 13\
**Last updated:** [July 8, 2023, 3:47am UTC](https://discourse.julialang.org/t/how-to-implement-a-bessel-filter-with-modelingtoolkit/101220 "2023-07-08T03:47:46Z")

</div>

How can I implement the following Bessel filter with ModelingToolkit? \\frac{w\_1²}{0.618 s²~+~1.3617 w\_1 s~+~w\_1²} I know there is this filter component in the standard library: Basic Blocks · ModelingToolkitStandardLib…

---

## [Rodas4 vs Rodas4P vs Rodas4P2 solvers](https://discourse.julialang.org/t/rodas4-vs-rodas4p-vs-rodas4p2-solvers/101261)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [July 6, 2023, 7:59pm UTC](https://discourse.julialang.org/t/rodas4-vs-rodas4p-vs-rodas4p2-solvers/101261 "2023-07-06T19:59:11Z")

</div>

Today I found that the solver Rodas4P2 is working best for my model. For an tolerance of 1e-7 it is 4 times faster than Simulink, operating at a tolerance of 1e-3. But what is the difference between Rodas4, Rodas4P and …

---

## [Training universal differential equations](https://discourse.julialang.org/t/training-universal-differential-equations/100787)

<div class="topic-metadata">

**Author:** [@T\_J](https://discourse.julialang.org/u/T_J)\
**Replies:** 7\
**Last updated:** [July 6, 2023, 3:09pm UTC](https://discourse.julialang.org/t/training-universal-differential-equations/100787 "2023-07-06T15:09:22Z")

</div>

Hello, In a universal differential equation where the ODE + NN is not able to finish the integration routine, Is there a procedure (best practices) to execute in order to train the ODE? If the integration procedure is …

---

## [Big PDESystem exceeds maximal parameter space of CUDA kernels](https://discourse.julialang.org/t/big-pdesystem-exceeds-maximal-parameter-space-of-cuda-kernels/101047)

<div class="topic-metadata">

**Author:** [@drsk](https://discourse.julialang.org/u/drsk)\
**Replies:** 7\
**Last updated:** [July 6, 2023, 6:48am UTC](https://discourse.julialang.org/t/big-pdesystem-exceeds-maximal-parameter-space-of-cuda-kernels/101047 "2023-07-06T06:48:06Z")

</div>

I’m using NeuralPDE.jl to find critical points of a geometric flow equation on the four-torus. This ends up being a fairly big system, with 18 variables in total. I think the size of the system makes the CUDA compiler ge…

---

## [Matrix SDE problem and dimension mismatch](https://discourse.julialang.org/t/matrix-sde-problem-and-dimension-mismatch/101194)

<div class="topic-metadata">

**Author:** [@simoneb](https://discourse.julialang.org/u/simoneb)\
**Replies:** 4\
**Last updated:** [July 6, 2023, 2:03am UTC](https://discourse.julialang.org/t/matrix-sde-problem-and-dimension-mismatch/101194 "2023-07-06T02:03:57Z")

</div>

Hi, I’m trying to fit an SDE model to elements of a 2x2 symmetric positive-definite matrix. I need to give separate BMs to all the elements, with the constraint that the off-diagonal elements are identical. ie have the s…

---

## [Instability lyapunov exponent, DifferentialEquations](https://discourse.julialang.org/t/instability-lyapunov-exponent-differentialequations/101177)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 0\
**Last updated:** [July 4, 2023, 3:48pm UTC](https://discourse.julialang.org/t/instability-lyapunov-exponent-differentialequations/101177 "2023-07-04T15:48:42Z")

</div>

Hello! I am trying to calculate the spectrum of Lyapunov exponents and get a message about instability. When I calculate a solution with the same settings method of integration, there is no instability message. How can …

---

## [Finding equilibrium states](https://discourse.julialang.org/t/finding-equilibrium-states/101163)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 2\
**Last updated:** [July 4, 2023, 11:06am UTC](https://discourse.julialang.org/t/finding-equilibrium-states/101163 "2023-07-04T11:06:46Z")

</div>

Hello! I try find equilibrium states for system: function HR\_mem(u, p, t) function sigma(x) return 1.0 / ( 1.0 + exp( -10.0 \* ( x - ( - 0.25 ) ) ) ) end memristor(z, k1\_me, k2\_me) = k1\_me + k2\_me \* …

---

## [Programmatically check if a variable is in an equation in ModelingToolkit.jl](https://discourse.julialang.org/t/programmatically-check-if-a-variable-is-in-an-equation-in-modelingtoolkit-jl/101124)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 2\
**Last updated:** [July 3, 2023, 10:59pm UTC](https://discourse.julialang.org/t/programmatically-check-if-a-variable-is-in-an-equation-in-modelingtoolkit-jl/101124 "2023-07-03T22:59:07Z")

</div>

Given an Equation generated by ModelingToolkit.jl, I want to check, programmatically, whether some variable exists in the equation. MWE: using ModelingToolkit @variables t # independent variable (time) dDt =…

---

## [Pendulum with dry friction](https://discourse.julialang.org/t/pendulum-with-dry-friction/101123)

<div class="topic-metadata">

**Author:** [@lieskjur](https://discourse.julialang.org/u/lieskjur)\
**Replies:** 1\
**Last updated:** [July 3, 2023, 3:41pm UTC](https://discourse.julialang.org/t/pendulum-with-dry-friction/101123 "2023-07-03T15:41:02Z")

</div>

Hi, I have decided to implement dry friction into one of my simulation models. As a first step, I created a simple example of a pendulum that I would like to share. I am already using DifferentialEquations.jl for my pr…

---

## [MethodError in 1D Lennard-Jones fluid simulation](https://discourse.julialang.org/t/methoderror-in-1d-lennard-jones-fluid-simulation/101126)

<div class="topic-metadata">

**Author:** [@rolenzo](https://discourse.julialang.org/u/rolenzo)\
**Replies:** 2\
**Last updated:** [July 3, 2023, 2:58pm UTC](https://discourse.julialang.org/t/methoderror-in-1d-lennard-jones-fluid-simulation/101126 "2023-07-03T14:58:08Z")

</div>

Hello people, I’m super new to Julia (\*) and as a starter I am simulating a 1D Lennard-Jones fluid. To do so I’m integrating Newton’s equations with periodic boundary conditions using second order velocity verlet. I tes…

---

## [Efficient simulation of spatially coupled ODEs on arbitrary graphs](https://discourse.julialang.org/t/efficient-simulation-of-spatially-coupled-odes-on-arbitrary-graphs/100852)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 5\
**Last updated:** [June 29, 2023, 9:00pm UTC](https://discourse.julialang.org/t/efficient-simulation-of-spatially-coupled-odes-on-arbitrary-graphs/100852 "2023-06-29T21:00:37Z")

</div>

I know this question is not very specific, but I would like to check whether there are existing approaches for simulating coupled ODEs on nodes of (arbitrarily large) graphs/networks with diffusion between the nodes. Loo…

---

## [ODE solution in Symbolics/SymbolicNumericIntegration vs. ModelingToolkit](https://discourse.julialang.org/t/ode-solution-in-symbolics-symbolicnumericintegration-vs-modelingtoolkit/100893)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [June 27, 2023, 6:07pm UTC](https://discourse.julialang.org/t/ode-solution-in-symbolics-symbolicnumericintegration-vs-modelingtoolkit/100893 "2023-06-27T18:07:40Z")

</div>

I’m comparing the analytic and numeric solutions of a linear, second order ODE, and get some weird (arbitrary) result with the analytic solution found by using SymbolicNumericIntegration… I assume I’m using the tools inc…

---

## [Differences in ODE Solver behaviour inside and outside Adam Optimizer](https://discourse.julialang.org/t/differences-in-ode-solver-behaviour-inside-and-outside-adam-optimizer/99657)

<div class="topic-metadata">

**Author:** [@Stefano\_Giampiccolo](https://discourse.julialang.org/u/Stefano_Giampiccolo)\
**Replies:** 5\
**Last updated:** [June 24, 2023, 4:12pm UTC](https://discourse.julialang.org/t/differences-in-ode-solver-behaviour-inside-and-outside-adam-optimizer/99657 "2023-06-24T16:12:05Z")

</div>

Good morning, I am working with hybrid systems (universal differential equations) using the SciML ecosystem. I apologize if this is a stupid question, but I have a doubt related to a stiff problem I’m working on, which …

---

## [Julia implementation for H-Matrices in GPU](https://discourse.julialang.org/t/julia-implementation-for-h-matrices-in-gpu/100297)

<div class="topic-metadata">

**Author:** [@KapilKhanal](https://discourse.julialang.org/u/KapilKhanal)\
**Replies:** 2\
**Last updated:** [June 23, 2023, 5:04pm UTC](https://discourse.julialang.org/t/julia-implementation-for-h-matrices-in-gpu/100297 "2023-06-23T17:04:01Z")

</div>

I am looking into performing H-matrices operations in GPU and specifically looking if there are any wrapper or native implementations in Julia.

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

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