numra-ocp
ODE-constrained optimization for the Numra workspace — single and multiple shooting, direct collocation, adjoint gradients, and parameter estimation for ODE models against measured data.
Bridges numra-ode and numra-optim: the ODE solver runs in the inner loop, the optimizer minimizes over parameters / initial conditions / controls. Gradients can come from forward sensitivity (via ParametricOdeSystem), adjoint methods, or autodiff bridges.
Example
use ;
// Recover k from data generated by y' = -k·y with k = 2
let t_data: = .map.collect;
let y_data: = t_data.iter.map.collect;
let r = new
.model
.data
.params
.initial_state
.ode_solver
.solve
.unwrap;
assert!;
What's in this crate
ParamEstProblem— declarative parameter-estimation builder for ODE models against time-series dataShootingProblem— single-shooting optimal controlMultipleShootingProblem— multiple-shooting variant for unstable systemsCollocationProblem— direct collocation with configurableCollocationSchemeadjoint_gradient/AdjointResult— adjoint-method gradients for the cost functionalforward_sensitivity/SensitivityResult— forward sensitivity matrices (re-exposed for OCP callers)
Composes with
numra-ode— inner ODE solver in shooting / collocationnumra-optim— outer optimizer for the parameter / control problemnumra-autodiff— analytical Jacobians for ODE sensitivitynumra-fit— alternative residual-based fitting for simple models
See interop workflows for the verified parameter-estimation → sensitivity → uncertainty workflow.
Install
[]
= "0.1"
Or via the umbrella crate:
[]
= "0.1"
Documentation
- API: https://docs.rs/numra-ocp
- Book: Parameter estimation · Shooting methods · Collocation · Adjoint methods
- Source: https://github.com/moussaoutlook/numra-rs/tree/main/numra-ocp
License
Numra Academic & Research License (Non-Commercial). Academic and research use is free; commercial use requires a separate license — contact contact@spectralautomata.com. See LICENSE.