Library
Public Interface
The following functions are designed for public use
NetworkDynamics.DDEVertex
NetworkDynamics.ODEEdge
NetworkDynamics.ODEVertex
NetworkDynamics.StaticDelayEdge
NetworkDynamics.StaticEdge
NetworkDynamics.StaticVertex
NetworkDynamics.idx_containing
NetworkDynamics.network_dynamics
NetworkDynamics.sum_coupling!
NetworkDynamics.syms_containing
NetworkDynamics.network_dynamics
— Functionnetwork_dynamics(vertices!, edges!, g; parallel = false)
Assembles the the dynamical equations of the network problem into an ODEFunction
compatible with the DifferentialEquations.jl
solvers. Takes as arguments an array of VertexFunctions vertices!
, an array of EdgeFunctions edges!
and a Graphs.jl
object g
. The optional argument parallel
is a boolean value that denotes if the central loop should be executed in parallel with the number of threads set by the environment variable JULIA_NUM_THREADS
.
NetworkDynamics.StaticVertex
— FunctionStaticVertex(; f, dim, sym)
Wrapper for ODEVertex with 0 mass matrix, i.e. static behaviour / algebraic constraint in mass matrix form.
f
describes the local behaviour at a static node and has to respect the following calling syntax
f(v, edges, p, t) -> nothing
Here v
, p
and t
are the usual arguments, while edges
is an arrays containing the edges for which the described vertex is the destination (in-edges for directed graphs).
dim
is the number of independent variables in the vertex equations and sym
is an array of symbols for these variables.
For more details see the documentation.
NetworkDynamics.ODEVertex
— TypeODEVertex(; f, dim, mass_matrix, sym)
Wrapper that ensures compatibility of a mutating function f
with the key constructor network_dynamics
.
f
describes the local behaviour at a dynamic node and has to respect the following calling syntax
f(dv, v, edges, p, t) -> nothing
Here dv
, v
, p
and t
are the usual ODE arguments, while edges
is an Array containing the edges for which the vertex is the destination (in-edges for directed graphs).
dim
is the number of independent variables in the vertex equations and sym
is an array of symbols for these variables. mass_matrix
is an optional argument that defaults to the identity matrix I
. If a mass matrix M is given the system M * dv = f
will be solved.
For more details see the documentation.
NetworkDynamics.DDEVertex
— TypeDDEVertex(; f, dim, mass_matrix, sym)
Wrapper that ensures compatibility of a mutating function f
with the key constructor network_dynamics
.
f
describes the local behaviour at a dynamic node and has to respect the following calling syntax
f(dv, v, edges, h, p, t) -> nothing
Here dv
, v
, p
and t
are the usual ODE arguments, while edges
is an Arry of incoming edges. h
is the history array for v
.
dim
is the number of independent variables in the edge equations andsym
is an array of symbols for these variables.mass_matrix
is an optional argument that defaults to the identity matrixI
. If a mass matrix M is given the systemM * de = f
will be solved.
For more details see the documentation.
NetworkDynamics.StaticEdge
— TypeStaticEdge(; f, dim, coupling, sym)
Wrapper that ensures compatibility of a mutating function f
with the key constructor network_dynamics
.
f
describes the local behaviour at a static edge and has to respect the following calling syntax
f(e, v_s, v_t, p, t) -> nothing
Here e
, p
and t
are the usual arguments, while v_s
and v_d
are arrays containing the vertices which are the source and destination of the described edge.
dim
is the number of independent variables in the edge equations andsym
is an array of symbols for these variables.coupling
is a Symbol describing if the EdgeFunction is intended for a directed graph (:directed
) or for an undirected graph ({:undirected, :symmetric, :antisymmetric, :fiducial}
).:directed
is intended for directed graphs.:undirected
is the default option and is only compatible with SimpleGraph. In this case f should specify the coupling from a source vertex to a destination vertex.:symmetric
and:antisymmetric
trigger performance optimizations, iff
has that symmetry property.:fiducial
lets the user specify both the coupling from src to dst, as well as the coupling from dst to src and is intended for advanced users, i.e. the edge gets passed a vector of2dim
edge states, where the firstdim
elements will be presented to the dst and the seconddim
elements will be presented to src,
For more details see the documentation.
NetworkDynamics.ODEEdge
— TypeODEEdge(; f, dim, mass_matrix, sym)
Wrapper that ensures compatibility of a mutating function f
with the key constructor network_dynamics
.
f
describes the local behaviour at a dynamic edge and has to respect the following calling syntax
f(de, e, v_s, v_t, p, t) -> nothing
Here de
, e
, p
and t
are the usual arguments, while v_s
and v_d
are arrays containing the vertices which are the source and destination of the described edge.
dim
is the number of independent variables in the edge equations and sym
is an array of symbols for these variables. For more details see the documentation. mass_matrix
is an optional argument that defaults to the identity matrix I
. If a mass matrix M is given the system M * de = f
will be solved.
For more details see the documentation.
NetworkDynamics.StaticDelayEdge
— TypeStaticDelayEdge(; f, dim, coupling, sym)
Like a static edge but with extra arguments for the history of the source and destination vertices. This is NOT a DDEEdge.
NetworkDynamics.syms_containing
— Functionsyms_containing(nd, expr)
Find all symbols present in a network_dynamics that contain the string, regex or symbol expr
.
NetworkDynamics.idx_containing
— Functionidx_containing(nd, expr)
Find all indices of variables with symbols containing the string, regex or symbol expr
NetworkDynamics.sum_coupling!
— Functionsum_coupling!(e_sum, dst_edges)
A small utility function for writing diffusion dynamics. It provides the sum of all incoming edges.