Questions tagged [differentialequations.jl]
103 questions
1
vote
0 answers
Incorporating forcing functions in the ODE model for Bayesian estimation
I am new to Turing package in Julia, and need some help!
I have been trying to estimate the parameters of a model with a discrete forcing function q(t), where the values of q(t) are discrete and are read from a file. The code is throwing up a…

Vembha
- 33
- 5
1
vote
1 answer
Simulating a reflecting boundary SDEProblem
I'm trying to simulate a reflecting boundary. Based on the suggestions found here: Stochastic differential equation with callback in Julia I tried
using DifferentialEquations
using Plots
using Random
m(x,p,t) -> 0
s(x,p,t) -> 1
x0 = 0.1
tspan =…

Shffl
- 396
- 3
- 18
1
vote
1 answer
Issue with solving a DDE in Julia
I am trying to use Julia’s DifferentialEquations.jl package to solve a DDE system. I was able to solve my problem for two objects using the code below
clearconsole()
@time using DifferentialEquations
const two_bubble =
let σ=0.0725, ρ=998, …

Hossein Haghi
- 39
- 3
1
vote
1 answer
Solving a gradient dependet ODE in Julia
I am trying to solve the following ODE using DifferentialEquation.jl :
Where P is a matrix used for a projection. I am having a hard time imagining how to solve this problem. Is there a way to directly solve it using Julia? Or should I try and…
user12158459
1
vote
1 answer
DifferentialEquations.jl Not Working w/ Julia 1.5?
using DifferentialEquations
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
using Plots
plot(sol,linewidth=5,title="Solution to the linear ODE with a thick line",
…

GrayLiterature
- 381
- 2
- 13
1
vote
1 answer
Switching ODE functions in Julia
Fom document of DifferentialEquations package, switching between sets of ODE functions can be done using a parameter as
function f(du,u,p,t)
if p==0
du[1] = 2u[1]
else
du[1] = - u[1]
end
du[2] = -u[2]
end
Is this possible to use…

Chris
- 93
- 6
1
vote
1 answer
How to use ImplicitEuler solver in Julia?
when trying to call Implicit Euler for solving an ODE, I receive the following error:
MethodError: no method matching OrdinaryDiffEq.NLNewtonConstantCache(::Float32, ::Array{Float64,2}, ::LinearAlgebra.LU{Float64,Array{Float64,2}}, ::Bool, ::Bool,…

SimonAda
- 167
- 1
- 9
1
vote
1 answer
Callbacks in Julia's DiffEqBiological
I've a reaction network defined using DiffEqBiological in Julia. At particular times, I want to change the parameters. However, I can't seem to be able to change them. Though not what I want to do, I am able to affect the variables.
I wrote a…

Hruodland
- 13
- 3
1
vote
1 answer
Output the index of the event in the solution when using VectorContinuousCallback in Julia/DifferentialEquations
I have a dynamical system for which many events could occur. I want to terminate the integration of the trajectory on an event, but I also want to known which event has been activated.
The workaround I found is to use a global variable to save the…

xdze2
- 3,986
- 2
- 12
- 29
1
vote
1 answer
Trouble getting Differential Equation to solve via diffeqpy
Recently, I learned about diffeqpy and wanted to give it a try. I had this Julia code, which worked and gave expected results:
using DifferentialEquations
using Plots
function bcm4(resid, dx, x, params, t)
# Algebraic equations
resid[11] =…

winkmal
- 622
- 1
- 6
- 16
1
vote
2 answers
Extracting derivatives (du/dt) from an ODE problem
I have multiple ODE problems that I am solving. where I need the solutions (u) and derivative of the solutions (du). For smaller ODEs it is practical for me to do the following
using DifferentialEquations
function SB(du,u,p,t)
du[1]=@. u[2]
…

Hossein Haghi
- 39
- 3
1
vote
1 answer
Stochastic differential equation with callback in Julia
I'm trying to solve a diffusion problem with reflecting boundaries, using various SDE integrators from DifferentialEquations.jl. I thought I could use the FunctionCallingCallback to handle the boundaries, by reflecting the solution about the domain…

Tor
- 658
- 6
- 19
1
vote
1 answer
using DifferentialEquations: u is not updating
I believe there is a bug in this code. For the sake of brevity though I will just write the function which defines the ODE
function clones(du,u,p,t)
(Nmut,f) = p
# average fitness
phi = sum(f.*u)
# constructing mutation kernel
…

Gregory
- 341
- 1
- 2
- 10
1
vote
1 answer
Julia 0.0.6 LoadError on ODE solve
I am trying to solve a simple Lotka Volterra model
using DifferentialEquations
f2 = @ode_def_nohes LVtest begin
dx = x*(1.0 - A*x - B*y)
dy = y*(rho - C*x - D*y)
end A B C D rho
u0 = [1;1]
tspan = (0.0,300.0)
p = [0.2,0.3,0.35,0.2,0.25]
prob =…

Gregory
- 341
- 1
- 2
- 10
1
vote
1 answer
Solve Poisson Equation for 3d mesh
I am trying to solve the poisson-equation div v = -curl w to simulate Incompressible Flow of a mesh in 3 dimensional space.
What I did:
I found the ODE example and how to solve the Poisson Equation.
My problems/questions are:
How to define -curl w…

Quonux
- 2,975
- 1
- 24
- 32