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
- Clone the repository.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file failure_analysis_toolkit-1.0.1.tar.gz.
File metadata
- Download URL: failure_analysis_toolkit-1.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9d40a52ff283c53b8daf444c0897752893fda38759917cbd2d02c5b387353ca
|
|
| MD5 |
45b807e95e75498da4173401f002f850
|
|
| BLAKE2b-256 |
912955dda99754e7b762ec297a4b7b7d9e84e6e54c44999911c7080aa22ca658
|
File details
Details for the file failure_analysis_toolkit-1.0.1-py3-none-any.whl.
File metadata
- Download URL: failure_analysis_toolkit-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0df27c3dfe700039f485611f205bd292ee5ea0dd95aa6a1bae7a713262e6cae8
|
|
| MD5 |
3d70906041ee2cfdb867104e2db716d3
|
|
| BLAKE2b-256 |
eca45861caebb43c9d05689148ed508ecbbd895c35b1c6ac8f253e5520522b29
|