rxnfit.lsoda_p_vector module
Construct the numbalsoda parameter vector p for LSODA integration.
The ordering rules here are part of the public ABI and must mirror the Numba
RHS compiled in rxnfit.numbalsoda_rhs.
- rxnfit.lsoda_p_vector.build_lsoda_parameter_vector_p(rate_const_values: Mapping[str, float], symbolic_rate_const_keys: Sequence[str]) ndarray
Assemble the numbalsoda parameter vector
pfrom rate-constant values.Parameter layout for numbalsoda RHS (must match
numbalsoda_rhscfunc):Let
n_fitted = len(symbolic_rate_const_keys).p[0] … p[n_fitted-1]: values forsymbolic_rate_const_keysin that exact order (same order ascreate_system_rhs/ fitters).p[n_fitted] … p[n_p-1]: every other key present inrate_const_values, excluding those insymbolic_rate_const_keys, ordered by lexicographic sort of the key strings (not natural sort).n_p = len(p)is fixed for a given RHS / build.
Example:
symbolic_rate_const_keys = ("k2", "k1")and the only remaining keys inrate_const_valuesarek3andk4→p = [v_k2, v_k1, v_k3, v_k4].The concentration vector
u(species order /function_names) does not need to align with the ordering of entries inp.- Parameters:
rate_const_values – All rate constants needed for the current integration (numeric).
symbolic_rate_const_keys – Fitted (or explicit) keys in the order used by
create_system_rhsfor extra ODE arguments.
- Returns:
One-dimensional
float64ndarray of lengthn_p.