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/callbacks.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ refer to the [Cascading Failure](@ref) example.
21
21
## Component-based Callback functions
22
22
In practice, events often act locally, meaning they only depend and act on a
23
23
specific component or type of component. `NetworkDynamics.jl` provides a way of
24
-
defining those callbacks on a component level and automaticially combine them into performant
24
+
defining those callbacks on a component level and automatically combine them into performant
25
25
[`VectorContinuousCallback`](@extref SciMLBase.VectorContinuousCallback) and [`DiscreteCallback`](@extref SciMLBase.DiscreteCallback) for the whole network.
26
26
27
27
The main entry points are the types [`ContinousComponentCallback`](@ref),
@@ -72,10 +72,10 @@ vectoraffect = ComponentAffect([:u], [:p]) do u, p, event_idx, ctx
72
72
end
73
73
end
74
74
```
75
-
Notably, the `syms` (here `:u`) can *exclusivly* refer to "ordinary" states, since they are now writable.
75
+
Notably, the `syms` (here `:u`) can *exclusively* refer to "ordinary" states, since they are now writable.
76
76
However the affect gets passed a `ctx` "context" object, which is a named tuple which holds additional context like the integrator object, the component model, the index of the component model, the current time and so on. Please refer to the [`ComponentAffect`](@ref) docstring for a detailed list.
77
77
78
-
Lastly we need to define the actuall callback object using [`ContinousComponentCallback`](@ref)/[`VectorContinousComponentCallback`](@ref):
78
+
Lastly we need to define the actual callback object using [`ContinuousComponentCallback`](@ref)/[`VectorContinuousComponentCallback`](@ref):
When combining the component based callbacks to a single callback, NetworkDynamics will check whether states and or parameters changed during the affect and automaticially call [`SciMLBase.auto_dt_reset!`](@extref) and [`save_parameters!`](@ref) if necessary.
104
+
When combining the component based callbacks to a single callback, NetworkDynamics will check whether states and or parameters changed during the affect and automatically call [`SciMLBase.auto_dt_reset!`](@extref) and [`save_parameters!`](@ref) if necessary.
105
105
106
106
107
107
## Normal DiffEq Callbacks
108
108
Besides component based callbacks, it is also possible to use "normal" DiffEq
109
109
callbacks together with `NetworkDynamics.jl`.
110
110
It is far more powerful but also more cumbersome compared to the component based callback functions.
111
-
To access states and parameters of specific components, we havily rely on the [Symbolic Indexing](@ref) features.
111
+
To access states and parameters of specific components, we heavily rely on the [Symbolic Indexing](@ref) features.
112
112
113
113
```julia
114
114
using SymbolicIndexingInterface as SII
@@ -134,7 +134,7 @@ Please note a few important things here:
134
134
135
135
```julia
136
136
functionaffect!(integrator, vidx)
137
-
p =NWParameter(integrator) # get symbolicially indexable parameter object
137
+
p =NWParameter(integrator) # get symbolically indexable parameter object
138
138
p.v[vidx, :some_vertex_parameter] =0# change some parameter
139
139
auto_dt_reset!(integrator)
140
140
save_parameters!(integrator)
@@ -159,4 +159,4 @@ Once the `condition` and `affect!` is defined, you can use the [`SciMLBase.Conti
159
159
To extract or plot timeseries of observed states under *time variant
160
160
parameters* (i.e. parameters that are changed in a callback), those changes
161
161
need to be recorded using the [`save_parameters!`](@ref) function whenever `p` is changed.
162
-
When using [ComponentCallback](@ref NetworkDynamics.ComponentCallback), NetworkDynamics will automaticially check for changes in `p` and save them if necessary.
162
+
When using [ComponentCallback](@ref NetworkDynamics.ComponentCallback), NetworkDynamics will automatically check for changes in `p` and save them if necessary.
0 commit comments