The calculation engine

Units: getting your quantity onto the factor's basis

You enter litres; the publisher prices per tonne, or per gigajoule, or per gallon. Slate converts exactly, refuses conversions that don't make physical sense, and never invents a density.

On this page you'll learn

  • How a quantity is converted onto a factor's unit
  • Where density and heat content come from
  • Which conversions are refused, and why
Function
normalize_activity_to_basis
Density / heat content
Your entry, then the publisher's, then Slate's fuel table
Constants
Exact where a definition exists

How a conversion works

The quantity is reduced to whichever physical measures can be known or derived (mass, volume, energy, distance), then expressed in the one the factor needs. Density bridges mass and volume; net calorific value bridges mass and energy.

Worked example500 litres of diesel against a factor per GJ
Mass: 500 L × density 0.84 kg/L
420 kg
Energy: 420 kg × NCV 43.0 MJ/kg
18,060 MJ
On the factor's basis
18.06 GJ
Multiplied by the factor
per GJ

Illustrative density and NCV. In a real calculation the values used, and where they came from, are recorded on the row.

Where density and heat content come from

  1. 1

    Your activity record

    If you entered a density or calorific value, it wins: it's specific to your fuel.

  2. 2

    The publisher

    If the factor's publisher states one, it's used, so a DEFRA factor uses DEFRA's net values and an EPA factor uses EPA's gross ones.

  3. 3

    Slate's fuel table

    The last resort, needed because publishers rarely give densities for gases and liquids. CNG and LPG are normally sold by mass.

Withheld on purpose

Seven fuels have no default property. Ethane and ethylene had gas-phase densities while EPA prices them per liquid gallon, about 400 times out. Bagasse, bamboo, hardwood, softwood and straw had calorific values that appear in no EPA publication, and raw biomass varies with moisture from about 7 to 19 MJ/kg. The plant that burns them supplies its own.

What is refused

  • Different physical dimensions

    A mass can't become a distance. Slate raises an error instead of returning a number.

  • A gas volume standing in for a liquid volume

    scf and gallons are both volumes. Each unit carries a phase so that ethane in scf can't be priced per liquid gallon.

  • Composite bases

    tonne-km, passenger-km, room-night, head-year and FTE-hour are never converted through a plain mass or distance. They're passed through as tallies.

  • Litres of compressed gas

    Ambiguous for CNG, and silently about 1,000 times under. Refused for mobile combustion.

Exact constants

UnitExact value
Pound0.45359237 kg
Mile1,609.344 m
Short ton907.18474 kg
International Btu1,055.05585262 J

Correcting truncated constants moved EPA results by at most 4.8 parts per million. A worse error was found the same way: a kg-per-kWh constant labelled per terajoule held the per-gigajoule value, a factor of 1,000.