Skip to main content

SciEng Formulary

SciEng Formulary is a curated, machine-readable library of verified scientific and engineering formulas for humans, Python programs, and AI agents.

Every formula carries:

  • its equation;
  • input variables and the output variable, each with a dimension and a reference SI unit;
  • assumptions and applicability limits, written so you can tell when not to use it;
  • one or more authoritative references, rendered in IEEE style;
  • an executable Python evaluator;
  • numerical verification cases that the evaluator must reproduce.

It is meant for engineers, scientists and students, and for the programs, AI agents and CAD/CAE/analysis workflows that need a formula they can look up, check and evaluate:

scientific or engineering question
  -> search for a formula
  -> inspect its variables and assumptions
  -> inspect its authoritative references
  -> evaluate it
  -> use the result in any downstream workflow

The package uses only the Python standard library.

Installation

Once SciEng Formulary is published on PyPI (it has not been released yet):

pip install sciengformulary

Until then, install it from a clone; see Development.

Quick start

from sciengformulary import formulas

f = formulas.get("aerodynamics.dynamic_pressure")
print(f.equation)                    # q = 0.5 * rho * V^2
print(f.input_names)                 # ('rho', 'V')
print(f.assumptions[0])              # when the formula applies
print(f.references[0].format_ieee()) # verified source, IEEE style

result = f.evaluate(rho=1.225, V=120.0)  # 8820.0 (Pa, for SI inputs)

More of the API:

formulas.list()                       # every formula, sorted by id
formulas.search("normal shock")       # deterministic keyword search
f.verification_cases                  # known input/output cases
f.verify()                            # re-run them; raises ValueError on a mismatch
f.to_dict()                           # all metadata, including structured references
                                      # and verification cases, as JSON-ready data

A formula can also be imported directly:

from sciengformulary.catalog.aerodynamics import dynamic_pressure

What is in the catalog

The catalog contains 320 formulas, organised by knowledge domain:

Domain Formulas Examples
aerodynamics 35 lift and drag, induced drag, isentropic and normal-shock relations, 1976 standard atmosphere layers, Barrowman rocket stability, stall and climb, Sears-Haack wave drag
electrical 2 Ohm's law, conductor resistance
fluids 22 hydrostatics, Reynolds number, Pitot airspeed, Poiseuille flow, Darcy-Weisbach and friction factors, Manning/Chezy, Sutherland viscosity, wind-shear power law
heat_transfer 51 conduction, convection correlations (Gnielinski, Churchill-Bernstein, Churchill-Chu), radiation exchange, effectiveness-NTU, dimensionless groups, LMTD
materials 15 true stress and strain, elastic constants, von Mises, fracture, Weibull
mathematics 91 combinatorics, series, triangle and solid geometry, vectors and determinants, 2x2 eigenvalues, probability distributions, gamma, beta and incomplete gamma/beta functions
mechanics 23 kinematics, friction, energy, momentum, vibration, springs and torque
nuclear 3 radioactive decay, half-life, activity
orbital 29 Kepler's third law, vis-viva, conic orbits and anomalies, Hohmann and bi-elliptic transfers, hyperbolic and parabolic orbits, J2 nodal precession, sphere of influence
propulsion 12 rocket thrust, specific impulse, Tsiolkovsky rocket equation, thrust coefficient, nozzle expansion ratio, solid-motor relations
structures 17 axial deformation, bending stress, torsion, beam deflections, fixed-end moments and reactions, beam and plate stiffness
thermodynamics 20 ideal gas, kinetic theory, entropy, Carnot limits, specific heats, Antoine vapour pressure

Only formulas that have been checked against an authoritative source are included. Candidates that could not be verified, or whose sources disagree, are left out rather than added with a weaker guarantee.

How formulas are verified

A formula is checked in two different ways.

References and human review establish that the formula is right.

  • Every formula has at least one authoritative ReferenceSpec: a standards body or government technical organisation (NASA, NIST, NACA reports), an established textbook, a peer-reviewed paper, or official university teaching material. A FormulaSpec without one cannot be constructed.
  • References are stored as structured fields (authors, organisation, title, year, URL, locator, ...). IEEE is the only citation style; format_ieee() renders it.
  • Locators (section, equation, figure) point at where the relationship was checked. Reviewers open the source and confirm the equation, its notation and its assumptions.

Verification cases establish that the code is right.

  • Every formula has at least one VerificationCase: inputs, an expected result determined independently of the evaluator (a published worked example or table, or an independent calculation from the published equation), and a tolerance.
  • verify() checks that the evaluator reproduces every case. It runs when each formula is constructed and again in CI.
  • A passing case shows that the Python code implements the declared equation. It does not show that the equation is scientifically correct or applies to your problem.

Check the whole installed catalog at any time:

python -m sciengformulary.validation

Units

  • Evaluators do no unit conversion. You are responsible for passing every input in one consistent unit system; the result comes out in the matching unit of that system.
  • Each variable's si_unit is its canonical reference SI representation, and dimension gives its base dimensions (M, L, T, Theta, N, I).
  • Empirical formulas whose coefficients only hold in particular units say so in their assumptions.
  • Formulas that need physical constants (Boltzmann, Planck, Stefan-Boltzmann, G, standard gravity) use the CODATA 2022 values in SI units, so their other inputs must be in SI units.

Development

git clone https://github.com/2ssunny/sciengformulary.git
cd sciengformulary
pip install -e .
python -m sciengformulary.validation

Repository structure

src/sciengformulary/
├─ __init__.py          # `formulas` registry instance
├─ validation.py        # whole-catalog checks (python -m sciengformulary.validation)
├─ core/
│  ├─ reference.py      # ReferenceSpec (structured source, IEEE rendering)
│  ├─ verification.py   # VerificationCase (known input/output case)
│  ├─ variable.py       # VariableSpec
│  ├─ spec.py           # FormulaSpec
│  └─ registry.py       # FormulaRegistry: get / list / search
└─ catalog/             # one package per knowledge domain, one file per formula
   ├─ _sources.py       # shared bibliographic records
   ├─ _constants.py     # CODATA constants with their NIST references
   ├─ aerodynamics/
   ├─ ...
   └─ thermodynamics/

Contributing

See CONTRIBUTING.md for the source-quality, anti-fabrication, verification-case and units rules, and RELEASING.md for how releases are published.

License

Licensed under the Apache License 2.0. See LICENSE.

Metadata

Release files for sciengformulary 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sciengformulary 1.1.0
File Size Uploaded
sciengformulary-1.1.0.tar.gz 293.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sciengformulary 1.1.0
File Interpreter ABI Platform
sciengformulary-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 865.8 kB

Release files / sciengformulary-1.1.0.tar.gz

Download URL sciengformulary-1.1.0.tar.gz
Size 293.3 kB
Tags Source
SHA-256 checksum
How to use checksums
97e75b467b3be670743a100ef03eece43729debee82b1122be3645eeffc5d39d
BLAKE2b-256 checksum
How to use checksums
cb93fe2ba83e6e8900182e155bf8c7d200f821edc028e6b94e959deb516685d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / sciengformulary-1.1.0-py3-none-any.whl

Download URL sciengformulary-1.1.0-py3-none-any.whl
Size 572.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78f65bfdd10c8d275bea272a907a2db9d5808fac01169ab378840602596ed0d1
BLAKE2b-256 checksum
How to use checksums
de0f31567a215fb2783b7f522bd153b2d230c1a40b13a0d7aa05a589c254c9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.0

2 release files

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page