SolvFilter: Integration
Python API
import numpy as np
import solvfilter
def cv(t, x):
return np.array([x[2], x[3], 0.0, 0.0])
cfg = solvfilter.Config(n=4, rhs=cv)
x = np.array([0.0, 0.0, 1.0, 2.0])
P = np.diag([100.0, 100.0, 10.0, 10.0])
x_pred, P_pred = solvfilter.predict(cfg, x, P, np.eye(4) * 1e-3, dt=0.5)
# With custom mean propagator (e.g. SolvSRK):
# x_pred, P_pred = solvfilter.predict_with(cfg, x, P, Q, dt, x_mean)
H = np.array([[1.0, 0, 0, 0], [0, 1.0, 0, 0]])
out = solvfilter.update(x_pred, P_pred, z=np.array([0.55, 1.1]), H=H, R=np.eye(2) * 4.0)
nees_val = solvfilter.nees(out["x"], x_true, out["P"])
nis_val = solvfilter.nis(out["nu"], out["S"])C API
#include "solvfilter.h"
solvfilter_predict(&cfg, x, P, dt, &x_pred, P_pred);
solvfilter_update(&cfg, x_pred, P_pred, z, H, R, &x_upd, P_upd);SolvSRK composition
Use SolvSRK for mean propagation on stiff/noisy dynamics, then pass the
propagated state to solvfilter_predict_with() for covariance update.
Related products
Underlying integrator: SolvSRK.