Skip to content

Commit 9ec7d48

Browse files
committed
mention that SYmbol isntances can be used as parameters
1 parent bc3d75c commit 9ec7d48

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicalSystemsBase"
22
uuid = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"
33
repo = "https://github.com/JuliaDynamics/DynamicalSystemsBase.jl.git"
4-
version = "3.5.6"
4+
version = "3.5.7"
55

66
[deps]
77
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

src/core/dynamicalsystem_interface.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ See also the DynamicalSystems.jl tutorial online for an example.
6060
In ModelingToolkit.jl v9 the default `split` behavior of the parameter container
6161
is `true`. This means that the parameter container is no longer a `Vector{Float64}`
6262
by default, which means that you cannot use integers to access parameters.
63-
In this case, the `index` given to `current_parameter/set_parameter!`
64-
must be the symbolic parameter binding.
63+
It is recommended to keep `split = true` (default) and only access
64+
parameters via their symbolic parameter binding.
6565
Use `structural_simplify(sys; split = false)` to allow accessing parameters
6666
with integers again.
6767
@@ -180,9 +180,10 @@ Return the state `u` of `ds` _observed_ at "index" `i`. Possibilities are:
180180
- `i::Function` returns `f(current_state(ds))`, which is asserted to be a real number.
181181
- `i::SymbolLike` returns the value of the corresponding symbolic variable.
182182
This is valid only for dynamical systems referrencing a ModelingToolkit.jl model
183-
which also has `i` as one of its listed variables. This can be a formal state variable
184-
or an "observed" variable according to ModelingToolkit.jl. In short, it can be anything
185-
that could index the solution object `sol = ModelingToolkit.solve(...)`.
183+
which also has `i` as one of its listed variables (either uknowns or observed).
184+
Here `i` can be anything can be anything
185+
that could index the solution object `sol = ModelingToolkit.solve(...)`,
186+
such as a `Num` or `Symbol` instance with the name of the symbolic variable.
186187
187188
For [`ProjectedDynamicalSystem`](@ref), this function assumes that the
188189
state of the system is the full state space state, not the projected one
@@ -331,8 +332,7 @@ set_state!(ds, u) = errormsg(ds)
331332
set_state!(ds::DynamicalSystem, value::Real, index) → u
332333
333334
Set the `i`th variable of `ds` to `value`. The `index` can be an integer or
334-
a symbolic variable that is a state variable for systems that reference a
335-
ModelingToolkit.jl model.
335+
a symbolic-like index for systems that reference a ModelingToolkit.jl model.
336336
337337
Calling instead `set_state!(u, value, index, ds)` will modify the given
338338
state `u` and return it, leaving `ds` unaltered.
@@ -368,7 +368,7 @@ and the `value` to set it to. This function works for any type of parameter cont
368368
(array/dictionary/composite types) provided the `index` is appropriate type.
369369
370370
The `index` can be a traditional Julia index (integer for arrays, key for dictionaries,
371-
or symbol for composite types). It can also be a symbolic variable.
371+
or symbol for composite types). It can also be a symbolic variable or `Symbol` instance.
372372
This is valid only for dynamical systems referring a ModelingToolkit.jl model
373373
which also has `index` as one of its parameters.
374374

0 commit comments

Comments
 (0)