Skip to content

Commit 51bd5e8

Browse files
docs: add docs for Equality, Flow, Stream and instream
1 parent 81a2cd6 commit 51bd5e8

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

src/systems/connectors.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ is_domain_connector(s) = isconnector(s) && get_connector_type(s) === DomainConne
9494

9595
get_systems(c::Connection) = c.systems
9696

97+
"""
98+
$(TYPEDSIGNATURES)
99+
100+
`instream` is used when modeling stream connections. It is only allowed to be used on
101+
`Stream` variables.
102+
103+
Refer to the [Connection semantics](@ref connect_semantics) section of the docs for more
104+
information.
105+
"""
97106
instream(a) = term(instream, unwrap(a), type = symtype(a))
98107
SymbolicUtils.promote_symtype(::typeof(instream), _) = Real
99108

src/variables.jl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,50 @@ end
9191

9292
### Connect
9393
abstract type AbstractConnectType end
94+
"""
95+
$(TYPEDEF)
96+
97+
Flag which is meant to be passed to the `connect` metadata of a variable to affect how it
98+
behaves when the connector it is in is part of a `connect` equation. `Equality` is the
99+
default value and such variables when connected are made equal. For example, electric
100+
potential is equated at a junction.
101+
102+
For more information, refer to the [Connection semantics](@ref connect_semantics) section
103+
of the docs.
104+
105+
See also: [`Symbolics.connect`](@ref), [`@connector`](@ref), [`Flow`](@ref),
106+
[`Stream`](@ref).
107+
"""
94108
struct Equality <: AbstractConnectType end # Equality connection
109+
"""
110+
$(TYPEDEF)
111+
112+
Flag which is meant to be passed to the `connect` metadata of a variable to affect how it
113+
behaves when the connector it is in is part of a `connect` equation. `Flow` denotes that
114+
the sum of marked variable in all connectors in the connection set must sum to zero. For
115+
example, electric current sums to zero at a junction (assuming appropriate signs are used
116+
for current flowing in and out of the function).
117+
118+
For more information, refer to the [Connection semantics](@ref connect_semantics) section
119+
of the docs.
120+
121+
See also: [`Symbolics.connect`](@ref), [`@connector`](@ref), [`Equality`](@ref),
122+
[`Stream`](@ref).
123+
"""
95124
struct Flow <: AbstractConnectType end # sum to 0
125+
"""
126+
$(TYPEDEF)
127+
128+
Flag which is meant to be passed to the `connect` metadata of a variable to affect how it
129+
behaves when the connector it is in is part of a `connect` equation. `Stream` denotes that
130+
the variable is part of a special stream connector.
131+
132+
For more information, refer to the [Connection semantics](@ref connect_semantics) section
133+
of the docs.
134+
135+
See also: [`Symbolics.connect`](@ref), [`@connector`](@ref), [`Equality`](@ref),
136+
[`Flow`](@ref).
137+
"""
96138
struct Stream <: AbstractConnectType end # special stream connector
97139

98140
"""

0 commit comments

Comments
 (0)