Questions tagged [differentialequations.jl]
103 questions
3
votes
1 answer
How to read corresponding value at specified time in DiscreteCallback?
Similar to this question, I am trying to solve this ODE with a time-dependent input parameter. It consists of a series of discrete callbacks. At certain times, a parameter is changed (not a state!). Times and values are stored in a nx2 Array. But I…

winkmal
- 622
- 1
- 6
- 16
3
votes
1 answer
Using results from ODEProblem while it is running
I’m currently studying the documentation of DifferentialEquations.jl and trying to port my older computational neuroscience codes for using it instead of my own, less elegant and performant, ODE solvers. While doing this, I stumbled upon the…

Arets Paeglis
- 3,856
- 4
- 35
- 44
3
votes
1 answer
Animating the solution to an ODE in Julia
I have a julia code:
using DifferentialEquations
using Plots
using ParameterizedFunctions
plotly()
lorenz = @ode_def Lorenz begin
dx = σ*(y-x)
dy = ρ*x-y-x*z
dz = x*y-β*z
end σ = 10. β = 8./3. ρ => 28.
u0 = [1., 5., 10.]
tspan = (0., 2.)
prob…

93a
- 106
- 5
2
votes
1 answer
Decoupled ODEs in Julia
The Lorenz attractor is the archetypal example in Julia documentation for solving systems of ODEs using DifferentialEquations.jl. Suppose I would like to solve that system for one thousand different initial conditions, keeping the attractor…

JustLearning
- 1,435
- 1
- 1
- 9
2
votes
0 answers
Julia DifferentialEquations.jl all variable output
I have the following example:
using DifferentialEquations
function test1(du,u,p,t)
a,b,c = p
d=a^0.1*(t+1)
e=u[1]/a
f=u[2]/d
du[1] = a*u[1]
du[2] = d*u[2]
du[3] = b*u[2] - c*u[3]
end
p = (2,0.75,0.8)
u0 =…

eod
- 449
- 3
- 17
2
votes
1 answer
TypeError in Julia/Turing when sampling for a forced differential equation
I am new to Julia and Turing and am trying to fit a forced 0-D box ODE to data, but I get type error when doing sampling.
Following this page (solve system of ODEs with read in external forcing), I added an interpolation handle of the forcing as a…

Duo Chan
- 31
- 3
2
votes
2 answers
Is there any faster method to solve differential equations with multidimensional array
I want a solve a complex network system involving higher-order interaction terms acting through a multidimensional array. I have written the corresponding code but it takes too much time to get my results. Is there any possible way to solve the…

MSA
- 55
- 3
2
votes
1 answer
How can I evaluate and take the derivative of a neural net in Julia
I have solved a differential equation with a neural net. I leave code below with an example. I want to be able to compute the first derivative of this neural net with respect to its input "x" and evaluate this derivative for any "x".
1- Notice that…

Gooseeee
- 31
- 4
2
votes
0 answers
ModelingToolkit: 2nd order differential equation and equivalent 1st order system give different answers
I am trying to solve a 2nd order differential equation with ModelingToolkit.jl in Julia:
using ModelingToolkit
using DifferentialEquations: solve
using Plots: plot
@variables s ρ(s) Dρ(s)
@parameters N,M,Λ
D = Differential(s)
ω = sqrt(N -…

Mentastin
- 80
- 5
2
votes
1 answer
How to use ModelingToolkit.jl to create variables dynamically
The main problem is that my variables would be determined only after running the codes (because the number of variables is not fixed).
In old version ModelingToolkit.jl, I used the following codes to generate a variable.
my_var =…

Pei Huang
- 344
- 1
- 6
2
votes
1 answer
FFTW.jl for 2D array: Diffusion only happening in 1D
From what I have read, using FFTW.jl / AbstractFFTs.jl's fft(A) when A is a 2D array should perform fft in 2D, not column-wise. Any idea why I am seeing only column-wise diffusion when (I think) I'm adding scaled second spatial derivative to u(t,x),…

Alex Crocker
- 35
- 5
2
votes
1 answer
Julia: When to type true or false in DifferentialEquations systems?
I'm drawing inspiration from the source code of DiffEqFinancial.jl to properly set up my own system. I do not understand the purpose of true and false in the code snippets below:
sde_f =…

PatrickT
- 10,037
- 9
- 76
- 111
2
votes
1 answer
Is it possible to use callbacks to access a single trajectory in Julia's DifferentialEquations Ensemble Problems?
I am new to Julia and trying to use the Julia package DifferentialEquations to simultaneously solve for several conditions of the same set of coupled ODEs. My system is a model of an experiment and in one of the conditions, I increase the amount of…

JellyFish55
- 23
- 3
2
votes
1 answer
Second order delay differential equation in Julia
I'm new to Julia programming I managed to solve some 1st order DDE (Delay Differential Equations) and ODE. I now need to solve a second order delay differential equation but I didn't manage to find documentation about that (I previously used…

Brian Sinquin
- 23
- 6
2
votes
1 answer
Callback function choosing problem in DifferentialEquations.jl
I have an object, when it reaches a threshold, it will enter a silence period, which I use a parameter (I call it ode_status) flipping between 1 and 0 to determine whether performing the ODE or not.
The threshold is implemented by…

Pei Huang
- 344
- 1
- 6