Invntr
Source

All instruments

control_chart

Statistical process control: X-bar and R, X-bar and S, and individuals / moving-range charts from subgrouped data, with d2, d3 and c4 computed by integration over the normal distribution (no copied table), Western Electric or Nelson run rules, capability Cp, Cpk, Pp, Ppk and the expected parts per million outside the specification.

Field
Measurement and data
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.1 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replaycontrol_chart 0.1.0 · files 90d11c69cb00…c6ff
  1. r0001n = 2 closed forms: d2 = 2/sqrt(pi), d3 = sqrt(2 - 4/pi), c4 = sqrt(2/pi), D4 = 1 + 3 sqrt(pi/2 - 1) (textbook 3.267); d2, d3 by 12-point Gauss-Legendre quadrature, rel 1e-8passed

    constants.d2{"value": 1.1283791670955126, "rel_tol": 1e-08}
    constants.d3{"value": 0.8525024664274217, "rel_tol": 1e-08}
    constants.c4{"value": 0.7978845608028654, "rel_tol": 1e-09}
    constants.c4_gamma{"value": 0.7978845608028654, "rel_tol": 1e-12}
    constants.D4{"value": 3.2665319192886013, "rel_tol": 1e-08}
  2. r0002n = 3 closed forms: d2 = 3/sqrt(pi), c4 = Gamma(3/2) = sqrt(pi)/2, rel 1e-8 (quadrature)passed

    constants.d2{"value": 1.692568750643269, "rel_tol": 1e-08}
    constants.c4{"value": 0.8862269254527579, "rel_tol": 1e-09}
  3. r0003n = 5: c4 = sqrt(2/4) Gamma(5/2)/Gamma(2) = 3 sqrt(pi)/(4 sqrt 2), A3 = 3/(c4 sqrt 5) (closed forms, rel 1e-9); d2(5) = 2.32593 and A2(5) = 0.577 (Tippett 1925 / ASTM STP 15D textbook table, abs to its last digit)passed

    constants.c4{"value": 0.9399856029866251, "rel_tol": 1e-09}
    constants.A3{"value": 1.427299292922217, "rel_tol": 1e-09}
    constants.d2{"value": 2.32593, "abs_tol": 5e-06}
    constants.A2{"value": 0.577, "abs_tol": 0.0005}
  4. r0004centred process, sigma = (USL - LSL)/6: Cp = Cpk = 1, ppm = 1e6 erfc(3/sqrt 2) = 2699.796 (textbook 2700), ARL = 1/erfc(3/sqrt 2) = 370.4; closed forms, rel 1e-6passed

    cp1 ± 1e-091lockedunder 0.01 % of the tolerance used
    cpk1 ± 1e-091lockedunder 0.01 % of the tolerance used
    ppm_expected2699.8 ± 0.00272699.8lockedunder 0.01 % of the tolerance used
    false_alarm_rate0.0026998 ± 2.7e-120.0026998lockedunder 0.01 % of the tolerance used
    arl_in_control370.398 ± 3.7e-07370.398lockedunder 0.01 % of the tolerance used
  5. r0005six sigma with a 1.5 sigma shift (Motorola): Cp = 2, Cpk = 1.5, ppm = 1e6 (Q(4.5) + Q(7.5)) = 3.3977 (textbook 3.4); closed forms, rel 1e-6passed

    cp2 ± 2e-092lockedunder 0.01 % of the tolerance used
    cpk1.5 ± 1.5e-091.5lockedunder 0.01 % of the tolerance used
    ppm_expected3.39767 ± 3.4e-063.39767lockedunder 0.01 % of the tolerance used
    fraction_outside_expected3.39767e-06 ± 3.4e-123.39767e-06lockedunder 0.01 % of the tolerance used
  6. r0006I-MR by hand on 1,3,2,4,3: mean 2.6, mean MR 1.5, sigma = 1.5 sqrt(pi)/2, UCL = 2.6 + 3 sigma, MR UCL = 1.5 (1 + 3 sqrt(pi/2 - 1)), s = sqrt(1.3); exact arithmetic, rel 1e-8 (d2, d3 by quadrature)passed

    chart= i_mri_mrlockedexact match
    mean2.6 ± 2.6e-122.6lockedunder 0.01 % of the tolerance used
    dispersion_mean1.5 ± 1.5e-121.5lockedunder 0.01 % of the tolerance used
    sigma_within1.32934 ± 1.3e-081.32934lockedunder 0.01 % of the tolerance used
    location_ucl6.58802 ± 6.6e-086.58802lockedunder 0.01 % of the tolerance used
    location_lcl-1.38802 ± 1.4e-08-1.38802lockedunder 0.01 % of the tolerance used
    dispersion_ucl4.8998 ± 4.9e-084.8998lockedunder 0.01 % of the tolerance used
    sigma_overall1.14018 ± 1.1e-121.14018lockedunder 0.01 % of the tolerance used
    in_control= truetruelockedexact match
  7. r0007X-bar R by hand on four subgroups (-1, 1), specs -6..6: sigma_within = R/d2 = sqrt(pi), Cp = Cpk = 2/sqrt(pi), s = sqrt(8/7), Pp = 2 sqrt(7/8), UCL = 3 sqrt(pi/2), R UCL = 2 (1 + 3 sqrt(pi/2 - 1)); exact arithmetic, rel 1e-8passed

    chart= xbar_rxbar_rlockedexact match
    sigma_within1.77245 ± 1.8e-081.77245lockedunder 0.01 % of the tolerance used
    cp1.12838 ± 1.1e-081.12838lockedunder 0.01 % of the tolerance used
    cpk1.12838 ± 1.1e-081.12838lockedunder 0.01 % of the tolerance used
    pp1.87083 ± 1.9e-121.87083lockedunder 0.01 % of the tolerance used
    ppk1.87083 ± 1.9e-121.87083lockedunder 0.01 % of the tolerance used
    location_ucl3.75994 ± 3.8e-083.75994lockedunder 0.01 % of the tolerance used
    dispersion_ucl6.53306 ± 6.5e-086.53306lockedunder 0.01 % of the tolerance used
    ppm_observed00locked
  8. r0008rules by construction, standards mean 0 sigma 1: a 4 sigma spike gives 1 point beyond 3 sigma and 2 moving ranges of 4 above (d2 + 3 d3) = 3.686; then 8 points at +0.5 sigma give one run of 8 (Western Electric)passed

    in_control= falsefalselockedexact match
    rule_counts.beyond_limits= 1misseddiffers
    rule_counts.dispersion_beyond_limits= 2misseddiffers
    rule_counts.run_same_side= 1misseddiffers
    rule_counts.two_of_three_beyond_2_sigma= 0misseddiffers
    rule_counts.four_of_five_beyond_1_sigma= 0misseddiffers
    dispersion_ucl3.68589 ± 3.7e-083.68589lockedunder 0.01 % of the tolerance used
8 of 8 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
dataThe measurements: a list of subgroups (each an inner list of equal length), or a flat list cut into subgroups of subgroup_size. Leave out to get the constants (and, with process_mean and process_sigma, the capability of a described process).
data_unit1Unit of the measurements, the specification limits and the process mean and sigma (mm, um, g, ...). Only recorded and passed on to the readings.
subgroup_size11Parts measured together, used to cut a flat data list; 1 charts individuals. Without data: the n of the constants.
chartautoauto: i_mr for single values, xbar_r for subgroups up to 10, xbar_s above.
ruleswestern_electricwestern_electric: beyond limits, 2 of 3 beyond 2 sigma, 4 of 5 beyond 1 sigma, 8 in a row on one side. nelson adds trend of 6, 14 alternating, 15 within 1 sigma, 8 beyond 1 sigma on both sides, and takes 9 in a row. Every set also flags the dispersion chart beyond its limits.
limit_sigmas13Control limits at this many standard deviations of the plotted statistic.
lslLower specification limit (optional).
uslUpper specification limit (optional).
process_meanKnown (standard) process mean: centres the chart. Without data, the mean of the described process.
process_sigmaKnown (standard) process standard deviation, greater than 0: sets the limits. Without data, the sigma of the described process.
constants_table_max_n10If 2 or more, also tabulate d2, d3, c4, A2, A3, B3-B6, D1-D4, E2 for n = 2 up to this, at limit_sigmas (out/constants.csv).

Readings

NameUnitMeaning
data_unit1The unit the location readings are in.
mode1"data" (charted measurements) or "model" (constants and a described process).
chart1
subgroup_size1
subgroups_n1
observations_n1
limit_sigmas1
false_alarm_rate1Probability that one in-control point falls beyond the limits, 2 (1 - Phi(L)).
arl_in_control1Average run length between false alarms, in points.
meanGrand mean of the data (or the described process mean).
sigma_withinMean range / d2, mean s / c4, or mean moving range / d2(2).
sigma_overallSample standard deviation of every observation (n - 1).
dispersion_mean
location_cl
location_lcl
location_ucl
dispersion_cl
dispersion_lcl
dispersion_ucl
in_control1true when no rule fired; null without data.
signals_n1
signal_points_n1
signals1
signals_detail1
rule_counts1
cp1(USL - LSL) / 6 sigma_within.
cpk1min(USL - mean, mean - LSL) / 3 sigma_within.
cpu1
cpl1
pp1(USL - LSL) / 6 sigma_overall.
ppk1As Cpk with sigma_overall.
sigma_level13 Cpk: the distance from the mean to the nearer specification limit in sigma_within.
fraction_outside_expected1ppm_expected / 1e6: the fraction of parts expected outside the specification, the number to chain into other runs.
ppm_expectedNo unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected outside the specification, normal with the mean and sigma_within (a count per million parts, not a fraction).
ppm_below_lslNo unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected below LSL.
ppm_above_uslNo unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected above USL.
ppm_expected_overallNo unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected outside, with sigma_overall.
ppm_observedNo unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million of the measurements that fall outside the specification.
constants1d2, d3, c4 (by integration), c4_gamma (Gamma-function check), and A2, A3, B3-B6, D1-D4, E2 at limit_sigmas for the subgroup size.
constants_table1
points1
points_truncated1
notes1

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call