Initialization data, concrete problems and saved values
Source:R/scimlbase-interface.R
scimlbase_initialization.RdSciMLBase's interface between ModelingToolkit and the solvers.
Usage
OverrideInitData(
initializeprob,
update_initializeprob = NULL,
initializeprobmap = NULL,
initializeprobpmap = NULL,
metadata = NULL
)
get_initial_values(prob, ...)
initialize_dae(integ, initializealg = NULL)
is_overdetermined_initialization(prob)
remake_initialization_data(prob, u0 = NULL, p = NULL)
updated_u0_p(prob, u0 = NULL, p = NULL)
late_binding_update_u0_p(prob, u0 = NULL, p = NULL)
RemakeInitializationDataContext(...)
LateBindingUpdateU0PContext(...)
get_concrete_problem(prob, ...)
get_concrete_u0(prob, ...)
get_concrete_p(prob, ...)
promote_tspan(tspan)
promote_u0(u0, p = NULL, t = NULL)
prepare_initial_state(u0)
unwrap_parameters(p)
get_updated_symbolic_problem(prob, u0 = NULL, p = NULL, ...)
get_save_idxs_and_saved_subsystem(prob, save_idxs)
SavedSubsystem(indexp, t = NULL, saved_subsystem = NULL)
SavedSubsystemWithFallback(saved_subsystem, fallback = NULL)
get_saved_state_idxs(x)
get_saved_subsystem(sol)
get_saveable_values(integ, idxs = NULL)
save_discretes(integ)
save_discretes_if_enabled(integ)
save_final_discretes(integ)
create_parameter_timeseries_collection(sol)
set_ut(integ, u, t)
postamble(integ)
get_sol(integ)
split_callbacks(cb)
getindepsym(x)
getindepsym_defaultt(x)
get_root_indp(x)
plottable_indices(x)
symbolic_interpolation(sol, idxs, t)
ImmutableODEProblem(...)
ImmutableNonlinearProblem(...)
StandardODEProblem()
StandardDAEProblem()
StandardDDEProblem()
StandardNonlinearProblem()
StandardBVProblem()
StandardSecondOrderBVProblem()
DefaultOptimizationCache(...)
ODENLStepData(prob)
SymbolicLinearInterface(update_A, update_b, sys = NULL, ...)
get_new_A_b(prob, p = prob$p)
check_prob_alg_pairing(prob, alg)
detect_cycles(map)Arguments
- initializeprob, update_initializeprob, initializeprobmap, initializeprobpmap, metadata
Fields of the initialization data.
- prob
A problem.
- ...
Further fields or arguments.
- integ
An integrator.
- initializealg
A DAE initialization algorithm.
- u0, p, t
New values.
- tspan
A time span.
- save_idxs
Indices or variables.
- indexp, saved_subsystem, fallback
Fields of a saved subsystem.
- x
A problem, solution or system.
- sol
A solution.
- idxs
Indices.
- u
A state.
- cb
Callbacks.
- update_A, update_b
Functions of the parameters.
- sys
A system.
- alg
An algorithm.
- map
A list of formulas or equations
var ~ expr.
Details
OverrideInitData(initializeprob, update_initializeprob, initializeprobmap, initializeprobpmap)attaches an initialization problem to a problem built from R functions (ODEProblem(..., initialization_data = )):get_initial_values(prob)solves it and maps its solution to the initial values (initializeprobmap(sol)) and parameters (initializeprobpmap(prob, sol)); for problems of aSystemit returns the values ModelingToolkit's initialization found.initialize_dae(integ)(Julia'sinitialize_dae!) makes the algebraic values of an integrator consistent again.is_overdetermined_initialization(prob)tells whether the initialization system has more equations than unknowns.remake_initialization_data(prob, u0, p),updated_u0_p(prob, u0, p)andlate_binding_update_u0_p(prob, u0, p)give the initialization data or the numeric initial values and parameters of a problem with new values;RemakeInitializationDataContext()andLateBindingUpdateU0PContext()hold their arguments.get_concrete_problem(prob),get_concrete_u0(prob)andget_concrete_p(prob)return the problem, initial values and parameters as the solver sees them;promote_tspan(),promote_u0(),prepare_initial_state()andunwrap_parameters()normalize them, andget_updated_symbolic_problem(prob, u0, p)is the problem with new values.solve(prob, alg, save_idxs = )saves only some components (indices or variables) insol$u; symbolic indexing still sees all of them.get_save_idxs_and_saved_subsystem(prob, save_idxs)resolves them, andSavedSubsystem(),SavedSubsystemWithFallback(),get_saved_state_idxs(),get_saved_subsystem()andget_saveable_values(integ, idxs)describe what is saved.save_discretes(integ)(save_discretes!) records the current parameters (the discrete variables) in the solution's parameter history;save_discretes_if_enabled()andsave_final_discretes()do so when they changed, andcreate_parameter_timeseries_collection(sol)returns the history (tand a matrixp).set_ut(integ, u, t)(set_ut!) sets state and time,postamble(integ)(postamble!) finishes the integration,get_sol(integ)is its solution so far, andsplit_callbacks(cb)separates continuous and discrete callbacks.getindepsym(sys)andgetindepsym_defaultt(sys)give the independent variable,get_root_indp(x)the system behind a problem or solution,plottable_indices(x)the indices that are plotted andsymbolic_interpolation(sol, idxs, t)interpolates expressions.ImmutableODEProblem()andImmutableNonlinearProblem()areODEProblem()andNonlinearProblem()(R problems are values);StandardODEProblem(),StandardDAEProblem(),StandardDDEProblem(),StandardNonlinearProblem(),StandardBVProblem()andStandardSecondOrderBVProblem()are theproblem_typetags.DefaultOptimizationCache()isOptimizationCache().ODENLStepData(prob)is the implicit stage system ofODEProblem(..., nlstep = TRUE);SymbolicLinearInterface(update_A, update_b, sys)andget_new_A_b(prob, p)rebuild the matrix and vector of a symbolic linear problem.check_prob_alg_pairing(prob, alg)signals an error when the algorithm does not solve that kind of problem, anddetect_cycles(map)tells whether a map of variables to expressions refers to itself through a chain of entries.