pub struct OrthogonalCollocation;Expand description
Orthogonal collocation at Gauss-Legendre points.
Approximates y(t) as a piecewise polynomial, enforcing the ODE at collocation points within each subinterval and matching state values at mesh nodes.
For each subinterval [t_i, t_{i+1}] with m collocation points τ_j:
- The polynomial p(t) satisfies p(t_i) = y_i (left endpoint)
- p’(τ_j) = f(τ_j, p(τ_j)) for j = 1..m (collocation conditions)
- y_{i+1} = p(t_{i+1}) (right endpoint value)
This results in a large nonlinear system that is solved by Newton iterations.
Implementations§
Source§impl OrthogonalCollocation
impl OrthogonalCollocation
Sourcepub fn solve<ODE, BC, Guess>(
ode: &ODE,
bc: &BC,
t_span: [f64; 2],
y_init_guess: &Guess,
n_state: usize,
cfg: &CollocationConfig,
) -> IntegrateResult<BVPResult>
pub fn solve<ODE, BC, Guess>( ode: &ODE, bc: &BC, t_span: [f64; 2], y_init_guess: &Guess, n_state: usize, cfg: &CollocationConfig, ) -> IntegrateResult<BVPResult>
Solve BVP by collocation at Gauss-Legendre points.
§Arguments
ode- ODE function f(t, y)bc- Boundary condition: g(y(a), y(b)) = 0 (n_bc equations)t_span- [a, b]y_init_guess- Closure providing initial guess for y at time tcfg- Collocation configuration
Auto Trait Implementations§
impl Freeze for OrthogonalCollocation
impl RefUnwindSafe for OrthogonalCollocation
impl Send for OrthogonalCollocation
impl Sync for OrthogonalCollocation
impl Unpin for OrthogonalCollocation
impl UnsafeUnpin for OrthogonalCollocation
impl UnwindSafe for OrthogonalCollocation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more