根据CPK 公式 使用java 代码实现

2024-09-06 16:37:00 浏览数 (2)

代码语言:javascript复制
String[] strArray = {
        "10", "20", "30", "40", "50",
        "50", "40", "30", "20", "10",
        "10", "20", "30", "40", "50",
        "10", "20", "30", "40", "50",
        "10", "20", "30", "40", "50"
};

//上限 下限 平均值
double usl = 50;
double lsl = 10;
double mean = 30;

// 标准差
double stdev = calculateStandardDeviation(strArray);
System.out.println("stdev : "   stdev);

// 平均值 -- 最大值---最小值
sumAvgValue(strArray,stdev);

//计算 cpk
double cpk = calculateCpk(usl, lsl, mean, stdev);
System.out.println("cpk : "   cpk);

// 计算 cp 制程 精密度
double cp = calculateCp(usl, lsl, mean, stdev);
System.out.println("cp : "   cp);

// 计算 CPL 相对于下限规格的工序能力
double cpl = calculateCpl(mean, lsl, stdev);
System.out.println("cpl : "   cpl);

// 计算 CPU 相对于上限规格的工序能力
double cpu = calculateCpu(usl, mean, stdev);
System.out.println("cpu : "   cpu);

0 人点赞