# Modelling & Simulations

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

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

**Page:** 27

---

## [Build\_function: stack overflow in type inference](https://discourse.julialang.org/t/build-function-stack-overflow-in-type-inference/109971)

<div class="topic-metadata">

**Author:** [@Johan-Gronqvist](https://discourse.julialang.org/u/Johan-Gronqvist)\
**Replies:** 4\
**Last updated:** [February 9, 2024, 9:23pm UTC](https://discourse.julialang.org/t/build-function-stack-overflow-in-type-inference/109971 "2024-02-09T21:23:23Z")

</div>

I am trying to use Symbolics.build\_function to generate JuMP.AffExpr expressions from symbolic expressions. I see an error message Internal error: stack overflow in type inference of (::RuntimeGeneratedFunctions.Runtim…

---

## [Using Zygote with ComponentArrays](https://discourse.julialang.org/t/using-zygote-with-componentarrays/109715)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 1\
**Last updated:** [February 9, 2024, 8:14pm UTC](https://discourse.julialang.org/t/using-zygote-with-componentarrays/109715 "2024-02-09T20:14:04Z")

</div>

I am computing gradients of functions using Zygote. The argument of my function is a ComponentArray, because my functions depend on DifferentialEquation.jl solvers using adjoint method. I have been naively assuming Zygot…

---

## [How to access optional input functions in sundials.jl IDA solver](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862)

<div class="topic-metadata">

**Author:** [@Aniket\_Patra](https://discourse.julialang.org/u/Aniket_Patra)\
**Replies:** 4\
**Last updated:** [February 8, 2024, 12:10pm UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862 "2024-02-08T12:10:07Z")

</div>

Hello! I am using IDA to solve a system of stiff differential equations. I know that this particular system of equations is singular. However, I am trying to understand the singularity better. It seems that at some poi…

---

## [Error from example '33D Mixed-Agent Ecosystem with Pathfinding'](https://discourse.julialang.org/t/error-from-example-33d-mixed-agent-ecosystem-with-pathfinding/109868)

<div class="topic-metadata">

**Author:** [@nadeen1507](https://discourse.julialang.org/u/nadeen1507)\
**Replies:** 0\
**Last updated:** [February 7, 2024, 1:13pm UTC](https://discourse.julialang.org/t/error-from-example-33d-mixed-agent-ecosystem-with-pathfinding/109868 "2024-02-07T13:13:27Z")

</div>

I have copied an example form the ‘Julia Library’ line by line and I am constantly receiving this error when running the last visualization step. Please tell me how to fix it. ERROR: MethodError: no method matching abmv…

---

## [Trainning UODE over multiple species](https://discourse.julialang.org/t/trainning-uode-over-multiple-species/100440)

<div class="topic-metadata">

**Author:** [@James\_Fernandez](https://discourse.julialang.org/u/James_Fernandez)\
**Replies:** 0\
**Last updated:** [June 16, 2023, 9:49am UTC](https://discourse.julialang.org/t/trainning-uode-over-multiple-species/100440 "2023-06-16T09:49:42Z")

</div>

I am trying to model the Lotka-Volterra system for multiple species. The system is defined as: \\left\\{\\begin{matrix} \\frac{\\mathrm{d} x}{\\mathrm{d} t}=\\alpha x - \\beta xy\\\\ \\frac{\\mathrm{d} y}{\\mathrm{d} t}=-\\del…

---

## [Calculation of gain margin fails](https://discourse.julialang.org/t/calculation-of-gain-margin-fails/109819)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [February 6, 2024, 4:42pm UTC](https://discourse.julialang.org/t/calculation-of-gain-margin-fails/109819 "2024-02-06T16:42:46Z")

</div>

I have the following code: using ControlSystemsBase Ts = 0.01 Ku = 100/5e6 K2 = 5e6 num = \[Ku \* Ts\] den = \[1, -1\] P = tf(num, den, Ts) # plant C = K2 sys = feedback(P, C) ol\_sys = P\*C margin(ol\_sys) If I create a bod…

---

## [Using symbolic variables in control systems](https://discourse.julialang.org/t/using-symbolic-variables-in-control-systems/109810)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [February 6, 2024, 3:11pm UTC](https://discourse.julialang.org/t/using-symbolic-variables-in-control-systems/109810 "2024-02-06T15:11:41Z")

</div>

Is it possible to use symbolic variables when defining a discrete time control system? The following code fails: using ControlSystemsBase, ModelingToolkit @parameters Ts # Ts = 0.01 Ku = 200/5e6 K2 = 5e6 num = \[Ku \* …

---

## [Number of domains in method of lines](https://discourse.julialang.org/t/number-of-domains-in-method-of-lines/109813)

<div class="topic-metadata">

**Author:** [@Sisuvoima10](https://discourse.julialang.org/u/Sisuvoima10)\
**Replies:** 0\
**Last updated:** [February 6, 2024, 2:49pm UTC](https://discourse.julialang.org/t/number-of-domains-in-method-of-lines/109813 "2024-02-06T14:49:32Z")

</div>

Hello to all, I have been trying to model a simple diffusion problem consisting from 3 different domains that are connected through interfaces. Problem is just in 1D and and the domains are connected to each other in fo…

---

## [How to prove stability of discrete time system](https://discourse.julialang.org/t/how-to-prove-stability-of-discrete-time-system/109789)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [February 6, 2024, 11:37am UTC](https://discourse.julialang.org/t/how-to-prove-stability-of-discrete-time-system/109789 "2024-02-06T11:37:46Z")

</div>

I am simulating the following discrete time feedback system: How can I prove that it is stable for K\_\\mathrm{u} \< 2 \\frac{1}{T\_\\mathrm{s} K\_2} ? Code: using ControlSystemsBase Ts = 0.01 Ku = 100/5e6 K2 = 5e6 nu…

---

## [Model a first-order-plus-delay system in ModelingToolkit](https://discourse.julialang.org/t/model-a-first-order-plus-delay-system-in-modelingtoolkit/109695)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 11\
**Last updated:** [February 5, 2024, 5:34pm UTC](https://discourse.julialang.org/t/model-a-first-order-plus-delay-system-in-modelingtoolkit/109695 "2024-02-05T17:34:35Z")

</div>

Hi, I wonder if there is any straightforward way to model a system consisting of a first-order-plus-delay plant T(s) = K.exp(-delay.s)/(tau.s + 1) and a PI controller using components from ModelingToolkitStandardLibrary…

---

## [Symbolics build\_function issues on complicated expressions](https://discourse.julialang.org/t/symbolics-build-function-issues-on-complicated-expressions/109727)

<div class="topic-metadata">

**Author:** [@Johan-Gronqvist](https://discourse.julialang.org/u/Johan-Gronqvist)\
**Replies:** 6\
**Last updated:** [February 5, 2024, 4:48pm UTC](https://discourse.julialang.org/t/symbolics-build-function-issues-on-complicated-expressions/109727 "2024-02-05T16:48:13Z")

</div>

I am trying to use Symbolics to define and manipulate my problem before moving to numerical methods to actually solve my problem. After initial manipulations, I want to replace all symbolic variables with their actual v…

---

## [Oceananigans.jl](https://discourse.julialang.org/t/oceananigans-jl/109693)

<div class="topic-metadata">

**Author:** [@benslinux](https://discourse.julialang.org/u/benslinux)\
**Replies:** 0\
**Last updated:** [February 4, 2024, 8:33am UTC](https://discourse.julialang.org/t/oceananigans-jl/109693 "2024-02-04T08:33:58Z")

</div>

\*\* SOLVED - Tried running the demo program for Oceananigans - I got as far as this: julia\> run!(simulation) \[ Info: Initializing simulation… \[ Info: … simulation initialization complete (88.034 ms) \[ Info: Execu…

---

## [BatchIntegralFunction not appearing to work as intended](https://discourse.julialang.org/t/batchintegralfunction-not-appearing-to-work-as-intended/109513)

<div class="topic-metadata">

**Author:** [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Replies:** 2\
**Last updated:** [February 3, 2024, 4:05am UTC](https://discourse.julialang.org/t/batchintegralfunction-not-appearing-to-work-as-intended/109513 "2024-02-03T04:05:09Z")

</div>

I am trying to implement a batch integral function using the new BatchIntegralFunction rather than then deprecated nout/batch keywords. However, when I do, the in-place vector to fill place the answer in is the incorrec…

---

## [How does DifferentialEquations give a continuous curve for plotting?](https://discourse.julialang.org/t/how-does-differentialequations-give-a-continuous-curve-for-plotting/109588)

<div class="topic-metadata">

**Author:** [@MatheusJanczkowski](https://discourse.julialang.org/u/MatheusJanczkowski)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 7:48pm UTC](https://discourse.julialang.org/t/how-does-differentialequations-give-a-continuous-curve-for-plotting/109588 "2024-02-01T19:48:03Z")

</div>

When I plot the solution given by some solver in DifferentialEquations, Tsit5 for instance, it gives a continuous curve (i.e., it has a lot of points). If I plot the points that the solver generated, however, they are ju…

---

## [Julia 1.10 and Ensemble Summary command error](https://discourse.julialang.org/t/julia-1-10-and-ensemble-summary-command-error/109482)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 5\
**Last updated:** [February 1, 2024, 3:24am UTC](https://discourse.julialang.org/t/julia-1-10-and-ensemble-summary-command-error/109482 "2024-02-01T03:24:09Z")

</div>

I updated to Julia 1.10 and was checking my past codes. Everything works fine, except for the EnsembleSummary function. I get the following error: ERROR: type NamedTuple has no field u The previous Julia version was …

---

## [Solving ODEdifferential equations where each time point is in triplicate](https://discourse.julialang.org/t/solving-odedifferential-equations-where-each-time-point-is-in-triplicate/109466)

<div class="topic-metadata">

**Author:** [@adelpinoherrera](https://discourse.julialang.org/u/adelpinoherrera)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 1:54am UTC](https://discourse.julialang.org/t/solving-odedifferential-equations-where-each-time-point-is-in-triplicate/109466 "2024-02-01T01:54:04Z")

</div>

I want to be able to calculate the exponential growth rate of some experimental data collected everyday for 11 days in triplicate. The experimental data can be set up in any way but I have cell counts of every day for 11…

---

## [Resolving Julia Warning: dt(2.27e-13) \<= dtmin(2.27e-13) in implementation of dual numbers](https://discourse.julialang.org/t/resolving-julia-warning-dt-2-27e-13-dtmin-2-27e-13-in-implementation-of-dual-numbers/109390)

<div class="topic-metadata">

**Author:** [@vivekag7](https://discourse.julialang.org/u/vivekag7)\
**Replies:** 4\
**Last updated:** [January 31, 2024, 1:56pm UTC](https://discourse.julialang.org/t/resolving-julia-warning-dt-2-27e-13-dtmin-2-27e-13-in-implementation-of-dual-numbers/109390 "2024-01-31T13:56:24Z")

</div>

Hi Julia Community, I’ve been trying to make a glacier SIA2D forward model compatible with dual numbers using PreallocationTools.jl, however I run into the following warning using the solver RDPK3Sp35: ┌ Warning: dt(2.…

---

## [FinETools Assemby Multiple Dispatch Include Integral Term](https://discourse.julialang.org/t/finetools-assemby-multiple-dispatch-include-integral-term/109502)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 0\
**Last updated:** [January 31, 2024, 8:34am UTC](https://discourse.julialang.org/t/finetools-assemby-multiple-dispatch-include-integral-term/109502 "2024-01-31T08:34:15Z")

</div>

Question: does FinETools allow to extend the assembly with a method that during assembly prints e.g. element id? Motivating this question is understanding better how “flexible” / “extensible” FenETools is solve integro-…

---

## [Time normalisation results in \`nothing\` gradients of ODE solutions](https://discourse.julialang.org/t/time-normalisation-results-in-nothing-gradients-of-ode-solutions/109353)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 5\
**Last updated:** [January 30, 2024, 11:22pm UTC](https://discourse.julialang.org/t/time-normalisation-results-in-nothing-gradients-of-ode-solutions/109353 "2024-01-30T23:22:04Z")

</div>

The following defines the simple one-dimensional ode dx\_dt = -ωx, and a function x(ω, t) to solve it. Fixing t=T, I can readily differentiate x(ω, t) with respect to ω: using DifferentialEquations using SciMLSensitivity…

---

## [SBMLToolkit and Catalyst Warnings](https://discourse.julialang.org/t/sbmltoolkit-and-catalyst-warnings/107533)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 3\
**Last updated:** [January 29, 2024, 10:14pm UTC](https://discourse.julialang.org/t/sbmltoolkit-and-catalyst-warnings/107533 "2024-01-29T22:14:12Z")

</div>

I am importing an SBML file without a problem but I got the following warnings: Warning: Stoichiometries of SpeciesReferences are not defined. Setting to 1. WARNING: both Symbolics and ModelingToolkit export “suprem…

---

## [MATLAB -\> Julia, Diffeq cannot solve large system over long time-span](https://discourse.julialang.org/t/matlab-julia-diffeq-cannot-solve-large-system-over-long-time-span/109103)

<div class="topic-metadata">

**Author:** [@atarias1](https://discourse.julialang.org/u/atarias1)\
**Replies:** 20\
**Last updated:** [January 23, 2024, 5:28pm UTC](https://discourse.julialang.org/t/matlab-julia-diffeq-cannot-solve-large-system-over-long-time-span/109103 "2024-01-23T17:28:19Z")

</div>

Hello, I am working on a project to model dehydration of some rocks. I am planning on adapting this model https://github.com/rmskarbek/PorosityWaves to different conditions. However, before moving on to that I wanted to…

---

## [Discrete Kalman filter](https://discourse.julialang.org/t/discrete-kalman-filter/109014)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 19\
**Last updated:** [January 23, 2024, 4:32pm UTC](https://discourse.julialang.org/t/discrete-kalman-filter/109014 "2024-01-23T16:32:02Z")

</div>

Kalman filter A wind turbine is modeled under the assumption that the rotor is directly attached to the generator and that the generator torque can be controlled directly. Then we can write (without noise): \\dot\\omega\_…

---

## [Automatic Differentiation: Second-order partial derivatives w.r.t. different arguments](https://discourse.julialang.org/t/automatic-differentiation-second-order-partial-derivatives-w-r-t-different-arguments/109108)

<div class="topic-metadata">

**Author:** [@Tengrath](https://discourse.julialang.org/u/Tengrath)\
**Replies:** 0\
**Last updated:** [January 22, 2024, 4:13pm UTC](https://discourse.julialang.org/t/automatic-differentiation-second-order-partial-derivatives-w-r-t-different-arguments/109108 "2024-01-22T16:13:27Z")

</div>

I’m interested in calculating second order partial derivatives w.r.t. to different arguments \\partial k\_j \\partial x\_i f. Consider function f(x,k) return @. k \* x^2 end Calculation of second-order derivatives w.r.…

---

## [Unexpected simulation behaviour of Geometric Brownian Motion with SciML](https://discourse.julialang.org/t/unexpected-simulation-behaviour-of-geometric-brownian-motion-with-sciml/108870)

<div class="topic-metadata">

**Author:** [@VincentW](https://discourse.julialang.org/u/VincentW)\
**Replies:** 1\
**Last updated:** [January 19, 2024, 3:32am UTC](https://discourse.julialang.org/t/unexpected-simulation-behaviour-of-geometric-brownian-motion-with-sciml/108870 "2024-01-19T03:32:24Z")

</div>

Hey, I wanted to simulate a geometric Brownian Motion of the form GBB(t)=\\exp\\left(\\beta t+\\delta B(t)\\right), where B(t) is just some standard Brownian Motion. Or expressed as a SDE, I want to simulate the solution …

---

## [Make Predictive Glacier Forward Model Compatible with Dual Numbers](https://discourse.julialang.org/t/make-predictive-glacier-forward-model-compatible-with-dual-numbers/108977)

<div class="topic-metadata">

**Author:** [@vivekag7](https://discourse.julialang.org/u/vivekag7)\
**Replies:** 3\
**Last updated:** [January 18, 2024, 10:49pm UTC](https://discourse.julialang.org/t/make-predictive-glacier-forward-model-compatible-with-dual-numbers/108977 "2024-01-18T22:49:55Z")

</div>

Hi Julia Community, I have an in place predictive model for glaciers, which is well tested and works perfectly fine with any \<:AbstractFloat. Now what I would like to do is make this model compatible with ForwardDiff.D…

---

## [How to understand filtering in topology optimization?](https://discourse.julialang.org/t/how-to-understand-filtering-in-topology-optimization/108905)

<div class="topic-metadata">

**Author:** [@ehgus](https://discourse.julialang.org/u/ehgus)\
**Replies:** 6\
**Last updated:** [January 18, 2024, 12:55pm UTC](https://discourse.julialang.org/t/how-to-understand-filtering-in-topology-optimization/108905 "2024-01-18T12:55:54Z")

</div>

Hello I’m trying to understand the role of filtering in the tutorial about topology optimization of gridap. It claims that filtering process will help to binarize the result. Well… I first imagine an optimization probl…

---

## [Modeling and solving systems of nonlinear dynamic equations](https://discourse.julialang.org/t/modeling-and-solving-systems-of-nonlinear-dynamic-equations/108556)

<div class="topic-metadata">

**Author:** [@enzo.salvatore](https://discourse.julialang.org/u/enzo.salvatore)\
**Replies:** 11\
**Last updated:** [January 17, 2024, 3:48pm UTC](https://discourse.julialang.org/t/modeling-and-solving-systems-of-nonlinear-dynamic-equations/108556 "2024-01-17T15:48:08Z")

</div>

I am currently a Ph.D. student in economics, and I am looking to find a way to model and solve dynamic systems of nonlinear equations. The goal is to create a dynamic Computable General Equilibrium (CGE) model in Julia. …

---

## [Are there any packages for finite volume simulations?](https://discourse.julialang.org/t/are-there-any-packages-for-finite-volume-simulations/108802)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [January 15, 2024, 10:13pm UTC](https://discourse.julialang.org/t/are-there-any-packages-for-finite-volume-simulations/108802 "2024-01-15T22:13:53Z")

</div>

I know finite element simulations well, but I am new to the field of finite volume simulations. See: Finite volume method - Wikipedia A comparison between finite element and finite volume methods: FEM vs. FVM | COMSOL B…

---

## [Is there a comprehensive molecular dynamics analysis library in Julia?](https://discourse.julialang.org/t/is-there-a-comprehensive-molecular-dynamics-analysis-library-in-julia/108817)

<div class="topic-metadata">

**Author:** [@Sam\_Xu](https://discourse.julialang.org/u/Sam_Xu)\
**Replies:** 2\
**Last updated:** [January 15, 2024, 1:43pm UTC](https://discourse.julialang.org/t/is-there-a-comprehensive-molecular-dynamics-analysis-library-in-julia/108817 "2024-01-15T13:43:57Z")

</div>

There was a discussion about this topic 4 years before: What is the best molecular dynamics analysis library in Julia?. After going through the libraries mentioned in that post, it seems like BioStructures.jl and Chemfi…

---

## [ModelingToolkit.jl and type-based equation deciding: best practices?](https://discourse.julialang.org/t/modelingtoolkit-jl-and-type-based-equation-deciding-best-practices/107491)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 3\
**Last updated:** [January 12, 2024, 11:13am UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-and-type-based-equation-deciding-best-practices/107491 "2024-01-12T11:13:33Z")

</div>

What do people recommend for ModelingToolkit.jl with variable equations that change depending on some input “type” specification? By that I mean that I have some sort of physical process that has a couple of different wa…

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

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