Skip to main content

A toolkit for probabilistic failure analysis of mechanical components

Project description

Probabilistic Failure Analysis Toolkit

A Python toolkit for performing probabilistic failure analysis on mechanical components. This tool allows engineers to simulate component behavior under various uncertain conditions (forces, dimensions, material properties) using Monte Carlo simulations.

Features

  • Monte Carlo Simulation: Run thousands of simulations to understand the probability of failure.
  • Sensitivity Analysis: Identify which input variables have the biggest impact on your results using Spearman rank correlation.
  • Engineering Formulas: Built-in formulas for common mechanical elements:
    • Shafts: Torsional shear stress, Von Mises stress.
    • Beams: Bending stress, deflection.
    • Gears: Lewis bending stress, contact stress.
    • Sheet Metal: Shearing force, bending force.
  • Visualization: Generate plots for stress distributions and sensitivity analysis.

Installation

  1. Clone the repository.
  2. Install the required dependencies:
pip install numpy matplotlib scipy

Usage

The demo.py file contains a complete example of how to use the toolkit to analyze a cantilever beam.

To run the demo:

python demo.py

Example Code Snippet

from prob_failure_toolkit.statistical_tools.monte_carlo import MonteCarloSimulation
import numpy as np


# 1. Define your model
def my_stress_model(force, area):
    return force / area


# 2. Setup Simulation
mc = MonteCarloSimulation(my_stress_model)
mc.add_input('force', 'normal', loc=1000, scale=100)
mc.add_input('area', 'normal', loc=0.01, scale=0.001)

# 3. Run
results = mc.run()
print(f"Mean Stress: {np.mean(results)} Pa")

Project Structure

  • prob_failure/: Main package directory.
    • formulas/: Engineering formulas for different components.
    • statistical_methods/: Monte Carlo and sensitivity analysis logic.
    • plotting/: Visualization utilities.
  • demo.py: Example usage script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

failure_analysis_toolkit-1.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

failure_analysis_toolkit-1.0.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file failure_analysis_toolkit-1.0.1.tar.gz.

File metadata

File hashes

Hashes for failure_analysis_toolkit-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a9d40a52ff283c53b8daf444c0897752893fda38759917cbd2d02c5b387353ca
MD5 45b807e95e75498da4173401f002f850
BLAKE2b-256 912955dda99754e7b762ec297a4b7b7d9e84e6e54c44999911c7080aa22ca658

See more details on using hashes here.

File details

Details for the file failure_analysis_toolkit-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for failure_analysis_toolkit-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0df27c3dfe700039f485611f205bd292ee5ea0dd95aa6a1bae7a713262e6cae8
MD5 3d70906041ee2cfdb867104e2db716d3
BLAKE2b-256 eca45861caebb43c9d05689148ed508ecbbd895c35b1c6ac8f253e5520522b29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page