# Modelling & Simulations

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

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

**Page:** 24

---

## [Matrix inversion in ODESystem in ModelingToolkit](https://discourse.julialang.org/t/matrix-inversion-in-odesystem-in-modelingtoolkit/113687)

<div class="topic-metadata">

**Author:** [@rveynde](https://discourse.julialang.org/u/rveynde)\
**Replies:** 1\
**Last updated:** [May 1, 2024, 12:03pm UTC](https://discourse.julialang.org/t/matrix-inversion-in-odesystem-in-modelingtoolkit/113687 "2024-05-01T12:03:00Z")

</div>

Hi all, I’m trying to build an ODESystem in ModelingToolkit, with an equation that uses a matrix inversion. Basically, I initialize a random matrix A of size (industries,industries), and the matrix L of size (industries,…

---

## [MTK: computing solutions of vectors of unknowns?](https://discourse.julialang.org/t/mtk-computing-solutions-of-vectors-of-unknowns/113614)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 11\
**Last updated:** [April 30, 2024, 3:29pm UTC](https://discourse.julialang.org/t/mtk-computing-solutions-of-vectors-of-unknowns/113614 "2024-04-30T15:29:08Z")

</div>

With ModelingToolkit, I have a number of variables of.w\_1.m, of.w\_2.m, …, of\_w\_5.m and I want to check the solution of these variables, e.g., at time = 0.5. With solution structure sol, I can do this as follows: sol(0.…

---

## [Anyone has a starter guide on finite element analysis?](https://discourse.julialang.org/t/anyone-has-a-starter-guide-on-finite-element-analysis/112894)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 5\
**Last updated:** [April 29, 2024, 12:22pm UTC](https://discourse.julialang.org/t/anyone-has-a-starter-guide-on-finite-element-analysis/112894 "2024-04-29T12:22:45Z")

</div>

After exploring several ideas, I think the idea I’m going to implement would be to simulate air pressure in a musical instrument or vocal tract to synthesize voice. I found finite-element method to be suitable for this a…

---

## [ModelingToolkit @mtkmodel and loop on equations](https://discourse.julialang.org/t/modelingtoolkit-mtkmodel-and-loop-on-equations/113374)

<div class="topic-metadata">

**Author:** [@julien-dc](https://discourse.julialang.org/u/julien-dc)\
**Replies:** 3\
**Last updated:** [April 29, 2024, 5:16am UTC](https://discourse.julialang.org/t/modelingtoolkit-mtkmodel-and-loop-on-equations/113374 "2024-04-29T05:16:56Z")

</div>

Greetings Julia community, I’m currently exploring the possibility of transitioning from a Modelica/Python workflow to a fully Julia-based workflow for my projects. As I’m relatively new to Julia, I’ve encountered an is…

---

## [Monitoring the progress of DiffEq solve](https://discourse.julialang.org/t/monitoring-the-progress-of-diffeq-solve/113579)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 5\
**Last updated:** [April 28, 2024, 10:35pm UTC](https://discourse.julialang.org/t/monitoring-the-progress-of-diffeq-solve/113579 "2024-04-28T22:35:11Z")

</div>

The motivation is that, sometimes, solve(prob) takes long time to run. While running, DiffEq doesn’t print any output (even with debug logging on). There is no easy way to tell what’s going on, e.g., if it’s stuck at a …

---

## [Simulating a stochastic volatility model with jumps using DifferentialEquations.jl and JumpProcesses.jl](https://discourse.julialang.org/t/simulating-a-stochastic-volatility-model-with-jumps-using-differentialequations-jl-and-jumpprocesses-jl/113534)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 4\
**Last updated:** [April 28, 2024, 12:46pm UTC](https://discourse.julialang.org/t/simulating-a-stochastic-volatility-model-with-jumps-using-differentialequations-jl-and-jumpprocesses-jl/113534 "2024-04-28T12:46:29Z")

</div>

I’ve been using DifferentialEquations.jl to simulate the following stochastic volatility model: du\_t = 0 dt + v\_t ( -0.576 dW\_{1,t} + \\sqrt{1 - 0.576^2} dW\_{2,t}) dv\_t^2 = 0.035 (0.636 - v\_t^2) dt + 0 . 144 v\_t^2 dW\_{1…

---

## [Problem in solve() DifferentialEquations. None algorithm define](https://discourse.julialang.org/t/problem-in-solve-differentialequations-none-algorithm-define/113342)

<div class="topic-metadata">

**Author:** [@Marta\_Pardo\_Araujo](https://discourse.julialang.org/u/Marta_Pardo_Araujo)\
**Replies:** 11\
**Last updated:** [April 25, 2024, 11:26am UTC](https://discourse.julialang.org/t/problem-in-solve-differentialequations-none-algorithm-define/113342 "2024-04-25T11:26:42Z")

</div>

Hi, I am new to Julia. I am trying to integrate an ODE. It works in my colleagues PC but not in mine. It looks like the package has not been loaded but I did it at the beginning of the script. I have tried with many sol…

---

## [Putting linear ODESystem in matrix-vector form](https://discourse.julialang.org/t/putting-linear-odesystem-in-matrix-vector-form/113333)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 26\
**Last updated:** [April 23, 2024, 2:18pm UTC](https://discourse.julialang.org/t/putting-linear-odesystem-in-matrix-vector-form/113333 "2024-04-23T14:18:37Z")

</div>

Hi, I have an ODESystem, defined in modelingtoolkit.jl by these equations: \\begin{align} \\frac{\\mathrm{d} Ci\_{+}v\\left( t \\right)}{\\mathrm{d}t} =& \\frac{\\frac{ - Ci\_{+}v\\left( t \\right) + Ch\_{+}v\\left( t \\right)}{Rih\_…

---

## [SVector and Type Stabilty](https://discourse.julialang.org/t/svector-and-type-stabilty/113391)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 4\
**Last updated:** [April 23, 2024, 1:05pm UTC](https://discourse.julialang.org/t/svector-and-type-stabilty/113391 "2024-04-23T13:05:17Z")

</div>

I am struggling to understand the type instability of function foo(x,y,z,r) r\_prime = Point3D(x,y,z) result = r - rprime end given as input x = 0.; y = 0.; z = 0.; r = Point3D(1.,1.,1.) @code\_warntype foo(x,…

---

## [Custom Agent constructors?](https://discourse.julialang.org/t/custom-agent-constructors/113376)

<div class="topic-metadata">

**Author:** [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Replies:** 2\
**Last updated:** [April 23, 2024, 11:37am UTC](https://discourse.julialang.org/t/custom-agent-constructors/113376 "2024-04-23T11:37:43Z")

</div>

I’d like to preprocess the parameters that are passed to an Agent upon construction. How would I go about that? A simple example of what I’d like to do: function make\_set(t::Union{Nothing, Symbol, Set{Symbol}}) if t …

---

## [ModelingToolkit and Linearization](https://discourse.julialang.org/t/modelingtoolkit-and-linearization/113241)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 15\
**Last updated:** [April 22, 2024, 7:44pm UTC](https://discourse.julialang.org/t/modelingtoolkit-and-linearization/113241 "2024-04-22T19:44:18Z")

</div>

Continuing a former discussion in Optimization of parameters of a dynamic problem with ModelingToolkit - #4 by BambOoxX, I’m now trying to model and linearize a mass-spring-damper system as an example to test MTKs capabi…

---

## [Is there an alternative to the agents\_first keyword?](https://discourse.julialang.org/t/is-there-an-alternative-to-the-agents-first-keyword/113272)

<div class="topic-metadata">

**Author:** [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Replies:** 2\
**Last updated:** [April 21, 2024, 8:31am UTC](https://discourse.julialang.org/t/is-there-an-alternative-to-the-agents-first-keyword/113272 "2024-04-21T08:31:35Z")

</div>

I’m upgrading my code to Agents.jl 6.x and I get an error stating that there is an unsupported keyword “agents\_first” for the run! function. I guess that the default is still the same (agents first) but I need the model\_…

---

## [Id error on creating an agent](https://discourse.julialang.org/t/id-error-on-creating-an-agent/113270)

<div class="topic-metadata">

**Author:** [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Replies:** 1\
**Last updated:** [April 20, 2024, 12:24pm UTC](https://discourse.julialang.org/t/id-error-on-creating-an-agent/113270 "2024-04-20T12:24:31Z")

</div>

I am in the process of updating my code for the Agents.jl 6.x package and I’m running into some trouble. I have the following Agents structures: @agent struct Actor(NoSpaceAgent) types::Set{Symbol} = Set{Symbol}() …

---

## [Linear Quadratic Integrator](https://discourse.julialang.org/t/linear-quadratic-integrator/113245)

<div class="topic-metadata">

**Author:** [@iabraham](https://discourse.julialang.org/u/iabraham)\
**Replies:** 3\
**Last updated:** [April 20, 2024, 8:52am UTC](https://discourse.julialang.org/t/linear-quadratic-integrator/113245 "2024-04-20T08:52:14Z")

</div>

The ControlSystems package seems to provide a lqr function for the LQR problem. I was wondering whether there was any plans to provide the lqi function for the Linear Quadratic Integrator problem. - e.g. Scilab or MATLAB …

---

## [How to define some predefined values to some part of the domain in gridap](https://discourse.julialang.org/t/how-to-define-some-predefined-values-to-some-part-of-the-domain-in-gridap/113254)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 0\
**Last updated:** [April 19, 2024, 9:38pm UTC](https://discourse.julialang.org/t/how-to-define-some-predefined-values-to-some-part-of-the-domain-in-gridap/113254 "2024-04-19T21:38:56Z")

</div>

Hi, I have a domain and I want to solve the pde to get the displacement and phase field. meanwhile I want to set the value of phase field in 3 surfaces near the supports and load line as 1 (s=1) I wrote this in julia u…

---

## [Fixedpoints for one dimensonal ODE DynamicalSystems.jl](https://discourse.julialang.org/t/fixedpoints-for-one-dimensonal-ode-dynamicalsystems-jl/113065)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 0\
**Last updated:** [April 17, 2024, 12:35pm UTC](https://discourse.julialang.org/t/fixedpoints-for-one-dimensonal-ode-dynamicalsystems-jl/113065 "2024-04-17T12:35:17Z")

</div>

Hello, i try calculate fixed points for one dimensional ODE and get next error: ERROR: MethodError: no method matching /(::Int64, ::SMatrix{1, 1, IntervalArithmetic.Interval{Float64}, 1}) Closest candidates are: /(::…

---

## [From Modelica source code to Julia](https://discourse.julialang.org/t/from-modelica-source-code-to-julia/80837)

<div class="topic-metadata">

**Author:** [@mzhenirovskyy](https://discourse.julialang.org/u/mzhenirovskyy)\
**Replies:** 15\
**Last updated:** [April 17, 2024, 2:06am UTC](https://discourse.julialang.org/t/from-modelica-source-code-to-julia/80837 "2024-04-17T02:06:26Z")

</div>

Hi All, Is there any way to import a Model from Modelica-file to Julia lang? I mean I have the model in the Modelica that can be simulated by Dymola. Of course, I can get the fmu compiled file and load it to Julia. But…

---

## [Solving a nonlinear equation using NonlinearSolve.jl with AutoFiniteDiff() yields errors about dual number](https://discourse.julialang.org/t/solving-a-nonlinear-equation-using-nonlinearsolve-jl-with-autofinitediff-yields-errors-about-dual-number/112988)

<div class="topic-metadata">

**Author:** [@LINGXIAO\_QIN](https://discourse.julialang.org/u/LINGXIAO_QIN)\
**Replies:** 2\
**Last updated:** [April 16, 2024, 12:13pm UTC](https://discourse.julialang.org/t/solving-a-nonlinear-equation-using-nonlinearsolve-jl-with-autofinitediff-yields-errors-about-dual-number/112988 "2024-04-16T12:13:18Z")

</div>

I am trying to solve a nonlinear equation, which is constructed using the thermophysical properties of fluids (via CoolProp package). An MWE is shown below. using NonlinearSolve, CoolProp function myfun\_P\_MWE(p, (T, i…

---

## [Sundials KLU Linear solver](https://discourse.julialang.org/t/sundials-klu-linear-solver/112954)

<div class="topic-metadata">

**Author:** [@jespfra](https://discourse.julialang.org/u/jespfra)\
**Replies:** 1\
**Last updated:** [April 15, 2024, 10:55am UTC](https://discourse.julialang.org/t/sundials-klu-linear-solver/112954 "2024-04-15T10:55:33Z")

</div>

Hi everyone, I am trying to use the KLU method as linear solver for solving an ODE problem using Sundials. I have tried to apply it to the CVODE\_BDF solver for a simple problem, the rober equation. However, when I prov…

---

## [Dynamical system of modelling two particle collisions](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922)

<div class="topic-metadata">

**Author:** [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Replies:** 4\
**Last updated:** [April 14, 2024, 5:40pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922 "2024-04-14T17:40:05Z")

</div>

Hello, I’m trying to model a system with collision dynamics. I’m well aware of Datseris’s DynamicalBillards, contrary to that what I’m studying is collision between 2 particles rather than the fixed geometry as in billa…

---

## [Setting up multi-output Gaussian process with Surrogates.jl](https://discourse.julialang.org/t/setting-up-multi-output-gaussian-process-with-surrogates-jl/112881)

<div class="topic-metadata">

**Author:** [@epi\_hannah](https://discourse.julialang.org/u/epi_hannah)\
**Replies:** 2\
**Last updated:** [April 14, 2024, 1:39pm UTC](https://discourse.julialang.org/t/setting-up-multi-output-gaussian-process-with-surrogates-jl/112881 "2024-04-14T13:39:51Z")

</div>

Hi all, I am trying to use Surrogates to train a Gaussian process surrogate to a model with 2 different outputs (i.e., a multi-output model). According to the Surrogates documentation I can use custom kriging in Stheno…

---

## [Implementation of algorithms ODE Problems differentialequations.jl](https://discourse.julialang.org/t/implementation-of-algorithms-ode-problems-differentialequations-jl/112840)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 2\
**Last updated:** [April 12, 2024, 5:45am UTC](https://discourse.julialang.org/t/implementation-of-algorithms-ode-problems-differentialequations-jl/112840 "2024-04-12T05:45:01Z")

</div>

Hello! Where i can find implementation of algorithms ODE Problems differentialequations.jl in repository? For example Vern9. Thank you for your help!

---

## [DiffEq: Discrete callback causes dt\<=dtmin](https://discourse.julialang.org/t/diffeq-discrete-callback-causes-dt-dtmin/104679)

<div class="topic-metadata">

**Author:** [@aaliqureshi](https://discourse.julialang.org/u/aaliqureshi)\
**Replies:** 6\
**Last updated:** [April 10, 2024, 4:07pm UTC](https://discourse.julialang.org/t/diffeq-discrete-callback-causes-dt-dtmin/104679 "2024-04-10T16:07:50Z")

</div>

Hello! I am simulating a DAE model as an ODEProblem using a constant mass matrix. A model parameter p changes from 0 to 1 at time t=t1 using DiscreteCallback. The solver returns dt\<=dtmin at t=t1 when p changes. Howeve…

---

## [DAE mass matrix formulation fails but implicit formulation works](https://discourse.julialang.org/t/dae-mass-matrix-formulation-fails-but-implicit-formulation-works/104940)

<div class="topic-metadata">

**Author:** [@aaliqureshi](https://discourse.julialang.org/u/aaliqureshi)\
**Replies:** 19\
**Last updated:** [April 7, 2024, 3:32pm UTC](https://discourse.julialang.org/t/dae-mass-matrix-formulation-fails-but-implicit-formulation-works/104940 "2024-04-07T15:32:27Z")

</div>

This question links to my previous post. I am simulating a DAE system and noticed that the mass matrix based formulation fails but the implicit DAE formulation works fine. Is this a bug or is there something else goi…

---

## [ContinuousDataDrivenProblem stuck if no time derivatives provided](https://discourse.julialang.org/t/continuousdatadrivenproblem-stuck-if-no-time-derivatives-provided/105758)

<div class="topic-metadata">

**Author:** [@Maxime-Fantino](https://discourse.julialang.org/u/Maxime-Fantino)\
**Replies:** 1\
**Last updated:** [April 7, 2024, 1:44pm UTC](https://discourse.julialang.org/t/continuousdatadrivenproblem-stuck-if-no-time-derivatives-provided/105758 "2024-04-07T13:44:55Z")

</div>

Hello, I am trying to do inference on particle dynamics with data coming from a simulator, using the DataDrivenDiffEq package. Similarly to what is done in the documentation (Automatically Discover Missing Physics by E…

---

## [Model discovery using Sparse Regression on UDE model](https://discourse.julialang.org/t/model-discovery-using-sparse-regression-on-ude-model/106698)

<div class="topic-metadata">

**Author:** [@gsh19](https://discourse.julialang.org/u/gsh19)\
**Replies:** 1\
**Last updated:** [April 7, 2024, 1:44pm UTC](https://discourse.julialang.org/t/model-discovery-using-sparse-regression-on-ude-model/106698 "2024-04-07T13:44:05Z")

</div>

Hi everyone, I am working on modeling the unknown physics of a non-autonomous system. The system has 5 states and 2 control inputs. The dynamics of states 1 to 3 are known precisely but those of states 4 and 5 are unkno…

---

## [Callbacks after integration step but before integration function](https://discourse.julialang.org/t/callbacks-after-integration-step-but-before-integration-function/103676)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 3\
**Last updated:** [April 7, 2024, 1:38pm UTC](https://discourse.julialang.org/t/callbacks-after-integration-step-but-before-integration-function/103676 "2024-04-07T13:38:51Z")

</div>

As an alternative to DAE definition or SavingCallbacks, I’m using a FunctionCallingCallback with DifferentialEquations.jl to solve algebraic states for an ODE. The callback would need to occur after the integration times…

---

## [Help modeling advection-diffusion equation with ModelingToolkit.jl](https://discourse.julialang.org/t/help-modeling-advection-diffusion-equation-with-modelingtoolkit-jl/105028)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 27\
**Last updated:** [April 7, 2024, 1:36pm UTC](https://discourse.julialang.org/t/help-modeling-advection-diffusion-equation-with-modelingtoolkit-jl/105028 "2024-04-07T13:36:10Z")

</div>

First time trying to use ModelingToolkit.jl in a project. Appreciate if someone can help with a simple 1D example of advection-diffusion: R \\frac{\\partial c}{\\partial t} = D \\frac{\\partial^2 c}{\\partial x^2} - v \\frac{\\…

---

## [NeuralPDE debuging: is it posible to get the loss of a point in the domain?](https://discourse.julialang.org/t/neuralpde-debuging-is-it-posible-to-get-the-loss-of-a-point-in-the-domain/105427)

<div class="topic-metadata">

**Author:** [@Knud\_Sorensen](https://discourse.julialang.org/u/Knud_Sorensen)\
**Replies:** 2\
**Last updated:** [April 7, 2024, 1:32pm UTC](https://discourse.julialang.org/t/neuralpde-debuging-is-it-posible-to-get-the-loss-of-a-point-in-the-domain/105427 "2024-04-07T13:32:27Z")

</div>

Hi. I am solving some differential equations with NeuralPDE and the solutions don’t look like expected. So, I really want to plot the loss at every point in the domain to see what is going on. Is there any way to get t…

---

## [Example for integro-differential equation with NeuralPDE does not run](https://discourse.julialang.org/t/example-for-integro-differential-equation-with-neuralpde-does-not-run/104603)

<div class="topic-metadata">

**Author:** [@TommasoStentella](https://discourse.julialang.org/u/TommasoStentella)\
**Replies:** 2\
**Last updated:** [April 7, 2024, 1:24pm UTC](https://discourse.julialang.org/t/example-for-integro-differential-equation-with-neuralpde-does-not-run/104603 "2024-04-07T13:24:15Z")

</div>

I am trying to use NeuralPDE for solving an integro-differential equation with the aim of later embedding a neural network in it. To begin with, I tried the example I found in the documentation, but it gives me an error: …

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

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