Click here to Skip to main content
15,896,606 members
Articles / Programming Languages / C# 4.0

Process Performance Determination in C# Part 4

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
29 Jun 2012CPOL4 min read 16.3K   144   2  
The program presented here provides a simple way to obtain process performance through Z-transformation.
  • ProcessPerformance4.zip
    • ProcessPerformance4
      • ExcelNORMSDIST
      • Local.testsettings
      • ProcessPerformance4.sln
      • ProcessPerformance4.suo
      • ProcessPerformance4.vsmdi
      • ProcessPerformance4
      • TestProcessPerformance4
      • TestResults
        • Sitt_JANAKA-PC 2012-06-21 15_25_25.trx
        • Sitt_JANAKA-PC 2012-06-21 15_37_11.trx
        • Sitt_JANAKA-PC 2012-06-21 15_37_40.trx
        • Sitt_JANAKA-PC 2012-06-21 15_55_12.trx
        • Sitt_JANAKA-PC 2012-06-21 15_55_12
          • In
            • JANAKA-PC
          • Out
            • AgentRestart.dat
        • Sitt_JANAKA-PC 2012-06-21 15_57_59.trx
        • Sitt_JANAKA-PC 2012-06-21 15_57_59
          • In
            • JANAKA-PC
          • Out
            • AgentRestart.dat
        • Sitt_JANAKA-PC 2012-06-21 16_01_07.trx
        • Sitt_JANAKA-PC 2012-06-21 16_07_56.trx
        • Sitt_JANAKA-PC 2012-06-21 17_13_54.trx
        • Sitt_JANAKA-PC 2012-06-21 17_14_22.trx
        • Sitt_JANAKA-PC 2012-06-26 15_56_21.trx
      • TraceAndTestImpact.testsettings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExcelNORMSDIST;

namespace ProcessPerformance4
{
    /// <summary>
    /// Process Performance from Z-Transformation Result class
    /// </summary>
    public class ProcessPerformanceFrZResult
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public ProcessPerformanceFrZResult() { }
        /// <summary>
        /// Expected % > USL
        /// </summary>
        public double PercentMoreThanUSL;
        /// <summary>
        /// Expected % < LSL
        /// </summary>
        public double PercentLessThanLSL;
        /// <summary>
        /// Expected yield (overall) %
        /// </summary>
        public double PercentYieldOverall;
    }

    /// <summary>
    /// Determine Process Performance from Z
    /// </summary>
    public class ProcessPerformanceFrZ
    {
        private double xBar = 0;
        private double s = 0;
        private double LSL = 0;
        private double USL = 0;
        private double percentMoreThanUSL = 0;
        private double percentLessThanLSL = 0;
        private double percentYieldOverall = 0;

        /// <summary>
        /// ProcessPerformanceFrZ Result
        /// </summary>
        public ProcessPerformanceFrZResult Result = new ProcessPerformanceFrZResult();

        #region constructor
        /// <summary>
        /// ProcessPerformanceFrZ default constructor
        /// </summary>
        public ProcessPerformanceFrZ() { }//default empty constructor
        #endregion//constructor

        /// <summary>
        /// Write only property: Mean
        /// </summary>
        public double XBar
        {
            set { xBar = value; }
        }

        /// <summary>
        /// Write only property: Std Dev
        /// </summary>
        public double StdDev
        {
            set { s = value; }
        }

        /// <summary>
        /// Write only property: Lower Spec Limit
        /// </summary>
        public double LowerSpecLimit
        {
            set { LSL = value; }
        }

        /// <summary>
        /// Write only property: Upper Spec Limit
        /// </summary>
        public double UpperSpecLimit
        {
            set { USL = value; }
        }

        /// <summary>
        /// Calculate the Process Performance from Z
        /// </summary>
        public void Analyze() 
        {
            percentMoreThanUSL = 100 * (1 - Excel.NORMSDIST((USL-xBar)/s));
            percentLessThanLSL = 100 * (Excel.NORMSDIST((LSL-xBar)/s));
            percentYieldOverall = 100 - percentMoreThanUSL - percentLessThanLSL;
            //Results
            Result.PercentMoreThanUSL = percentMoreThanUSL;
            Result.PercentLessThanLSL = percentLessThanLSL;
            Result.PercentYieldOverall = percentYieldOverall;
        }
    }//end class ProcessPerformanceFrZ
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Foundasoft.com
Malaysia Malaysia
Consultant

Comments and Discussions