Computers ind. Engng Vol. 20, No. I, pp. 1-16, 1991 Printed in Great Britain. All rights reserved
0360-8352/91 $3.00+ 0.00 Copyright © 1991 Pergamon Press plc
RELIABILITY D E M O N S T R A T I O N TEST A N D OC CURVES FOR ATTRIBUTE DATA TONY LrN a n d MICHAEL D . HOLBROOK GMI Engineering & Management Institute Flint, MI 48504 and AC Rochester Division, General Motors Corporation, Flint, MI 48502, U.S.A.
(Received for publication 29 March 1990) Abstract--Binomial reliability test plan procedures are widely used to demonstrate the satisfaction of the contractual reliability requirements. In this paper, a computer program for binomial test plans is developed to provide the user with desired information such as sample size, confidence level, designed reliability goal, and number of failures permitted in a more efficient and timely manner. An operating characteristic curve can be plotted by using the data file generated from the program to evaluate the test plans.
1. INTRODUCTION
A success-failure reliability test is frequently used to determine if a product is qualified for its intended application. It is also a common practice in industry to use such a test procedure to demonstrate compliance to contractual reliability requirements. A description of the success-failure reliability test using the binomial distribution can be found in Lloyd and Lipow [1]. General procedures to obtain test plans involve for example, using a nomograph by Larson [2], a Poisson approximation, or binomial distribution tables such as "Tables of Binomial Probability Distribution" [3]. The mechanics of the procedure can involve time consuming computation or reference to tables. The computer program discussed here is developed to allow engineers to obtain test plans and other necessary information more accurately and efficiently. Operating Characteristic (OC) curves play an important role in describing the protection provided by reliability test plans. When a customer provides specified reliability requirements for a success-failure reliability test, OC curves can be helpful in evaluating reliability test plans so that the producer and the customer can agree upon the conditions both parties want. The computer program is used to generate a data file of the OC curve for a test plan which can then be plotted by using any graphic routine.
2. PROGRAM DESCRIPTION
The computer program designs reliability test plans based on the binomial distribution. The following formula is used in the calculation:
(i) where P = probability of failure
=l-R, R = reliability, f = acceptable number of observed failures, n = number of units tested, and L(P) = probability of acceptance. It is desired to construct a test plan for a product such that the probability of acceptance is, at least, 1 - ~t with reliability Rd and the probability of acceptance is, at most, fl with reliability Re. CAm20/I--A
1
2
TONY LIN a n d MICHAEL D. HOLBROOK Table 1. Options for the program
Option
Table 2. Options for the second menu
Comment
Calculate sample size n Calculate confidence level 1 - 8 Calculate reliability Ro Calculate f Calculate reliability Rd Determine (n, f )
Option
Given f, confidence level (I - 8 ) , and Rc Given n, f, and Rc Given n, f, and confidence level (1 - 8 ) Given n, confidence level (1 - 8 ) , and Rc Given n, f, ~, 8, and Re Given ~, Rd, 8, and R~
Determine Rd for the plan Generate OC curve--data file Print plan Return to main menu Quit
The program determines the solution of the test plan by solving the following inequalities: L(e~)/> ] - ~
(2)
L(P¢) ~~
(3)
where Pd = 1 -- Rd, and
Pc= 1-Re, to obtain n and f. In some applications, only inequality (3) is specified for contractual reliability requirements. For example, a test plan may consist of the customer's (minimum) reliability requirement, R¢ with associated risk/~, i.e. the customer wants reliability R¢ to be demonstrated with confidence 1 - / ~ by the producer. A variety of test plans are available for such reliability requirements. In the program, the variables n and f a r e determined by using an iterative process to solve inequality (3) for a fixed n or f. From a producer's perspective, a resonable design reliability goal Rd at an acceptable risk • has to be determined based on the desirable test plan, The program obtains Rd iteratively by using inequality (2) for given n, f, ~,/~ and Re. The exact confidence level can also be computed for each reliability test plan. 3. P R O G R A M
OPERATION
The computer program is menu driven. Table 1 gives the options available to obtain a reliability test plan and other pertinent information. When the program is initiated, an introductory screen, Fig. 1, appears which prompts the user to press any key to continue. The second screen, Fig. 2, is the main menu. The program prompts the user for an optional title and all inputs required to perform the selected option. On completion of the task, the results are displayed and a second menu appears below the results. The second manu offers the options to determine the necessary design reliability, generate a data file which can be used to produce an operating characteristic curve, print the plan, return to the main menu, or quit. This program deligne reliability ~eltm ba6ed on the binomial generatem their operatin9 characteristic (OC) c u r v e . The
program
the
calculatel
following
diltribution
and
formula:
F
L(p)
= Z
{(Nt/x!(N-x)!)
* p^x
~
(l-p)^(N-x)}
x=O
Where:
L(p) F N p
= Probability = Number of = Number of • ProbQbility
of acceptance obmerved failures feet8
of
failure
(l-R) R 10-10-1988
Preee
any
key
to
•
Reliability
continue.
Fig. I. I n t r o d u c t o r y screen display.
Revised
10-10-1988
Reliability demonstration test and OC curves ~elect
one
of
Calculate
1. 2.
Calculate
3. 4. 5. 6. 7.
Calculate Calculate Calculate Determine Quit
the
following
3
options:
sample size confidence level reliability n u m b e r of f a i l u r e s p e r m i t t e d Rd g i v e n a, Re, ~, N. and F r e l i a b i l i t y teat plan g i v e n a, ~, Rd,
and Rc
Fig. 2. Main menu.
Reliability and risk inputs are tested for validity. For Option 4, "Calculate number of failures permitted," of the main menu, the program provides a warning if the stated sample size is insufficient to demonstrate the required reliability at the required confidence level. Currently the maximum number of failures is limited to 100 becomes the computing time increases rapidly with large failure quantities. This limitation can be easily changed by changing the I F . . . T H E N . . . ELSE statement in the I N V A L I D F section of the INDATA subroutine (see Appendix). The program is written in Microsoft QuickBASIC Version 3.0. QuickBASIC programs run from a compiler rather than an interpreter as in traditional BASIC. The " O N E R R O R " and " R E S U M E NEXT" options must be selected when the program is compiled.
3.1. Example 1 It is often necessary to determine a reliability test plan that will provide controlled consumer's and producer's risks, when it is required to demonstrate the customer's reliability requirement if the product design reliability is known. In this example ~ = fl = 0.05, Rc = 0.995, and the product design reliability Rd = 0.999. To solve this problem, Option 6 "Determine reliability test plan, given ~, fl, Rd, and Re," is selected. The screen shown in Fig. 3 will be presented. The user can specify a title at this time or he can press ENTER to bypass the title. The program will prompt the user to enter ~t, 8, Ro and Rc respectively. Note that these values may be entered in .nnnnnn or nn.nnnn formats. The results presented in Fig. 4 give the reliability test plan as n = 1829 and f = 4. The actual values • and ~ are 0.038459 and 0.049864 respectively due to the integer nature o f n andf. Selection of Option 2, "Generate OC curve----data file," at this time will generate an ASCII data file which can be used to generate an operating characteristic curve shown in Fig. 5.
3.2. Example 2 Another common problem may be stated as, "What sample size must be tested to demonstrate the specified customer reliability and confidence level requirements?" In this example, the reliability requirement is R~ = 0.95, the confidence level is 1 - fl = 0.9, and it has been agreed that a maximum o f f = 3 failures can occur. To solve this problem, Option 1 (menu 1) "Calculate sample size." is selected. Again, the user can specify an optional title. The program will prompt the user to enter the number of failures, the confidence level, and the reliability requirements respectively. The results of the calculation, Fig. 6, indicate that a sample size of n = 132 must be tested to demonstrate the customer reliability requirement of Rc = 0.95 at the 90% confidence level when Reliability
T e s t Plan:
3ample size, N: Number of failures, F: Producers risk, ~: Consumers risk, ~: Design reliability0 Rd: C u s t o m e r r e l i a b i l i t y , Re:
E n t e r title:
Fig. 3. Screen display of Option 6 in main menu.
0 0 0.000000 0.000000 0.000000 0.000000
4
TONY LIN and MICHAEL D. HOLBROOK Reliability
Teat Plan:
S a m p l e size, N: N u m b e r of f a i l u r e e 0 F: P r o d u c e r m tieR, =: C o n e u m e r e rilk, ~ : D e m i g n r e l i a b i l i t y , Rd: C u s t o m e r r e l i a b i l i t y , Re:
Select
one
of
1. D e t e r m i n e 2.
the
following
Rd for
Generate
OC
curve
3, P r i n t p l a n 4. R e t u r n to m a i n 5. Q u i t
1829 4
0.038459 0.049864 0.999000 0.995000
optioni:
thie plan Data File
menu 10-10-1988
Fig. 4. Results of the reliability test plan ~ r example 1 and display o f the ~ c o n d menu.
--•
1.0
. 0.8 .J
,
Test plan :
::829
,
C O
a = 0.0385 ~' - 0.0499 RD - 0.9990 RC - 09950
~. 0.6 o uu o
~ 0.4 C
.Q p
~
0.2
I
i 0.004
0.002
I
0.006
O.OO8
ProbabiLity o f f a i l u r e P
Fig. 5. OC Curve of the test plan for example 1. Calculation of Sample
Size:
Sample size required: Nunber of failureo: Confidence level requirement: Reliability requirelent: Actual confidence level:
Select
one
of
the Rd f o r
following
1.
Determine
2.
Generate
3. 4. 5,
P r i n t plan R e t u r n t o main menu Quit
OC
curve
132 3 0.900000 0.950000 0.900772
opticne:
thim plan - Data File
10-10-1988
Fig. 6. Results of the reliability test plan ~ r example 2 calculation of Option l (menu 1) and display of t h e s e c o n d menu.
f = 3 failures have occurred. Notice that the actual confidence level is given as 0.900772 because of the integer nature of n and fi A second consideration in this case may be stated as, "What reliability must the product be designed for if the producer wishes to control his risk?" To answer this question, Option 1 (menu 2) "Determine Rd for this plan," is selected from the second menu. The results, Fig. 7, show that
Reliability demonstration test and OC curves Reliability
Teat
Plan:
5ample eizo, N: Number of feiluree, F: Produoere rick, a: Coneumere rick, 4: Deeign reliability, Rd: Cuetomer r e l i a b i l i t y , Re:
5elect
one
1.
Determine
2.
Generate
3. Print 4. Return 5 , Quit
of
the Rd
following for
thia
OC c u r v e
-
5
132 3 0.100000 0.099228 0.986718 0.950000
optione:
plan Data File
plan
to main m e n u i0-10-1988
Fig. 7. Resultsof the reliabilitytestplan ~r example 2 tabulation of Option I (menu 2) and display of the second menu. 1.o
0.8 Test pt0n :
.J
N - 132 F-3
=
0.6
- O. 1000
/9 - 0 . 0 9 9 2 u C
RD - 0 . 9 8 6 7 RC - 0 . 9 5 0 0
°I ~, 0.4
.-!
J~
I1- 0.2
I 0
0.02
0.02
0.06
0.08
0.10
ProbobiLity of foiLure P Fig. 8. OC Curve of the test plan for example 2.
the product must be designed for a reliability of at least 0.986718 if the producer's risk ~t is to be controlled at 0.1 or less. Selection of Option 2, "Generate OC curve---data file," at this time will generate an ASCII data file which can be used to generate an operating characteristic curve such as Fig. 8. 4. CONCLUSIONS
In this paper, we presented the reliability practitioner with a computer program capable of providing reliability test plans without resorting to hand calculations or reference to tables. The program has been tested and used over a year and a half by the product assurance group at AC Rochester division of General Motors Corporation without any reported problems. The use of a math coprocessor is recommended to minimize computation time and to achieve maximum precision. Future enhancement of the program would include development of a graphic routine to plot the OC curves.
Acknowledgements--The authors would like to acknowledge the efforts of Drew Hoelscher who suggested many alternative methods in the writing of this program. We also want to thank the referees for their useful review and helpful suggestions.
6
TONY LIN and MICHAELD. HOLBROOK REFERENCES
I. D. K. Lloyd and M. Lipow. Reliability: Management, Methods, and Mathematics, 2nd Edn, American Society for Quality Control, pp. 279-297 (1977). 2. H. R. Larson. A nomograph of the cumulative binomial distribution. Ind. Qual. Control 23(6), 270-278 (1966). 3. U.S. Department of Commerce. National Bureau of Standards. Tables of the Binomial Probability Distribution, Applied Mathematics Series 6. Washington, D.C. (1950).
APPENDIX
Program Listing BINOHIAL DISTRIBUTION Reliability Demonstration Test g i t h OC C u r v e C a p a b i l i t y 'Author: t w
M.D. Holbrook AC R o c h e s t e r Product Flint, Hlchlgan
Prograa
Assurance
REVS="Ot-29-1989"
KEY O F F = C L S FOR 1=1 TO 10= KEY I , " " = NEXT DEFDBL A-Z DIN LP(IOO),PF(IO0) ON ERROR GOTO HANDLER BS="RELIABILITY DEHONSTRATION T E S T PROGRAM" CS="RELIABILITY DEMONSTRATION T E S T " EI=nOPERATING CHARACTERISTIC CURVE"
F~=WRalimbillty
Test
GSfWProbabillty
Plan" of
acceptance p"
LIp)"
H$="Probabillty of failure TITLES= w" CLS: COLOR 1 5 , 1 , 8 = CLS
LOCATE 3 , 1 N T ( ( ( 8 0 - L E N ( B $ ) ) / 2 ) + 3 ) , O = P R I N T BS LOCATE 6 , 2 , 0 = PRINT "This program designs reliabili";_ "ty tests based on the binomial distribution and" LOCATE 7 , 2 , 0 : PRINT "generates their operating char";_ "acteristic (OC) c u r v e . " LOCATE 9 , 2 , 0 = PRINT "The program calculates the fol";_
"lowing
formula:"
LOCATE 1 1 , 2 2 , 0 = PRINT "F" PRINT SPC(14)"L(p) = E i(N!/x!(N-x)!) m p^x m (t-p)";_ "^(N-x)}" PRINT SPC(20)"x=O" LOCATE 1 5 , 1 5 , 0 : PRINT "Where= Lip) = Probability o";_ "f acceptance" PRINT SPC(iS)"F = Number of observed failures" PRINT SPC(25)nN = Number of tests PRINT SPC(25)"p = Probability of failure" PRINT SPC(27)"= (I-R)" PRINT SPC(25)"R = Reliability" LOCATE 2 3 , 2 , 0 = PRINT "Press any key to continue." LOCATE 2 3 , 6 2 , 0 = P R I N T "Revised ";REV$ LOOPINTRO:
AS=INKEYS= 'NAINHENU
-
IF AS="" THEN GOTO LOOPINTRO
Display
lain
menu.
NAINHENU= CLS: CHOICE1,="": RD=O: RC=O: R=O= C L = O : CLC=O B E T A = O : N=O= F = O : DR=O ALPHA=5 "Default • to undefined code (5). LOCATE 5 , 1 N T ( ( ( O O - L E N ( B S ) ) / 2 ) * 3 ) , O : P R I N T Be LOCATE 7 , 1 1 , 0 : PRINT "Select one of the folio,i"; "ng options= " LOCATE 9 , 1 , 0 = PRINT SPACES(80) LOCATE 9 , 1 1 , 0 = PRINT "t. Calculate sample size" PRINT SPC(IO) "2. Calculate confidence level" PRINT SPC(IO) "3. Calculate reliability" PRINT SPC(IO) "4. Calculate nuaber of failures ";_ "permitted" PRINT SPC(IO) "S. Calculate Rd g i v e n ~, Rc, ~, ";_ "N, and F"
Reliability demonstration test and OC curves
7
PRINT SPC(IO) "6. Determine reliability test pl";_ nan liven ~ , B, Rd, a n d R c " PRINT SPC(IO) "7. Quit" LOCATE 2 3 , 7 0 , 0 = P R I N T DATES LOOPNENU: CHOICES=INPUTS(I) I F V A L ( C H O I C E S ) < = 6 AND V A L ( C H O I C E S ) = > I THEN CHOICE=VAt(CHOICES) END I F I F C H O I C E S < U 1 " OR C H O I C E S > " 7 " THEN BEEP: GOTO LOOPHENU E L S E I F C H O I C E S = " 7 w THEN COLOR 7 , 0 , 0 : C L S : S Y S T E H : END
END I F •
. . . . S e t P R I N T S E T f o r SCREEN & P R I N T E R o p e r a t i o n . PRINTSET=CHOICE GOSUB INDATA 'Input data. ON V A L ( C H O I C E $ ) GOSUB C A L C N , C A L C C L , C A L C R , C A L C F , _ CALCRD,CALCPLAN GOSUB HENU2 "Call HENU2. GOTO HAINHENU •Repeat m a i n menu. 'HENU2
-
This
subroutine
HENU2: • ....
the
I f WARNS s e t , then I F WARNS
seccond
return
menu.
to
NAINNENU.
W A R N I = " " = RETURN END I F ' . . . . R e s e t CHOICE t o d i s a b l e HAINHENU o p t i o n s when • using HENU2. i GOSUB SCRN= CHOICE=O ' .... Display HENU2. LOCATE 1 7 , 1 1 , 0 = PRINT "Select one of the follow";_ "lng options: " LOCATE 1 9 , 1 , 0 : PRINT SPACES(80) LOCATE 1 9 , 1 1 , 0 = PRINT Wl. D e t e r m i n e Rd f o r this";_ w plan" PRINT SPC(IO) "2. Generate OC c u r v e - Data File" PRINT SPC(IO) "3. Print plan" PRINT SPC(IO) "4. Return to main menu" PRINT SPC(IO) "5. Quit" CHOICElS=INPUT$(1) IF CHOICElS="I" THEN P R I N T S E T = 5 : GOSUB CLEAN: GOSUB INDATA GOSUB CALCRD: GOTO MENU2 END I F IF CHOICEI$="2" THEN GOSUB CLEAN: GOSUB OCCURVE: GOTO NENU2 END I F IF CHOICEIS="3" THEN GOSUB C L E A N : GOSUB P R I N T E R : GOTO HENU2 END I F IF CHOICElS="4" THEN CLS: TITLES="": P R I N T S E T = O : RETURN END I F IF CHOICEIS="5" THEN COLOR 7 , 0 , 0 : C L S : SYSTEN: END END I F BEEP GOTO NENU2 'CLEAN •
-
This subroutine NENU2 c h o i c e .
CLEAN: LOCATE 1 6 , 1 , 0 FOR ! = 1 TO 7 : LOCATE 2 3 , 1 , 0 : RETURN 'INDATA
-
This
cleans
up
PRINT SPACES(80): PRINT SPACES(69)
subroutine
inputs
the
screen
NEXT
after
1
data.
INDATA: I F NOT C H O I C E I I = ' i " THEN C L S : GOSUB SCRN "Call results LOCATE 1 7 , 3 , 0 = INPUT " E n t e r title= LOCATE 1 7 , 1 , 0 : PRINT SPACES(80)
screen. ",TITLES
8
TONY LIN and MICHAEL D. HOLBROOK
'
GOSUB SCRN END I F .... Enter sample size, I F NOT C H O I C E = 6 THEN
N.
I F NOT CHOICE=I AND NOT C H O I C E l t = " I " LOCATE 1 7 , 3 p 0
'
'
' •
' •
THEN
INPUT R E n t e r s a m p l e s i z e =
",N LOCATE 1 7 , 1 , 0 : PRINT SPACEe(80) END I F I F NOT C H O I C E I $ = " I " THEN GOSUB SCRN END I F .... Enter number of failures, F. I F NOT C H O I C E = 6 THEN I F NOT C H O I C E = 4 AND NOT C H O I C E I $ = " I " THEN LOCATE 1 7 , 3 , 0 PRINT "Enter number of failures: " LOCATE 1 7 , 3 5 , 0 : INPUT " " , F LOCATE 1 7 , 1 , 0 = PRINT SPACES(80) END I F .... Limit number of failures to ~ 100. INVALIDF= I F NOT C H O I C E = I THEN I F F>N THEN LOCATE 1 7 , 3 , 0 = SEEP PRINT "Number of failures must be";_ " < N - enter new v a l u e = n ; S P A C E S ( 1 7 ) LOCATE 1 7 , 5 3 , 0 = INPUT " " , F LOCATE 1 7 , 1 , 0 = PRINT SPACES(80) GOTO I N V A L I D F END I F END I F I F F > I O 0 THEN LOCATE 1 7 , 3 , 0 : BEEP PRINT "Failures limited t o ~ 100 - " ; _ Renter new v a l u e : " ; S P A C E S ( 1 7 ) LOCATE 1 7 , 4 8 , 0 = INPUT " " , F LOCATE 1 7 , 1 , 0 : PRINT SPACEI(80) GOTO I N V A L I D F END I F I F NOT ( C H O I C E I $ = " I " ) THEN GOSUB SCRN END I F .... Enter confidence level CL, p r o d u c e r s risk ~, or consumers risk ~. I F NOT C H f l l C E = 2 THEN I F C H O I C E = 5 OR C H O I C E = 6 THEN LOCATE 1 7 , 3 , 0 PRINT "Enter ~: <.nnnnnn or nn.nnnn>" LOCATE 1 7 , 3 3 , 0 = INPUT " " , A L P H A CL=ALPHA= CHECKCON=I= GOSUB CHECKCL REQRDLP=I-ALPHA LOCATE 17,1,0: PRINT SPACEe(80) LOCATE 17,3,0 P R I N T R E n t e r ~: < . n n n n n n or n n . n n n n > n LOCATE 17,33,0: INPUT "",BETA C L = B E T A : CHECKCDN=2: GOSUB CHECKCL REQRDLP=I-BETA LOCATE 1 7 , 1 , 0 = PRINT SPACES(80) LOCATE 1 7 , 3 , 0 ELSEIF CHOICEle="I" THEN LOCATE 17,3,0 PRINT REnter ~: <.nnnnnn or nn.nnnn>" LOCATE 1 7 , 3 3 , 0 = INPUT " " , A L P H A CL=ALPHA= CHECKCON=I= GOSUB CHECKCL REQRDLP=I-ALPHA LOCATE 1 7 , 1 , 0 : PRINT SPACE~(80) ELSE LOCATE 1 7 , 3 , 0 PRINT "Enter confidence level: <.nnnnnnW;_ " or n n . n n n n > " LOCATE 17,48,0= INPUT "",CL GOSUB CHECKCL: R E Q R D L P = I - C L LOCATE t 7 , 1 , 0 : PRINT SPACEe(80) END I F END I F .... Enter reliability R or customer reliability Ro. I F NOT C H O I C E = 3 AND NOT C H O 1 C E I S = " I w THEN I F C H O I C E = 6 THEN
R e l i a b i l i t y d e m o n s t r a t i o n test a n d O C c u r v e s
9
LOCATE 1 7 , 3 , 0 PRINT "Enter Rd: <.nnnnnn or nn.nnnnnn>" LOCATE 1 7 , 3 6 , 0 : I N P U T wm,RD R = R D : C H E C K R E L = I : GOSUB CHECKR
LOCATE 1 7 , 1 , 0 :
PRINT
SPACEr(80)
END I F LOCATE t7,3,0 I F C H O I C E = 5 OR C H O I C E = 6 THEN PRINT ~Enter Re: <.nnnnnn or nn.nnnnnn>" LOCATE 1 7 , 3 6 , 0 = INPUT "",RC R=RC= C H E C K R E L = 2 = GOSUB CHECKR ELSE PRINT "Enter reliability: <.nnnnnn or n"; "n.nnnn> ~ LOCATE 17,43,0: INPUT "",R GOSUB CHECKR END I F LOCATE 17,1,0: PRINT SPACES(80) END I F RETURN 'CHECKR
-
This
subroutine
checks
for
valid
R.
CHECKR= I F R > I THEN R = R / I O 0 'Insure that R is decimal. I F R > I OR R
-
This
subroutine
checks
for
valid
CL.
CHECKCL: I F C L > I THEN C L = C L / I O 0 'Insure that CL i s d e c i m a l . I F C L > I ON C L ( O THEN LOCATE 1 8 , 3 , 0 PRINT "Invalid confidence or risk level - i';_ "nput nev value:";SPACEt(17) LOCATE 1 8 , 5 5 , 0 : INPUT "",CL LOCATE 1 8 , 1 , 0 = PRINT SPACES(80) GOTO CHECKCL END I F I F CHECKCON=t THEN A L P H A = C L : CL=O I F CHECKCON=2 THEN B E T A = C L : CL=O CHECKCON=O I F NOT ( C H O 1 C E I $ = n l ~ ) THEN GOSUB SCAN RETURN 'SCREEN
-
This
subroutine
displays
the
results
screen.
SCRN= I F A L P H A = 5 THEN A L P H A T E N P = 5 : ALPHA=O LOCATE 3 , I N T ( ( ( 8 0 - L E N ( T I T L E S ) ) / 2 ) + 3 ) , O PRINT TITLEt LOCATE S , 1 N T ( ( ( 8 0 - L E N ( C S ) ) / 2 ) + 2 ) , O : P R I N T CS IF PRINTSET=I THEN LOCATE 7 , 2 3 , 0 PRINT "Calculation of Sample Size:" END I F IF PRINTSET=2 THEN LOCATE 7,23,0 PRINT "Caloulation of Confidence Level=" END I F I F P R I ~ T S E T = 3 THEN LOCATE 7 , 2 3 , 0 PRINT "Calculation of Reliability:" END I F I F P R I N T S E T = 4 THEN LOCATE 7 , 2 3 , 0
10
TONY LIN a n d MICHAEL D. HOLBROOK
•
'
'
'
PRINT "Calculation of Allowable Failures:* END I F I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LOCATE 7 , 2 3 , 0 PRINT =Reliability Test Plan:"; SPACES(20) END I F .... Print N to screen. I F P R I N T S E T = I THEN LOCATE 9 , 2 3 , 0 PRINT "Sample size required: "; P R I N T USING " n | | l | | " ; N END I F I F NOT P R I N T S E T = I THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LOCATE 9 , 2 3 , 0 PRINT "Sample size, N: P R I N T USING " | | l l | n " ; N ELSE LOCATE 9 , 2 3 , 0 PRINT "Sample size: P R I N T USING " # | | | | | " ; N END I F END I F .... Print F IF PRINTSET=4
to
screen. THEN
LOCATE 1 0 , 2 3 , 0 PRINT "Number of failures permitted: "; PRINT USING "IIItt";F END I F I F NOT P R I N T S E T = 4 THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LOCATE 1 0 , 2 3 , 0 PRINT "Number of failures, F:";SPACE$(12); P R I N T USING " | # i l l " ; F ELSE LOCATE 1 0 , 2 3 , 0 PRINT "Number of failures:";SPACE$(I5)| P R I N T USING " I l U # I n ; F END I F END I F .... Print ~ , ~ , o r CL t o s c r e e n . I F NOT P R I N T S E T = 2 THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LOCATE 1 1 , 2 3 , 0 PRINT "Producers risk, ~: "; PRINT USING "I.IIII#I";ALPHA LOCATE 1 2 , 2 3 , 0 PRINT "Consumers risk, J3: "; PRINT USING "#.lltIII";BETA ELSE LOCATE 1 1 , 2 3 , 0 PRINT "Confidence level requirement: "; PRINT USING "I.II#t#t";CL END I F END I F I F P R I N T S E T = 2 '*HEN LOCATE l i , 2 3 , 0 PRINT "Confidence level: "; PRINT USING "I.I#I#tl";CL END I F .... Print R, RD, o r RC t o s c r e e n . I F NOT P R I N T S E T = 3 THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LOCATE 1 3 , 2 3 , 0 PRINT "Design reliability, Rd: "; PRINT USING "#.IIIlll";RD LOCATE 1 4 , 2 3 , 0 PRINT "Customer reliability, Rc: "; P R I N T USING " # . l l l l n | " ; R C ELSE LOCATE 1 2 , 2 3 , 0 PRINT "Reliability requirement: "; PRINT USING "I.II#111";R END I F END I F I F P R I N T S E T = 3 THEN LOCATE 1 2 , 2 3 , 0 PRINT "Reliability: ";
";
";
Reliability demonstration test and OC curves PRINT USING "|.||||||w;R END I F • .... Print CLC t o s c r e e n . IF PRINTSET=I OR P R I N T S E T = 4 THEN LOCATE 1 3 , 2 3 , 0 PRINT "Actual confidence level: PRINT USING "|.I|O|||";CLC END I F I F A L P H A T E H P = 5 THEN A L P H A = 5 = ALPHATEHP=O LOCATE 2 3 , 7 0 , 0 = P R I N T DATES RETURN 'PRINTER '
-
This subroutine the printer.
prints
out
the
11
";
results
to
PRINTER: LPRINT CHRO(IO);CHR$(IO);CHR~(IO);CHRS(IO); CHR$(IO);SPC(INT(((80-LEN(TITLEe))/2)+4));TITLE$; CHR$(IO) LPRINT SPC(INT(((80-LEN(C$))/2)÷3));C~;CHR$(IO) IF PRINTSET=I THEN LPRINT 5PC(24) "Calculation of Sample Size:',CHR$(IO) END I F I F P R I N T S E T = 2 THEN LPRINT SPC(24) "Calculation of Confidence L";_ "evel:w;CHR$(lO) END I F I F P R I N T S E T = 3 THEN LPRINT 5PC(24) "Calculation of Reliability:";_ CHR$(IO) END I F I F P R I N T S E T = 4 THEN LPRINT SPC(24) "Calculation of Allowable ";_ "FalIures:";CHRS(IO) END I F I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LPRINT 5PC(24) "Reliability Test Plan:";_ CHR$(IO) END I F ' .... Print N to printer. IF PRINTSET=I THEN LPRINT SPC(24) "Sample size required:";_ SPC(121; LPRINT USING "|||I||";N END I F I F NUT P R I N T S E T = I THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LPRINT SPC(24) "Sample size, N:';SPC(16); LPRINT USING "IIlIil";N ELSE LPRINT SPC(24) "Sample size:";SPC(21); LPRINT USING "IIIIII";N END I F END I F ' .... Print F to printer. I F P R I N T S E T = 4 THEN LPRINT 5PC(24) "Number of failures permitte";_ "d:";SPC(S); LPRINT USING "|W||I";F END I F I F NOT P R I N T S E T = 4 THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LPRINT 5PC(24) "Number of failures, F:";_ SPC(12); LPRINT USING "Itltl";F ELSE LPRINT SPC(24) "Number of failures:";_ SPC(I5); LPRINT USING "|I|||";F END I F END I F • .... Print ~ , ~ , o r CL t o p r i n t e r . I F NOT P R I N T S E T = 2 THEN I F P R I N T S E T = 5 OR P R I N T S E T = 6 THEN LPRINT SPC(24) "Producers risk, ~:"; SPC(13); LPRINT USING "I.ItlIII";ALPHA
12
TONY L]N and MICHAEL D. HOLBROOK LPRINT SPC(24) SPC(13);
"Consumers
risk,
8:";_
LPBINT USING " | . # | | t | | " ; B E T A ELSE LPRINT S P C ( 2 4 )
"Confidence level requirW;_ "eaent=";SPC(2) L P R I N T USING " | . | | | | | J " ; C L END I F END I F I F P R I N T S E T = 2 THEN LPRINT 5PC(24) "Confidence level:";SPC(14) L P R I N T USING " | . | | I | I | " ; C L END I F '
.... Print R, R D , IF N O T P R I N T S E T = 3 IF P R I N T S E T = 5
or RC to printer. THEN OR PRINTSET=6 THEN
LPRINT 5PC(24) "Design Reliability, SPC(8); L P R I N T USING " I . I I | I I I ' ; R D LPRINT 5PC(24) "Customer Reliability, "c:";SPC(6); L P R I N T USING " I . I I I I t l " ; R C
Rd:~;_
R";_
ELSE LPRINT SPC(24) "Reliability requirement";_ ":";SPC(7); L P R I N T USING " | . l | g l e l ' ; R END I F END I F I F P R I N T S E T = 3 THEN LPRINT SPC(24) "Reliability:";SPC(19); L P R I N T USING " I . | I I # I I " ; R END I F I F P R I N T S E T = i OR P R I N T S E T = 4 THEN LPRINT SPC(24) "Actual confidence level:";_ SPC(7); L P R I N T USING " | . I I l I t l " ; C L C END I F LPRINT CHR$(IO);SPC(S3);DATEO RETURN 'CALCN •
-
This subroutine sample size.
CALCN: • .... Calculate
N
for
calculates
F
=
the
required
O.
IF
'
' ' ' '
' '
'
F=O THEN N=LOG(REQRDLP)/LOG(R) NI=INT(N) I F N > N I THEN N = I N T ( N ÷ I ) GOSUB C A L C L P : C L C = ( I - L P ) .... Blank "Working" message. LOCATE 1 8 , 1 , 0 : PRINT SPACES(80) RETURN END I F .... Calculate N for F > 0 .... Initiate lower interval limits & counter. N = O : N L = O : C=O .... Determine initial upper limit. LOOPCALCN= .... Determine upper LOCATE 18,3,0 PRINT USING "Working
N=N+IO00 GOSUB CALCLP I F LP=>REQRDLP NH=N .... Hake first for
F
>
lialt. please
'Increment
wait
|el';C:
N (sample
C=C+I
size).
THEN GOTO LOOPCALCN guess
and
calculate
sample
size
O.
N=NL+((NH-NL)/2) 'First guess. LOOPCALCNI: LOCATE 1 8 , 3 , 0 P R I N T USING " W o r k i n g please wait lll";C C=C+I GOSUB C A L C L P : T E S T = R E Q R D L P / I O 0 0 0 .... Compare calculated and required L(P). I F A B S ( L P - R E Q R D L P ) < = T E S T AND ( N H - N L ) = < I THEN NI=INT(N)
R e l i a b i l i t y d e m o n s t r a t i o n test a n d O C c u r v e s
13
IF
N>NI THEN N=INT(N+I) GOSUB C A L C L P = C L C = I - L P END I F .... Blank "Vorking" message. LOCATE 18,1,0= PRINT SPACES(80) RETURN END I F 'Reset lower IF LP
limit.
N=(N-((NH-NL)/2)) GOTO L O O P C A L C N 1 END I F I F L P > R E Q R D L P THEN NL=N N=(N+((NH-NL)/2)) GOTO L O O P C A L C N 1 END I F 'CALCCL •
-
This subroutine level.
calculates
'Reset
the
CALCCL: LOCATE 18,3,0: PRINT WWorking please GOSUB C A L C L P CL=I-LP ' .... Blank ~Working w message. LOCATE 18,1,0= PRINT SPACES(80) RETURN 'CALCR
-
This
subroutine
calculates
upper
limit.
confidence
wait
w;
reliability.
CALCR: ' .... Calculate R for F = O. IF F=O THEN R=EXP((LOG(REQRDLP))/N) LP=REQRDLP RETURN END I F • .... Set initial limits and first guess. PA=O:PB=I:C=O:R=.5 LOOPCALCR: LOCATE 18,3,0 PRINT USING ~Worklng please wait |J|";C: GOSUB C A L C L P = T E S T = R E Q R D L P / I O 0 0 0 0 0 ' .... Compare calculated and required L(p). IF ABS(LP-REQRDLP)<=TEST THEN ' .... Blank "Working n message. LOCATE 18,1,0: PRINT SPACES(80) RETURN END I F ' .... Reset upper limit. I F L P < R E Q R D L P THEN PA=R R=R÷((PB-PA)/2) GOTO L O O P C A L C R END I F ' .... Reset lower limit. I F L P > R E Q R D L P THEN PB=R R=R-((PB-PA)/2) GOTO L O O P C A L C R END I F
C=C+I
'CALCF - This subroutine calculates the number of ' failures permitted. CALCF: LOOPCALCF: GOSUB C A L C L P I F L P = > R E Q R D L P THEN I F F = < O THEN ' .... Blank Wgorkinl" message. LOCATE 18tl,O: PRINT SPACEe(O0) GOSUB WARN RETURN •Return to NAINNENU. ELSE F=F-I: GOSUB C A L C L P : C L C = I - L P • .... Blank WWorkingn message.
14
TONY LIN a n d MICHAEL D. HOLBROOK LOCATE 1 8 , 1 , 0 : PRINT SPACES(80) RETURN END I F END I F F=F+I LOCATE 18t3,0 PRINT USING "Working please wait II|";F GOTQ L O O P C A L C F 'WARN '
-
This size
subroutine warning.
displays
inadequate
sample
WARN: LOCATE 16,3,0 P R I N T "WARNING ! ! ! Sample size is not adequate ";_ "to demonstrate the stated w LOCATE 17,15,0 PRINT nrellabillty at the required confidence I";_ "evel. W LOCATE 19,15,0: PRINT "Press any key to continue, w LOOPWARN: WARN$=INKEY$: I F WARNS = ' R T H E N GOTO LOOPWARN LOCATE 16,1,0 FOR 1 = 1 TO 4 : P R I N T S P A C E S ( 8 0 ) : NEXT I R=O: CL=O: CLC=O: N=O RETURN
'CALCRD ' • '
-
This subroutine calculates the design reliability Rd r e q u i r e d to demonstrate the customer required reliability Rc at the consumer risk ~ and the producers risk ~.
CALCRD: I F C H O I C E = 5 THEN R = R C : GOSUB C A L C L P : BETA=LP LOCATE 18,1,0: PRINT SPACES(80) END I F IF CHOICEI$=nl" AND R D = O T H E N BETA=LP: RC=R END I F REQRDLP=I-ALPHA GOSUB CALCR RD=R RETURN 'CALCPLAN '
-
This plan
subroutine when given
calculates ~, ~, Rd,
a two point and Rc.
CALCPLAN: • .... Save ~ and ~ requirements. ALPHAREQ=ALPHA: BETAREQ=BETA F=O 'Insure F=O. LOOPPLAN: • .... Calculate N for ~, Rc. REQRDLP=BETAREQ: R=RC GOSUB C A L C N BETA=LP • .... Calculate ~ for Rd, N and F. R=RD GQSUB C A L C L P : ALPHA=I-LP IF LP>=I-ALPHAREQ AND BETA<=BETAREQ THEN • .... Blank "Working" meassage. LOCATE 18,1,0: PRINT SPACES(80) RETURN •Return to N A I N N E N U . ELSE GOSUB S C R N : F = F + I GOTQ L O O P P L A N END I F 'CALCLP '
-
This subroutine calculates following formula:
L(p)
using
t '
' •
F
L(p)
CALCLP: • ....
=
E
((N!/x!(N-x)!)
m p^x
x=O
p
= PF
and
(l-p)
= R
•
(I-p)^(N-x)}
the
Reliability demonstration
'
'
•
'
test and OC curves
15
.... Initialize for CALCLP. PF=I-R: X=O: NF=O: LP=O LOCATE 1 8 , 3 , 0 = PRINT "Working please wait "; FOR X=O TO F X F = X : NF=N= N X = N - X LOCATE 1 8 , 2 7 , 0 = PRINT USING "||,t;X .... Calculate P = p'x m (1-p)'(N-x). 1000: •Error trap line number. PFX=(PFAX) RNX=(R^NX) P=PFXuRNX .... Calculate NF = ( N ! / x ! ( N - x ) ! ) m p. I F X=O THEN N F = P I F X = > l THEN NF=NmP I F X = > 2 THEN FOR R C = I TO X - 1 NF=(NF*(N-BC))/XF XF=(XF-I) N E X T BC END I F .... Calculate LP = E NF f o r x=O to x=F.
SUHLP: LP=LP+NF NEXT X RETURN 'OCCURVE '
-
This file
subroutine generates for OC c u r v e s .
an
ASCII
data
OCCURVE: I F A L P H A = 5 THEN RC=R: B E T A = L P : R T E N P = R : C L T E H P = C L : C L C T E H P = C L C END I F • .... Calculate reliability bounds. R=.999999: GOSUB C A L C L P : L P ( O ) = L P : PF(O)=I-R R E Q R D L P = . O 0 5 : GOSUB C A L C R : L P ( 9 9 ) = . O 0 5 : PF(99)=I-R • .... Calculate reliability increment and second ' reliability value. INCRHTR=((I-PF(O))-(1-PF(991))/99 R=(I-PF(Oll-INCRHTR • .... Calculate L(P) for incremental reliability i values. FOR I N D E X = I TO 9 8 GOSUB C A L C L P LP(INDEX)=LP: PF(INDEX)=I-R R=R-INCRNTR LOCATE 1 8 , 3 2 , 0 : PRINT USING "'''";INDEX N E X T INDEX LOCATE 1 8 , 1 , 0 : PRINT SPACES(80) I F A L P H A = 5 THEN C L = C L T E H P : CLC=CLCTEHP: R=RTEMP: L P = B E T A END I F • .... Create ASCII file for OCCURVE data. LOCATE 16,3,0 INPUT "Enter name of file: n,FILENAME, PAUSE=-1 WHILE PAUSE LOCATE 20,3,0 PRINT "Install f l o p p y d i s k in d r i v e A . " LOCATE 21,3,0 PRINT "Press any key to continue." PAUSES=INKEY$ IF N O T P A U S E S = " " THEN PAUSE=O WEND GOSUB CLEAN FILE: 2000: "Error trap line number. OPEN FILENAHE$ FOR OUTPUT A S ,I PRINT|I," ";TITLES PRINT, I," . PRINT|i," TEST PLAN:" PRINT,I,W PRINT'I," N ="IN PRINT'I," F ="IF PRINT'I," " I F NOT A L P H A = 5 THEN PRINT'I,USING " ALPHA = '.''g'";ALPHA END IF
16
TONY LIN a n d MICHAEL D. HOLBROOK
PRINT|I,USING " BETA = I.IIII";BETA I F NOT ALPHA=S THEN PRINTI1,USING " Rd = I.IIIi";RD END I F PRINT|I,USING " Rc = |.||||";RC PRINT|I," PRINT|I," OC CURVE D A T A " PRINT81," " PRINT|l," p L(p) w PRINT|l," . . . . . . . . . . . . . . . . " FOR INDEX=O TO 9 9 PRINT|I,USING . I.t1111t ";PF(INDEX);_ LP(INDEX) NEXT INDEX CLOSEll RETURN "HANDLER
-
This
subroutine
handles
errors.
HANDLER: I F ERL = 1 0 0 0 THEN LOCATE 2 0 , 3 , 0 PRINT "Combination of N and F exceed";_ " computer capacity, n LOCATE 2 2 , 3 , 0 PRINT "Press any key to return to the main ~Benu." PAUSE=-1 WHILE PAUSE PAUSEe=INKEY$ I F NOT PAUSES= R" THEN PAUSE=O WEND RESUNE NAINNENU END I F I F ERL = 2 0 0 0 THEN LOCATE 2 0 , 3 , 0 PRINT "Disk drive not ready, w PAUSE=-I WHILE PAUSE LOCATE 2 2 , 3 , 0 PRINT "Retry Yes/No." PAUSEQ=INKEYS I F P A U S E S = " Y " OR PAUSEe=nY n THEN PAUSE=O: RESUHE F I L E END I F I F P A U S E S = " N " OR PAUSES=nnn THEN PAUSE=O: RESUNE HENU2 END I F I F NOT PAUSES=W" THEN BEEP WEND END I F I F E R L < > I O 0 0 AND E R L < > 2 0 0 0 THEN LOCATE 2 0 , 3 , 0 PRINT "Unrecoverable error detected." LOCATE 2 2 , 3 , 0 PRINT "Press any key to return to the main Hlenu. n PAUSE=-1 g H I L E PAUSE PAUSE~=INKEYe I F NOT P A U S E S = " " THEN PAUSE=O WEND RESUNE NAINNENU END I F
";_
";_