Anvil
The complete feature map

Everything Anvil does.

One small core, a large library, and the machinery to solve, sweep, decompose and serve it. Every feature below is real and shipping. Short examples throughout; the Guide and Wiki go deeper.

At a glance
Relations
166 across 33 domains
Units
100+, dimensional
Adapters
15 real tools
Core
numpy · scipy
License
MIT, open source
Foundation

Three types you learn once. Everything else composes from them.

Core primitives.

primitives.pypython
import anvil
from anvil import Q, Relation, System

# Quantity: a value with units, tracked through every op
force = Q(10, "kg") * Q(9.81, "m/s^2")   # 98.1 N

# Relation: a physics function as a reusable component
def kinetic(m, v): return {"KE": Q(0.5*m*v**2, "J")}
ke = Relation(kinetic)(m=2, v=3)             # {'KE': 9.0 J}

# System: wire relations into a solvable graph
sys = System("drop")
sys.add("m", 2, "kg"); sys.use(kinetic)
sys.solve()

Quantity carries units and dimensions; incompatible operations raise instead of silently corrupting a result.

Relation wraps an ordinary function, auto-extracting its inputs and outputs so it can be inspected, unit-checked and reused.

System orders the computation, detects coupling, and picks the solver. No configuration.


100+ units

SI, imperial, and derived, with full dimensional analysis.

A units engine, not a lookup table.

Tracking

Automatic propagation

Units flow through arithmetic; m*a yields newtons without being told.
Safety

Dimension checks

Adding metres to seconds raises; a dimensioned value against a raw float raises.
Conversion

SI on demand

float(q) gives the SI value; convert between any compatible units.
Temperatures

Offset scales

Kelvin, Celsius and Fahrenheit handled with correct offsets, not just factors.

166 relations

Built-in engineering and science knowledge, callable by name.

A physics library across 33 domains.

library.pypython
# call any built-in relation directly
anvil.R.isentropic_ratios(M=2.0, gamma=1.4)
anvil.R.von_mises_stress(sigma_x=80e6, sigma_y=20e6,
                     sigma_z=0, tau_xy=30e6, tau_yz=0, tau_zx=0)
anvil.R.hohmann_transfer(r1=7000e3, r2=42164e3, mu=3.986e14)
anvil.R.nernst_cell_potential(E0=1.10, n=2, T=298.15, Q_rxn=1e-3)

# pre-built solvable systems, including full jet-engine cycles
tj = anvil.S.turbojet_cycle

Relations are grouped by dot-hierarchical domain and reachable as anvil.R.name or anvil.R.domain.name.

Five domains ship as pre-built Systems, including GasTurb-style turbojet, turbofan, afterburner and turboprop cycles with station tables and T-s / h-s diagrams.

Aerospace

Aero & compressible

Isentropic, normal / oblique shocks, Prandtl-Meyer, Fanno, Rayleigh, lift, drag, ISA.
Propulsion

Jet & rocket cycles

Turbojet, turbofan, afterburner, turboprop, nozzles, thrust, specific impulse.
Orbital

Astrodynamics & ADCS

Kepler, Hohmann, bielliptic, plane change, J2, attitude, reaction wheels.
Structures

Stress & stability

Beams, buckling, torsion, principal / von Mises stress, pressure vessels.
Heat transfer

Conduction to HX

Conduction, convection, radiation, fins, LMTD, effectiveness-NTU, transients.
Fluids

Internal flow

Reynolds, Colebrook / Haaland friction, pipe pressure drop, skin friction.
Thermo

Cycles & gases

Ideal gas, Carnot, Brayton, speed of sound, Sutherland viscosity.
Controls

Classical & state-space

PID tuning, step response, Routh-Hurwitz, gain / phase margin, LQR, poles.
Materials

Fatigue & fracture

Safety factor, Basquin fatigue, Miner rule, fracture toughness, composites.
Physics

Fundamentals

Mechanics, electromagnetism, optics, waves, relativity, quantum.
Chemistry

General chemistry

Stoichiometry, gas laws, solutions, colligative, kinetics, equilibrium, electro, acid-base.
Data

Curve fitting

Linear, polynomial, power and exponential regression on data tables.

Compute

From a single forward pass to optimization over a coupled model.

Solvers, sweeps and studies.

study.pypython
sys = anvil.S.rocket_nozzle.copy()
sys.set(P0=10e6, T0=3200)

sys.solve()                       # auto: forward / Gauss-Seidel / Newton
sys.sweep("P0", [5e6, 1e7, 2e7], parallel=4)
sys.sensitivity(outputs=["thrust"]).summary()
sys.optimize("thrust", {"P0": (5e6, 2e7)}, minimize=False)

The solver is chosen for you from the graph structure; you can also force forward, Gauss-Seidel or Newton.

Sweeps run in parallel and export to CSV or JSON; sensitivity ranks normalized influence of each input.

Solvers

Forward to Newton

Automatic ordering, coupling detection, iterative solve with live residuals.
Differential

ODE / BVP / PDE

RK45, BDF, Radau, Crank-Nicolson, boundary-value and 1D PDE patterns.
Optimization

Global & local

Bounded optimization over any output, reusing the same solvable system.
Sweeps

Parallel parametric

Sweep any input over a range, multi-worker, tabulated and plottable.
Sensitivity

Ranked influence

Normalized derivatives of chosen outputs with respect to each input.
Studies

DOE & UQ

Design-of-experiments sampling and uncertainty quantification via adapters.

Beyond relations

Model-order reduction, a built-in flow solver, and signal analysis.

Advanced numerics, built in.

Decomposition

POD & DMD

Proper orthogonal and dynamic mode decomposition for reduced-order models.
Inversion

Abel transform

Forward and inverse Abel for axisymmetric field reconstruction.
CFD

2D Euler solver

A native compressible flow solver with meshing, shocks and field visualization.
Signal

Spectra & filters

FFT spectra, Welch PSD, STFT spectrograms, band-pass filters, correlation.

15 adapters

Industry tools wrapped as native relations. Real results only.

Real solvers, wrapped.

Aerodynamics

XFOIL · SU2

Airfoil analysis and CFD, called as ordinary relations.
CFD

OpenFOAM · gmsh

Finite-volume flow and mesh generation from the same interface.
Structural

FEniCSx · NASTRAN

Finite-element analysis through pyNASTRAN and dolfinx.
Thermochemistry

Cantera · CoolProp

Combustion, equilibrium and fluid property databases.
Astrodynamics

poliastro · pykep

High-fidelity orbits and interplanetary trajectory optimization.
Rocketry

NASA CEA · RocketCEA

Chemical-equilibrium rocket performance and detonation.
Design

OpenMDAO · surrogates

Multidisciplinary optimization and scikit-learn / GPy surrogate models.
Guarantee

No mock fallbacks

Missing a tool raises a clear install-hint error, never a fabricated number.

Your own work

Author, isolate and promote relations without touching the global set.

A registry you can build on.

registry.pypython
# develop in an isolated project store
with anvil.project("study", path="./work") as proj:
    anvil.push(my_relation, domain="aero")   # project only
    proj.R.my_relation(M=2.0)
    anvil.R.isentropic_ratios(M=2.0)      # globals still visible

proj.promote("my_relation")               # graduate to global
anvil.check("my_relation")               # smoke-test any relation

Relations are stored as Python source in a per-project SQLite registry, reconstructed into live callables on demand.

Experiment in a project store, validate with anvil.check, then promote to the global registry when ready.


In the browser

A calculator and a node-graph builder over the same engine.

The web workbench.

Calculator

Any relation, unit-aware

Pick an RSQ, type 500 kPa, read outputs with units and a typeset formula.
Canvas

Node-graph builder

Wire quantities into relations; solve server-side with live residuals over WebSocket.
Packs

Curated collections

Filter the catalog to jet-cycle, compressible, heat, structures, fitting, and more.
Compare

Result tray

Pin runs side by side, one row per variable, export the comparison as CSV.
Reports

HTML & Markdown

Export a solved relation as a self-contained report, alongside CSV and JSON.
Data tables

Curve fitting

Paste a table, map columns to array inputs, read back coefficients and fit.
Keypad

Scratch calculator

A scientific keypad plus memory slots and an auto-log of recent results.
Spotlight

Command palette

Ctrl / Cmd-K fuzzy search over every relation, with keyboard navigation.

Getting running

One command to launch; call it from anywhere.

Start it, then call it.

run.shshell + python
$ python start_anvil.py       # provisions, launches, opens UI
$ anvil doctor                # what tools are usable here
$ anvil serve                 # start the API server

# call a running server from any Python
from anvil.client import AnvilClient
AnvilClient().solve("isentropic_ratios", M=2.0, gamma=1.4)

The core needs only NumPy and SciPy. One command provisions and launches, no npm, no build step; the web bundle ships prebuilt.

Everything is scriptable and REST-addressable: solve, sweep, and read the registry over HTTP, or export CSV and JSON.

Open

Open source, MIT licensed.

Anvil is free to use, read, fork and extend. The core stays lean, numpy and scipy only, with every heavier tool an optional extra. No accounts, no telemetry, no lock-in.

Read the source →
Extensible

Built to be extended by LLMs.

A relation is plain Python stored as source, so an LLM can author one from a page of equations. Anvil ships a feed-me prompt, docs/RSQ_AUTHORING_PROMPT.md, and a pipeline guide; the physics and chemistry packs were authored this way and validated against textbook values before shipping.

See the pipeline →