pub struct MechanicalAnalyzer { /* private fields */ }Expand description
Mechanical analyzer for mechanical engineering analysis
Implementations§
Source§impl MechanicalAnalyzer
impl MechanicalAnalyzer
pub fn new() -> Self
Sourcepub fn attach_physics_simulation(
&mut self,
lib: Option<Arc<Mutex<PhysicsSimulationLibrary>>>,
)
pub fn attach_physics_simulation( &mut self, lib: Option<Arc<Mutex<PhysicsSimulationLibrary>>>, )
Attach the Phase 2 physics-simulation library for coupled dynamics.
pub fn initialize(&mut self) -> Result<(), EngineeringError>
pub fn validate_model( &self, model: &EngineeringModel, ) -> Result<(), EngineeringError>
pub fn analyze( &mut self, _model: &EngineeringModel, _analysis_type: AnalysisType, ) -> Result<AnalysisResults, EngineeringError>
Sourcepub fn analyze_kinematics(
&mut self,
initial_position: f64,
initial_velocity: f64,
acceleration: f64,
time_steps: &[f64],
) -> Result<KinematicsResults, EngineeringError>
pub fn analyze_kinematics( &mut self, initial_position: f64, initial_velocity: f64, acceleration: f64, time_steps: &[f64], ) -> Result<KinematicsResults, EngineeringError>
Basic kinematic time-history analysis with constant acceleration.
For each time step t:
- position(t) = x₀ + v₀·t + ½·a·t²
- velocity(t) = v₀ + a·t
- acceleration(t) = a (constant)
Sourcepub fn analyze_dynamics(
&mut self,
mass: f64,
force: f64,
initial_velocity: f64,
time_steps: &[f64],
) -> Result<DynamicsResults, EngineeringError>
pub fn analyze_dynamics( &mut self, mass: f64, force: f64, initial_velocity: f64, time_steps: &[f64], ) -> Result<DynamicsResults, EngineeringError>
Dynamics time-history analysis from Newton’s second law (F = m·a).
- acceleration a = force / mass (constant)
- velocity(t) = v₀ + a·t
- position(t) = ½·a·t² + v₀·t
Energy is reported in the constant-applied-force potential convention
(PE = −F·x) so that the total mechanical energy KE + PE = ½·m·v₀² is
conserved across the whole history (verifiable in tests).
Auto Trait Implementations§
impl Freeze for MechanicalAnalyzer
impl RefUnwindSafe for MechanicalAnalyzer
impl Send for MechanicalAnalyzer
impl Sync for MechanicalAnalyzer
impl Unpin for MechanicalAnalyzer
impl UnsafeUnpin for MechanicalAnalyzer
impl UnwindSafe for MechanicalAnalyzer
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