AbstractODEProblemParSetter

The following type implements Translating between parameters and Problem for AbstractODEProblems.

See the specific implementation ODEProblemParSetter.

Helper functions to access state and parameters

MTKHelpers.axis_stateFunction
axis_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.

source
MTKHelpers.keys_stateFunction
keys_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.

source
MTKHelpers.count_stateFunction
count_state(::AbstractODEProblemParSetter) 
count_par(::AbstractODEProblemParSetter)

Report the number of problem states, problem parameters and optimized parameters respectively.

source
MTKHelpers.symbols_stateFunction
symbols_state(sys::ODESystem)
symbols_par(sys::ODESystem)

Extract the basic symbols without namespace of system states and system parameters.

source
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.

source

Labeling

MTKHelpers.label_stateMethod
label_state(pset::AbstractODEProblemParSetter, u::AbstractVector) 
label_par(pset::AbstractODEProblemParSetter, par::AbstractVector)

Produce a labeled version, i.e. a ComponentVector of initial states, parameters respectively.

source
MTKHelpers.name_stateMethod
name_state(pset, u::AbstractVector) 
name_par(pset, par::AbstractVector)

Produce a NamedVector of given state, parameters, or optimized vars.

source

ODEProblemParSetter

MTKHelpers.ODEProblemParSetterType
ODEProblemParSetter(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 problem
  • par_template: all the parameters of the problem
  • popt_template: the parameter/initial states to be optimized. If given as Tuple or AbstractVector of symbols, then a template ComponentVector is extracted from state_template and par_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).

source

ODEProblemParSetterConcrete

To support Concrete ProblemUpdater the following variant of ODEProblemParSetter is provided.