@@ -216,10 +216,12 @@ See also [`initial_parameters`](@ref), [`current_parameter`](@ref), [`set_parame
216216current_parameters (ds:: DynamicalSystem ) = ds. p
217217
218218"""
219- current_parameter(ds::DynamicalSystem, index)
219+ current_parameter(ds::DynamicalSystem, index [,p] )
220220
221- Return the specific parameter corresponding to `index`,
221+ Return the specific parameter of `ds` corresponding to `index`,
222222which can be anything given to [`set_parameter!`](@ref).
223+ `p` defaults to [`current_parameters`](@ref) and is the parameter container
224+ to extract the parameter from, which must match layout with its default value.
223225"""
224226function current_parameter (ds:: DynamicalSystem , index, p = current_parameters (ds))
225227 prob = referrenced_sciml_prob (ds)
@@ -351,7 +353,7 @@ function set_state!(u::AbstractArray, value::Real, i, ds::DynamicalSystem)
351353end
352354
353355"""
354- set_parameter!(ds::DynamicalSystem, index, value)
356+ set_parameter!(ds::DynamicalSystem, index, value [, p] )
355357
356358Change a parameter of `ds` given the `index` it has in the parameter container
357359and the `value` to set it to. This function works for any type of parameter container
@@ -361,6 +363,10 @@ The `index` can be a traditional Julia index (integer for arrays, key for dictio
361363or symbol for composite types). It can also be a symbolic variable.
362364This is valid only for dynamical systems referring a ModelingToolkit.jl model
363365which also has `index` as one of its parameters.
366+
367+ The last optional argument `p` defaults to [`current_parameters`](@ref) and is
368+ the parameter container whose value is changed at the given index.
369+ It must match layout with its default value.
364370"""
365371function set_parameter! (ds:: DynamicalSystem , index, value, p = current_parameters (ds))
366372 # internal function is necessary so that we are able to call `u_modified!` for ODEs.
0 commit comments