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_kit.statistical_methods.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.0.tar.gz (6.8 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.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for failure_analysis_toolkit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a16a81cf355692ab65c4d74549e31afa1e41d5c912e432ce75f111f4805245d8
MD5 f29cdd59c0159cba3d8d57c1bc23292a
BLAKE2b-256 45c1927616fa2ba29233e7afcc19a3e764b126f0330c00bb067df8b62e2e992b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for failure_analysis_toolkit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09b3d84fbc3f9f296b074f2fcaf7abc8f74e77d73cf793ce93dc9b04bc32bde7
MD5 fa4997a5d49aff4e43ec4c0b64596773
BLAKE2b-256 a291b071575595b99308aed5c6de049582c1ef9b52604441817e79d5ce255b81

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