pub struct System { /* private fields */ }Expand description
A simulation of Le Chatelier’s Principle.
It will produce how the system should react to certain changes
Implementations§
Source§impl System
impl System
Sourcepub fn new(eq: Equation) -> Result<Self, SystemError>
pub fn new(eq: Equation) -> Result<Self, SystemError>
Construct a System, passing an equation at equilibrium
Sourcepub fn adjust(&mut self, adjust: Adjustment<'_>) -> Result<(), AdjustError>
pub fn adjust(&mut self, adjust: Adjustment<'_>) -> Result<(), AdjustError>
Take a transformation to the reaction, return time to reach new values
Sourcepub fn get_shift_direction(
&self,
adjust: Adjustment<'_>,
) -> Result<Direction, AdjustError>
pub fn get_shift_direction( &self, adjust: Adjustment<'_>, ) -> Result<Direction, AdjustError>
Returns which the direction a given adjustment will cause the equilibrium to shift
Sourcepub fn get_k_expr(&self) -> f32
pub fn get_k_expr(&self) -> f32
Set the k expression
Sourcepub fn mul_k_expr(&mut self, v: f32)
pub fn mul_k_expr(&mut self, v: f32)
Multiply the k expression
Sourcepub fn set_k_expr(&mut self, k: f32)
pub fn set_k_expr(&mut self, k: f32)
Set the k expression
Sourcepub fn equation_mut(&mut self) -> &mut Equation
pub fn equation_mut(&mut self) -> &mut Equation
Get mutable access to the internal equation
Trait Implementations§
impl StructuralPartialEq for System
Auto Trait Implementations§
impl Freeze for System
impl RefUnwindSafe for System
impl Send for System
impl Sync for System
impl Unpin for System
impl UnwindSafe for System
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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