pub struct ODEClassifier;Expand description
ODE classifier with comprehensive detection capabilities
Implementations§
Source§impl ODEClassifier
impl ODEClassifier
Sourcepub fn classify_first_order(
rhs: &Expression,
dependent: &Symbol,
independent: &Symbol,
) -> ODEType
pub fn classify_first_order( rhs: &Expression, dependent: &Symbol, independent: &Symbol, ) -> ODEType
Classify a first-order ODE
Attempts to classify the ODE in order of computational efficiency:
- Separable (fastest, widest coverage)
- Linear first-order (integrating factor method)
- Exact (requires exactness condition check)
- Bernoulli (transforms to linear)
- Homogeneous (substitution method)
§Arguments
rhs- Right-hand side of dy/dx = rhsdependent- Dependent variable (y)independent- Independent variable (x)
§Examples
use mathhook_core::calculus::ode::classifier::{ODEClassifier, ODEType};
use mathhook_core::{symbol, expr, Expression};
let x = symbol!(x);
let y = symbol!(y);
let rhs = expr!(x * y);
let ode_type = ODEClassifier::classify_first_order(&rhs, &y, &x);
assert_eq!(ode_type, ODEType::Separable);Sourcepub fn classify_second_order(
_lhs: &Expression,
_rhs: &Expression,
_dependent: &Symbol,
_independent: &Symbol,
) -> ODEType
pub fn classify_second_order( _lhs: &Expression, _rhs: &Expression, _dependent: &Symbol, _independent: &Symbol, ) -> ODEType
Classify a second-order ODE
§Arguments
lhs- Left-hand side expression (usually y’‘, y’, y terms)rhs- Right-hand side expression (forcing function)dependent- Dependent variable (y)independent- Independent variable (x)
§Examples
use mathhook_core::calculus::ode::classifier::{ODEClassifier, ODEType};
use mathhook_core::{symbol, expr, Expression};
let x = symbol!(x);
let y = symbol!(y);
let ode_type = ODEClassifier::classify_second_order(
&expr!(y + y),
&Expression::integer(0),
&y,
&x
);
assert_eq!(ode_type, ODEType::ConstantCoefficients);Auto Trait Implementations§
impl Freeze for ODEClassifier
impl RefUnwindSafe for ODEClassifier
impl Send for ODEClassifier
impl Sync for ODEClassifier
impl Unpin for ODEClassifier
impl UnsafeUnpin for ODEClassifier
impl UnwindSafe for ODEClassifier
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> 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