Skip to main content

stages-thermo

A staged-separation (distillation) learning library and fast steady-state column solver, built on vle-thermo.

import stages — walk the full pedagogical ladder of column methods (McCabe–Thiele → Ponchon–Savarit → Fenske–Underwood–Gilliland shortcut → rigorous MESH), each implemented from scratch and anchored to its textbook equations, with a granular, batch-capable API ("numpy for distillation columns"). All thermodynamics come from vle-thermo; this package adds none of its own.

pip install stages-thermo           # import name is `stages`
pip install "stages-thermo[plot]"   # + matplotlib for the staircase diagrams

Status: 0.2.x ships the first two rungs of the ladder — the binary McCabe–Thiele (Milestone 1) and Ponchon–Savarit (Milestone 2) layers: equilibrium and enthalpy–composition (H–x–y) curves from real thermodynamics, minimum reflux by geometric pinch detection (tangent pinches included), stage stepping with Murphree efficiency, total reflux, N(R), the energy-exact difference-point construction (with condenser/reboiler duties), the NRTL γ-φ model, per-phase enthalpies, and the diagram plots. Multicomponent and rigorous MESH solvers land milestone by milestone — see the repo's ROADMAP.md. The API may still move before 1.0.

import stages

# Real thermodynamics from vle-thermo: Peng–Robinson benzene–toluene at 1 atm
# (light component first; units K / kPa absolute / mole fractions).
sys = stages.ThermoSystem.peng_robinson(["benzene", "toluene"])
curve = stages.EquilibriumCurve.from_thermo(sys, 101.325)

# Minimum reflux by pinch detection — tangent pinches included …
r = stages.rmin(curve, x_distillate=0.95, x_bottoms=0.05, z_feed=0.50, q=1.0)

# … then the full construction. Rich result objects, never bare numbers:
design = stages.mccabe_thiele(curve, 0.95, 0.05, 0.50, reflux=1.5 * r.r_min)
print(f"N = {design.n_stages:.2f} stages, feed stage {design.feed_stage}, "
      f"R_min = {r.r_min:.3f}")

design.stages          # every (x, y) stage corner
design.staircase       # the full polyline, ready to plot
design.rectifying      # operating lines as slope/intercept
r.pinch, r.tangent     # where the pinch sits, and whether it's a tangent pinch

# The staircase diagram (requires the [plot] extra):
# from stages import plotting
# plotting.plot_mccabe_thiele(design, curve, show_rmin=True)

Strongly non-ideal systems go through the γ-φ route — the same construction, different thermodynamics:

# van Laar methanol–water (the system validated in vle's Chapter IV notebooks).
mw = stages.ThermoSystem.van_laar(["methanol", "water"], 0.5853, 0.3458)
curve_mw = stages.EquilibriumCurve.from_thermo(mw, 101.325)

Rung 2 — Ponchon–Savarit — closes the energy balance on the enthalpy–composition (H–x–y) diagram, so it also returns the condenser and reboiler duties (which McCabe–Thiele cannot):

# H–x–y curve: saturated-liquid and -vapor enthalpies alongside y*(x).
ec = stages.EnthalpyCurve.from_thermo(sys, 101.325)
ps = stages.ponchon_savarit(ec, x_distillate=0.95, x_bottoms=0.05,
                            z_feed=0.50, reflux=1.5)
print(f"N = {ps.n_stages:.2f} stages, feed stage {ps.feed_stage}")
print(f"Q_C/F = {ps.q_condenser:,.0f}, Q_R/F = {ps.q_reboiler:,.0f} kJ/kmol feed")
ps.delta_d, ps.delta_b   # the two difference points (poles), (x, H) in kJ/kmol

# NRTL for strongly non-ideal aqueous-organic systems (a12/a21 in kJ/kmol):
aw = stages.ThermoSystem.nrtl(["ammonia", "water"], a12=-1800.0, a21=-1200.0, alpha=0.2)
# from stages import plotting; plotting.plot_ponchon_savarit(ps, ec)

The executable learning path lives in the repo's notebooks/ — 01-mccabe-thiele.ipynb and 02-ponchon-savarit.ipynb design benzene–toluene, methanol–water, and ammonia–water columns end-to-end, with exercises.

The native core is a Rust crate (stages-thermo on crates.io) with PyO3 bindings; wheels are abi3 (cp310-abi3-*), so one wheel per (OS, arch) covers CPython 3.10+.

License

MIT © Miguel Roberto Jackson Ugueto

Metadata

Release files for stages-thermo 0.2.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 stages-thermo 0.2.0
File Size Uploaded Provenance Actions
stages_thermo-0.2.0.tar.gz 57.3 kB With provenance Details for stages_thermo-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for stages-thermo 0.2.0
File Actions
stages_thermo-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for stages_thermo-0.2.0-cp310-abi3-win_amd64.whl
stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
stages_thermo-0.2.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for stages_thermo-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 1.6 MB

Release files / stages_thermo-0.2.0.tar.gz

Download URL stages_thermo-0.2.0.tar.gz
Size 57.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6086b58d4aaa21100a6505727b28b9e950950302f7fcdb6b911dc21e9984719f
BLAKE2b-256 checksum
How to use checksums
524f06ca783ac315ec3f30dd85ca84331617f81ef28a26b41d28dbe89597270a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 10, 2026.

Transparency log

Release files / stages_thermo-0.2.0-cp310-abi3-win_amd64.whl

Download URL stages_thermo-0.2.0-cp310-abi3-win_amd64.whl
Size 327.3 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e35b76223f8c0dd6d96efb1ad1b8066828610f2641dd2bca53d68c14165d683c
BLAKE2b-256 checksum
How to use checksums
60b5059f4c5e86756db50011a97876dd9325fe3e02e6f1af55e3b4a3d5c79999
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 10, 2026.

Transparency log

Release files / stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 434.4 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
81dd41a48e2817bab9b9279f0bcdc18de54033ca4d852201607fb7a5fa78f278
BLAKE2b-256 checksum
How to use checksums
4e2c3d75de13ce1c7191829a1c5ec4b8c92c7481be816e9a45fb84378ecdd7a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 10, 2026.

Transparency log

Release files / stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL stages_thermo-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
Size 421.5 kB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
cf4a0ca97e581ec9393e4a8531ea44e9327cd08918c5d2c009fb7200cd86b28d
BLAKE2b-256 checksum
How to use checksums
5dd216653aa8a1e9f03ab0191c0ca9f5df399d6865cd2a0551219e088b68708a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 10, 2026.

Transparency log

Release files / stages_thermo-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL stages_thermo-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 397.2 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1e8ffef2d3799c3970d04cfee8c3c6e6a2efaf6bf83dee6f74fb66f3ff17c7be
BLAKE2b-256 checksum
How to use checksums
539c4e7cfd49471c26dfedf47b592b1a3233806552fb164efc5d1f927f12e072
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 10, 2026.

Transparency log

Security for stages-thermo 0.2.0

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for stages_thermo-0.2.0.tar.gz

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 Jul 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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