Skip to content

Commit

Permalink
Heterogeneous lags for networks with delay (#104)
Browse files Browse the repository at this point in the history
* refactor submodules

* remove unused code

* set up a simple test

* remove internal exports

* first attempts

* adding type information everywhere

* minor

* Static Edge promotion is not used anymore

* remove history from NetworkDE

* tuple syntax not necessary anymore

* fixing the tests

* simplify tests (minor)

* new example with delay

* wrap `h`, change function signature

* adjustments to new conventions

* bump version

* test on 1.8

* update docs with DDE

* update dde test

* Literate compatible example

* rename

* remove compat

* fix arguments

* Update tests.yml

* Update src/NetworkDiffEq.jl

Co-authored-by: Hans Würfel <[email protected]>

* Update NetworkDiffEq.jl

* Improve docstrings

* fix test

* Apply suggestions from code review

Co-authored-by: Hans Würfel <[email protected]>

* hopefully lower docs build time

Co-authored-by: Hans Würfel <[email protected]>

Closes #39.
  • Loading branch information
lindnemi authored Jun 22, 2022
1 parent e514126 commit 9978f01
Show file tree
Hide file tree
Showing 20 changed files with 445 additions and 357 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NetworkDynamics"
uuid = "22e9dc34-2a0d-11e9-0de0-8588d035468b"
authors = ["Frank Hellmann <[email protected]>, Michael Lindner <[email protected]>"]
version = "0.7.1"
version = "0.8"

[deps]
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Expand Down
7 changes: 3 additions & 4 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[deps]
DelayDiffEq = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
NetworkDynamics = "22e9dc34-2a0d-11e9-0de0-8588d035468b"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"

[compat]
Documenter = "0.26"
6 changes: 3 additions & 3 deletions docs/localmake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ julia localmake.jl
python3 -m http.server --bind localhost
=#


using Pkg
Pkg.activate(@__DIR__)
Pkg.develop(PackageSpec(; path=dirname(@__DIR__))) # adds the package this script is called from
Expand All @@ -22,6 +21,7 @@ makedocs(; sitename="NetworkDynamics",
"accessing_edge_variables.md",
"Tutorials" => ["Getting started" => "getting_started_with_network_dynamics.md",
"Directed and weighted graphs" => "directed_and_weighted_graphs.md",
"Delay differential equations" => "getting_started_with_DDEs.md",
"Delay differential equations" => "kura_delay.md",
"Heterogeneous systems" => "heterogeneous_system.md",
"Stochastic differential equations" => "SDEVertex.md"]])
"Stochastic differential equations" => "SDEVertex.md"
]])
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ makedocs(; sitename = "NetworkDynamics",
"Directed and weighted graphs" => "directed_and_weighted_graphs.md",
"Heterogeneous systems" => "heterogeneous_system.md",
"Stochastic differential equations" => "SDEVertex.md",
"Delay differential equations" => "getting_started_with_DDEs.md"]])
"Delay differential equations" => "kuramoto_delay.md"]])

deploydocs(; repo="github.com/PIK-ICoNe/NetworkDynamics.jl.git",
devbranch="main")
6 changes: 3 additions & 3 deletions docs/src/BasicConstructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The function then defaults to using the identity as mass matrix and `[:v for i i

### [`DDEVertex`](@ref)

If a vertex has local dynamics described by a delay differential equation (DDE) the local dynamics need to have the signature `vertexfunction!(dv, v, edges, h_v, p, t)`, where `h_v` are the history values of `v`. Then the `VertexFunction` is constructed as
If a vertex has local dynamics described by a delay differential equation (DDE) the local dynamics need to have the signature `vertexfunction!(dv, v, edges, h_v, p, t)`, where `h_v` is an automatically generated wrapper of the global history function, providing history values for`v`. Then the `VertexFunction` is constructed as

```julia
DDEVertex(vertexfunction!, dim, mass_matrix, sym)
Expand Down Expand Up @@ -150,12 +150,12 @@ In this case the function defaults to using the identity matrix as mass matrix a

### [`StaticDelayEdge`](@ref)

This constructor is used when edge variables depend on past values of the vertex variables. In this case the `edgefunction!` has to accept two additional arguments `h_v_s` and `h_v_d` that hold the history of `v_s` and `v_d`. *Static* means that the edge depends only on the dynamics of the vertices the edge is connected to and not on an internal derivative of the edge variables itself.
This constructor is used when edge variables depend on past values of the vertex variables. In this case the `edgefunction!` has to accept two additional arguments `h_v_s` and `h_v_d` that hold the (automatically generated) localised history functions of `v_s` and `v_d`. *Static* means that the edge depends only on the dynamics of the vertices the edge is connected to and not on an internal derivative of the edge variables itself.

As an example for such system, we show a diffusive coupling with delay:

```julia
edgefunction! = (e, v_s, v_d, h_v_s, h_v_d, p, t) -> e .= 0.1 * (h_v_s .- v_d)
edgefunction! = (e, v_s, v_d, h_v_s, h_v_d, p, t) -> e .= 0.1 * (h_v_s(t - p) .- v_d)
```

The `EdgeFunction` object is constructed as
Expand Down
194 changes: 0 additions & 194 deletions docs/src/getting_started_with_DDEs.md

This file was deleted.

Loading

2 comments on commit 9978f01

@lindnemi
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/62880

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.0 -m "<description of version>" 9978f016e29cadce87432d200df279850587f8f2
git push origin v0.8.0

Please sign in to comment.