**Spare Parts from Normal Distribution and eTCL Slot Calculator Demo Example , numerical analysis ** This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER in your comment with the same courtesy that I will give you. Its very hard to reply understandably without some background of the correspondent. Thanks,[gold] ---- <> [gold] Here is some eTCL starter code for calculations estimating spare parts or spare drives for a cloud backup system. This report references both the poisson and normal distributions, as implemented in TCL. *** Initial solution *** The cloud backup system is an assembly of 45 drives in a case with N1 assemblies in the installation. The drives are used 24/7 for a time interval of 90 days.The product N1*45 devices is much much greater than 10 devices. The eTCL calculator estimates the required number of spare parts or spare drives for a 95% confidence in the normal distribution. In each of 3 testcases, a different mean time between failure (MTBF ) in hours was assigned to the drives. Rounding up to the nearest whole number, an assembly of 100000 hours MTBF needed 3 spare drives, 200000 hours MTBF needed 2 spare drives, and 300000 hours MTBF needed 2 spare drive over the time interval and specified 95 percent confidence. *** Testcases for spare parts function *** The three drive types of 100000, 200000, and 300000 hour MTBF were converted into annualized failure rates (AFR) for 3 testcases. Converting the 100000 hour MTBF to years, the first drive type was 100000. hours/ 8760 hours in year or 11.415 years. This is 1 failure over 11.415 years which gives an annualized failure rate (AFR) of 1/11.415, 0.0876, 8.76 percent. For a testcase of 45 drives, the predicted (average) failure was45*8.76*1E-2, or 3.9 drives per year. Converting the 200000 hour MTBF to years, the second drive type was 200000. hours/8760 hours in year or 22.831 years. This is 1 failure over 11.415 years which gives an annualized failure rate (AFR) of 1/22.831, 0.0438, 4.38 percent. For a case of 45 drives, the predicted (average) failure was 45*4.38*1E-2, or 1.971 drives per year. Converting the 300000 hour MTBF to years, the third drive type was 300000. hours/8760 hours in year or 34.246 years. This is 1 failure over 34.246 years which gives an annualized failure rate (AFR) of 1/34.246 , 0.0292, 2.92 percent. For a case of 45 drives, the predicted (average) failure was 45*2.92*1E-2, or 1.314 drives per year. For comparison in the cloud backup industry, the annualized failure rate for 24/7 disk drives ranges normally between 1 and 4 percent per year. However, outliers have been reported as high as 14 percent per year. *** Spare parts function from a poisson distribution *** For the spare parts function on a poisson distribution, the mean or mu is N* (1/MTBF)*((interval period in days)/(365 days in year)) . The sigma in the poisson distribution is the square root of the mean. So for the spare parts function, the sigma is sqrt < N* (1/MTBF)*((interval period in days)/(365 days in year)) > . The interval adjustment factor is written in the software, but will be left aside for the remaining derivation as a complicating factor. The spare parts function could be written as mu+kay*sigma on a yearly basis. Kay is a constant adjusted from 1*sigma, 2*sigma, or up to 3*sigma to match the desired confidence levels. The trial design criterion would spare devices greater than > mu+2 * sigma per year. The mu+2*sigma would be the 97 percent confidence level. Since N* (1/MTBF) equals the annual failure rate (AFR), the spare parts formula is equivalent to AFR plus 2 * sqrt(AFR). For an example in rounded numbers, the 100000 hour MTBF in a case of 45 drives converted to mean or mu of 4 failures per year. For 97c confidence, the spare parts formula would be > mu+2*sigma, mu+2*sqrt(mu), 4+2*sqrt(4), 8 spare drives per year. On a quarterly basis, the suggested spare parts would be 8/4 or 2 spare drives per quarter. The greater than > in the trial formula is used to indicate rounding up to next higher integer, especially not truncation for estimates based on yearly definitions. *** Push Button Operation*** For the push buttons in the eTCL calculator, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console. For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers. The current result numbers will be cleared on the next solve button. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the functions (subroutines). *** Pseudocode and Equations *** ====== MTBF = mean time between failures in hours = 10E9*(1/FIT). 8760 hours = 1 year AFR = 1/(MTBF in years) MTTF = mean time to failure MTTR= mean time to repair MTBF = MTTF + MTTR MTTF = (time_interval*number_devices_tested)/ (number devices failed) (number devices failed) = (time_interval*number_devices_tested)/ MTTF if {MTTR << MTTF} {MTBF is roughly equivalent to MTTF} MTTF(D) = 2 · MTTF() , where MTTF(D) is considered dangerous or catastrophic failure,1/2 of failures and MTTF() considered non-dangerous, 1/2 of failures MTTF(D) = 2 · MTBF , under certain conditions {MTTR << MTTF} average failures over time interval= n_quantity*AFR percent*1E-2* (time_interval_days/365 days in year) spare devices > failures over time interval, minimal design criterion spare devices > 2 * average failures over time interval, trial design criterion spare devices > failures per year + 0.13* sqrt (failures per year) , rule of thumb for >55% confidence spare devices > failures per year + 0.5* sqrt (failures per year) , rule of thumb for >68% confidence spare devices > failures per year + 1.* sqrt (failures per year) , rule of thumb for >84% confidence spare devices > failures per year + 1.65* sqrt (failures per year) , rule of thumb for >95% confidence spare devices > failures per year + 2.* sqrt (failures per year) , rule of thumb for >97% confidence spare devices > failures per year + 2.5* sqrt (failures per year) , rule of thumb for >99% confidence spare devices > failures per year + 3.* sqrt (failures per year) , rule of thumb for >99.9% confidence repairable > MTBF non-repairable > MTTF FIT failures in time = failures per billion device_hours FIT reports normally use a 60% confidence level number of expected failures=FIT*Operating hours * number of devices DPPM= Defects per parts per million exponential probability distribution > electronic components lognormal probability distribution > incandescent lightbulbs, lasers,tires ====== ---- ***Testcases Section*** **** Testcase 1 **** %|table 1|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number:|1 | |& &| 100000.0 :|MTBF mean time between failures in hours| |& &| 45.0 :|n quantity devices| |& &| 90.0 :|time interval days| |& &| 1.645 :|95 percentile | |& &| 11.415 :|answers:MTBF in years | |& &| 8.76 :|AFR annualized failure rate percent/year | |& &| 0.972 :|average failures from prorated AFR over time interval| |& &| 2.593 :|required spares from normal distribution over time interval| |& ---- **** Testcase 2 **** %|table 2|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number:|2 | |& &| 200000.0 :|MTBF mean time between failures in hours| |& &| 45.0 :|n quantity devices| |& &| 90.0 :|time interval days| |& &| 1.645 :|95 percentile | |& &| 22.831 :|answers:MTBF in years | |& &| 4.38 :|AFR annualized failure rate percent/year | |& &| 0.486 :|average failures from prorated AFR over time interval| |& &| 1.632 :|required spares from normal distribution over time interval| |& ---- **** Testcase 3 **** %|table 3|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number:|3 | |& &| 300000.0 :|MTBF mean time between failures in hours| |& &| 45.0 :|n quantity devices| |& &| 90.0 :|time interval days| |& &| 1.645 :|95 percentile | |& &| 34.246 :|answers:MTBF in years | |& &| 2.92 :|AFR annualized failure rate percent/year | |& &| 0.324 :|average failures from prorated AFR over time interval| |& &| 1.260 :|required spares from normal distribution over time interval| |& ---- **** Testcase 4 **** %|table 4|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number:|4 | |& &| 700000.0 :|MTBF mean time between failures in hours| |& &| 45.0 :|n quantity devices| |& &| 1095.0 :|time interval days| |& &| 1.645 :|95 percentile | |& &| 79.908 :|answers:MTBF in years | |& &| 1.251 :|AFR annualized failure rate percent/year | |& &| 1.689 :|average failures from prorated AFR over time interval| |& &| 3.827 :|required spares from normal distribution over time interval| |& ---- ***References:*** * Find The Right Fit With Probability Distributions By David Harper * Hard drive reliability to the test by Peter Bright,Technology Editor at [http://arstechnica.com] * Math Encounters Blog, Spare Parts Math, 27feb2012, Mark Biegert ---- **Appendix Code** ***appendix TCL programs and scripts *** ====== # pretty print from autoindent and ased editor # Spare Parts from Normal Distribution, Calculator # written on Windows XP on eTCL # working under TCL version 8.6.x and eTCL 1.0.1 # gold on TCL WIKI, 10oct2014 package require Tk namespace path {::tcl::mathop ::tcl::mathfunc} frame .frame -relief flat -bg aquamarine4 pack .frame -side top -fill y -anchor center set names {{} {MTBF mean time between failures in hours:} } lappend names {n quantity devices:} lappend names {time interval days : } lappend names {95 percentile :} lappend names {answers: MTBF in years:} lappend names {AFR annualized failure rate percent/year : } lappend names {average failures from prorated AFR over time interval : } lappend names {required spares from normal distribution over time interval :} foreach i {1 2 3 4 5 6 7 8} { label .frame.label$i -text [lindex $names $i] -anchor e entry .frame.entry$i -width 35 -textvariable side$i grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 } proc about {} { set msg "Calculator for Spare Parts from Normal Distribution from TCL WIKI, written on eTCL " tk_messageBox -title "About" -message $msg } proc calculate { } { global answer2 global side1 side2 side3 side4 side5 global side6 side7 side8 global testcase_number incr testcase_number set side1 [* $side1 1. ] set side2 [* $side2 1. ] set side3 [* $side3 1. ] set side4 [* $side4 1. ] set side5 [* $side5 1. ] set side6 [* $side6 1. ] set side7 [* $side7 1. ] set side8 [* $side8 1. ] set mtbf $side1 set n_quantity $side2 set time_days [* $side3 1. ] set time_hours [* $side3 24. ] set cl $side4 set term2 [* [/ 1. $mtbf ] $time_hours $n_quantity ] set term3 [sqrt $term2 ] set spares [+ $term2 [* 1.645 $term3 ] ] set mtbfyears [/ $mtbf 8760. ] set annual_failure [* [/ 1. $mtbfyears ] 100. ] set annual_failure_rel_days_case [* $n_quantity $annual_failure 1.E-2 [/ $time_days 365. ] ] set side5 $mtbfyears set side6 $annual_failure set side7 $annual_failure_rel_days_case set side8 $spares } proc fillup {aa bb cc dd ee ff gg hh} { .frame.entry1 insert 0 "$aa" .frame.entry2 insert 0 "$bb" .frame.entry3 insert 0 "$cc" .frame.entry4 insert 0 "$dd" .frame.entry5 insert 0 "$ee" .frame.entry6 insert 0 "$ff" .frame.entry7 insert 0 "$gg" .frame.entry8 insert 0 "$hh" } proc clearx {} { foreach i {1 2 3 4 5 6 7 8 } { .frame.entry$i delete 0 end } } proc reportx {} { global side1 side2 side3 side4 side5 global side6 side7 side8 global testcase_number console show; puts "%|table $testcase_number|printed in| tcl wiki format|% " puts "&| quantity| value| comment, if any|& " puts "&| testcase number:|$testcase_number | |&" puts "&| $side1 :|MTBF mean time between failures in hours| |&" puts "&| $side2 :|n quantity devices| |& " puts "&| $side3 :|time interval days| |& " puts "&| $side4 :|95 percentile | |&" puts "&| $side5 :|answers:MTBF in years | |&" puts "&| $side6 :|AFR annualized failure rate percent/year | |&" puts "&| $side7 :|average failures from prorated AFR over time interval| |&" puts "&| $side8 :|required spares from normal distribution over time interval| |&" } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 100000. 45. 90. 1.645 11.4 8.76 0.972 2.59} ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 200000.0 45. 90. 1.645 22.83 4.38 0.486 1.633 } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 300000.00 45. 90. 1.645 34.246 2.92 0.324 1.26 } ::ttk::button .clearallx -text clear -command {clearx } ::ttk::button .about -text about -command about ::ttk::button .cons -text report -command { reportx } ::ttk::button .exit -text exit -command {exit} pack .calculator -in .buttons -side top -padx 10 -pady 5 pack .clearallx .cons .about .exit .test4 .test3 .test2 -side bottom -in .buttons grid .frame .buttons -sticky ns -pady {0 10} . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30 wm title . "Spare Parts from Normal Distribution " ====== ---- ** Initial Console program for spare parts ** ====== # pretty print from autoindent and ased editor # written on Windows XP on eTCL # working under TCL version 8.6.2 and_or eTCL 1.0.1 # gold on TCL WIKI, 5nov2014 # Console program for spare parts from normal distribution # using Tcl_Lib for trial solution from 1) normal 2) poisson # 3) other distributions and not picky. # The original solution used an inverse normal distribution (cad function), # meaning finding x from a known cdf-normal probability (95 percent c.). package require Tk package require math::statistics namespace path {::tcl::mathop ::tcl::mathfunc} console show proc spare_parts {args} { foreach item $args { set assembly_case 45 set mtbfyears [/ $item 8760. ] set annual_failure [* [/ 1. $mtbfyears ] 100. ] set annual_failure_per_case [* $annual_failure $assembly_case 1.E-2] set spares_97c [* $annual_failure_per_case 2. ] set spares_97c_prorated_90_days [* $annual_failure_per_case 2. [/ 90. 365. ] ] set megaparts $item set spares_fraction [* $annual_failure_per_case 0.13 ] set spares_fraction2 [* $annual_failure_per_case 1. ] set spares_fraction6 [* $annual_failure_per_case 2. ] set spares_fraction10 [* $annual_failure_per_case 3. ] puts " design lifetime hours $megaparts 45 drives in assembly case \ trial spares for 97c on annual $spares_97c \ trial spares for 97c prorated for quarter year $spares_97c_prorated_90_days \ zap2 55c $spares_fraction zap3 84c $spares_fraction2 \ zap4 97c $spares_fraction6 zap5 99.9c spares_fraction10 \ zap6 annual failure percent $annual_failure \ annual failures per case ref 45 $annual_failure_per_case \n "}} spare_parts 100000. 200000. 300000. 700000. set bin { 100000. 200000. 300000. 700000. } puts " max number [math::statistics::max $bin] " puts " Console program for spare parts from normal distribution, check poisson " puts " The answer is x spare parts for large working inventory to 95% C. " puts " Note: Spare parts answers should be rounded up to nearest integer, especially not truncated." puts " pnorm number [ math::statistics::pnorm_quicker .95 ] " puts " 12 in_assembly 20 visit [ math::statistics::pdf-poisson 12 20 ] " puts " 12 in_assembly 20 more than 20 visitors=2.% [- 1. [ math::statistics::cdf-poisson 12 19 ] ]" puts " 45 in_assembly 41 success= still on line poisson [- 1. [ math::statistics::pdf-poisson 45 41 ] ]" puts " 45 in_assembly 43 success= still on line poisson [- 1. [ math::statistics::pdf-poisson 45 43 ] ]]" puts " 45 in_assembly 42 success= still on line poisson [- 1. [ math::statistics::pdf-poisson 45 42 ] ]]" puts " 45 in_assembly 43 success= still on line poisson [- 1. [ math::statistics::pdf-poisson 45 43 ] ]]" puts " 45 in_assembly 44 success= still on line poisson [- 1. [ math::statistics::pdf-poisson 45 44 ] ]]" ====== ---- [gold] This page is copyrighted under the TCL/TK license terms, [http://tcl.tk/software/tcltk/license.html%|%this license]. **Comments Section** <> Please place any comments here, Thanks. <> Numerical Analysis | Toys | Calculator | Mathematics| Example