Questions tagged [differentialequations.jl]
103 questions
1
vote
1 answer
How can I implement an integration termination callback in DifferentialEquations.jl to solve an ODE?
Need help implementing a integration termination callback in DifferentialEquations.jl.
Greetings,
I have the code
function height(dh, h, p, t)
dh[1] = -1*sqrt(h[1])
end
h0 = [14]
tspan = (0.0, 10.0)
prob =…

G. Church
- 15
- 3
1
vote
1 answer
Julia DifferentialEquations.jl: EnsembleProblem where tspan is varied
I am currently working on some ensemble problems where I vary quite a few parameters of an ODE. The ODE in code is given by sys! below. It certainly is quite easy to vary the parameters, w, plateu_cycle, px and py using the Parallel Ensemble…

derdotte
- 81
- 7
1
vote
1 answer
Exclamation mark in Julia "!" after function in scripts
I am trying to save multiple solutions of my ODE in an Array. Right now this is what I got:
sols = []
for i in 1:numSim
if solver == "Rosenbrock23"
solution = solve(odeprob, Rosenbrock23())
append!(sols, solution)
end
end
As you can see…

Marc Schneider
- 11
- 2
1
vote
1 answer
How to optimize the julia differential equation solution
I am running the following Julia code to solve a set of differential equations, but it takes too much time, and sometimes my machine gets crushed. Is there any solution to reduce the running time and memory usage? I am not too familiar with Julia.…

MSA
- 55
- 3
1
vote
1 answer
How do I setup the timestep when using DifferentialEquations.jl in Julia for an irregular time series?
Playing with the harmonic oscillator, the differential equation is driven by a regular time series
w_i in the millisecond range.
ζ = 1/4pi # damped ratio
function oscillator!(du,u,p,t)
…

Bouarfa Mahi
- 59
- 1
- 4
1
vote
1 answer
Method for measuring the percentual of time span in a Differential Equation solver
I use Differential Equations from julia (previously solve_ivp from scipy) and it would be very convenient for me to have a notion of the amount of time steps that have occured.
For example, if my simulation has a timespan = (0.0, 10e4), the method…

Prometeu
- 55
- 5
1
vote
0 answers
Using the GPU with Lux and NeuralPDE Julia
I am trying to run a model using the GPU, no problem with the CPU. I think somehow using measured boundary conditions is causing the issue but I am not sure. I am following this example: https://docs.sciml.ai/dev/modules/NeuralPDE/tutorials/gpu/.…

user1321988
- 513
- 2
- 6
1
vote
1 answer
BoundsError when providing sparsity pattern to DifferentialEquations.jl
I'm trying to solve a set of stiff ordinary differential equations using DifferentialEquations.jl. It works fine when I'm just providing the ODE functions with or without the Jacobian, however when I'm trying to provide the sparsity pattern using…

Thonash
- 13
- 2
1
vote
1 answer
Does the command "expectation" in Distributions.jl not work recently?
I tried the following commands
using DiffEqUncertainty, Distributions
expectation(g, prob, u0_dist, p)
Of course, the second command is not correct and many arguments are still missing, but it still serves for the purpose of nWME (not Working…

Chris
- 93
- 6
1
vote
1 answer
Sciml conflict using DiffEqFlux
I'm getting an error using sciml to train a DiffEqFlux tutorial. I used the same exact code with some modifications last summer with no problems but can't seem to find a solution. I am using Julia v.1.7.1
using DiffEqFlux, OrdinaryDiffEq, Flux,…

Adam Davis
- 13
- 2
1
vote
1 answer
Puzzling result from boundary condition code in Julia BVP solver
I am trying to solve a boundary value problem in Julia, following the example found here, using the BoundaryValueDiffEq package. In the boundary condition function, the example requires a for loop to update each index individually, à la
function…

Alex
- 13
- 2
1
vote
1 answer
Solving IVPs with vectors in Julia DifferentialEquations
I am fairly new to Julia, so apologies in advance. I am trying to simultaneously solve two differential equations in Julia and having trouble. I have a MWE in Python, which is:
import numpy as np
from scipy import solve_ivp
def derivatives(T,y):
…

Aidan
- 21
- 6
1
vote
0 answers
Error when using CorrelatedWienerProcess with VectorContinuousCallback
I am trying to simulate stochastic population dynamics using CorrelatedWienerProcess to add the noise. To prevent populations going negative I am using callbacks. Ideally I would like to use VectorContinuousCallback so I can automatically generate…

thomalpas
- 11
- 1
1
vote
1 answer
How to solve a 4th order differential equation in space and time variables in Julia
I am relatively new to solving differential equations in Julia and thus cant figure out how to solve a higher order ode in 2 independent variables(space and time) and thus would request for assistance.
I am trying to plot the curve using Julia…

Rodash
- 13
- 2
1
vote
0 answers
Heston model example from DifferentialEquations.jl giving Bridging distribution error
While trying to run a code which is paraphrasing the DE tutorial on SDE's, I'm getting the following stacktrace (only the first few lines):
Bridging distribution is unknown. Cannot use adapativity
Stacktrace:
[1] error(s::String)
@ Base…

Tom
- 11
- 3