You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/tutorials/domain_connections.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ end
115
115
nothing #hide
116
116
```
117
117
118
-
To see how the domain works, we can examine the set parameter values for each of the ports `src.port` and `vol.port`. First we assemble the system using `structural_simplify()` and then check the default value of `vol.port.ρ`, whichs points to the setter value `fluid₊ρ`. Likewise, `src.port.ρ`, will also point to the setter value `fluid₊ρ`. Therefore, there is now only 1 defined density value `fluid₊ρ` which sets the density for the connected network.
118
+
To see how the domain works, we can examine the set parameter values for each of the ports `src.port` and `vol.port`. First we assemble the system using `structural_simplify()` and then check the default value of `vol.port.ρ`, whichs points to the setter value `fluid.ρ`. Likewise, `src.port.ρ`, will also point to the setter value `fluid.ρ`. Therefore, there is now only 1 defined density value `fluid.ρ` which sets the density for the connected network.
119
119
120
120
```@repl domain
121
121
sys = structural_simplify(odesys)
@@ -181,7 +181,7 @@ end
181
181
nothing #hide
182
182
```
183
183
184
-
After running `structural_simplify()` on `actsys2`, the defaults will show that `act.port_a.ρ` points to `fluid_a₊ρ` and `act.port_b.ρ` points to `fluid_b₊ρ`. This is a special case, in most cases a hydraulic system will have only 1 fluid, however this simple system has 2 separate domain networks. Therefore, we can connect a single fluid to both networks. This does not interfere with the mathematical equations of the system, since no unknown variables are connected.
184
+
After running `structural_simplify()` on `actsys2`, the defaults will show that `act.port_a.ρ` points to `fluid_a.ρ` and `act.port_b.ρ` points to `fluid_b.ρ`. This is a special case, in most cases a hydraulic system will have only 1 fluid, however this simple system has 2 separate domain networks. Therefore, we can connect a single fluid to both networks. This does not interfere with the mathematical equations of the system, since no unknown variables are connected.
Copy file name to clipboardExpand all lines: src/inputoutput.jl
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -71,11 +71,11 @@ function is_bound(sys, u, stack = [])
71
71
In the following scenario
72
72
julia> observed(syss)
73
73
2-element Vector{Equation}:
74
-
sys₊y(tv) ~ sys₊x(tv)
75
-
y(tv) ~ sys₊x(tv)
76
-
sys₊y(t) is bound to the outer y(t) through the variable sys₊x(t) and should thus return is_bound(sys₊y(t)) = true.
77
-
When asking is_bound(sys₊y(t)), we know that we are looking through observed equations and can thus ask
78
-
if var is bound, if it is, then sys₊y(t) is also bound. This can lead to an infinite recursion, so we maintain a stack of variables we have previously asked about to be able to break cycles
74
+
sys.y(tv) ~ sys.x(tv)
75
+
y(tv) ~ sys.x(tv)
76
+
sys.y(t) is bound to the outer y(t) through the variable sys.x(t) and should thus return is_bound(sys.y(t)) = true.
77
+
When asking is_bound(sys.y(t)), we know that we are looking through observed equations and can thus ask
78
+
if var is bound, if it is, then sys.y(t) is also bound. This can lead to an infinite recursion, so we maintain a stack of variables we have previously asked about to be able to break cycles
79
79
=#
80
80
u ∈Set(stack) &&returnfalse# Cycle detected
81
81
eqs =equations(sys)
@@ -119,17 +119,17 @@ function same_or_inner_namespace(u, var)
119
119
nv =get_namespace(var)
120
120
nu == nv ||# namespaces are the same
121
121
startswith(nv, nu) ||# or nv starts with nu, i.e., nv is an inner namespace to nu
122
-
occursin('₊', string(getname(var))) &&
123
-
!occursin('₊', string(getname(u))) # or u is top level but var is internal
122
+
occursin('.', string(getname(var))) &&
123
+
!occursin('.', string(getname(u))) # or u is top level but var is internal
124
124
end
125
125
126
126
functioninner_namespace(u, var)
127
127
nu =get_namespace(u)
128
128
nv =get_namespace(var)
129
129
nu == nv &&returnfalse
130
130
startswith(nv, nu) ||# or nv starts with nu, i.e., nv is an inner namespace to nu
131
-
occursin('₊', string(getname(var))) &&
132
-
!occursin('₊', string(getname(u))) # or u is top level but var is internal
131
+
occursin('.', string(getname(var))) &&
132
+
!occursin('.', string(getname(u))) # or u is top level but var is internal
133
133
end
134
134
135
135
"""
@@ -139,11 +139,11 @@ Return the namespace of a variable as a string. If the variable is not namespace
0 commit comments