Skip to content
You Start with one site
Amounts in Start with one site
Control, Measurement & Energy · Course

Describing Sensor Data

Lesson 1 of 10 23 min read
Found this useful?

A report says “the average power of the compressor was 0.34 kW”, and a technician sizes a backup supply for 0.34 kW. The compressor never draws 0.34 kW. It draws 1.16 kW or almost nothing, and the backup supply trips at the first start. Another report says “the average room temperature was 4.0 °C” about a room whose stock must never pass 5.0 °C, and the average is silent about the hour that matters. This lesson shows how to describe a set of readings so that the description is true: the centre, the spread, the shape, and the time spent beyond a limit. #EngineeringStatistics #SensorData #Histogram

Learning Objectives

By the end of this lesson, you will be able to:

  1. Calculate the mean, median, percentiles, interquartile range and standard deviation of a set of readings
  2. Read a histogram and recognise skewed data, two-peaked data and outliers
  3. Find the duty of an on-off machine from its power readings, with a threshold chosen from the histogram
  4. Explain why the mean is the right number for energy and the wrong number for a typical value
  5. Report the time above a limit, and the longest single run above it, when a requirement is written as a limit

Real-World System Problem: One day of compressor power



A small refrigeration compressor is fitted with a power meter, and a logger stores one reading every 10 seconds. After one day the site holds 8,640 numbers. The owner asks three plain questions. How much energy did the compressor use? For what part of the day did it run? What power does the supply have to deliver?

One number cannot answer all three. The compressor has two states: it draws about 1.16 kW when it runs, and its electronics draw about 14 W when it is stopped. The average of the day is a mixture of the two, a power at which the machine never operates, and yet exactly the number that gives the energy bill.

So the first skill with any log is to look at how the readings are distributed, and then to choose the number that matches the question.

Loggerevery 10 sCompressoron / offPower meteron supply8,640 readings a dayabout 1.16 kW running, 0.014 kW stopped
One day of compressor power readings

Fundamental Theory: Centre, spread and shape



A set of readings

A log is a list of readings, written . A small example is used first. A tank probe gives nine readings in °C:

The mean

The sample mean is the sum of the readings divided by their number.

For the tank, the sum is 36.0 and , so . The mean is the balance point of the readings, like the support of a seesaw. Every reading has the same weight, so one very large reading moves the mean a long way.

The median and the percentiles

Sort the readings from smallest to largest. The median is the middle value: half of the readings are below it and half are above it. The sorted tank readings are

The fifth of the nine is the middle one, so the median is .

A percentile extends the same idea. The 95th percentile is the value that 95 percent of the readings are at or below. The median is the 50th percentile. The 25th and 75th percentiles are called the lower and upper quartiles.

To find the percentile by hand, calculate the position in the sorted list. If is not a whole number, take the value in proportion between the two neighbours. This is the rule that numpy and the spreadsheet function PERCENTILE.INC use. Some other tools use a slightly different rule, so with a few readings two programs can give different quartiles; with thousands of readings they agree. For the tank, the 25th percentile has , so it is the third sorted value, . The 75th percentile has and is .

Spread: range, interquartile range and standard deviation

The range is the largest reading minus the smallest: for the tank. It depends on only two readings, so one bad reading changes it completely.

The interquartile range is the upper quartile minus the lower quartile. It is the width of the middle half of the readings. For the tank it is .

The sample standard deviation measures the typical distance of a reading from the mean.

For the tank, the squared distances from 4.0 add to 0.12, so . The division is by and not by because the mean was calculated from the same readings. With thousands of readings the difference is too small to see.

Outliers and robust measures

Now suppose a tenth reading arrives, and it is 40.0 °C: a loose connector, not a hot tank.

MeasureNine readingsWith the reading of 40.0
Mean4.0 °C7.6 °C
Median4.0 °C4.0 °C
Standard deviation0.122 °C11.4 °C
Interquartile range0.2 °C0.175 °C

One bad reading in ten moved the mean by 3.6 °C and made the standard deviation almost 100 times larger, while the median and the interquartile range hardly moved. A measure that one or two extreme readings cannot move far is called robust: the median and the interquartile range are robust; the mean, the range and the standard deviation are not.

The histogram

A histogram divides the range of the readings into intervals of equal width, called bins, and counts the readings in each bin. It shows the shape of the data, which no single number shows. The most common value, the top of a peak, is called a mode.

The bin width is a choice. Wide bins hide the shape and narrow bins show only noise. Start with 20 to 50 bins across the range, then try half and double that width.

Three shapes cover most sensor logs.

  • One symmetrical peak. The mean and the median are close. The mean and the standard deviation describe the data well. Sensor noise about a steady value has this shape.
  • A skewed peak. One side has a long tail. The mean is pulled toward the tail and the median is not. Waiting times, flows and repair times are often skewed. Report the median and the percentiles.
  • Two peaks. The machine has two states. The mean falls in the empty space between the peaks. Every on-off machine gives this shape.
readings6205mean 0.337 kW24350.0141.16kWstopped(no readings)running
Histogram of a two-state machine

Two-peaked data: describe each state

When the histogram has two peaks, describe the two states one at a time. Let be the duty, the fraction of the readings in the running state. Let be the mean power while running and the mean power while stopped.

Mean of a two-state signal

The mean is a weighted mixture of the two states. It equals neither of them unless the duty is 0 or 1.

For example, a duty of 0.25 with 2.0 kW running and 0.02 kW stopped gives .

The standard deviation of a two-peaked signal describes neither peak: it measures the distance of the readings from a mean where there are no readings. It is close to the distance between the peaks multiplied by , which is never more than half that distance. The noise inside each peak, the real spread of each state, can be a hundred times smaller.

To separate the states, call every reading above a threshold power “running”, and choose the threshold from the histogram: in the empty gap between the peaks, far from both. Anywhere in the gap gives the same duty; a threshold inside a peak cuts that peak in two and gives a wrong duty.

Why the mean still matters: energy

Energy is power multiplied by time, added over the readings. If each reading stands for the same time step , and the whole record lasts :

Energy from power readings

Energy equals mean power multiplied by duration. This is exact, for any shape of histogram.

A machine with a mean power of 0.515 kW for 24 hours uses . No robust measure can replace the mean here. The median of a compressor that is stopped for most of the day is its standby power, and the energy calculated from it would be wrong by a large factor.

Time above a limit

Many requirements are written as limits: the room must not pass 5.0 °C, the pressure must stay above 2.0 bar. For a limit , count the readings beyond it.

If 1,512 of 43,200 readings are above the limit, the fraction is percent. The count treats each reading as one time step, so it is valid only when the readings are evenly spaced and none are missing. On a real site, check that first: count the readings you expected and the readings you have. A logger often stops in a power cut, which is also when a cold room warms. Report those hours as “not known”, never as hours below the limit.

The fraction does not say whether the time above the limit was one long event or many short ones. For that, find each unbroken run of readings above the limit and report the number of runs and the length of the longest.

Air temperaturelimit 5.0 °Cmean4.0°C3.0 °Ctime abovetime above
Time above a limit

Choosing the number to report

Application 1: A compressor that is never at its average power



Step 1: Mean and median

Click to reveal the centre of the data
  1. Mean. The 8,640 readings add to 2,909.1 kW.

    The mean power is 0.337 kW. ✅

  2. Median. The middle of the sorted readings is 0.0141 kW, which is the standby power. The mean is 24 times the median. A difference this large is the first sign that the data are not one peak. ✅

  3. Look for readings near the mean. The smallest reading is 0.0120 kW and the largest is 1.2338 kW. The number of readings from 0.03 kW to 1.00 kW is 0. Not one reading in the day is near 0.337 kW. ✅

Step 2: The histogram and the two modes

Click to reveal the shape of the data
  1. Count in bins of 0.01 kW. The bin from 0.01 to 0.02 kW holds 6,205 readings. This is the lower mode, the stopped state. ✅

  2. Upper mode. Above 1 kW the fullest bin is from 1.15 to 1.16 kW, with 482 readings. This is the upper mode, the running state. Its peak is wider than one bin because the running power varies a little. ✅

  3. The gap. There is no reading from 0.0195 kW to 1.0952 kW. The histogram is two narrow peaks with an empty space of more than 1 kW between them. ✅

  4. Spread of the whole set. The standard deviation is 0.516 kW. The lower quartile is 0.0129 kW and the upper quartile is 1.1355 kW, so the interquartile range is 1.123 kW. ✅

  5. What the spread means here. Neither number describes a state. One quartile lies in each peak, so the interquartile range is only the distance between the peaks. The standard deviation of 0.516 kW is 26 times the spread inside the running peak, which Step 3 finds. ✅

Step 3: Duty, running power and starts

Click to reveal the two states
  1. Choose the threshold. The gap runs from 0.02 kW to 1.10 kW. A threshold of 0.50 kW is far from both peaks. ✅

  2. Duty. The number of readings above 0.50 kW is 2,435.

    The compressor ran for 28.2 percent of the day, which is . ✅

  3. Test the threshold. Thresholds of 0.10 kW and 1.00 kW give the same 28.18 percent, because both are in the gap. A threshold of 1.14 kW, which is inside the running peak, gives 23.68 percent. That answer is wrong by 4.5 points, and nothing in the result warns you. ✅

  4. Each state alone. The 2,435 running readings have a mean of 1.1601 kW and a standard deviation of 0.0200 kW. The 6,205 stopped readings have a mean of 0.0136 kW and a standard deviation of 0.0012 kW. The supply must deliver 1.16 kW, not 0.337 kW, and more than that for the moment of each start, which a 10 second reading does not show. ✅

  5. Starts. A start is a reading above the threshold that follows a reading below it. There are 52 starts in 24 hours, which is 2.17 starts per hour. ✅

Step 4: Energy for the day

Click to reveal the energy and its check
  1. Sum of power multiplied by time. Each reading stands for 10 s, which is .

    The compressor used 8.08 kWh in the day. ✅

  2. Mean power multiplied by duration.

    The mean gives the same energy, as the theory said. ✅

  3. What the median would give. . This is 24 times too small. The median is the typical reading, and the typical reading of this compressor is “stopped”. ✅

  4. Check a second way, state by state. Running: . Stopped: . The total is . ✅

  5. Rebuild the mean from the two states.

    The mixture formula returns the mean of Step 1. ✅

  6. Check it against the meter. The two calculations above agree because they use the same readings, so they cannot find a wrong reading. Most power meters also keep their own energy register. Read it at the start and the end of the day: the difference should be close to 8.08 kWh, within a few percent (the readings miss the short surge at each start). A larger difference means a scale error, a wrong current transformer ratio in the logger, or missing readings. ✅

Application 2: A cold room with a limit of 5.0 °C



Step 1: Centre and spread

Click to reveal the summary numbers
  1. Mean and median. The mean is and the median is . They agree, so the data are not skewed. ✅

  2. Range. The smallest reading is and the largest is . The air has been above the limit at least once. ✅

  3. Percentiles. The 5th percentile is and the 95th percentile is . The middle 90 percent of the readings fill the thermostat band from 3 to 5 °C almost exactly. ✅

  4. Spread. The standard deviation is and the interquartile range is . The histogram is nearly flat between 3 and 5 °C, because the temperature travels up and down the band at steady rates. It is not a bell shape, so rules made for a bell shape must not be used here. ✅

  5. The daily means. The 14 daily means lie from to . By its average, every day looks the same and every day looks good. ✅

Step 2: Time above the limit

Click to reveal the time above 5.0 and 5.2 °C
  1. Above 5.0 °C. The number of readings above is 877.

    The air was above the limit for 4.35 percent of the time. ✅

  2. In hours. 877 minutes is 14.6 hours in 14 days, or 62.6 minutes in an average day. ✅

  3. Above 5.2 °C. The number of readings above is 38, which is percent of the time. Almost all of the time above the limit is within 0.2 °C of it. ✅

  4. Check with a percentile. If 4.35 percent of the readings are above 5.0, then the 95.65th percentile must be 5.0. The script gives for that percentile. ✅

Step 3: One long event or many short ones

Click to reveal the runs above the limit
  1. Count the runs. The 877 minutes above are in 676 separate runs. The mean run is minutes. ✅

  2. Longest run. The longest unbroken run above is 3 minutes. Above there are 36 runs and the longest is 2 minutes. ✅

  3. Explain the pattern. The thermostat starts the compressor only when the air reaches , so the top of every cycle touches or passes the limit for a minute or two. An open door adds to the rise. The excursions are a result of where the thermostat band was placed, not a fault of the machine. ✅

Step 4: Check the probe before you report

Click to reveal how much a small probe error changes the answer
  1. Move the limit by 0.1 °C. A probe that reads 0.1 °C low reports 4.9 °C when the air is at 5.0 °C, so the real time above 5.0 °C is the logged time above 4.9 °C: 1,589 minutes, 7.88 percent. A probe that reads 0.1 °C high makes the room look worse than it is: the real time is the logged time above 5.1 °C, 246 minutes, 1.22 percent. ✅

  2. What it means. An error of only 0.1 °C changes the answer from 4.35 percent to anything between 1.22 and 7.88 percent, because most readings sit close to the limit. Before you report the time above a limit, compare the probe with a reference thermometer in the same place (or in an ice and water bath, which is 0.0 °C), and state the probe error with the result. ✅

Verify It in Python



The script generates both data sets and prints every number used in the two applications. It saves one plot with the two histograms.

describing_sensor_data.py
"""Describe two sensor logs: compressor power (two peaks) and cold room temperature."""
import numpy as np
import matplotlib.pyplot as plt
def compressor_power(seed=41, seconds=86400, step=10):
"""Data set D: compressor electrical power in kW, one reading every 10 s."""
rng = np.random.default_rng(seed)
n = seconds // step; p = np.empty(n); on = False; left = 0
for i in range(n):
if left <= 0:
on = not on
left = rng.integers(36, 60) if on else rng.integers(60, 180) # in steps of 10 s
p[i] = (1.16 + rng.normal(0, 0.02)) if on else (0.012 + abs(rng.normal(0, 0.002)))
left -= 1
return p # kW
def cold_room_minutes(seed=11, days=14):
"""Data set A: cold room air temperature in degC, one reading a minute."""
rng = np.random.default_rng(seed)
n = days * 1440
t = np.empty(n); temp = 4.0; on = False; out = []
for i in range(n):
minute = i % 1440
# door openings are more likely in working hours
door = (480 <= minute < 1020) and (rng.random() < 0.035)
if temp >= 5.0: on = True
if temp <= 3.0: on = False
temp += (-0.30 if on else 0.10) + (0.35 if door else 0.0)
t[i] = temp + rng.normal(0.0, 0.05) # sensor noise, 0.05 degC
return t
def longest_run(flags):
"""Length of the longest unbroken run of True values."""
best = run = 0
for f in flags:
run = run + 1 if f else 0
best = max(best, run)
return best
def count_runs(flags):
"""Number of separate runs of True values."""
f = np.asarray(flags, dtype=int)
return int(f[0] + np.sum(np.diff(f) == 1))
# ---------- Part 1: compressor power, data set D ----------
STEP = 10.0 # s between readings
p = compressor_power()
n = p.size
hours = n * STEP / 3600.0
q5, q25, q50, q75, q95 = np.percentile(p, [5, 25, 50, 75, 95])
print("Compressor power, one day at 10 s")
print(f" readings {n}, minimum {p.min():.4f} kW, maximum {p.max():.4f} kW")
print(f" mean {p.mean():.4f} kW, median {q50:.4f} kW, "
f"standard deviation {p.std(ddof=1):.4f} kW")
print(f" 25th percentile {q25:.4f} kW, 75th percentile {q75:.4f} kW, "
f"interquartile range {q75 - q25:.4f} kW")
print(f" readings from 0.03 to 1.00 kW: {np.sum((p > 0.03) & (p < 1.00))}")
counts, edges = np.histogram(p, bins=np.arange(0.0, 1.2501, 0.01))
low_bin = int(np.argmax(counts[:60]))
high_bin = 60 + int(np.argmax(counts[60:]))
print(f" lower mode: bin {edges[low_bin]:.2f} to {edges[low_bin + 1]:.2f} kW "
f"with {counts[low_bin]} readings")
print(f" upper mode: bin {edges[high_bin]:.2f} to {edges[high_bin + 1]:.2f} kW "
f"with {counts[high_bin]} readings")
print(f" gap: no reading from {p[p < 0.5].max():.4f} to {p[p > 0.5].min():.4f} kW")
for threshold in (0.10, 0.50, 1.00, 1.14):
print(f" duty with threshold {threshold:.2f} kW: "
f"{100.0 * np.mean(p > threshold):.2f} %")
running = p > 0.50
duty = running.mean()
p_run, p_stop = p[running].mean(), p[~running].mean()
print(f" running: {running.sum()} readings, {running.sum() * STEP / 3600.0:.3f} h, "
f"mean {p_run:.4f} kW, standard deviation {p[running].std(ddof=1):.4f} kW")
print(f" stopped: {(~running).sum()} readings, mean {p_stop:.4f} kW, "
f"standard deviation {p[~running].std(ddof=1):.4f} kW")
print(f" starts {count_runs(running)}, "
f"starts per hour {count_runs(running) / hours:.2f}")
energy_sum = np.sum(p) * STEP / 3600.0
energy_mean = p.mean() * hours
e_run = p[running].sum() * STEP / 3600.0
e_stop = p[~running].sum() * STEP / 3600.0
print(f" energy, sum of power x time: {energy_sum:.3f} kWh")
print(f" energy, mean power x 24 h: {energy_mean:.3f} kWh")
print(f" energy, running {e_run:.3f} kWh + standby {e_stop:.3f} kWh "
f"= {e_run + e_stop:.3f} kWh")
print(f" mean rebuilt from the two states: "
f"{duty * p_run + (1.0 - duty) * p_stop:.4f} kW")
print(f" energy if the median is used: {q50 * hours:.3f} kWh")
# ---------- Part 2: cold room temperature, data set A ----------
temp = cold_room_minutes()
m = temp.size
t5, t25, t50, t75, t95 = np.percentile(temp, [5, 25, 50, 75, 95])
print("Cold room temperature, 14 days at 1 min")
print(f" readings {m}, minimum {temp.min():.2f} degC, maximum {temp.max():.2f} degC")
print(f" mean {temp.mean():.3f} degC, median {t50:.3f} degC, "
f"standard deviation {temp.std(ddof=1):.3f} degC")
print(f" 5th percentile {t5:.2f} degC, 95th percentile {t95:.2f} degC, "
f"interquartile range {t75 - t25:.2f} degC")
for limit in (5.0, 5.2):
above = temp > limit
print(f" above {limit:.1f} degC: {above.sum()} min = {100.0 * above.mean():.2f} % "
f"of the time, in {count_runs(above)} runs, longest {longest_run(above)} min")
above5 = temp > 5.0
print(f" above 5.0 degC: {above5.sum() / 60.0:.1f} h in 14 days, "
f"{above5.sum() / 14.0:.1f} min a day")
print(f" check: the {100.0 * (1.0 - above5.mean()):.2f}th percentile is "
f"{np.percentile(temp, 100.0 * (1.0 - above5.mean())):.3f} degC")
daily = temp.reshape(14, 1440).mean(axis=1)
print(f" daily means from {daily.min():.2f} to {daily.max():.2f} degC")
# ---------- Plot ----------
fig, ax = plt.subplots(1, 2, figsize=(10, 4))
ax[0].hist(p, bins=np.arange(0.0, 1.2501, 0.02), color="tab:blue")
ax[0].axvline(p.mean(), color="tab:red", label=f"mean {p.mean():.3f} kW")
ax[0].axvline(q50, color="black", linestyle="--", label=f"median {q50:.3f} kW")
ax[0].set_xlabel("power (kW)")
ax[0].set_ylabel("number of readings")
ax[0].set_title("Compressor power: two peaks")
ax[0].legend()
ax[1].hist(temp, bins=np.arange(2.6, 5.5001, 0.1), color="tab:blue")
ax[1].axvline(5.0, color="tab:red", label="limit 5.0 degC")
ax[1].axvline(temp.mean(), color="black", linestyle="--",
label=f"mean {temp.mean():.2f} degC")
ax[1].set_xlabel("air temperature (degC)")
ax[1].set_ylabel("number of readings")
ax[1].set_title("Cold room temperature")
ax[1].legend()
fig.tight_layout()
fig.savefig("describing_sensor_data.png", dpi=120)
print("Saved describing_sensor_data.png")

Expected output

Compressor power, one day at 10 s
readings 8640, minimum 0.0120 kW, maximum 1.2338 kW
mean 0.3367 kW, median 0.0141 kW, standard deviation 0.5159 kW
25th percentile 0.0129 kW, 75th percentile 1.1355 kW, interquartile range 1.1227 kW
readings from 0.03 to 1.00 kW: 0
lower mode: bin 0.01 to 0.02 kW with 6205 readings
upper mode: bin 1.15 to 1.16 kW with 482 readings
gap: no reading from 0.0195 to 1.0952 kW
duty with threshold 0.10 kW: 28.18 %
duty with threshold 0.50 kW: 28.18 %
duty with threshold 1.00 kW: 28.18 %
duty with threshold 1.14 kW: 23.68 %
running: 2435 readings, 6.764 h, mean 1.1601 kW, standard deviation 0.0200 kW
stopped: 6205 readings, mean 0.0136 kW, standard deviation 0.0012 kW
starts 52, starts per hour 2.17
energy, sum of power x time: 8.081 kWh
energy, mean power x 24 h: 8.081 kWh
energy, running 7.847 kWh + standby 0.234 kWh = 8.081 kWh
mean rebuilt from the two states: 0.3367 kW
energy if the median is used: 0.338 kWh
Cold room temperature, 14 days at 1 min
readings 20160, minimum 2.66 degC, maximum 5.44 degC
mean 4.013 degC, median 4.015 degC, standard deviation 0.620 degC
5th percentile 3.04 degC, 95th percentile 4.98 degC, interquartile range 1.04 degC
above 5.0 degC: 877 min = 4.35 % of the time, in 676 runs, longest 3 min
above 5.2 degC: 38 min = 0.19 % of the time, in 36 runs, longest 2 min
above 5.0 degC: 14.6 h in 14 days, 62.6 min a day
check: the 95.65th percentile is 5.000 degC
daily means from 4.00 to 4.06 degC
Saved describing_sensor_data.png

In the left plot the mean line stands alone in the empty space between the two peaks. In the right plot the thin tail beyond the limit line is the 877 minutes.

Common Mistakes



  • Reporting the mean power of an on-off machine as if the machine operated at that power. Size cables, supplies and generators from the running power and the start, and use the mean only for energy.
  • Using the median to calculate energy because it is “robust”. Energy is a total, and only the mean multiplied by the duration gives a total.
  • Placing the threshold for “running” at a round number without looking at the histogram. Put it in the empty gap between the peaks, and test that a nearby threshold gives the same duty.
  • Answering a requirement written as a limit with an average. Report the time beyond the limit, the number of runs and the longest run.

Summary



  • Draw the histogram before you report a number. One peak, a skewed peak and two peaks each need a different description.
  • The mean is the balance point and gives totals: energy equals mean power multiplied by duration, exactly, for any shape of data.
  • The median and the interquartile range describe a typical reading and its spread, and one bad reading cannot move them far.
  • An on-off machine is described by its duty and the mean of each state. Its overall mean lies between the peaks, and its overall standard deviation describes neither peak.
  • A requirement written as a limit is answered by the time beyond the limit and the longest run, never by an average.

Exercises



1. A pressure sensor gives seven readings in bar: 3.9, 4.1, 4.0, 4.2, 3.8, 4.0, 9.5. Find the mean and the median. Which describes the typical pressure?

Answer

The sum is 33.5, so the mean is bar. Sorted, the fourth value is 4.0, so the median is 4.0 bar. The median describes the typical pressure. The reading of 9.5 moved the mean by 0.79 bar and must be investigated.

2. Eight pump start times in seconds are 12, 15, 11, 14, 13, 40, 12, 13. Find the quartiles, the interquartile range, the mean and the standard deviation. Use the position rule .

Answer

Sorted: 11, 12, 12, 13, 13, 14, 15, 40. The 25th percentile has , which gives 12.0 s. The median is 13.0 s. The 75th percentile has , which gives s. The interquartile range is 2.25 s. The mean is s and s. The one slow start makes the standard deviation four times the interquartile range.

3. A heater draws 2.0 kW when on and 0.02 kW when off. Its mean power over one day is 0.515 kW. Find the duty and the energy for the day.

Answer

From : , a duty of 25 percent. The energy is kWh.

4. A vaccine store is logged every minute for 30 days. The mean is 5.1 °C. Of the 43,200 readings, 1,512 are above 8.0 °C. The requirement is “not above 8.0 °C for more than 2 percent of the time”. Is the requirement met? What else must be reported?

Answer

percent, which is 25.2 hours. The requirement is not met, although the mean of 5.1 °C looks safe. The report must also give the number of runs above 8.0 °C and the longest run.

5. Change the script to study the lower limit of the cold room. For data set A, find the number of minutes below 3.0 °C, the percentage of the time, and the longest run below 3.0 °C.

Answer

Replace temp > limit with temp < 3.0. There are 735 minutes below 3.0 °C, which is percent of the time, and the longest run is 6 minutes. The runs at the bottom of the band are longer than those at the top because the room warms slowly (0.10 °C per minute) after the compressor stops.

References



  • D. C. Montgomery and G. C. Runger, Applied Statistics and Probability for Engineers, 7th edition, Wiley, 2018.
  • J. W. Tukey, Exploratory Data Analysis, Addison-Wesley, 1977.
  • NIST/SEMATECH, e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012.


© 2021-2026 SiliconWit®. All rights reserved.
Compressor on / off Power meter on supply Logger every 10 s 8,640 readings a day about 1.16 kW running, 0.014 kW stopped
One day of compressor power readings
0 2,000 4,000 6,000 6,205 2,435 readings mean 0.337 kW (no readings) 0.014 stopped 1.16 running 0.337 kW
Histogram of a two-state machine
limit 5.0 °C mean 4.0 °C 3.0 °C time above time above Air temperature example
Time above a limit
Predict first

A report says: the average power of the compressor was 0.337 kW. The compressor is an on-off machine. For how much of the day did it draw between 0.3 and 0.4 kW?

Watch it build: nine readings
3.83.94.04.14.2 °C nine tank readings mean = 36.0 ÷ 9 = 4.0 median: 5th of 9 = 4.0 quartiles 3.9 and 4.1 0.4 0.2 range 0.4, IQR 0.2 s = √(0.12 ÷ 8) = 0.122 40.0 mean 7.6, median 4.0
  1. Nine readings from a tank probe, each dot stacked where it falls on the scale.
  2. The mean is the balance point of the dots: 36.0 ÷ 9 = 4.0 °C.
  3. Sorted, the fifth of nine readings is the middle one: the median is 4.0 °C.
  4. The third and seventh sorted readings are the quartiles: 3.9 and 4.1 °C.
  5. The range, 4.2 − 3.8 = 0.4 °C, rests on two readings. The IQR, 0.2 °C, on the middle half.
  6. The standard deviation, 0.122 °C, is the typical distance of a reading from the mean.
  7. A loose connector reads 40.0 °C. The mean jumps to 7.6 °C; the median stays at 4.0 °C.
See it: a machine with two states
The first two hours of the day
Histogram of the whole day

Mean
Median
Standard deviation, s
Duty
Energy for 24 hours
Within 0.05 kW of the mean

nine readings near 4.0 °Cloose connector: 40.0 °C mean 7.6 °Cmedian 4.0 °C Median: the middle of the line. Mean: the balance point.
676 runs, the longest 3 minutesone run of 14.6 hours day 0day 14day 0day 14 Both: 877 minutes, 4.35 % of the time above 5.0 °C.

Check yourself

Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.

1. A pump runs for 40 percent of the time at 1.5 kW. When it is stopped, its controller draws 0.05 kW. What is the energy for 24 hours?

2. A compressor draws 1.16 kW when it runs and 0.014 kW when it is stopped. Its duty rises from 45 percent to 55 percent. What happens to the mean and to the median?

3. The lesson's compressor has a mean of 0.337 kW and a standard deviation of 0.516 kW. What does the standard deviation tell you?

Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.