Simulate systems over timeLesson 42 of 76 · 9 min

Failure and repair use up time

Estimate finite-horizon availability while accounting for the full observation window.

Availability over a finite window is the fraction of that window during which the system is working. A failure probability for an entire mission answers a different question. A repairable system can fail and return to service within the same observation.

The model alternates exponential working and repair periods, starts healthy, and clips each interval at the horizon. That clipping prevents a long final interval from contributing time outside the observed window. Retain both working and down time as a ledger check.

For this simple alternating process, a long-run availability reference is mean uptime divided by mean uptime plus mean repair time. A finite window starting healthy need not equal that limit. Compare longer horizons and state the starting condition before interpreting the average.

Account for the whole time window
  1. Alternate states
    up→repair→up\text{up}\to\text{repair}\to\text{up}
  2. Clip the final segment
    Tup+Tdown=100T_{\rm up}+T_{\rm down}=100
  3. Finite-window availability
    A=up time/100A=\text{up time}/100
Reference illustration. The authored horizon is 100 time units. The last segment must stop at the horizon. The long-run ratio 10/(10+2) is a reference, not an exact claim about every finite window.

Should a repair that ends after the horizon contribute its entire duration?

Write a prediction (optional)

Seeded teaching simulation

Select Run Python below with the code unchanged.

Tools
About Python ↗

The code is editable. Press Ctrl+Enter or ⌘+Enter to run Python from the editor.

Published example output

This result comes from the original Python. Your runs appear above. Build environment ↗

Mean finite-window availability: 0.8332
Long-run reference for this model: 0.8333

Read the first result

The time ledger sums to the horizon in every trial. The finite healthy-start result is not automatically a stationary availability estimate.

Try an edit

Replace horizon = 100 with horizon = 1000. Select Run Python again. Compare Mean finite-window availability with Long-run reference for this model before and after the change. Does a longer window make the healthy start less important?

Back to the Python editor

Scope. The model assumes independent exponential working and repair periods and omits shared failures and maintenance scheduling.

Try a fresh case

Which definition matches finite-window availability?

Choose an answer
Need a hint?
Hint 1

Keep the units of the numerator and denominator visible.

Hint 2

Ask how an early failure followed by quick repair should count.

Your notes