Skip to content

Commit 54c8e56

Browse files
committed
fix spelling
1 parent 30d4923 commit 54c8e56

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

docs/src/mathematical_model.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mathematical Model
22

3-
The core of the `NetworkDynamics.jl` package is the [`Network`](@ref) function. It accepts the functions describing the
3+
The core of the `NetworkDynamics.jl` package is the [`Network`](@ref) function. It accepts functions describing the
44
local dynamics on the edges and nodes of the graph `g` as inputs, and returns a composite function compatible with the
55
DifferentialEquations.jl syntax as output.
66

@@ -9,15 +9,15 @@ nd = Network(g, vertex_dynamics, edge_dynamics)
99
nd(dx, x, p, t)
1010
```
1111

12-
In general the local dynamics on the edges and nodes of a graph can be described through the use of (a) algebraic
13-
equations, (b) differential algebraic equation (DAEs) in mass matrix form or (c) ordinary differential equations (ODE).
12+
In general, the local dynamics on the edges and nodes of a graph can be described through the use of (a) algebraic
13+
equations, (b) differential algebraic equations (DAEs) in mass matrix form, or (c) ordinary differential equations (ODEs).
1414
The `NetworkDynamics.jl` package uses
1515
[Differential-Algebraic-Equations (DAE)](https://mathworld.wolfram.com/Differential-AlgebraicEquation.html) to express
1616
the overall network dynamics:
1717
```math
1818
M\,\frac{\mathrm{d}}{\mathrm{d}t}u = f^{\mathrm{nw}}(u, p, t)
1919
```
20-
where $M$ is a (possibly singular) mass matrix, $u$ is the internal state vector of the system, $p$ are the parameters
20+
where $M$ is a (possibly singular) mass matrix, $u$ is the internal state vector of the system, $p$ are the parameters,
2121
and $t$ is the time. To make this compatible with the solvers used in `OrdinaryDiffEq.jl`, the generated
2222
[`Network`](@ref) object is callable
2323
```
@@ -26,19 +26,19 @@ nw(du, u, p, t) # mutates du as an "output"
2626
and represents the right-hand-side (RHS) of the equation above. The mass-matrix $M$ is stored in the `Network` object
2727
as well.
2828

29-
## Modelling the Dynamics of the System
30-
Each component model $\mathrm c$ is modeled as a general input-output-system:
29+
## Modeling the Dynamics of the System
30+
Each component model $\mathrm c$ is modeled as a general input-output system:
3131
```math
3232
\begin{aligned}
3333
M_{\mathrm c}\,\frac{\mathrm{d}}{\mathrm{d}t}x_{\mathrm c} &= f^{\mathrm c}(x^{\mathrm c}, i_{\mathrm c}, p_{\mathrm c}, t)\\
3434
y^{\mathrm c} &= g^{\mathrm c}(x^\mathrm{c}, i_{\mathrm c}, p_{\mathrm c}, t)
3535
\end{aligned}
3636
```
3737
where $M_{\mathrm{c}}$ is the component mass matrix, $x^{\mathrm c}$ are the component states, $i^{\mathrm c}$ are the
38-
inputs of the component and $y^{\mathrm c}$ is the output of the component. If
38+
inputs of the component, and $y^{\mathrm c}$ is the output of the component. If
3939
$\mathrm{dim}(x^{\mathrm{c}}) = 0$, the number of internal states is 0.
4040

41-
The mathematical model of `NetworkDynamics.jl` splits the network system in two parts: the vertex and
41+
The mathematical model of `NetworkDynamics.jl` splits the network system into two parts: the vertex and
4242
the edge components (the nodes and edges, respectively). Instead of defining the $f^{\mathrm{nw}}$ by hand, `ND.jl`
4343
builds it automatically based on a list of decentralized nodal and edge dynamics that the user provides (the
4444
`VertexModel` and `EdgeModel` objects).
@@ -56,10 +56,10 @@ conceptual and not necessarily physical way.)
5656
<img src="../assets/mathmodel.svg" width="100%" height="100%"/>
5757
</picture>
5858
```
59-
In this graphical representation of a partial network graph
60-
three nodes are visible (node 1, node 2 and node 3) as well as the edges connecting node 1 and node 2 ($e_{\mathrm{12}}$).
59+
In this graphical representation of a partial network graph,
60+
three nodes are visible (node 1, node 2, and node 3) as well as the edges connecting node 1 and node 2 ($e_{\mathrm{12}}$).
6161
Above the network, you can see the dynamical systems for both nodes 1 and 2 as well as the connecting edge.
62-
The figure shows, how the outputs of the edge appears as input of the nodes and the output of the nodes appears as input of the edge models.
62+
The figure shows how the outputs of the edge appear as inputs to the nodes and the outputs of the nodes appear as inputs to the edge models.
6363

6464
### Vertex Models
6565
The equations of a (single-layer) full vertex model are:
@@ -101,17 +101,17 @@ $i^v$ and the model output $y^v$ (the vertex model output).
101101

102102

103103
### Edge Models
104-
In contrast to the vertex models, edge models in general have *two* inputs and *two* outputs, for both the source and
105-
the destination end of the edge. We commonly use `src` and `dst` to describe the source and destination end of an edge,
104+
In contrast to vertex models, edge models in general have *two* inputs and *two* outputs, for both the source and
105+
the destination end of the edge. We commonly use `src` and `dst` to describe the source and destination ends of an edge,
106106
respectively.
107107

108108
!!! note "On the directionality of edges"
109-
Mathematically, in a system defined on an undirected graph there is no difference between edge $(1,2)$ and
110-
edge $(2,1)$, because the edge has no direction. However, from an implementation point of view we always need to
111-
have some kind of ordering. For undirected graphs, the edges are always defined from `src -> dst` where `src < dst`
112-
(This convention matches the behavior of the `edges` iterator from `Graphs.jl`).
113-
I.e. the undirectional edge between nodes 1 and 2 will be always referenced as `1 -> 2`, never `2 -> 1`.
114-
The **source** and **destination** naming is related to this notion of directionality, it is not related to the actual flows, i.e.
109+
Mathematically, in a system defined on an undirected graph, there is no difference between edge $(1,2)$ and
110+
edge $(2,1)$, because the edge has no direction. However, from an implementation point of view, we always need to
111+
have some kind of ordering. For undirected graphs, the edges are always defined from `src -> dst` where `src < dst`
112+
(this convention matches the behavior of the `edges` iterator from `Graphs.jl`).
113+
I.e., the undirected edge between nodes 1 and 2 will always be referenced as `1 -> 2`, never `2 -> 1`.
114+
The **source** and **destination** naming is related to this notion of directionality; it is not related to the actual flows, i.e.,
115115
a system might exist where there is a net flow from destination to source.
116116

117117
The full edge model equations are:
@@ -138,21 +138,21 @@ edgef = EdgeModel(; f=fₑ, g=gₑ, mass_matrix=Mₑ, ...)
138138
Each edge has:
139139
1. two inputs:
140140
1. the node outputs of the source
141-
2. the destination end of the edge
141+
2. the node outputs of the destination end of the edge
142142
2. two outputs:
143-
1. the `dst` output (which is used as the input of the vertex at the destination end)
144-
2. the `src` output (which is used as the input of the vertex at the source end)
143+
1. the `dst` output (which is used as input for the vertex at the destination end)
144+
2. the `src` output (which is used as input for the vertex at the source end)
145145

146146
In general, the two edge outputs $y_{\mathrm{src}}$ and $y_{\mathrm{dst}}$ are **completely independent** because there
147147
is no implicit conservation law dictating that their values should be identical.
148-
An example for such an unbalanced systems is power lines in an energy grid with losses, where the power flowing into a line
148+
An example of such unbalanced systems is power lines in an energy grid with losses, where the power flowing into a line
149149
does not match the power flowing out of it, because some of the energy transported is lost in the form of heat.
150150
Another example would be a gas pipeline with some internal pressure: it is entirely possible to push in gas from both
151151
ends simultaneously. It would simply result in increased pressure within the pipe. For the (important) special cases
152-
where there is a strong correlation between source and destination output see the section on [Single Sided Edge Outputs](@ref) below.
152+
where there is a strong correlation between source and destination output, see the section on [Single Sided Edge Outputs](@ref) below.
153153

154154
The vertex models connected to the edge do not know whether they are at the 'src' or the 'dst' end of the edge.
155-
Therefore, the sign convention for both outputs of an edge must be identical. Typically, a positive flow represents
155+
Therefore, the sign convention for both outputs of an edge must be identical. Typically, a positive flow represents
156156
a flow *into* the connected vertex, whereas a negative flow represents a flow *out of* the connected vertex.
157157
```
158158
y_src ┌───────────────────┐ y_dst
@@ -162,11 +162,11 @@ a flow *into* the connected vertex, whereas a negative flow represents a flow *o
162162

163163
### Single Sided Edge Outputs
164164
Often, the edge output functions $g_\mathrm{src}$ and $g_\mathrm{dst}$ are not independent, but rather one of them is a function of the other.
165-
For example, in an edge model with flow conservation without internal storage, the flow magnitude at the source end is equal to the flow magnitude at the destination end (what flows in, must come out).
166-
Since the sign convention on both ends must be identical (e.g. positive flow is a flow towards the vertex) we get anti symmetric behavior: $y_\mathrm{src} = -y_\mathrm{dst}$.
165+
For example, in an edge model with flow conservation without internal storage, the flow magnitude at the source end is equal to the flow magnitude at the destination end (what flows in must come out).
166+
Since the sign convention on both ends must be identical (e.g., positive flow is a flow towards the vertex), we get antisymmetric behavior: $y_\mathrm{src} = -y_\mathrm{dst}$.
167167

168-
To accommodate such cases, we can use the concept of **single sided edge output functions**.
169-
A single sided output function only defines a function for one of the outputs:
168+
To accommodate such cases, we can use the concept of **single-sided edge output functions**.
169+
A single-sided output function only defines a function for one of the outputs:
170170

171171
```julia
172172
function g_single(y, xᵥ, v_src, v_dst, pₑ, t)
@@ -176,18 +176,18 @@ end
176176
```
177177

178178
There are multiple wrappers available to automatically convert them into double-sided edge output functions:
179-
- `Directed(g_single)` builds a double-sided function *which only couples* to the destination side (i.e. $y_{dst}=y$ and $y_{src} = 0$).
180-
- `Symmetric(g_single)` builds a double-sided function in which both ends receive `y` (i.e. $y = y_{src} = y_{dst})$.
181-
- `AntiSymmetric(g_single)` builds a double-sided function where the destination receives `y` and the source receives `-y` (i.e. $y=y_{dst}=-y_{src}$).
182-
- `Fiducial(g_single_src, g_single_dst)` builds a double-sided edge output function based on two single sided functions.
179+
- `Directed(g_single)` builds a double-sided function *which only couples* to the destination side (i.e., $y_{dst}=y$ and $y_{src} = 0$).
180+
- `Symmetric(g_single)` builds a double-sided function in which both ends receive `y` (i.e., $y = y_{src} = y_{dst}$).
181+
- `AntiSymmetric(g_single)` builds a double-sided function where the destination receives `y` and the source receives `-y` (i.e., $y=y_{dst}=-y_{src}$).
182+
- `Fiducial(g_single_src, g_single_dst)` builds a double-sided edge output function based on two single-sided functions.
183183

184184

185185
## Feed Forward Behavior
186186
!!! warning "Feed Forward Vertices"
187-
As of 11/2024, vertices with feed forward behaviour (FF) are not supported at all. Use [`ff_to_constraint`](@ref) to
187+
As of 11/2024, vertices with feed forward behavior (FF) are not supported at all. Use [`ff_to_constraint`](@ref) to
188188
transform them into vertex models without FF.
189189

190-
Component models can have a so-called Feed Forward behaviour, which provides a direct link between the input and the
190+
Component models can have a so-called feed forward behavior, which provides a direct link between the input and the
191191
output.
192192

193193
The most generic version of the component models can contain direct FFs from the input to the output. This means that
@@ -204,14 +204,14 @@ gᵥ(yᵥ, xᵥ, e_aggr, pᵥ, t)
204204
gₑ([y_src,] y_dst, xₑ, v_src, v_dst, pₑ, t)
205205
```
206206

207-
NetworkDynamics cannot couple two components with FFs to each other. But, it is always possible to transform
208-
feed forward behaviour to an internal state `x` with mass matrix entry zero to circumvent this problem. This
207+
NetworkDynamics cannot couple two components with FFs to each other. However, it is always possible to transform
208+
feed forward behavior to an internal state `x` with mass matrix entry zero to circumvent this problem. This
209209
transformation can be performed automatically using [`ff_to_constraint`](@ref).
210210

211-
Concretely, NetworkDynamics distinguishes between 4 types of feed forward behaviours of `g` functions based on the
211+
Concretely, NetworkDynamics distinguishes between 4 types of feed forward behaviors of `g` functions based on the
212212
[`FeedForwardType`](@ref) trait.
213213
The feed forward type is inferred automatically based on the provided function `g` (this is done by inspecting the available
214-
method signatures for `g`, i.e. network dynamics checks how many arguments your `g` function takes)
214+
method signatures for `g`, i.e., NetworkDynamics checks how many arguments your `g` function takes).
215215
If the automatic inference of feed forward type fails, the user may specify it explicitly using the `ff` keyword
216216
argument of the Edge/VertexModel constructor.
217217

0 commit comments

Comments
 (0)