Plant meeting | Fresh steam per tonne

Summary

Fresh steam per tonne rose from 111.11 kg/t on January 1 to 307.14 kg/t on January 2 (utility_batches.xlsx, both sheets). The two-day comparison does not establish a loss of efficiency.

January 1 pooled rate

111.11 kg/t

Fresh steam in kg divided by output in tonnes across 5 assigned records, including any shutdown at 0 kg and 0 t.

January 2 pooled rate

307.14 kg/t

Fresh steam in kg divided by output in tonnes across 4 assigned records, including any shutdown at 0 kg and 0 t.

January 1 pooled minus simple

-38.89 kg/t

Difference of the two January 1 rates in kg/t. This subtraction has no numerator or denominator.

January 2 pooled minus simple

82.14 kg/t

Difference of the two January 2 rates in kg/t. This subtraction has no numerator or denominator.

The pooled ratio weights each producing batch by tonnes. The simple average gives each producing batch equal weight.
Two producing batches used zero recorded fresh steam. Individual rates span 0 to 400 kg/t.

Charts

How far apart are the two daily calculations?

daily_rates · n = 2

Excluded 0

How far apart are the two daily calculations?
Observation
Both plotted days are included. Daily totals use nine matched records from both sheets. The simple averages use four producing batches per day and exclude the zero-output shutdown.
Domain interpretation
The pooled ratio weights each producing batch by tonnes. The simple average gives each producing batch equal weight.

Which individual batch rates underlie the daily averages?

batch_rates · n = 8

Excluded 0

Which individual batch rates underlie the daily averages?
Observation
Eight producing batches are plotted in kg/t, four per day, with zero rendering exclusions. The input omits the confirmed duplicate at batches row 12 and the zero-output shutdown at row 6.
Domain interpretation
Two producing batches used zero recorded fresh steam. Individual rates span 0 to 400 kg/t.

Assumptions & limitations

  • The workbook covers recorded batch-associated fresh steam only. There are two dates and gaps between recorded batch intervals. The data do not measure plant-wide steam outside the recorded intervals or establish comparable operating conditions.
  • No blanks or parsing failures occur in the relevant source data. After excluding the one exact production duplicate, there are no duplicate batch IDs or reading IDs. Meter readings have one deliberately repeated batch ID.
  • The 9.5 t, 3,800 kg product H batch on January 2 is the largest observed batch and remains in scope. Its rate equals the other product H batch rates.
  • Individual points show the distribution directly with eight batches, so a histogram is omitted. A continuous time chart would imply coverage through gaps in the records.

Ambiguity log

IDItemStatusAnswer
A01Business processresolvedThe request identifies batch production and steam metering. Rows identify running batches and one shutdown.
Evidence and options
file_evidence
  • utility_batches.xlsx, batches rows 3–12 and meter_readings rows 3–12
A02DecisionresolvedCompare fresh steam per tonne and assess what the change says about efficiency.
Evidence and options
file_evidence
  • User request for the daily plant meeting
A03Row meaningresolvedUser confirmed both rows represent one batch and chose row 10.
Evidence and options
question
Should I count rows 10 and 12 once as one physical batch?
file_evidence
  • utility_batches.xlsx, batches rows 10 and 12
candidates
  • One physical batch
  • Two distinct records that both count
affects
  • January 2 rates and product mix
A04Units and denominatorsresolvedUse recorded output in tonnes for the pooled ratio and one equal weight per positive-output batch for the simple average, as requested.
Evidence and options
file_evidence
  • utility_batches.xlsx, batches F2:G12 and meter_readings D2:D12
A04BMeter reading meaningresolvedUser confirmed 80 kg and 120 kg are additive increments.
Evidence and options
question
Are the two readings separate amounts or cumulative totals?
file_evidence
  • utility_batches.xlsx, meter_readings rows 3 and 4
candidates
  • Separate amounts
  • Cumulative values
affects
  • Daily pooled rates
  • Simple batch averages
  • Pooled minus simple
A05Time basisresolvedUser assigned all of B-0016 to its January 1 start date in Korea Standard Time.
Evidence and options
question
Which day should receive the whole batch?
file_evidence
  • utility_batches.xlsx, batches row 7 and meter_readings row 8
candidates
  • January 1 start date
  • January 2 end date
affects
  • Daily pooled rates
  • Simple batch averages
  • Pooled minus simple
A06Shutdown outputresolvedUser confirmed zero output. The shutdown has an undefined individual rate.
Evidence and options
question
Does zero mean no output or inapplicable or unrecorded production?
file_evidence
  • utility_batches.xlsx, batches row 6
candidates
  • Zero output
  • Inapplicable or unrecorded
A06BShutdown steamresolvedUser confirmed measured zero steam during the shutdown.
Evidence and options
question
Was shutdown steam a measured zero or unrecorded?
file_evidence
  • utility_batches.xlsx, meter_readings row 7
candidates
  • Measured zero
  • Unrecorded
A07Missingness and zero steam on January 1resolvedUser confirmed B-0016 used no fresh steam. No blank cells in the original data rows.
Evidence and options
question
Does the recorded zero mean measured zero or unavailable steam?
file_evidence
  • utility_batches.xlsx, meter_readings row 8
candidates
  • Measured zero
  • Unavailable
affects
  • Daily pooled rates
  • Simple batch averages
  • Pooled minus simple
A07BZero steam on January 2resolvedUser confirmed B-0017 used no fresh steam.
Evidence and options
question
Does the recorded zero mean measured zero or unavailable steam?
file_evidence
  • utility_batches.xlsx, meter_readings row 9
candidates
  • Measured zero
  • Unavailable
affects
  • Daily pooled rates
  • Simple batch averages
  • Pooled minus simple
A08Join keysresolvedAll nine unique batch IDs match. Sum increments by batch_id before the one-to-one merge.
Evidence and options
file_evidence
  • utility_batches.xlsx, batches A3:A12 and meter_readings B3:B12

Data overview

datasets
  • id
    batches
    format
    XLSX
    rows
    10
    columns
    7
    read_ranges
    • utility_batches.xlsx, batches A1:G12. Group headers in row 1, field names in row 2, records in rows 3–12. Merged spans A1:B1, C1:D1 and E1:G1.
  • id
    meter_readings
    format
    XLSX
    rows
    10
    columns
    4
    read_ranges
    • utility_batches.xlsx, meter_readings A1:D12. Group headers in row 1, field names in row 2, records in rows 3–12. Merged spans A1:B1 and C1:D1.
row_grain
One production record per batch or shutdown after deduplication, and one steam increment per reading. ZIP workbook parts match the .xlsx extension. Both sheets were read in full.

Metrics

MetricValueDefinitionNumeratorDenominatorConditionSources
January 1 pooled rate111.11 kg/tFresh steam in kg divided by output in tonnes across 5 assigned records, including any shutdown at 0 kg and 0 t.500.04.5
  • utility_batches.xlsx, batches rows 3, 4, 5, 6, 7
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 6, 7, 8
January 1 simple batch average150 kg/tSum of individual batch kg/t rates divided by the number of positive-output batches, with equal weight per batch.600.04
  • utility_batches.xlsx, batches rows 3, 4, 5, 7
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 6, 8
January 1 pooled minus simple-38.89 kg/tDifference of the two January 1 rates in kg/t. This subtraction has no numerator or denominator.
  • utility_batches.xlsx, batches rows 3, 4, 5, 6, 7
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 6, 7, 8
January 1 product L pooled rate75 kg/tTotal fresh steam divided by total output for the 3 producing batch(es) of product L.300.04.0
  • utility_batches.xlsx, batches rows 3, 4, 7
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 8
January 1 product H pooled rate400 kg/tTotal fresh steam divided by total output for the 1 producing batch(es) of product H.200.00.5
  • utility_batches.xlsx, batches rows 5
  • utility_batches.xlsx, meter_readings rows 6
January 1 product H output share11.11 %Product H tonnes divided by all positive output tonnes.0.54.5
  • utility_batches.xlsx, batches rows 3, 4, 5, 7
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 6, 8
January 2 pooled rate307.14 kg/tFresh steam in kg divided by output in tonnes across 4 assigned records, including any shutdown at 0 kg and 0 t.4,300.014.0
  • utility_batches.xlsx, batches rows 8, 9, 10, 11
  • utility_batches.xlsx, meter_readings rows 9, 10, 11, 12
January 2 simple batch average225 kg/tSum of individual batch kg/t rates divided by the number of positive-output batches, with equal weight per batch.900.04
  • utility_batches.xlsx, batches rows 8, 9, 10, 11
  • utility_batches.xlsx, meter_readings rows 9, 10, 11, 12
January 2 pooled minus simple82.14 kg/tDifference of the two January 2 rates in kg/t. This subtraction has no numerator or denominator.
  • utility_batches.xlsx, batches rows 8, 9, 10, 11
  • utility_batches.xlsx, meter_readings rows 9, 10, 11, 12
January 2 product L pooled rate75 kg/tTotal fresh steam divided by total output for the 2 producing batch(es) of product L.300.04.0
  • utility_batches.xlsx, batches rows 8, 9
  • utility_batches.xlsx, meter_readings rows 9, 10
January 2 product H pooled rate400 kg/tTotal fresh steam divided by total output for the 2 producing batch(es) of product H.4,000.010.0
  • utility_batches.xlsx, batches rows 10, 11
  • utility_batches.xlsx, meter_readings rows 11, 12
January 2 product H output share71.43 %Product H tonnes divided by all positive output tonnes.10.014.0
  • utility_batches.xlsx, batches rows 8, 9, 10, 11
  • utility_batches.xlsx, meter_readings rows 9, 10, 11, 12
January 2 minus January 1 pooled rate196.03 kg/tDifference of daily pooled rates in kg/t. This subtraction has no numerator or denominator.
  • utility_batches.xlsx, batches rows 3, 4, 5, 6, 7, 8, 9, 10, 11
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

Reproducibility

filters
  • Use the recorded start date in Korea Standard Time, including all of B-0016 on January 1.
  • Use the same eligible records for both pooled totals. For the simple average, require positive tonnes.
exclusions
  • scope
    All metrics and charts
    source_refs
    • utility_batches.xlsx, batches row 12
    reason
    Exact duplicate of row 10, removed with user confirmation.
  • scope
    Simple batch averages, batch-rate figure and product comparisons
    source_refs
    • utility_batches.xlsx, batches rows 6
    • utility_batches.xlsx, meter_readings rows 7
    reason
    Shutdown had 0 t output and 0 kg steam, so its individual rate is undefined. It contributes zero to both daily totals.
transforms
  • input
    batches
    transform
    Exclude confirmed duplicate and express output in tonnes
    output
    unique batches
    before
    10
    after
    9
  • input
    meter_readings
    transform
    Sum kilograms by batch_id
    output
    steam per batch
    before
    10
    after
    9
  • input
    unique batches
    transform
    One-to-one merge by batch_id
    output
    matched batch records
    before
    9
    after
    9
  • input
    steam per batch
    transform
    One-to-one merge by batch_id
    output
    matched batch records
    before
    9
    after
    9
  • input
    matched batch records
    transform
    Assign start date in KST and aggregate daily totals
    output
    daily rates
    before
    9
    after
    2
  • input
    matched batch records
    transform
    Calculate rates for batches with positive output
    output
    plotted batch rates
    before
    9
    after
    8
sample_sizes
original_batch_records
10
meter_readings
10
matched_records
9
January_1_batch_rates
4
January_2_batch_rates
4
source_locators
  • utility_batches.xlsx, batches rows 3, 4, 5, 6, 7, 8, 9, 10, 11
  • utility_batches.xlsx, meter_readings rows 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
  • utility_batches.xlsx, batches row 12 (logged duplicate)

Code

# Run from eda-work with Python 3.10+ and the supplied dependencies.
python3 -I delivery/clean.py ../utility_batches.xlsx delivery/cleaned_utility_batches.csv excluded.csv
python3 -I ../eda-skill/scripts/audit_clean.py ../utility_batches.xlsx --header-row 2 --cleaned delivery/cleaned_utility_batches.csv --excluded excluded.csv
python3 -I analyze.py
python3 -I ../eda-skill/scripts/plots.py --spec plot-spec.json --outdir delivery/figures
# Contents of analyze.py
import json
from pathlib import Path

import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd


data = pd.read_csv("delivery/cleaned_utility_batches.csv", dtype={"batch_id": str, "reading_id": str})
batches = data.loc[data["_source_sheet"].eq("batches"), [
    "_source_row", "batch_id", "product", "start_at", "end_at", "status", "production", "production_unit"
]].rename(columns={"_source_row": "batch_row"}).copy()
meter = data.loc[data["_source_sheet"].eq("meter_readings"), [
    "_source_row", "reading_id", "batch_id", "reading_at", "steam_kg"
]].rename(columns={"_source_row": "meter_row"}).copy()
for frame in (batches, meter):
    assert frame.notna().all().all()
    assert not frame.drop(columns=frame.columns[0]).duplicated().any()
assert batches["batch_id"].is_unique and meter["reading_id"].is_unique
assert set(batches["batch_id"]) == set(meter["batch_id"])
assert set(batches["production_unit"]) == {"kg", "t"}
batches["output_t"] = pd.to_numeric(batches["production"]) * batches["production_unit"].map({"kg": 0.001, "t": 1})
batches["start_at"] = pd.to_datetime(batches["start_at"]).dt.tz_localize("Asia/Seoul")
batches["end_at"] = pd.to_datetime(batches["end_at"]).dt.tz_localize("Asia/Seoul")
meter["reading_at"] = pd.to_datetime(meter["reading_at"]).dt.tz_localize("Asia/Seoul")
meter["steam_kg"] = pd.to_numeric(meter["steam_kg"])
assert batches["output_t"].ge(0).all() and meter["steam_kg"].ge(0).all()
assert len(meter.merge(batches[["batch_id"]], on="batch_id", validate="many_to_one")) == len(meter)
by_batch = meter.groupby("batch_id", as_index=False).agg(steam_kg=("steam_kg", "sum"), meter_rows=("meter_row", list))
joined = batches.merge(by_batch, on="batch_id", validate="one_to_one")
assert len(joined) == len(batches) == len(by_batch)
assert joined["steam_kg"].sum() == meter["steam_kg"].sum()
assert joined["output_t"].sum() == batches["output_t"].sum()
assert sum(map(len, joined["meter_rows"])) == len(meter)
joined["day"] = joined["start_at"].dt.strftime("%Y-%m-%d")
joined["rate"] = joined["steam_kg"].div(joined["output_t"].where(joined["output_t"].gt(0)))
running = joined.loc[joined["output_t"].gt(0)]
assert running["status"].eq("running").all()
running.to_csv("batch_rates.csv", index=False)
daily = joined.groupby("day").agg(steam_kg=("steam_kg", "sum"), output_t=("output_t", "sum"),
                                  rate_sum=("rate", "sum"), n_rates=("rate", "count"))
daily["pooled"] = daily["steam_kg"] / daily["output_t"]
daily["simple"] = daily["rate_sum"] / daily["n_rates"]
daily["gap"] = daily["pooled"] - daily["simple"]
product = running.groupby(["day", "product"]).agg(steam_kg=("steam_kg", "sum"),
                                                   output_t=("output_t", "sum"), batches=("rate", "count"))
product["pooled"] = product["steam_kg"] / product["output_t"]
product["output_share"] = product["output_t"] / product.groupby(level="day")["output_t"].transform("sum")
print(joined[["batch_row", "meter_rows", "product", "day", "output_t", "steam_kg", "rate"]].to_string(index=False))
print(daily.to_string())
print(product.to_string())

results = {
    "daily": daily.reset_index().to_dict("records"),
    "product": product.reset_index().to_dict("records"),
    "records": json.loads(joined[["batch_row", "meter_rows", "day", "product", "output_t", "steam_kg", "rate"]].to_json(orient="records")),
}
Path("results.json").write_text(json.dumps(results, indent=2))

fig, ax = plt.subplots(figsize=(7.5, 4.2), layout="constrained")
figure_data = daily[["pooled", "simple"]].rename(columns={"pooled": "Total steam ÷ total output", "simple": "Simple batch average"})
figure_data.index = ["January 1", "January 2"]
figure_data.plot.bar(ax=ax, color=["#126A73", "#C76135"], width=0.58, rot=0)
for bars in ax.containers:
    ax.bar_label(bars, fmt="%.2f", padding=4)
ax.set(ylim=(0, 365), xlabel="Batch start date (KST)", ylabel="Fresh steam (kg/t)",
       title="Daily fresh-steam intensity by calculation")
ax.legend(frameon=False, loc="upper left")
ax.spines[["top", "right"]].set_visible(False)
fig.savefig("delivery/figures/daily_rates.png", dpi=160)