pub struct ReliabilityAnalyzer { /* private fields */ }Expand description
Reliability analyzer for reliability engineering analysis
Implementations§
Source§impl ReliabilityAnalyzer
impl ReliabilityAnalyzer
pub fn new() -> Self
Sourcepub fn attach_statistical_computing(
&mut self,
lib: Option<Arc<Mutex<StatisticalComputingLibrary>>>,
)
pub fn attach_statistical_computing( &mut self, lib: Option<Arc<Mutex<StatisticalComputingLibrary>>>, )
Attach the Phase 2 statistical-computing library for Monte Carlo / reliability maths.
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<ReliabilityResults, EngineeringError>
Sourcepub fn analyze_monte_carlo(
&mut self,
limit_state_function: &[f64],
mean: f64,
std_dev: f64,
) -> Result<ReliabilityResults, EngineeringError>
pub fn analyze_monte_carlo( &mut self, limit_state_function: &[f64], mean: f64, std_dev: f64, ) -> Result<ReliabilityResults, EngineeringError>
Monte Carlo reliability analysis. Generates num_simulations samples from a
normal distribution N(mean, std_dev²) and evaluates the limit-state function
g(x) = x − threshold for each sample, where threshold is taken as the
first element of limit_state_function (the capacity / resistance). A
failure occurs when g(x) < 0. The failure probability Pf is the failure
fraction and the reliability index is β = −Φ⁻¹(Pf).
(Named analyze_monte_carlo rather than analyze because Rust does not
support method overloading — the existing analyze(&EngineeringModel, …)
is retained for the perform_reliability_analysis facade.)
Sourcepub fn compute_reliability_index(&self, failure_prob: f64) -> f64
pub fn compute_reliability_index(&self, failure_prob: f64) -> f64
Compute the reliability index β = −Φ⁻¹(failure_prob) using an
approximation of the inverse standard normal CDF (Acklam’s rational
approximation). failure_prob is clamped to (0, 1) to keep β finite.
Sourcepub fn analyze_reliability(
&self,
config: &ReliabilityConfig,
) -> Result<ReliabilityResult, EngineeringError>
pub fn analyze_reliability( &self, config: &ReliabilityConfig, ) -> Result<ReliabilityResult, EngineeringError>
General reliability analysis via Monte-Carlo simulation.
For each of config.num_simulations runs, every component’s state
(working / failed) is sampled from a Bernoulli distribution with
success probability 1 - failure_probability. The system state is then
determined from SystemModel:
SystemModel::Series– the system works iff all components work.SystemModel::Parallel– the system works iff at least one component works.- [
SystemModel::KOutOfN { k, .. }] – the system works iff at least k of thencomponents work.
system_reliability is the fraction of runs in which the system worked.
Component importance is the exact Birnbaum importance computed from the
nominal component reliabilities (the change in system reliability when a
component moves from certainly-failed to certainly-working), and the 95%
confidence interval uses the normal approximation for a proportion.
(Named analyze_reliability rather than analyze because Rust does not
support method overloading – the existing analyze(&EngineeringModel, …) is retained for the perform_reliability_analysis facade, mirroring
the analyze_monte_carlo precedent.)
Auto Trait Implementations§
impl Freeze for ReliabilityAnalyzer
impl RefUnwindSafe for ReliabilityAnalyzer
impl Send for ReliabilityAnalyzer
impl Sync for ReliabilityAnalyzer
impl Unpin for ReliabilityAnalyzer
impl UnsafeUnpin for ReliabilityAnalyzer
impl UnwindSafe for ReliabilityAnalyzer
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>,
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
§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>
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>
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