Optional workbooksOptional workbooks · 12 min
Sizing and total cost
Compare capacity choices and five-year cost under shared uncertain demand.
Sizing selects installed capacity under uncertain demand. Total cost of ownership (TCO) totals the costs inside a stated boundary; here it includes capital purchase (capex) and electricity over five years. Capacity is useful work per day. Reserve leaves headroom: the .8 factor makes only 80% of sustainable capacity available to the planned load. Prices and capacities are invented.
One small-fleet world with 8 units gives 8×220×.8=1,408 work units/day of usable capacity. Power is a rate in kilowatts (kW); energy is power times time in kilowatt-hours (kWh). At .25 kW each, 8 units use 17,520 kWh/year. At an invented £.20/kWh, five-year electricity is £17,520; adding £40,000 purchase gives £57,520. The code varies the shared world inputs, not this arithmetic.
Each world draws initial daily demand, one annual growth rate g and an energy price. Year t demand multiplies the initial value by (1+g)^t: growth compounds on earlier growth. The fleet stays fixed for five years; shortfalls are reported, not silently repaired by purchases. Costs are nominal undiscounted totals: no conversion of future payments to today's value. Staffing, support, replacements and financing require an explicit extension.
The code's required-unit diagnostic rounds up demand divided by usable capacity per unit; it does not buy those units during a trial. Any capacity failure means at least one of the five years fails.
- One demand world
- Apply a fixed fleet choice
- Count the five-year costs
Should a cheaper option with insufficient capacity appear feasible merely because its mean cost is low?
Write a prediction (optional)
Seeded teaching simulation
Select Run Python below with the code unchanged.
A saved draft is open. To run the published example, open Tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
Your result
Published example output
This result comes from the original Python. Your runs appear above. Build environment ↗
Small fleet P(any capacity shortfall): 0.449 TCO P90 (£): 65548 P(over budget): 0.0 P90 required units: 11.0 Larger fleet P(any capacity shortfall): 0.047 TCO P90 (£): 98322 P(over budget): 0.0 P90 required units: 11.0 Dense fleet P(any capacity shortfall): 0.07 TCO P90 (£): 98767 P(over budget): 0.0 P90 required units: 7.0
Read the first result
The required-unit diagnostic describes demand; it does not change the fixed fleet policy or its cost. Costs are nominal undiscounted five-year totals.
Try an edit
At the end of the cost line inside the fleet loop, add + units*years*300, representing £300 of annual support per installed unit. Select Run Python again. Compare TCO P90 (£) and P(over budget) by fleet. Why does adding support leave P(any capacity shortfall) unchanged?
Scope. All prices and capacities are invented. The fixed fleet model omits failures, expansions, financing, tax, staffing and time discounting.
Try a fresh case
Which comparison is meaningful before choosing a fleet?
Need a hint?
Hint 1
Write the service requirement first.
Hint 2
A low cost is not enough when the option cannot perform the required work.