Skip to content

Commit 83cd859

Browse files
authored
Merge pull request #2219 from hstrey/parentscopedoc
changed ParentScope docs to better reflect best usage
2 parents b9f285d + e411c8e commit 83cd859

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/src/basics/Composition.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,15 @@ In a hierarchical system, variables of the subsystem get namespaced by the name
137137

138138
```julia
139139
@parameters t a b c d e f
140-
p = [a #a is a local variable
141-
ParentScope(b) # b is a variable that belongs to one level up in the hierarchy
142-
ParentScope(ParentScope(c))# ParentScope can be nested
143-
DelayParentScope(d) # skips one level before applying ParentScope
144-
DelayParentScope(e, 2) # second argument allows skipping N levels
145-
GlobalScope(f)]
140+
141+
# a is a local variable
142+
b = ParentScope(b) # b is a variable that belongs to one level up in the hierarchy
143+
c = ParentScope(ParentScope(c)) # ParentScope can be nested
144+
d = DelayParentScope(d) # skips one level before applying ParentScope
145+
e = DelayParentScope(e, 2) # second argument allows skipping N levels
146+
f = GlobalScope(f)
147+
148+
p = [a, b, c, d, e, f]
146149

147150
level0 = ODESystem(Equation[], t, [], p; name = :level0)
148151
level1 = ODESystem(Equation[], t, [], []; name = :level1) level0

0 commit comments

Comments
 (0)