Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoupledDDEs #220

Open
awage opened this issue Oct 4, 2024 · 5 comments
Open

CoupledDDEs #220

awage opened this issue Oct 4, 2024 · 5 comments
Labels
big project This is a significantly large project that requires scientific knowledge as well new-system Addition of a new type of system wanted feature Something that we would like to have!

Comments

@awage
Copy link
Contributor

awage commented Oct 4, 2024

I saw the fantastic work on CoupledSDEs. What about other specialized solvers? In particular DDEs or of interest in the dynamical system community.

At first sight a wrapper around DDEProblem should be doable.

Any thoughts based on your experience integrating SDEs?

@awage awage added wanted feature Something that we would like to have! integrator interface labels Oct 4, 2024
@Datseris
Copy link
Member

Datseris commented Oct 4, 2024

If you look at #212 it was quite a bit of work and back and forth. I think the whole process took a couple of months on and off... :D @oameye was the main driver so he can write about how hard it was.

For me what was mindblowing was that Attractors.jl worked out of the box for a multistable SDE FitzHugh Nagumo. We didn't have to change anything there !

With DDEs we have a problem to solve: what would be dimension(ds)? As DDEs are effectively infinitely dimensional. What would be current_state(ds)? What sorts of additional quierying function you would need? Would the delay time be part of the parameters or something special like the σ of the SDEs?

I know nearly nothing about how numerically solving a DDE works unless you do it in discretized time. And I'd guess some knowledge on that front would be important to know how to handle this object as a dynamical system.

But in principle, as long as this implements the DynamicalSystem api, that's all we need.

@Datseris Datseris added new-system Addition of a new type of system big project This is a significantly large project that requires scientific knowledge as well and removed integrator interface labels Oct 4, 2024
@awage
Copy link
Contributor Author

awage commented Oct 9, 2024

I had a first try at defining CoupledDDES and it works for the examples I tried.

function duffing_delay!(du, u, h, p, t)
    α = p[1]; F = p[2]; ω = p[3]; tau = p[4]
    hist = h(p, t - tau)[1]
    du[1] = -u[1]*((1+α)*u[1]^2 -1) + α*hist + F*sin*t)
end
α = -0.925; F = 0.525; ω = 1.; tau = 1.065; x = 1.; y = 1.;   
lags = [tau]; 
h(p,t) =  [x,y]
u0 = [x, y]
ds = CoupledDDEs(duffing_delay!, u0, [α, F, ω, tau]; h = h, constant_lags = lags)
y,t = trajectory(ds, 1000)

It just works!

Now, before beginning the PR process I have to design tests. But it will be very similar to the architecture of CoupledSDE
It may take a while.

@Datseris
Copy link
Member

Datseris commented Oct 9, 2024

With DDEs we have a problem to solve: what would be dimension(ds)? As DDEs are effectively infinitely dimensional. What would be current_state(ds)? What sorts of additional quierying function you would need? Would the delay time be part of the parameters or something special like the σ of the SDEs?

Before tests you need to figure out the above, as they are conceptual issues, not technical.

@Datseris
Copy link
Member

Datseris commented Oct 9, 2024

But it is of course fantastic that things work straightforwardly :) yet another testament of how nice is the DynamicalSystem interface. Which makes sense as it has been through 4 reworks... :P

@awage
Copy link
Contributor Author

awage commented Oct 9, 2024

I literally copied the file continuous_time_sde.jl and replaced SDE for DDE everywhere. Some small changes here and there and it worked.

For your specific questions:

  • dimension(ds) -> dimension of the state vector.
  • current_state(ds) -> state vector.
    Maybe you can request the history function h. Although I would ask the DelayDiffEq.jl gurus for pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big project This is a significantly large project that requires scientific knowledge as well new-system Addition of a new type of system wanted feature Something that we would like to have!
Projects
None yet
Development

No branches or pull requests

2 participants