Skip to content

Commit f080955

Browse files
author
Est
committed
intermediate state
1 parent eb054c7 commit f080955

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

docs/src/mathematical_model.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ conceptual and not necessarily physical way.)
5757
</picture>
5858
```
5959
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 edge connecting node 1 and node 2 ($e_{\mathrm{12}}$).
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.
6262
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.
6363

@@ -109,10 +109,10 @@ respectively.
109109
Mathematically, in a system defined on an undirected graph there is no difference between edge $(1,2)$ and
110110
edge $(2,1)$, because the edge has no direction. However, from an implementation point of view we always need to
111111
have some kind of ordering. For undirected graphs, the edges are allways 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 actuall flows, i.e.
115-
a system might exists where there is a net flow from destination to source.
112+
(this convention matches the behavior of the `edges` iterator from `Graphs.jl`).
113+
Specifically, the undirectional edge between nodes 1 and 2 always be referenced as `1 -> 2`, never `2 -> 1`.
114+
The **source** and **destination** naming is related to this notion of directionality, rather than to the actual flows, i.e.
115+
a system might exist where there is a net flow from destination to source.
116116

117117
The full edge model equations are:
118118
```math
@@ -135,29 +135,38 @@ end
135135
edgef = EdgeModel(; f=fₑ, g=gₑ, mass_matrix=Mₑ, ...)
136136
```
137137

138-
Each edge has two inputs: the node outputs of the source and destination end of the edge.
139-
Similarily, they also have two outputs:
140-
1. the `dst` output which is used as the input of the vertex at the destination end
141-
2. the `src` output which is used as the input of the vertex at the source end.
138+
Each edge has:
139+
1. two inputs:
140+
1. the node outputs of the source
141+
2. the destination end of the edge
142+
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)
142145

143-
In general, the two edge outputs $y_{\mathrm{src}}$ and $y_{\mathrm{dst}}$ are **completely independent**. There is not implicit conservation law or something like that.
144-
Examples for such unbalanced systems are power lines with losses, i.e. the power flowing into the line does not match the power flowing out of the line, because some energy is lost as heat. Another example would be a gas pipeline with some internal pressure: it es entirely possible to push in gas from both ends simultaneously, which would just result in increased pressure.
145-
For the (important) special case where there is a strong correlation between source and destination output see the section on [Single Sided Edge Outputs](@ref) below.
146+
In general, the two edge outputs $y_{\mathrm{src}}$ and $y_{\mathrm{dst}}$ are **completely independent** because there
147+
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
149+
does not match the power flowing out of it, because some of the energy transported is lost in the form of heat.
150+
Another example would be a gas pipeline with some internal pressure: it is entirely possible to push in gas from both
151+
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.
146153

147-
The vertex models connected to the edge do not know whether they are at the src or dst end of the edge.
148-
Therefore, the sign convention for both outputs of an edge must be identical, typically, a positive flow represents a flow *into* the connected vertex.
154+
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
156+
a flow *into* the connected vertex, whereas a negative flow represents a flow *out of* the connected vertex.
149157
```
150158
y_src ┌───────────────────┐ y_dst
151159
V_src o───←───┤ internal dynamics ├───→───o V_dst
152160
└───────────────────┘
153161
```
154162

155-
### Single Sided Edge Outputs
156-
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.
157-
For example, in a system with a conservation law, the output at the source end is equal to the output at the destination end, i.e. $y_\mathrm{src} = -y_\mathrm{dst}$.
163+
### Single Sided Edge Outputs
164+
In cases where a conservation law is present in a system, the edge output functions $g_\mathrm{src}$ and
165+
$g_\mathrm{dst}$ are not independent, but rather one of them is a function of the other. For example, in a system with
166+
a conservation law, the output at the source end is equal to the output at the destination end, i.e. $y_\mathrm{src} = -y_\mathrm{dst}$.
158167

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

162171
```julia
163172
function g_single(y, xᵥ, v_src, v_dst, pₑ, t)

0 commit comments

Comments
 (0)