AbstractODEProblemParSetter
The following type implements Translating between parameters and Problem for AbstractODEProblems.
MTKHelpers.AbstractODEProblemParSetter — TypeSupport translation between parameter vectors and AbstractODEProblem.
Takes care of mapping optimized parameters to subset of
- state
u0, and - parameters
p
In addition to the AbstractProblemParSetter functions, which accessing and labelling parameter vectors, it provides functions that access and label problem state and parameters: axis_state, count_state, keys_state, symbols_state, label_state, name_state
See the specific implementation ODEProblemParSetter.
Helper functions to access state and parameters
MTKHelpers.axis_state — Functionaxis_state(pset::AbstractODEProblemParSetter)
axis_state_scalar(pset::AbstractODEProblemParSetter)
axis_par(pset::AbstractODEProblemParSetter)Report the Axis, i.e. nested component symbols of problem states, and problem parameters respectively. There is a scalarized version, where symbolic arrays are scalarized, to support updating a subset of the indices. Returns an AbstractAxis.
MTKHelpers.keys_state — Functionkeys_state(::AbstractODEProblemParSetter)
keys_par(::AbstractODEProblemParSetter)Report the keys problem states, problem parameters. This usually correspdonds to keys(axis), but if there is a classification, similar to keys_paropt, report the keys below this classification.
MTKHelpers.count_state — Functioncount_state(::AbstractODEProblemParSetter)
count_par(::AbstractODEProblemParSetter)Report the number of problem states, problem parameters and optimized parameters respectively.
MTKHelpers.symbols_state — Functionsymbols_state(sys::ODESystem)
symbols_par(sys::ODESystem)Extract the basic symbols without namespace of system states and system parameters.
symbols_state(pset::AbstractODEProblemParSetter)
symbols_par(pset::AbstractODEProblemParSetter)
symbols_paropt(pset::AbstractODEProblemParSetter)Report the names, i.e. symbols of problem states, problem parameters respectively, i.e. the concatenation of components. Similar to ComponentArrays.label, but inferred from Axis object.
Reports the scalarized version of symbolic array, because the ordering of components is not fixed.
Labeling
MTKHelpers.label_state — Methodlabel_state(pset::AbstractODEProblemParSetter, u::AbstractVector)
label_par(pset::AbstractODEProblemParSetter, par::AbstractVector)Produce a labeled version, i.e. a ComponentVector of initial states, parameters respectively.
MTKHelpers.name_state — Methodname_state(pset, u::AbstractVector)
name_par(pset, par::AbstractVector)Produce a NamedVector of given state, parameters, or optimized vars.
ODEProblemParSetter
MTKHelpers.ODEProblemParSetter — TypeODEProblemParSetter(state_template,par_template,popt_template)
ODEProblemParSetter(sys::ODESystem, popt_template)Helps keeping track of a subset of initial states and parameters to be optimized.
Arguments
state_template: ComponentVector or Axis of all the initial states of the problempar_template: all the parameters of the problempopt_template: the parameter/initial states to be optimized. If given as Tuple or AbstractVector of symbols, then a template ComponentVector is extracted fromstate_templateandpar_template.
If all of state_template, par_template, and popt_template are type-inferred Axes, then also the constructed ODEProblemParSetter is type-inferred.
The states and parameters can be extracted from an ModelingToolkit.ODESystem.
Note the similar ODEProblemParSetterConcrete with template parameters, which supports type-stable calls (see Concrete ProblemUpdater).
ODEProblemParSetterConcrete
To support Concrete ProblemUpdater the following variant of ODEProblemParSetter is provided.
MTKHelpers.ODEProblemParSetterConcrete — TypeODEProblemParSetterConcreteHelps keeping track of a subset of initial states and parameters to be optimized. Similar to ODEProblemParSetter, but with axis and length information as type parameters.
It is constructed by get_concrete(ODEProblemParSetter(...)). `