AI Data Center Power Cost Calculator in Python: PUE, Load Factor, and Grid Delay

A 100-megawatt AI data center sounds like a single number. It is not.

The servers may have a maximum IT capacity of 100 MW, but they do not run at exactly that level every hour. Cooling and power equipment also use electricity. The electricity price can change, and a slow grid connection can delay the entire project.

We can turn these moving parts into a small Python model. The goal is not to predict a real project perfectly. It is to see which assumptions control the answer.

A useful model does not hide uncertainty. It makes each assumption visible so that we can change one value and see what happens.

This article builds on Why Power, Not Chips, May Limit the AI Data Center Boom . That article explains the physical bottleneck. Here, we turn the same idea into a working calculator.

What We Are Going to Build

We will start with five inputs.

Input Meaning Example
IT capacity Maximum electrical power assigned to servers and network equipment 100 MW
Average load factor Average IT load divided by maximum IT capacity 0.85
PUE Total facility energy divided by IT equipment energy 1.30
Electricity price Price paid for one megawatt-hour $70/MWh
Operating hours Hours in one ordinary year 8,760 h

The model follows one simple chain.

IT capacity × load factor × PUE × hours × electricity price

Each multiplication has a physical meaning. We will build the chain one link at a time.

Step 1: Describe the Data Center

Create a new Python file and enter the first assumptions.

Python — Step 1: Input Values
HOURS_PER_YEAR = 8_760

it_capacity_mw = 100
average_load_factor = 0.85
pue = 1.30
electricity_price_per_mwh = 70

The underscore in 8_760 is only a visual separator. Python reads it as the number 8760.

The value average_load_factor = 0.85 means that the average IT load is 85% of the maximum IT capacity. It does not mean that every GPU is busy exactly 85% of the time. It is an early-stage electrical-load assumption.

Step 2: Move from IT Power to Annual Energy

Power and energy are related, but they are not the same.

  • MW measures a rate of electricity use at one moment.
  • MWh measures electricity used over time.

A 100 MW facility running for one hour uses 100 MWh. If the load changes, we first estimate the average power and then multiply by time.

Python — Step 2: Core Calculation
average_it_load_mw = (
    it_capacity_mw
    * average_load_factor
)

average_facility_load_mw = (
    average_it_load_mw
    * pue
)

annual_energy_mwh = (
    average_facility_load_mw
    * HOURS_PER_YEAR
)

annual_electricity_cost = (
    annual_energy_mwh
    * electricity_price_per_mwh
)

The calculation now moves through four levels.

  1. Maximum IT capacity becomes average IT load.
  2. PUE adds cooling and other facility loads.
  3. Hours turn average power into annual energy.
  4. The tariff turns energy into money.

Step 3: Print the First Result

Python — Step 3: Show the Result
print(f"Average IT load: {average_it_load_mw:,.1f} MW")
print(
    "Average facility load: "
    f"{average_facility_load_mw:,.1f} MW"
)
print(
    "Annual electricity use: "
    f"{annual_energy_mwh:,.0f} MWh"
)
print(
    "Annual electricity cost: "
    f"${annual_electricity_cost:,.0f}"
)

Run the file. The result should look like this.

Expected Output
Average IT load: 85.0 MW
Average facility load: 110.5 MW
Annual electricity use: 967,980 MWh
Annual electricity cost: $67,758,600

Stop for a moment and picture the result.

The IT system averages 85 MW, but the whole facility averages 110.5 MW. The difference, 25.5 MW, supports cooling, power conversion, pumps, lighting, and other infrastructure.

Over one year, that total becomes almost 968,000 MWh. At $70 per MWh, the illustrative annual electricity bill is about $67.8 million.

Step 4: Put the Inputs into One Case

Separate variables work for one calculation. A reusable model needs a clearer structure. A Python data class keeps the assumptions for one site together.

Python — Step 4: Define One Data-Center Case
from dataclasses import dataclass


@dataclass(frozen=True)
class DataCenterCase:
    name: str
    it_capacity_mw: float
    average_load_factor: float
    pue: float
    electricity_price_per_mwh: float
    grid_connection_delay_months: float = 0.0
    monthly_delay_cost: float = 0.0

The first four fields describe normal operation. The last two fields describe a simple grid-delay scenario.

We use frozen=True so that a case cannot change by accident after it is created. To test another assumption, we create another case. This makes comparisons easier to audit.

Step 5: Turn the Calculation into a Function

Python — Step 5: Reusable Calculation Function
def calculate_case(case: DataCenterCase) -> dict:
    average_it_load_mw = (
        case.it_capacity_mw
        * case.average_load_factor
    )

    average_facility_load_mw = (
        average_it_load_mw
        * case.pue
    )

    annual_energy_mwh = (
        average_facility_load_mw
        * HOURS_PER_YEAR
    )

    annual_electricity_cost = (
        annual_energy_mwh
        * case.electricity_price_per_mwh
    )

    delay_cost = (
        case.grid_connection_delay_months
        * case.monthly_delay_cost
    )

    return {
        "average_it_load_mw": average_it_load_mw,
        "average_facility_load_mw": average_facility_load_mw,
        "annual_energy_mwh": annual_energy_mwh,
        "annual_electricity_cost": annual_electricity_cost,
        "delay_cost": delay_cost,
    }

A function takes one case and returns several results. The equations have not changed. We have only placed them inside a reusable container.

The delay model is intentionally simple:

Simple delay cost = delay months × assumed monthly delay cost

This is not an accounting standard. The monthly value might represent financing, idle buildings, missed revenue, equipment depreciation, or a chosen combination. The important point is that the assumption is visible.

Step 6: Change PUE and Watch the Bill Move

A single result cannot show sensitivity. We need to change PUE while holding the other assumptions constant.

Python — Step 6: PUE Sensitivity Graph
import matplotlib.pyplot as plt
import numpy as np


pue_values = np.arange(1.10, 1.61, 0.05)
annual_costs_million = []

for changed_pue in pue_values:
    annual_cost = (
        it_capacity_mw
        * average_load_factor
        * changed_pue
        * HOURS_PER_YEAR
        * electricity_price_per_mwh
    )
    annual_costs_million.append(
        annual_cost / 1_000_000
    )

plt.figure(figsize=(10, 6))
plt.plot(
    pue_values,
    annual_costs_million,
    marker="o",
)
plt.xlabel("Power Usage Effectiveness (PUE)")
plt.ylabel("Annual electricity cost (USD million)")
plt.title("A Higher PUE Raises Annual Electricity Cost")
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()

This loop calculates the annual cost for PUE values from 1.10 to 1.60. The result is a straight rising line because PUE enters the simple model as a direct multiplier.

In this example, every 0.10 increase in PUE adds about $5.2 million to annual electricity cost.

The graph does not prove that the lowest possible PUE is always the best design. A more efficient cooling system may require more capital, water, maintenance, or operational complexity. The graph shows the operating-cost side of the trade-off.

Step 7: Compare Cheap Power with Fast Power

Now create two locations.

Python — Step 7: Two Candidate Sites
site_a = DataCenterCase(
    name="Site A: cheap, slow",
    it_capacity_mw=100,
    average_load_factor=0.85,
    pue=1.30,
    electricity_price_per_mwh=50,
    grid_connection_delay_months=48,
    monthly_delay_cost=2_000_000,
)

site_b = DataCenterCase(
    name="Site B: costly, fast",
    it_capacity_mw=100,
    average_load_factor=0.85,
    pue=1.30,
    electricity_price_per_mwh=75,
    grid_connection_delay_months=18,
    monthly_delay_cost=2_000_000,
)

Site A pays less for each MWh, but waits four years for grid access. Site B pays more for electricity but connects in eighteen months.

We assume a monthly delay cost of $2 million for both sites. This number is not a market average. It is a visible scenario input that the reader should replace.

Under these assumptions, Site A saves money on electricity but loses more to the long delay. Site B becomes less expensive in the simple first-year comparison.

Cheap electricity is valuable only after electricity can reach the site.

Change the monthly delay cost to $500,000 and run the model again. Then try $5 million. The preferred site may change. That is the real purpose of the calculator: not to produce one permanent winner, but to show which assumptions control the decision.

How to Run the Complete File

  1. Install Python 3.10 or later.
  2. Save the complete file as ai_data_center_power_cost_calculator.py.
  3. Install the two plotting packages.
Terminal
python -m pip install matplotlib numpy

Move to the folder containing the file and run:

Terminal
python ai_data_center_power_cost_calculator.py

The script prints the three cases and saves two image files in the same folder.

  • pue_cost_sensitivity.png
  • site_cost_comparison.png

The thumbnail for this article is based on the first graph produced by this script. It is not a decorative stock image. It shows one real output from the model.

What This Model Includes—and What It Leaves Out

The calculator is useful for first screening. It is not a full data-center financial model.

Included Not Yet Included
IT capacity and average load factor Hourly and seasonal load variation
PUE Cooling capital cost and water use
Flat electricity price Demand charges, time-of-use tariffs, and taxes
Simple delay cost Discounted cash flow and revenue ramp
Two-site comparison Grid upgrade CAPEX and reliability value

These missing elements are not errors. They are the next building blocks. A model becomes useful by adding detail only when the decision requires it.

Three Experiments to Try

  1. Change PUE from 1.30 to 1.20. How much money does the model save each year?
  2. Raise electricity price from $70 to $100 per MWh. Which variable now deserves more attention?
  3. Reduce average load factor from 0.85 to 0.60. Does the electricity bill fall because the facility became more efficient, or because less IT capacity is being used?

The third question is important. A lower bill is not always a better result. It may mean that expensive computing equipment is sitting idle.

Conclusion

We began with a 100 MW label and turned it into a visible chain of assumptions.

IT capacity and load factor define the average computing load. PUE adds the facility overhead. Time turns power into energy. The electricity price turns energy into operating cost. A delay assumption adds the value of waiting.

Python makes this reasoning repeatable. Change one input, run the model again, and watch the result move.

The most valuable output is not one number. It is a clearer picture of what can change the decision.

Key Vocabulary & Phrases

Load factor

Average load divided by maximum capacity. A lower load factor reduces energy use but may also show unused computing capacity.

Sensitivity analysis

A method that changes one or more assumptions to see how the result responds. The PUE graph is a simple sensitivity analysis.

Facility overhead

Electricity used by cooling, power conversion, lighting, and support systems. PUE helps estimate facility overhead.

Scenario input

An assumed value used to explore a possible case. Monthly delay cost is a scenario input, not a universal market value.

Trade-off

A situation in which improving one result may worsen another. Lower PUE can reduce electricity cost but may require more investment.

Related Articles

References

Published: July 2026 · Model version: 1.0 · Data and references checked through: July 2026 · This calculator is an educational screening tool, not a project quotation.