Tolerance Stack-up Analyzer (Worst Case, RSS, Monte Carlo) avatar

Tolerance Stack-up Analyzer (Worst Case, RSS, Monte Carlo)

Pricing

Pay per event

Go to Apify Store
Tolerance Stack-up Analyzer (Worst Case, RSS, Monte Carlo)

Tolerance Stack-up Analyzer (Worst Case, RSS, Monte Carlo)

Tolerance stack-up analysis from plain text: worst case, RSS, Monte Carlo, yield, ppm and Cpk, contributors, plus ISO 286 hole and shaft fits (H7/g6). For engineers and AI agents.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Jumble Mog

Jumble Mog

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

an hour ago

Last modified

Features

Limited permissions

Share

Will the parts fit? Write the stack-up as text and find out. Type a chain of dimensions such as + housing depth 50 ±0.1; - bearing width 20 ±0.05; - spacer 19.8 +0.05/-0; gap 0.05 to 0.5. You get back:

  • Every standard method side by side:
    • Worst case (arithmetic).
    • RSS: the root sum square, reported as mean ± 3σ.
    • Modified RSS.
    • A Monte Carlo simulation of 200,000 assemblies, with a fixed seed so runs repeat.
  • The verdict against your requirement: whether the worst case fits, the share and ppm out of spec (from the normal theory and from the simulation), Cp and Cpk.
  • What drives it: each dimension's share of the variation and of the worst case.
  • What to change: the factor every tolerance could be scaled by to meet the worst case, or to reach a target Cpk (1.33 unless you say otherwise), and how far to move the mean to center it.
  • A chart: the simulated gap histogram with the requirement, worst-case and RSS ranges, next to the contributions.

Each dimension can be:

  • Normal: the tolerance band is ±3σ, or set a Cpk or sigma.
  • Uniform or triangular.
  • Scaled by a sensitivity (x0.5 for a radius from a diameter).
  • An ISO 286 class: - pin 10 g6, + bore 30 H7.
  • Limits: 29.95 to 30.05.
  • A geometric tolerance: position 0.1 counts as ±0.05 on the stack.

It also computes ISO 286 fits. Type 30 H7/g6 or Ø25 H7/p6 to get:

  • The hole and shaft limits.
  • The minimum and maximum clearance or interference.
  • The fit type.
  • For transition fits, the chance of interference.

It's made for:

  • Mechanical and design engineers checking assemblies before the drawings go out.
  • Quality and manufacturing engineers setting tolerances and judging yield.
  • 3D-printing and machining shops, and engineering students.
  • AI agents that need a real stack-up instead of a guess.

The shaft end-play stack analyzed by this Actor: the Monte Carlo histogram of the gap with the 0.05 to 0.5 mm requirement, the worst case from -0.03 to 0.38 mm and RSS from 0.057 to 0.293 mm, and the housing depth driving 71% of the variation

How to use it

  1. Write Stacks, one per entry, or Fits, one per line. The form has examples.
  2. Optionally set a Default requirement or the Units (mm or inches).
  3. Click Start. Each stack or fit is a row in the results, with its summary, chart and report.

Writing a stack

Separate the dimensions with semicolons or new lines. Go around the loop and give each dimension a sign:

  • + for one that opens the gap.
  • - for one that closes it.

Then the name, the nominal and the tolerance:

You writeIt means
+ housing 50 ±0.149.9 to 50.1
- spacer 19.8 +0.05/-019.8 to 19.85
- ring 0.5 -0.01/-0.030.47 to 0.49
+ slot 10.2 to 10.3limits
- pin 10 g6ISO 286: 9.986 to 9.995
- position 0.1±0.05 around 0
- bore 12 ±0.02 x0.5half of a diameter (a radius)
... uniform, ... triangular, ... Cpk 1.33, ... sigma 0.01, ... shift 0.01how the dimension varies

The requirement goes in its own part:

  • A range: gap 0.05 to 0.5.
  • One side: clearance min 0, max 0.3, gap ≥ 0.1.
  • A nominal and tolerance: gap 0.2 ±0.15.

A title can lead: Shaft end play: + housing 50 ±0.1; .... Objects work too; see Input.

Examples

All of these ran on this Actor; the numbers are from the results.

Stack or fitResult
Shaft end play: + housing depth 50 ±0.1; - bearing width 20 ±0.05; - spacer 19.8 +0.05/-0; - bearing width 10 ±0.03; gap 0.05 to 0.5Worst case -0.03 to 0.38 fails. RSS 0.057 to 0.293 has Cpk 1.06 and 771 ppm out; Monte Carlo has 765 ppm. The housing drives 71%. Tolerances at 61% would meet the worst case, and moving the mean by +0.1 would center it
Pin in slot: + slot 10.2 to 10.3; - pin 10 g6; - position 0.1; clearance min 0The g6 pin is 9.986 to 9.995. Worst case 0.155 to 0.364 always clears; RSS Cpk 3.66
Lid gap: box 80 ±0.3, insert 76 ±0.2 uniform, gasket 3 +0.2/-0.1 at Cpk 1.33, gap 0.2 to 1.8Mean 0.95. Worst case 0.3 to 1.6 fits. RSS Cpk 1.59; the uniform insert drives 54%
+ A 25 ±0.2; - B 10 ±0.2; - C 14.6 ±0.1 uniform; gap 0.1 to 0.6Worst case -0.1 to 0.9 fails. RSS has 3.85% out and Monte Carlo 3.7%; tolerances at 40% would meet the worst case
30 H7/g6Clearance fit: hole 30.000 to 30.021, shaft 29.980 to 29.993, clearance 7 to 41 µm
25 H7/p6Interference fit, 1 to 35 µm
40 H7/k6Transition fit, from 18 µm interference to 23 µm clearance; 30.7% of assemblies interfere when both parts are normal over their bands

The tests check that:

  • 15 tolerance classes match the ISO 286-2 tables, holes and shafts, from 3 to 200 mm (including the Δ rule for K, M, N and P holes).
  • Worst case and RSS match hand sums, and Monte Carlo matches the normal theory within 2%.
  • Uniform and triangular sigmas, sensitivities, Cp, Cpk, normal ppm and scaling match their formulas.
  • Every text form above is read correctly.

How-to examples

Each example is a complete input; the results are from runs of the Actor (also listed under Examples).

How to do a tolerance stack-up (worst case, RSS and Monte Carlo)

{"stacks": ["Shaft end play: + housing depth 50 ±0.1; - bearing width 20 ±0.05; - spacer 19.8 +0.05/-0; - bearing width 10 ±0.03; gap 0.05 to 0.5"]}

Result: worst case -0.03 to 0.38 fails; RSS 0.057 to 0.293 has Cpk 1.06 and 771 ppm out, and Monte Carlo 765 ppm. The housing drives 71%; tolerances at 61% would meet the worst case, and moving the mean by +0.1 would center it.

How to include an ISO fit and a position tolerance in a stack

{"stacks": ["Pin in slot: + slot 10.2 to 10.3; - pin 10 g6; - position 0.1; clearance min 0"]}

Result: the g6 pin is 9.986 to 9.995; worst case 0.155 to 0.364 always clears, with RSS Cpk 3.66.

How to look up an ISO 286 hole and shaft fit

{
"fits": [
"30 H7/g6",
"40 H7/k6"
]
}

Result: 30 H7/g6 is a clearance fit: hole 30.000 to 30.021, shaft 29.980 to 29.993, clearance 7 to 41 µm. 40 H7/k6 is a transition fit, from 18 µm interference to 23 µm clearance; 30.7% of assemblies interfere.

How to let an AI agent check if parts fit

Add this Actor to the Apify MCP server with https://mcp.apify.com/?tools=jumblemog/tolerance-stackup-analyzer. The agent writes the chain of dimensions as text and answers with the worst-case range, the yield and which dimension to tighten.

FAQ

Which tolerance forms can I write? ±, unequal (+0.05/-0), limits (10.2 to 10.3), ISO classes (10 g6) and geometric tolerances such as position 0.1.

What distributions does it use? Normal by default, centered with σ = half-band / (3·Cpk); mark a dimension uniform or triangular, or give its cpk.

Does it say what to change? Yes: each dimension's share of the variation, how far the tolerances would have to scale to meet the requirement, and the mean shift that centers it.

Which ISO 286 classes are covered? 15 hole and shaft classes from 3 to 200 mm, checked against the ISO 286-2 tables, including the Δ rule for K, M, N and P holes.

Input

FieldWhat it is
stacksStacks, as text or objects.
fitsFits or tolerance classes, one per line.
requirementDefault requirement for stacks that don't give one.
unitsmm (default) or in. ISO classes need mm.
chartsDraw charts (default on).

A stack as an object takes:

  • title.
  • dimensions: a list of text lines or objects.
  • requirement: "0.05 to 0.5" or {"min": 0.05, "max": 0.5}; or min and max directly.
  • units.
  • samples: Monte Carlo draws, 1,000 to 1,000,000; default 200,000.
  • targetCpk: default 1.33.
  • mrssFactor: default 1.5.
  • seed.

A dimension as an object takes:

  • name and nominal.
  • The tolerance, one of: tolerance ("±0.1", "+0.05/-0" or a number), plus and minus, min and max, or fit ("g6").
  • sign (+ or -) and coefficient.
  • distribution (normal, uniform, triangular), cpk, sigma and shift.

A fit as an object takes size and either fit ("H7/g6") or hole and/or shaft.

Output

One dataset item per stack or fit, also saved together in the run's OUTPUT record:

{
"request": 1, "status": "ok", "type": "stack", "title": "Shaft end play", "units": "mm",
"summary": "Nominal 0.2 mm (mean 0.175); worst case -0.03 to 0.38, which does not fit the 0.05 to 0.5 requirement; RSS ±3σ 0.05657 to 0.2934 (Cpk 1.06, 771 ppm out); Monte Carlo 0.0765% out of spec. Housing depth drives 71% of the variation; scaling every tolerance to 61% would meet the worst case.",
"requirement": {"min": 0.05, "max": 0.5}, "nominal": 0.2, "mean": 0.175,
"worstCase": {"min": -0.03, "max": 0.38, "range": 0.41, "meetsRequirement": false},
"rss": {"mean": 0.175, "sigma": 0.03947573, "min": 0.056573, "max": 0.293427, "outOfSpecPercent": 0.077142,
"ppm": 771.4, "cp": 1.8999, "cpk": 1.0555, "meetsTargetCpk": false},
"monteCarlo": {"samples": 200000, "mean": 0.174954, "std": 0.03946839, "p00135": 0.055812, "p99865": 0.2939,
"outOfSpecPercent": 0.0765, "ppm": 765.0, "belowMinPercent": 0.0765, "aboveMaxPercent": 0.0},
"dimensions": [{"name": "housing depth", "sign": "+", "nominal": 50.0, "plus": 0.1, "minus": -0.1,
"distribution": "normal", "sigma": 0.03333333, "worstCaseShare": 48.78, "varianceShare": 71.3}, "..."],
"scaling": {"worstCase": 0.6098, "rssForTargetCpk": 0.7936, "targetCpk": 1.33, "centerShift": 0.1},
"imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-....png"
}

A fit has fitType, hole and shaft (deviations, limits and IT band), minClearance and maxClearance in mm (negative means interference), and interferenceProbabilityPercent. A request that can't be computed has "status": "failed" and the reason in error, and isn't billed.

How it works

  1. Reading: each part is a dimension or the requirement. Tolerances can be ±, unequal, limits, ISO classes or geometric tolerances.
  2. Worst case: each dimension at the limit that pushes the gap down, then up.
  3. RSS:
    • σ = √Σ(aᵢσᵢ)², with each dimension centered in its band.
    • Normal dimensions use σ = half-band / (3·Cpk). Uniform ones use half-band/√3, triangular ones half-band/√6.
    • Yield, ppm and Cpk come from the normal distribution.
  4. Monte Carlo: NumPy draws every dimension from its distribution and adds the stack. The result gives the 0.135% and 99.865% points (the ±3σ equivalents) and the counted share out of spec.
  5. Scaling: the room between the mean and the nearer limit, divided by the worst-case half-range or by 3·target Cpk·σ.
  6. ISO 286:
    • IT grades and fundamental deviations come from ISO 286-1, with the values tabulated in ISO 286-2.
    • K, M, N and P holes get the Δ correction in the finer grades.
  7. Charts are drawn with Vega-Lite and rendered with vl-convert.

Pricing

You pay one low price per stack and a lower one per fit, at the prices shown on this page. They include the chart and the report. Requests that can't be computed are never charged. If you set a maximum cost per run, the Actor stops before a request that wouldn't fit.

Speed

A stack with 200,000 Monte Carlo draws takes well under a second, and a fit a few milliseconds, plus the chart. A run through the API answers in about 5 to 10 seconds, including the cloud container starting.

Tips and limits

  • One-dimensional stacks: dimensions add along one direction with a sensitivity each. For angles or 3D geometry, work out each sensitivity (∂gap/∂dimension) and enter it as x....
  • RSS assumes independent, centered dimensions. With few dimensions or skewed processes, trust the worst case and Monte Carlo more. Use shift to model a process that runs off center.
  • Geometric tolerances are entered as their ± effect on this one direction (position 0.1 → ±0.05). Bonus tolerance from material conditions isn't added.
  • ISO 286: sizes up to 500 mm, holes D to P and JS, shafts d to p and js, grades IT1 to IT16.
  • Limits: 200 dimensions per stack, 500 requests per run.

For AI agents and developers

This Actor works with the Apify MCP server, so AI agents can call it as a tool. Pass stacks or fits as plain text and read summary, worstCase.meetsRequirement, rss.cpk, monteCarlo.ppm and scaling. A direct API call that waits for the answer:

curl -X POST "https://api.apify.com/v2/acts/jumblemog~tolerance-stackup-analyzer/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"stacks": ["+ case 40 ±0.15; - PCB 1.6 ±0.16; - standoff 35 ±0.1; - connector 3 ±0.05; gap min 0.1"], "fits": ["12 H7/h6"]}'

run-sync instead returns the run's OUTPUT: the status, the counts and every result as JSON.

In Python, with the apify-client package:

from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/tolerance-stackup-analyzer").call(run_input={
"stacks": [{"title": "Lid gap", "requirement": {"min": 0.2, "max": 1.8}, "dimensions": [
{"name": "box", "nominal": 80, "tolerance": "±0.3"},
{"name": "insert", "nominal": 76, "tolerance": "±0.2", "sign": "-", "distribution": "uniform"},
{"name": "gasket", "nominal": 3, "plus": 0.2, "minus": -0.1, "sign": "-", "cpk": 1.33}]}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["summary"])

Credits

  • Numbers: NumPy and SciPy (BSD-3-Clause).
  • Charts: Vega-Lite and vl-convert (BSD-3-Clause), with the Inter font (SIL Open Font License).
  • Standards:
    • ISO 286-1 and ISO 286-2, Geometrical product specifications (GPS): ISO code system for tolerances on linear sizes.
    • The stack-up methods follow common practice, as in ASME Y14.5 users' guides and Fortini, Dimensioning for Interchangeable Manufacture.