Expand description
General-dimension numerical methods (Calculus plan §4.4).
The original solvers in super (RungeKutta4Static, ShootingMethodBVP,
SimpsonsIntegratorChunked) are fixed at [f64; 4] / scalar — the same toy-sizing the
linear-algebra and optimisation solvers once had. This module generalises them to
arbitrary state dimension on heap Vec<f64>, reusing the engine’s canonical dense LU
solve (crate::solvers::linear_algebra::lu::lu_solve) for the BVP Newton correction —
no re-implemented linear algebra. These are the allocate-friendly authoring-path
versions; the zero-heap [f64; 4] solvers remain for the hot path.
Functions§
- rk4_
integrate - Integrate
y' = f(t, y)fromt0tot1instepsequal RK4 steps; returns the final state.stepsis clamped to≥ 1. - rk4_
solve - Full trajectory
[(t, y)], including the initial point, overstepsRK4 steps. - rk4_
step - One classical RK4 step of
y' = f(t, y)for a state of any dimension.freturns the derivative vector, which must have the same length asy. - shooting_
bvp - Shooting-method boundary-value solver for a first-order system
y' = f(t, y)of dimensionn. The components of the initial state listed infreeare the unknowns; they are chosen by Newton’s method so the userresidual(y(t1))(length =free.len()) is driven to zero. The Jacobian is built by forward finite differences and solved with the canonicallu_solve. Returns the converged initial state, orNoneif it fails to converge withinmax_iter(or the Jacobian is singular). - simpson
- Composite Simpson’s rule for a scalar integrand over
[a, b]withpanelssubintervals (forced even,≥ 2). The general-Nversion of the fixed 100-chunk solver insuper. - simpson_
vec - Composite Simpson’s rule for a vector-valued integrand
g: t → ℝᵏ, integrated component-wise (e.g. a vector field along a parameter, or a state trajectory). The output length is the length ofg(a);panelsis forced even and≥ 2.