pub struct ShootingMethod<S: BvpSystem> { /* private fields */ }Expand description
Boundary Value Problem solver using the Shooting Method
Converts BVPs to IVPs by iteratively adjusting initial conditions until boundary conditions are satisfied within a residual threshold.
§Usage
use qualia_core_db::modalities::calculus::ode_solver::{ShootingMethod, BvpSystem};
let system = ChaoitonProfile::new();
let mut solver = ShootingMethod::new(system, 1e-6);
let solution = solver.solve(0.0, 10.0, 1.0, 0.0);Implementations§
Source§impl<S: BvpSystem> ShootingMethod<S>
impl<S: BvpSystem> ShootingMethod<S>
Sourcepub fn new(system: S, residual_threshold: f64) -> Self
pub fn new(system: S, residual_threshold: f64) -> Self
Creates a new shooting method solver
§Arguments
system- The BVP system to solveresidual_threshold- Acceptable residual for convergence
Sourcepub fn with_max_iterations(self, max: usize) -> Self
pub fn with_max_iterations(self, max: usize) -> Self
Sets the maximum number of iterations
Sourcepub fn solve(
&mut self,
t_start: f64,
t_end: f64,
y_left: f64,
y_right_target: f64,
) -> Result<(f64, f64), String>
pub fn solve( &mut self, t_start: f64, t_end: f64, y_left: f64, y_right_target: f64, ) -> Result<(f64, f64), String>
Solves the BVP using the shooting method
§Arguments
t_start- Starting time (left boundary)t_end- Ending time (right boundary)y_left- Initial guess for left boundary conditiony_right_target- Target value for right boundary condition
§Returns
The converged initial condition that satisfies the BVP
Auto Trait Implementations§
impl<S> Freeze for ShootingMethod<S>where
S: Freeze,
impl<S> RefUnwindSafe for ShootingMethod<S>where
S: RefUnwindSafe,
impl<S> Send for ShootingMethod<S>
impl<S> Sync for ShootingMethod<S>
impl<S> Unpin for ShootingMethod<S>where
S: Unpin,
impl<S> UnsafeUnpin for ShootingMethod<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ShootingMethod<S>where
S: UnwindSafe,
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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