Expected loss of a machine
Criticality Ranking and Spares
On this page
A compressor stops on a Friday night because a contactor has failed. The part costs less than one hour of lost production, the store room does not have one, and the supplier needs six weeks. The same store room has shelves of parts for machines scrapped years ago, bought because somebody once had a bad day. Both problems have one origin: nobody decided which machines matter most, or calculated which parts to hold. This lesson shows how to rank machines by what their failure does, and how to work out a spare stock from a failure rate and a lead time. #Criticality #SpareParts #MaintenancePlanning
Learning Objectives
By the end of this lesson, you will be able to:
- Rank the machines of a site by consequence and likelihood on a criticality matrix with scales that you define
- Identify the few machines that carry most of the expected loss, and say where a matrix score can mislead
- Calculate the demand for a spare part during its lead time from the failure rate and the number of parts in service
- Determine with the Poisson distribution the stock that gives a stated service level
- Decide whether an insurance spare is worth holding by comparing its holding cost with the expected cost of being without it
Real-World System Problem: Five machines and one maintenance team
The cold store of this course has five machines: two refrigeration compressors (duty and standby), a borehole pump, a conveyor with a gearbox, and a standby generator. It has one small maintenance team, one budget and one store room. The team cannot inspect everything every week, and the store room cannot hold one of everything.
Before any maintenance plan is written, two questions need answers: which machine deserves attention first, and which parts must already be on the shelf when a failure comes? Without them, attention goes to the machine that failed most recently, and the store room fills with whatever was last missing. Both use the same three facts about each machine: how often it fails, what a failure costs, and how long it takes to get the part.
Fundamental Theory: Ranking machines and sizing a stock
Criticality is consequence and likelihood together
A machine is critical when its failure hurts and is likely enough to plan for; neither part is enough alone. Criticality ranking gives each machine two classes:
- a consequence class: what one failure does (to safety, to the environment, to the stock, to output, to the repair budget),
- a likelihood class: how often that failure is expected.
The classes are placed on a grid, the criticality matrix, whose cells each belong to a risk class: high, medium or low. A site writes its own scales, in its own money and words, so that two people who score the same machine reach the same class. The cold store uses these:
| Class | Consequence of one failure |
|---|---|
| 1 | No effect on output. Cost below 10,000 currency units |
| 2 | Short loss of a service. Cost 10,000 to 50,000 |
| 3 | Output stopped for hours. Cost 50,000 to 200,000 |
| 4 | Stock at risk or a long stop. Cost 200,000 to 500,000 |
| 5 | Loss of the stock (above 500,000), or any harm to people or to the environment |
| Class | Likelihood of that failure |
|---|---|
| 1 | Less often than once in 10 years |
| 2 | Once in 3 to 10 years |
| 3 | Once in 1 to 3 years |
| 4 | 1 to 3 times a year |
| 5 | More than 3 times a year |
The matrix and its risk classes
A common way to combine the two classes is to multiply them into a score from 1 to 25. The rule used here is:
- high if the score is 10 or more, or if the consequence class is 5,
- low if the score is 4 or less,
- medium for the rest.
The risk class decides how much thought a machine receives. A high machine gets a full analysis of its failure modes, a chosen task for each and a review of its spares. A low machine can usually run to failure with a simple repair plan.
What a score cannot tell you
The matrix is quick, and easy to trust too much. It has four weaknesses:
- The classes are ordinal. Class 4 is worse than class 2 but not twice as bad; in the scales above, class 5 likelihood is more than thirty times class 1. The product of two classes ranks; it is not a quantity. Do not add scores or average them.
- Equal scores hide different risks. A score of 12 can be a costly nuisance four times a year or a disaster once in a decade. They need different answers.
- A boundary can move a machine. One class up or down, which is within the uncertainty of most estimates, can change medium into high.
- The likelihood must match the consequence. Score the likelihood of the failure that has the stated consequence, not of any small stop.
For these reasons, when rough numbers exist, put a second column beside the score: the expected loss a year.
The expected loss has its own weakness: it treats a loss of 600,000 once in five years the same as 60,000 twice a year, and a small site may not survive the first. Keep both columns.
A few machines carry most of the risk
Sorted by expected loss, the list is nearly always uneven: a few machines account for most of the total. This is the Pareto pattern, often quoted as “20 percent of the machines cause 80 percent of the loss”; those two numbers are a way of speaking, not a law. The method matters: sort, add from the top, and stop where the running total reaches most of the loss. Effort on that short list returns far more than the same effort spread evenly.
Which spares to hold
A spare on the shelf is money that earns nothing until needed. A spare not on the shelf is a machine that waits for the whole lead time. Three facts decide between them:
- The demand: how many of this part fail in a year, across every machine that uses it.
- The lead time: the time from the order to the part in your hand, including approval, payment, transport and customs.
- The cost of waiting: what the site loses while the machine stands without the part.
A part with a lead time of one day and a small cost of waiting does not need a shelf. A part with a lead time of weeks on a high machine does.
Demand during the lead time
Suppose
The mean is not enough, because failures do not arrive evenly: some lead times have none and a few have two. For random failures at a constant rate, the number in a fixed time follows the Poisson distribution:
scipy.stats.poisson.pmf(k, m) gives this value and scipy.stats.poisson.cdf(k, m) gives the sum up to
Stock for a stated service level
The service level used in this lesson is the probability that a failure finds a spare on the shelf.
Take the simplest and most common ordering rule for slow parts: hold a stock of
Service level of a stock of S, one ordered for each one used
Choose the smallest
The cost of holding stock
A spare costs more than its price. Each year on the shelf it costs the interest on the money, the space, the care (a motor shaft must be turned, a seal kept from light and heat), and the chance that it is damaged, lost or no longer fits anything. This yearly cost is usually a share of the price; about 20 percent a year is common in examples. It is an assumption a site should replace with its own.
With a holding share
The first term rises with every unit added and the second falls; the best stock is where the sum is smallest. This is a second way to choose
Insurance spares
Some parts fail so rarely that the Poisson rule says to hold none: a compressor motor, a gearbox, a large transformer. If the lead time is months and the machine is high on the criticality list, one may still be held: an insurance spare, bought in the expectation that it will probably never be used. Like the spare wheel in a car, it is carried because waiting without it costs more. The comparison breaks on price: a spare wheel is cheap and fits the car used every day, while a spare motor is costly, needs care and fits one machine.
The decision compares two yearly figures: the holding cost of the spare, and the failure rate multiplied by the cost of being without the part. An example with stated assumptions: a compressor motor costs 250,000 currency units and holding it costs 15 percent a year, 37,500 a year. The two motors together fail 0.04 times a year. Without a spare, a failure means 16 weeks with no standby compressor, taken here as a loss of 2,000,000. The expected cost with no spare is
An insurance spare can often be avoided: by an agreement in which the supplier holds the unit, by sharing one spare between sister sites, or by a design that uses a standard motor available in days.
Application 1: Ranking the five machines of the cold store
Step 1: Classes, scores and risk classes
Click to reveal the ranking
-
Compressor 1 (duty). A cost of 150,000 is in the band 50,000 to 200,000: consequence class 3. A rate of 1.80 a year is in the band 1 to 3 a year: likelihood class 4. Score
: high. ✅ -
Conveyor and gearbox. A cost of 73,500 is class 3. Two failures a year is class 4. Score 12: high. ✅
-
Standby generator. A cost of 600,000 is the loss of the stock: class 5. A rate of 0.20 a year is once in 5 years: class 2. Score 10: high, and it would be high by the class 5 rule with any likelihood. ✅
-
Borehole pump. A cost of 40,000 is class 2. Once in 2 years is class 3. Score 6: medium. ✅
-
Compressor 2 (standby). A cost of 380,000 is class 4. A rate of 0.09 a year is once in 11.1 years: class 1. Score 4: low. ✅
Step 2: Expected loss and the share of the top machines
Click to reveal the calculation
-
Compressor 1 (duty). Only the covered failures belong to this row, because the uncovered ones are in the row of the standby.
currency units a year. ✅
-
Conveyor and gearbox.
a year. ✅ -
Standby generator.
a year. ✅ -
Compressor 2 (standby).
a year. ✅ -
Borehole pump.
a year. ✅ -
Total.
currency units a year. ✅ -
Running share from the top. The duty compressor carries 44.4 percent. With the conveyor the share is 69.8 percent. With the generator it is 90.6 percent. Three machines of five carry nine tenths of the expected loss. ✅
Step 3: Where the two rankings disagree
Click to reveal the comparison
-
The top three agree. Both columns name the duty compressor, the conveyor and the generator. That agreement is the main result. ✅
-
Two machines with a score of 12. The duty compressor and the conveyor have the same score, but their expected losses are 256,500 and 147,000. The score cannot separate them, and the expected loss can. ✅
-
The generator. By expected loss it is third, at 120,000 a year; by consequence it is the only machine in class 5. A plan on expected loss alone would give it less attention than a conveyor, though its one failure in five years could end the business. The class 5 rule keeps it at the top. ✅
-
The standby compressor. It scores 4, low, yet by expected loss it is above the borehole pump. The low score rests wholly on the 0.95: if the standby is never run, nobody knows that number, and the true likelihood class could be 3 or 4. ✅
Step 4: Check against an earlier result and against a change of one class
Click to reveal the check
-
The two compressor rows together.
currency units a year. This is the expected failure cost of the duty and standby pair found from the compressor record, so the split into two rows has lost nothing. ✅ -
One class of doubt. The conveyor was scored at two stops a year, likelihood class 4. If it stopped once in 13 months, the class would be 3, the score 9 and the risk class medium, with an expected loss that is still about 68,000 a year. A small change in an estimate moved the machine across a boundary. ✅
-
Meaning. A machine that lies near a boundary should be discussed, not sorted by arithmetic. ✅
Application 2: Spare contactors for the compressors
Step 1: Demand during the lead time
Click to reveal the calculation
-
Demand a year.
contactors a year. ✅ -
Mean demand in one lead time.
✅
-
Poisson probabilities.
. . . . ✅ -
Read it. In nine lead times of ten no contactor fails. In about one of ten, one fails. Two fail in about 1 lead time of 200. ✅
Step 2: Stock for 95 and 99 percent
Click to reveal the calculation
-
Stock of 1. A failure finds the spare if no other failure came in the lead time before it:
. The service level is 90.1 percent, below both targets. ✅ -
Stock of 2.
. The service level is 99.5 percent. ✅ -
Result. A stock of 2 is the smallest that reaches 95 percent, and it also reaches 99 percent. Both targets give 2 spare contactors. ✅
-
Failures that find no spare. With a stock of 1:
a year, once in 11 years. With a stock of 2: a year, once in about 220 years. With no stock, all 0.90 a year wait six weeks. ✅
Step 3: Check with the yearly cost and with other lead times
Click to reveal the check
-
Holding cost of one spare.
currency units a year. ✅ -
No stock.
a year. ✅ -
Stock of 1.
a year. ✅ -
Stock of 2.
a year. ✅ -
Stock of 3.
a year. The third spare costs more to hold than it saves. The lowest yearly cost is at a stock of 2, the same answer as the service level. ✅ -
Other lead times. With a lead time of 2 weeks the stock for 95 percent is 1 and for 99 percent is 2. With 12 weeks it is 2 and 3. With 26 weeks it is 3 and 4. ✅
Verify It in Python
The script ranks the five machines, calculates the Poisson stock and the yearly cost for the contactors, repeats the stock for four lead times, and works through the insurance spare of the theory section. It saves one plot of the matrix and of the service level against the stock.
"""Criticality ranking of five machines and the spare stock for a small group of parts."""import numpy as npfrom scipy.stats import poissonimport matplotlib.pyplot as plt
# ---------- Application 1: criticality of the five machines ----------# name, consequence class (1 to 5), likelihood class (1 to 5),# failures a year and cost of one failure (stated estimates of the ranking session)MACHINES = [ ("Compressor 1 (duty)", 3, 4, 1.80, 150000.0), ("Compressor 2 (standby)", 4, 1, 0.09, 380000.0), ("Conveyor and gearbox", 3, 4, 2.00, 73500.0), ("Borehole pump", 2, 3, 0.50, 40000.0), ("Standby generator", 5, 2, 0.20, 600000.0),]
def risk_class(c, l): """High if the score is 10 or more or the consequence class is 5; low if 4 or less.""" score = c * l if c == 5 or score >= 10: return "high" return "low" if score <= 4 else "medium"
print("Application 1: criticality of the five machines")rows = []for name, c, l, rate, cost in MACHINES: # the duty compressor row counts only the failures that the standby covers events = rate * 0.95 if name.startswith("Compressor 1") else rate rows.append((name, c, l, c * l, risk_class(c, l), events * cost))for name, c, l, score, cls, loss in sorted(rows, key=lambda r: -r[3]): print(f" {name:24s} C{c} x L{l} = {score:2d} ({cls:6s}) expected loss {loss:9,.0f} a year")total = sum(r[5] for r in rows)print(f" total expected loss {total:,.0f} currency units a year")running = 0.0for k, r in enumerate(sorted(rows, key=lambda r: -r[5]), start=1): running += r[5] print(f" top {k} by expected loss: {r[0]:24s} cumulative {100 * running / total:5.1f} %")
# ---------- Application 2: spare contactors ----------N_UNITS, RATE, WEEKS = 6, 0.15, 6.0 # in service, failures a year each, lead timedemand_year = N_UNITS * RATEm = demand_year * WEEKS / 52.0 # mean demand in one lead timeprint("Application 2: spare contactors")print(f" demand {demand_year:.2f} a year, lead time {WEEKS:.0f} weeks: " f"mean demand in the lead time {m:.4f}")for k in range(4): print(f" P(demand = {k}) = {poisson.pmf(k, m):.5f} " f"P(demand <= {k}) = {poisson.cdf(k, m):.5f}")
def service(stock, mean): """Chance that a failure finds a spare on the shelf (one ordered for each one used).""" return poisson.cdf(stock - 1, mean) if stock > 0 else 0.0
def stock_for(level, mean): s = 0 while service(s, mean) < level: s += 1 return s
for s in range(4): print(f" stock {s}: service level {service(s, m):.5f}, " f"failures a year that find no spare {demand_year * (1 - service(s, m)):.5f}")for level in (0.95, 0.99): print(f" stock for a service level of {100 * level:.0f} %: {stock_for(level, m)}")
PRICE, HOLD, SHORT = 18000.0, 0.20, 200000.0 # unit price, holding share a year, cost of a shortageprint(" yearly cost by stock (holding + expected shortage):")for s in range(4): hold = s * PRICE * HOLD short = demand_year * (1 - service(s, m)) * SHORT print(f" stock {s}: {hold:7,.0f} + {short:9,.0f} = {hold + short:9,.0f}")
print(" effect of the lead time:")for weeks in (2.0, 6.0, 12.0, 26.0): mw = demand_year * weeks / 52.0 print(f" {weeks:4.0f} weeks: mean demand {mw:.3f}, " f"stock for 95 % = {stock_for(0.95, mw)}, for 99 % = {stock_for(0.99, mw)}")
# insurance spare: one compressor motorM_RATE, M_WEEKS, M_PRICE, M_HOLD, M_SHORT = 0.04, 16.0, 250000.0, 0.15, 2000000.0mm = M_RATE * M_WEEKS / 52.0print("Insurance spare: compressor motor")print(f" mean demand in the lead time {mm:.4f}, chance of no demand {poisson.pmf(0, mm):.4f}")print(f" no spare: expected shortage cost {M_RATE * M_SHORT:,.0f} a year")print(f" one spare: holding {M_PRICE * M_HOLD:,.0f} + shortage " f"{M_RATE * (1 - service(1, mm)) * M_SHORT:,.0f} a year")print(f" years between demands on average: {1 / M_RATE:.0f}")
# ---------- Plot ----------fig, ax = plt.subplots(1, 2, figsize=(10, 4.2))for name, c, l, rate, cost in MACHINES: ax[0].scatter(l, c, s=160) ax[0].annotate(name, (l, c), textcoords="offset points", xytext=(6, 8), fontsize=8)ax[0].set_xlim(0.5, 5.5)ax[0].set_ylim(0.5, 5.5)ax[0].set_xlabel("likelihood class")ax[0].set_ylabel("consequence class")ax[0].set_title("Criticality matrix")ax[0].grid(True, alpha=0.4)stocks = np.arange(0, 5)for weeks in (6.0, 26.0): mw = demand_year * weeks / 52.0 ax[1].plot(stocks, [service(int(s), mw) for s in stocks], marker="o", label=f"lead time {weeks:.0f} weeks")ax[1].axhline(0.95, color="gray", linewidth=0.8, linestyle="--")ax[1].axhline(0.99, color="gray", linewidth=0.8, linestyle=":")ax[1].set_xlabel("spares on the shelf")ax[1].set_ylabel("service level")ax[1].set_title("Spare contactors")ax[1].legend()fig.tight_layout()fig.savefig("criticality_spares.png", dpi=120)print("Saved criticality_spares.png")Expected output
Application 1: criticality of the five machines Compressor 1 (duty) C3 x L4 = 12 (high ) expected loss 256,500 a year Conveyor and gearbox C3 x L4 = 12 (high ) expected loss 147,000 a year Standby generator C5 x L2 = 10 (high ) expected loss 120,000 a year Borehole pump C2 x L3 = 6 (medium) expected loss 20,000 a year Compressor 2 (standby) C4 x L1 = 4 (low ) expected loss 34,200 a year total expected loss 577,700 currency units a year top 1 by expected loss: Compressor 1 (duty) cumulative 44.4 % top 2 by expected loss: Conveyor and gearbox cumulative 69.8 % top 3 by expected loss: Standby generator cumulative 90.6 % top 4 by expected loss: Compressor 2 (standby) cumulative 96.5 % top 5 by expected loss: Borehole pump cumulative 100.0 %Application 2: spare contactors demand 0.90 a year, lead time 6 weeks: mean demand in the lead time 0.1038 P(demand = 0) = 0.90136 P(demand <= 0) = 0.90136 P(demand = 1) = 0.09360 P(demand <= 1) = 0.99497 P(demand = 2) = 0.00486 P(demand <= 2) = 0.99983 P(demand = 3) = 0.00017 P(demand <= 3) = 1.00000 stock 0: service level 0.00000, failures a year that find no spare 0.90000 stock 1: service level 0.90136, failures a year that find no spare 0.08877 stock 2: service level 0.99497, failures a year that find no spare 0.00453 stock 3: service level 0.99983, failures a year that find no spare 0.00016 stock for a service level of 95 %: 2 stock for a service level of 99 %: 2 yearly cost by stock (holding + expected shortage): stock 0: 0 + 180,000 = 180,000 stock 1: 3,600 + 17,754 = 21,354 stock 2: 7,200 + 906 = 8,106 stock 3: 10,800 + 31 = 10,831 effect of the lead time: 2 weeks: mean demand 0.035, stock for 95 % = 1, for 99 % = 2 6 weeks: mean demand 0.104, stock for 95 % = 2, for 99 % = 2 12 weeks: mean demand 0.208, stock for 95 % = 2, for 99 % = 3 26 weeks: mean demand 0.450, stock for 95 % = 3, for 99 % = 4Insurance spare: compressor motor mean demand in the lead time 0.0123, chance of no demand 0.9878 no spare: expected shortage cost 80,000 a year one spare: holding 37,500 + shortage 979 a year years between demands on average: 25Saved criticality_spares.pngCommon Mistakes
- Ranking machines by how often they fail. A machine that stops every week for ten minutes can matter less than one that fails once in five years and loses the stock.
- Adding or averaging matrix scores. The classes are ordinal: a score ranks and measures nothing.
- Weighing a safety consequence against cost on the matrix. A failure that can harm a person goes to the top class and to a proper safety assessment.
- Ranking idle machines low because they are absent from the breakdown log. A standby unit or a generator fails without showing it; only a test finds it.
- Using the supplier’s quoted delivery time as the lead time. Count from the day the need is known to the day the part is in the store room.
- Choosing the stock from the mean demand alone. A mean of 0.1 in the lead time still leaves one failure in ten without a spare if only one is held.
Summary
- Criticality combines the consequence of a failure with its likelihood, on scales the site writes for itself. A safety consequence goes in the top class and is not traded against cost.
- A matrix score only ranks. The expected loss a year (failures a year times the cost of one) shows where the money goes; read the two columns together.
- At the cold store three machines of five carry 90.6 percent of an expected loss of 577,700 currency units a year: the duty compressor, the conveyor and the generator.
- The demand for a spare in its lead time has the mean
and follows the Poisson distribution when failures are random. With one ordered for each one used, the service level of a stock is . - Six contactors at 0.15 failures a year with a lead time of 6 weeks give a mean demand of 0.1038. A stock of 2 gives a service level of 99.5 percent and the lowest yearly cost.
- An insurance spare is justified when its holding cost is below the failure rate multiplied by the cost of being without the part.
Exercises
1. With the scales and the risk class rule of this lesson, give the score and the risk class of (a) a machine with a failure cost of 300,000 once in 6 years, and (b) a machine whose failure could injure a person once in 20 years.
Answer
(a) Consequence class 4, likelihood class 2, score 8: medium. (b) Consequence class 5, likelihood class 1, score 5. The score alone would say medium, but the class 5 rule makes it high, and it needs a proper safety assessment.
2. Ten pump seals of one type are in service. Each fails at 0.30 a year, and the lead time is 4 weeks of a 52 week year. One is ordered for each one used. Find the mean demand in the lead time and the stock for service levels of 95 and 99 percent.
Answer
3. The supplier of the contactors of Application 2 opens a local depot, and the lead time falls from 6 weeks to 1 week. Find the new stock for 95 and 99 percent.
Answer
4. The conveyor uses a bearing that costs 4,500 currency units, with a holding share of 20 percent a year. The demand is 0.50 a year and the lead time is 2 weeks of a 52 week year. A failure with no bearing in the store room stops the conveyor for 48 extra hours at 12,000 an hour. Find the yearly cost with a stock of 0, 1 and 2, and choose the stock.
Answer
The cost of a shortage is
5. The conveyor gearbox fails 0.03 times a year. A spare gearbox costs 400,000 currency units with a holding share of 15 percent a year. A failure with no spare costs 1,500,000. Is the insurance spare justified by cost? At what cost of a failure would the two choices be equal? (Ignore the small chance of a second failure in the lead time.)
Answer
Holding costs
References
- J. Moubray, Reliability-centred Maintenance, 2nd edition, Butterworth-Heinemann, 1997.
- P. D. T. O’Connor and A. Kleyner, Practical Reliability Engineering, 5th edition, Wiley, 2012.
- A. K. S. Jardine and A. H. C. Tsang, Maintenance, Replacement, and Reliability: Theory and Applications, 2nd edition, CRC Press, 2013.
- A. M. Smith and G. R. Hinchcliffe, RCM: Gateway to World Class Maintenance, Elsevier Butterworth-Heinemann, 2004.
- Six contactors fail 0.90 times a year in all. In a 6 week lead time the mean is 0.104.
- Failures come at random: no failure in 90.1 percent of lead times, one in 9.4, two in 0.5.
- Add the bars from zero: one failure or fewer in 99.5 percent of lead times.
Six contactors of one type are in service, and together they fail less than once a year. A new one takes 6 weeks to arrive. You want a failure to find a spare on the shelf at least 95 times in 100. How many spares do you hold?
The contactors of Application 2: six in service, 0.15 failures a year each, a lead time of 6 weeks. Each failure (a tick) takes a spare and orders one, which arrives one lead time later. A coral tick found the shelf empty and its compressor waits. The cost uses the lesson's assumptions: 3,600 a year to hold one contactor, 200,000 for a failure with no spare. Set the stock to 1 and run 1,000 years: about one failure in ten waits.
Check yourself
Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.
1. A valve on an ammonia line could release gas where people work if it fails. The team scores it consequence class 5 and likelihood class 1, because it has never failed. On the matrix of this lesson, what is its risk class?
2. Four identical bearings are in service, each failing 0.5 times a year at random. The lead time is 13 weeks, and one is ordered for each one used. What stock gives a service level of at least 95 percent?
3. A conveyor gearbox costs 400,000 currency units, and holding a spare costs 15 percent of its price a year. The gearboxes fail 0.02 times a year in all, and a failure with no spare costs 1,500,000. Should the site hold an insurance spare?
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.