Questions tagged [differentialequations.jl]
103 questions
1
vote
1 answer
terminating the integration of ode after some convergence test in DiffEqPhysics Julia
Recently I started to be familiar with DiffEqPhysics and DifferentialEquations package of Julia. I'm wondering if there is a way (like callback functions) to terminate the solver with certain output convergence condition. For example if the result…

nero_bin
- 65
- 5
1
vote
2 answers
solve system of ODEs with read in external forcing
In Julia, I want to solve a system of ODEs with external forcings g1(t), g2(t) like
dx1(t) / dt = f1(x1, t) + g1(t)
dx2(t) / dt = f2(x1, x2, t) + g2(t)
with the forcings read in from a file.
I am using this study to learn Julia and the package…

LSchueler
- 1,414
- 12
- 23
1
vote
1 answer
Running an ODEProblem until given a signal
Is it possible for the timespan of an ODEProblem to be open-ended, i.e. for the problem to run until given an external signal (possibly via a discrete callback with an appropriate condition)? Intuitively, this would mean giving something like tspan…

Arets Paeglis
- 3,856
- 4
- 35
- 44
1
vote
1 answer
Generate function in a loop for DifferentialEquations in Julia
Taking the Lorenz example (JuliaDiffEq github)
function lorenz(t,u,du)
du[1] = 10.0*(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
If I had to generate equations in a loop, I would try to concatenation…

umayfindurself
- 123
- 3
- 18
1
vote
1 answer
Method error when using DifferentialEquations.jl Julia package
I'm trying to solve an ode45 differential equation with the DifferentialEquation.jl package but I'm getting a method error.
using DifferentialEquations
M = 400; m = 35;
C = 3e3; c = 300;
K = 50e3; k = 200e3;
A = 0.05; L = 0.5; vh = 13.9
MM = [M…

maikkirapo
- 155
- 9
1
vote
1 answer
Using DifferentialEquations package in Julia to solve matrix ODE
I would like to solve:
[\mathbf{M} \ddot{ \mathbf{U} }+ \mathbf{C} \dot{ \mathbf{U} }+ \mathbf{K} \mathbf{U} = \mathbf{P}(t)]
Or, in state-space form:
[\dot{\mathbf{Y}}=f(\mathbf{Y},t)]
where:
[\mathbf{Y} = \left[ \begin{array}{ c} \mathbf{U} \…

Thanh Nguyen
- 83
- 8
0
votes
0 answers
How can I solve a non-autonomous ODE using DifferentialEquations.jl and Julia
How to solve this autonomous ODE using DifferentialEquations.jl?
I'm using Pluto notebooks for the Differential Equations class I'm teaching this semester.
I'm having problems using DifferentialEquations.jl to solve this non-autonomous ODE:
`u'(t) =…

G. Church
- 15
- 3
0
votes
1 answer
Sundials for larger system of chemical plant
I am trying to solve a rather larger system of differential algebraic equations (DAEs) using Sundials. The DAEs contain both algebraic and differential variables.
To get the initial conditions for the DAEs, I am using Ipopt and Jump, solving the…

Raggen
- 1
- 1
0
votes
1 answer
How to use a callback in DifferentialEquations.jl to simulate a hammer blow to a mass in a spring-mass system?
I'm teaching Differential Equations and am using Pluto notebooks with DifferentialEquations.jl to supplement the course. We are currently trying to model a spring-mass system that is subject to an impulse of 10 Newton-seconds (hammer blow) at a…

G. Church
- 15
- 3
0
votes
1 answer
Passing Jacobian to Julia through the diffeqpy python package
I have a Python package that defines an ODE y'=f(y) corresponding to the semi-discretisation in space of a heat-like equation.
I want to test some integrators availabe in the DifferentialEquations module from Julia, without rewriting everything in…

Laurent90
- 284
- 1
- 10
0
votes
2 answers
How to solve the error "UndefVarError: InterpolatingAdjoint not defined" using differentialequations.jl in Julia
I'm trying to solve the LotkaVolterra problem that Chris Rackauckas explained in the JuliaCon 2020 and get an error when try to calculate the loss between the prediction and the values.
I have a separate Project Environment for this exercise with…

David
- 25
- 1
- 8
0
votes
2 answers
Dynamic function invocation, InvalidIRError with DiffEqGPU.EnsembleGPUKernel
EDIT4: The problem seems to be much larger and I will be refraining from further investigating this type of EnsembleProblem on GPU. Below is the last working code (that has nothing to do anymore with the actual problem I want to solve) and what to…

derdotte
- 81
- 7
0
votes
1 answer
storing the solution of differential equation takes too long time
I am solving a differential equation whose solution comes up with size (2000,2000000),
i.e., size(sol)=(2000,2000000).
Now I want to store the time evolution of first 1000 variable to an array.
for instance say,
x=sol[1:1000,:];
and from this…

MSA
- 55
- 3
0
votes
0 answers
Analytic solution to differential equation does not show same result as numerical solution
I have attempted to solve the differential equation $\frac{dy}{dt} = -ay^3 $ analytically. My solution is
$y = \sqrt{\frac{1}{2[C_4-at]}}$
When I attempt to use the odeint function in scipy.integrate, I do not get the same graphed result
#Import…

Cyclops
- 1
0
votes
1 answer
DynamicalODEProblem not compatible with EnsembleProblem?
I'm trying to use the EnsembleProblem feature, where in my case prob is a DynamicalODEProblem(f1, f2, v0, u0, tspan). I'd like my ensemble to span different initial conditions for the same ODE.
Example 1 in this tutorial explains how to establish an…

JustLearning
- 1,435
- 1
- 1
- 9