← Subpart

Methodology

How the numbers get made, and how you can check them.

An air permit application rests on its emission calculations. Every compressor station, tank battery, and dehydrator has a potential to emit that has to be quantified before it can be permitted, and that number decides which rules apply, how long review takes, and what controls get installed. This page describes how Subpart produces those calculations and how anyone can audit them. It is not the product; it is the reasoning behind it.

The problem

Emission calculations are almost always produced by consultants – engineering firms that build the inventory in spreadsheets and process simulators and hand the operator a package to file. The agency on the other end is supposed to check that work. In practice, state air programs are understaffed and reviewing more applications than they can audit line by line. A reviewer confirms that the form is complete, the right subparts are cited, and the totals are internally consistent. Re-deriving a floating-roof tank’s standing loss from first principles, for every tank in every application, is not something a review queue has time for.

That leaves the calculation functionally unauditable by anyone outside the firm that produced it. The inputs live in a licensed simulator. The emission factors are transcribed by hand. The arithmetic is buried in spreadsheet cells. If a factor is wrong, or a value is entered wrong, the resulting document still looks exactly like a correct one. Nobody downstream – the operator paying for it, the agency approving it, the people living next to the site – is positioned to catch the error.

The approach

Subpart separates the part of the work that needs judgment from the part that needs to be exact.

The calculations live in a deterministic layer written in Python. Every emission factor, equation, and lookup comes from a public source – AP-42, the federal greenhouse-gas rules under Subpart W, EPA’s fugitive-component method, the Peng-Robinson equation of state for vapor pressure – and every number the engine returns carries the citation, the factor, and the equation that produced it. Given the same inputs, it returns the same output every time, with a trail back to the regulation.

Around that sits a retrieval corpus of public material: the regulations themselves, and real permits already on file with agencies. That is what the system reads to answer questions about applicability and precedent.

The language model’s job is deliberately small. It routes. It reads what the operator describes, decides which calculation applies and which regulatory text is relevant, and asks for the inputs the deterministic layer needs. It does not generate emission factors and it does not do the math. The numbers come from the Python layer, the citations come from the corpus, and the model connects a plain-language description of a facility to the right pieces of both.

Why this architecture

The failure mode we designed against is the plausible wrong answer.

A model asked to produce an emission calculation directly will, when it does not know a factor, produce one anyway. It states an AP-42 value that is close but not correct, or applies an equation that fits the shape of the problem but not the case. The output reads as authoritative – units, a citation, a clean total – and is wrong in a way that survives a quick look. In a domain whose entire purpose is to produce a document that will be trusted and filed, that is the worst behavior available.

A deterministic layer removes that surface. The engine cannot invent a factor it does not have; it either cites a value or it stops. Because the calculation is code with a fixed method, it can be checked the way any calculation is checked: line by line, factor against source, against the regulation it claims to implement. The model can still be wrong about routing – it might reach for the wrong calculation – but a routing error is visible in a way a fabricated number is not, because the calculation it lands on shows its work.

What the validation establishes

Two separate things are tested, and they establish different claims. Kept apart on purpose, because conflating them is how software gets oversold.

The first is a suite of more than a thousand automated tests that run against the engine. These establish that the engine computes what the published methods specify: each equation implemented as written, each emission factor matching its source, each unit conversion correct, and the edge cases behaving. This is internal correctness. It says the engine faithfully carries out AP-42, Subpart W, and the referenced federal methods. It does not say those methods match any particular real facility.

The second is a set of comparisons against seven real permits filed with and reviewed by the Texas Commission on Environmental Quality. Here the engine is given the same facility inputs a consultant used, and its output is compared to the numbers in the permit as filed. Across those seven, facility-wide totals reproduce the permit’s reported potential to emit within a few percent on the criteria pollutants and VOC, and the places where the engine and the permit diverge trace to a specific cause – most often a regulatory-basis choice, meaning which agency-approved factor to use, or a rule revision that changed a factor between the permit’s filing date and the current standard. Where the two disagree, we can say why.

These are different kinds of evidence. The tests establish that the method is implemented correctly. The seven permits establish that, on real applications produced independently by consultants and accepted by an agency, the engine lands where the accepted work landed. Seven is a small number, and we report it as one: corroboration on real cases, not a statistical guarantee across every facility that exists.

Limits

The engine covers the federal New Source Performance Standards for oil and gas – NSPS Subparts OOOOa, OOOOb, and OOOOc – and the equipment and source categories that go with them. It does not cover other source categories, other industries, or the wider body of state-specific methods beyond what those subparts and the referenced federal methods define.

We can also name where it is weakest. Composition-driven vapor pressure for heavy or aromatic-rich streams is approximated with a small catalog of surrogate components, and that approximation flattens on the heaviest condensates – the one place our TCEQ comparisons show a double-digit divergence rather than a low single-digit one. Agency-specific factor choices differ, and the engine’s default is one defensible choice among several. And it computes what it is given: an operator who supplies a wrong throughput or the wrong stock gets a wrong answer, correctly derived. The engine makes a calculation auditable. It does not make the inputs true.


Questions about the methodology, or want to compare it against a permit you already have? Reach out – josephkminton@gmail.com.