otaf.capabilities package
Module contents
Capability assessment and process analysis tools.
- otaf.capabilities.process_capability(usl, lsl, mean, std_dev)[source]
Calculate the process capability indices Cp, CPU, CPL, Cpk, and k.
- Parameters:
usl (float) – Upper Specification Limit.
lsl (float) – Lower Specification Limit.
mean (float) – Mean of the process ($bar{x}$).
std_dev (float) – Standard deviation of the process ($sigma$).
- Returns:
dict of {str – A dictionary containing the calculated capability metrics: - ‘Cp’ : Process potential index. - ‘CPU’ : Upper process capability index. - ‘CPL’ : Lower process capability index. - ‘Cpk’ : Minimum process capability index. - ‘k’ : Standardized deviation from the specification center.
- Return type:
float}
Notes
The capability indices are computed using the following formulas:
\[ \begin{align}\begin{aligned}C_p = \frac{usl - lsl}{6\sigma}\\CPU = \frac{usl - \mu}{3\sigma}\\CPL = \frac{\mu - lsl}{3\sigma}\\C_{pk} = \min(CPU, CPL)\\k = \frac{|\mu - m|}{\frac{usl - lsl}{2}}\end{aligned}\end{align} \]Where $m = frac{usl + lsl}{2}$ is the specification midpoint.
- Raises:
ZeroDivisionError – If std_dev is 0, resulting in a division by zero during indices calculation.
ValueError – If usl is less than lsl, resulting in an invalid specification range, or if std_dev is negative.
- Parameters:
usl (float)
lsl (float)
mean (float)
std_dev (float)
- Return type:
dict[str, float]