| name | monte-carlo-tolerance |
| description | Monte Carlo tolerance analysis — statistical vs. worst-case tolerancing, process capability (Cp/Cpk), GD&T tolerance stacks, simulation setup (N iterations, distributions), probability of assembly failure, RSS method, ANOVA-based sensitivity, Six Sigma tolerance design, DFSS, ISO 286 fit selection. |
| metadata | {"priority":7,"promptSignals":{"phrases":["Monte Carlo tolerance","tolerance analysis","tolerance stack","Cp Cpk tolerance","statistical tolerancing","RSS tolerance"],"minScore":3}} |
Monte Carlo Tolerance Analysis — Complete Skill
Tolerancing Methods Comparison
Worst-Case (WC) Tolerancing
Method: all parts at extreme tolerance limits simultaneously → compute assembly gap
Assembly gap: G_WC = G_nominal - Σ |t_i| [sum of all component tolerances subtracted from nominal gap]
Conservative: extremely conservative; assumes all parts simultaneously at worst tolerance
Problem: probability of all parts at worst limits simultaneously ≈ 0 for N > 5 components → parts over-toleranced → cost excessive
RSS (Root Sum of Squares) Method
Assumption: component dimensions normally distributed; independent
Assembly variation (1σ):
σ_G = √(Σ σ_i²) [σ_i = standard deviation of i-th component = t_i / 3 for ±3σ tolerance; t_i = half-tolerance]
Assembly tolerance (±3σ):
T_G_RSS = 3 × √(Σ (t_i/3)²) = √(Σ t_i²) [RSS assembly tolerance]
Example: 5 components, each t_i = 0.05 mm
WC: T_G = 5 × 0.05 = 0.25 mm
RSS: T_G = √(5 × 0.05²) = √(0.0125) = 0.112 mm (55% of WC)
RSS validity: normal distributions; Cp = 1 (centered processes)
Monte Carlo Simulation
Setup
Variable distributions per component:
Normal (Gaussian): N(μ, σ) where σ = t_i/3 (for ±3σ process); use for most machined dimensions
Uniform: U(nominal - t, nominal + t); for crude estimate or non-normal processes
Log-normal: for positive-only dimensions with right-skew; some casting dimensions
Truncated normal: if process has 100% inspection or hard physical limits
Key parameters:
Mean (μ): nominal dimension (0 shift assumed for Cp process; shift for Cpk)
Standard deviation (σ) = tolerance / (3 × Cp) = tolerance / 3 for Cp = 1
Number of iterations:
N = 10,000: adequate for P_fail > 0.1%; error ≈ 1/√N ≈ 1% relative error
N = 100,000: for P_fail > 0.01%; 0.3% error
N = 1,000,000: for P_fail > 0.0001%; 0.1% error (rare events → very long runs)
Rule: N × P_fail > 100 for reliable estimate (at least 100 failure events in simulation)
Simulation Execution
Algorithm:
- For iteration j = 1 to N:
a. Sample each component x_i ~ distribution(μ_i, σ_i)
b. Compute assembly gap G_j = f(x₁_j, x₂_j, ..., x_n_j)
c. Record G_j
- From {G_j}: compute mean G̅, std_dev σ_G
- Count failures: N_fail = count(G_j < G_min or G_j > G_max)
- P_fail = N_fail / N
Python implementation:
import numpy as np
N = 100000
components = {'A': (10.0, 0.05), 'B': (5.0, 0.03), 'C': (15.0, 0.04)}
samples = {name: np.random.normal(nom, t/3, N) for name, (nom, t) in components.items()}
G = samples['A'] + samples['B'] - samples['C']
G_min, G_max = -0.05, 0.10
P_fail = np.mean((G < G_min) | (G > G_max))
sigma_G = np.std(G)
print(f"P_fail = {P_fail:.4f} = {P_fail*1e6:.0f} ppm")
print(f"Assembly sigma = {sigma_G:.4f} mm")
Process Capability Integration
Cp (process capability index):
Cp = T / (6σ) = (USL - LSL) / (6σ) [T = tolerance; USL, LSL = spec limits; Cp = 1 → ±3σ; Cp = 1.33 → ±4σ]
Cpk (centered process capability):
Cpk = min((USL - μ) / 3σ, (μ - LSL) / 3σ) [accounts for process shift; Cpk ≤ Cp]
Six Sigma quality target:
AIAG: Cpk ≥ 1.33 for production (minimum); Cpk ≥ 1.67 for safety-critical
Six Sigma: Cpk = 2.0 → 6σ process → 3.4 ppm defect rate (with 1.5σ long-term shift)
Monte Carlo σ adjustment for process shift:
μ_i = nominal + shift (use shift from historical Cpk data)
σ_i = t_i / (3 × Cp) [adjust σ for Cp ≠ 1]
Example:
Cp = 1.33 → σ = t / (3 × 1.33) = t / 4 (tighter distribution than Cp = 1)
Reassemble G distribution → lower P_fail
GD&T Tolerance Stack Analysis
Linear Stack
For assembly gap G = Σ a_i × x_i:
Sensitivity factor a_i: +1 (adds to gap), -1 (reduces gap)
G_nominal = Σ a_i × x_i_nominal
σ_G = √(Σ (a_i × σ_i)²)
GD&T contributions to stack:
Position tolerance: contributes t_position / (√3 × 3) to σ for uniform distribution within circular zone
Perpendicularity: angular error → linear equivalent at length L: δ = L × tan(angle)
Flatness: adds directly to stack as planar variation
ANOVA Sensitivity Analysis
Which tolerances dominate?
Contribution of each factor: η_i = (a_i × σ_i)² / σ_G² × 100% [percent contribution to total variance]
Sum Σ η_i = 100%
Example analysis:
5 components: η = [30%, 25%, 20%, 15%, 10%]
Dominant factors (30% + 25%) = 55% of variance → tighten these two for most impact
Decision: tighten vs. loosen:
High η_i → dominant; tighten tolerance → significant assembly variation improvement
Low η_i → minor contributor; safe to loosen tolerance → cost saving
Geometric Nonlinear Stacks
For complex geometries (e.g., angular chains):
G = f(x₁, x₂, ..., x_n) [nonlinear function]
Linearized sensitivity: ∂G/∂x_i (partial derivatives computed numerically or analytically)
σ_G = √(Σ (∂G/∂x_i × σ_i)²) [first-order propagation; add second-order terms for high curvature]
Monte Carlo handles nonlinear exactly: no linearization needed; direct simulation → preferred for complex 3D stacks
ISO 286 Fit Selection
Clearance fits:
H7/g6: sliding fit (precision mechanism); 0–50 μm clearance
H7/f7: running fit (bearings, spindles); 20–100 μm clearance
Interference fits (press fits):
H7/p6: light interference; press with thermal assist
H7/s6: medium interference; permanent assembly
Transition fits:
H7/k6: locating fit; may have clearance or interference (centered distribution)
H7/n6: snug fit; slight interference likely
ISO 286 fundamental deviation and IT grade:
Fundamental deviation: position of tolerance zone relative to nominal
IT grade (International Tolerance grade): 01, 0, 1, 2, ..., 18 (finer to coarser)
IT6 = 0.016 mm for 50 mm diameter; IT7 = 0.025 mm; IT8 = 0.039 mm
Monte Carlo for fit analysis:
Sample shaft: x_shaft ~ N(μ_shaft = 50 + deviation, σ_shaft = IT_grade/6)
Sample bore: x_bore ~ N(μ_bore = 50 + deviation, σ_bore = IT_grade/6)
Clearance C = x_bore - x_shaft; find P(C < 0) = P_interference; P(C > C_max) = P_excessive_clearance
DFSS (Design for Six Sigma) Tolerance Design
Transfer Function Development
Step 1: identify Critical-to-Quality (CTQ) output y
Step 2: identify key inputs x_i (component dimensions, material properties)
Step 3: develop transfer function y = f(x_i) from physics or DOE
Step 4: compute sensitivities ∂y/∂x_i
Step 5: allocate tolerances inversely proportional to sensitivity (equal contribution rule)
Equal contribution rule:
σ_xi = σ_y_target / (n^0.5 × |∂y/∂x_i|) [n = number of contributors; distributes variance equally]
Alternative: proportional to manufacturing cost sensitivity
Taguchi Tolerance Design
Signal-to-noise ratio:
S/N = -10 × log₁₀(σ²) [higher S/N → more robust to variation]
L9 or L18 orthogonal array: vary component nominal values → identify optimal nominal → robust to manufacturing variation
Loss function (quadratic):
L = k × (y - target)² [k = loss constant; economic loss from deviation]
Expected loss: E[L] = k × (σ_y² + bias²) [minimize by reducing σ and bias]
Tolerance = t → loss per defect × defect rate = break-even
Tools
Commercial:
3DCS (Dimensional Control Systems, Dassault): full 3D Monte Carlo; GD&T; mechanical assembly
VisVSA (Dimensional Control Systems): similar; automotive industry standard
CETOL 6σ (Siemens Tecnomatix): NX integrated; ANOVA; sensitivity charts
Sigmetrix CETOL: popular in automotive and aerospace
Open source / custom:
Python NumPy/SciPy: flexible; custom distributions; fast for N = 10⁶
MATLAB Statistics Toolbox: distributions, regression, Monte Carlo built-in
Standards
| Standard | Scope |
|---|
| ISO 286-1/-2 | Limits and fits for holes and shafts |
| ISO 5459 | Datums and datum systems (GD&T) |
| ASME Y14.5-2018 | Dimensioning and tolerancing (GD&T) |
| AIAG PPAP | Production part approval (Cpk ≥ 1.67 requirement) |
| ISO 22514-1 | Statistical methods in process management (Cpk) |
| ISO 10303-210 (STEP) | CAD representation including tolerances |
Output
Provide: assembly gap requirement (G_min and G_max [mm]), number of contributing components N, each component (nominal [mm], tolerance t_i [mm], Cp and Cpk from supplier data), distribution type (normal/uniform), assembly σ_G from RSS [mm], Monte Carlo results (P_fail [ppm], confidence interval), sensitivity analysis (η_i [%] for each component; top contributors), recommended tolerance tightening (which components; expected P_fail reduction), ISO 286 fit (if bearing/shaft: H7/g6 or equivalent; clearance distribution statistics), DFSS transfer function (if developed: y = f(x); sensitivities ∂y/∂x_i), and applicable standard (ASME Y14.5, ISO 286, ISO 22514, AIAG PPAP Cpk ≥ 1.67).