Engineering Calculator Library — Ideal Gas, Ohm's Law, Mohr's Circle, Beam Analysis, and more with rich Jupyter output
Project description
🔬 Phaxor — Engineering Calculator Library
Embeddable engineering calculations for JavaScript and Python.
Install
pip install phaxor
Quick Start
import phaxor
# Ideal Gas Law
result = phaxor.compute('ideal-gas', {
'solveFor': 'pressure',
'volume': 0.02241,
'moles': 1,
'temperature': 273.15,
'gas': 'air'
})
print(f"Pressure = {result['P']:.0f} Pa") # 101325 Pa
# Ohm's Law
result = phaxor.compute('ohms-law', {
'solveFor': 'I',
'voltage': 12,
'resistance': 100
})
print(f"Current = {result['I']} A") # 0.12 A
# Unit Conversion
km = phaxor.convert('length', 1, 'mi', 'km')
print(f"1 mile = {km:.6f} km") # 1.609344 km
# Mohr's Circle
result = phaxor.compute('mohrs-circle', {
'sigmaX': 80,
'sigmaY': -40,
'tauXY': 30,
'theta': 25
})
print(f"σ₁ = {result['sigma1']:.1f} MPa")
# List all calculators
for calc in phaxor.list_calculators():
print(f" {calc['id']:20s} {calc['name']}")
Available Calculators (All 74 Engines)
| ID | Name | Category |
|---|---|---|
arrhenius |
Arrhenius | Chemical |
cstr |
CSTR Design | Chemical |
chem-equilibrium |
Chem Equilibrium | Chemical |
distillation |
Distillation | Chemical |
gibbs |
Gibbs | Chemical |
pfr |
PFR Design | Chemical |
packed-bed |
Packed Bed | Chemical |
stoichiometry |
Stoichiometry | Chemical |
vle |
VLE / Phase Equilibrium | Chemical |
battery-ups |
Battery Ups | Electrical |
cable-sizing |
Cable Sizing | Electrical |
circuit-breaker |
Circuit Breaker | Electrical |
dc-motor |
DC Motor | Electrical |
earthing |
Earthing | Electrical |
electrical-efficiency |
Electrical Efficiency | Electrical |
energy-consumption |
Energy Consumption | Electrical |
impedance |
Impedance | Electrical |
induction-motor |
Induction Motor | Electrical |
ohms-law |
Ohm's Law | Electrical |
power |
Power | Electrical |
pf-correction |
Power Factor Correction | Electrical |
rectifier |
Rectifier | Electrical |
resonance |
Resonance | Electrical |
short-circuit |
Short Circuit | Electrical |
solar-sizing |
Solar Sizing | Electrical |
transformer |
Transformer | Electrical |
geometry |
Geometry | General |
matrix |
Matrix | General |
unit-converter |
Unit Converter | General |
open-channel |
Open Channel Flow | Hydraulics |
pavement-thickness |
Pavement Thickness | Hydraulics |
sight-distance |
Sight Distance | Hydraulics |
weir-orifice |
Weir & Orifice | Hydraulics |
apf |
Atomic Packing Factor | Materials |
corrosion |
Corrosion | Materials |
fatigue-life |
Fatigue Life | Materials |
hardness-conversion |
Hardness Conversion | Materials |
rule-of-mixtures |
Rule of Mixtures | Materials |
beam |
Beam | Mechanical |
bearing-life |
Bearing Life | Mechanical |
belt-drive |
Belt Drive | Mechanical |
bolt-analysis |
Bolt Analysis | Mechanical |
cop |
Coefficient of Performance | Mechanical |
flywheel |
Flywheel | Mechanical |
gear-ratio |
Gear Ratio | Mechanical |
heat-exchanger |
Heat Exchanger | Mechanical |
heat-transfer |
Heat Transfer | Mechanical |
ideal-gas |
Ideal Gas Law | Mechanical |
pipe-flow |
Pipe Flow | Mechanical |
pressure-force |
Pressure Force | Mechanical |
pump-power |
Pump Power | Mechanical |
rankine-cycle |
Rankine Cycle | Mechanical |
shaft-design |
Shaft Design | Mechanical |
spring-design |
Spring Design | Mechanical |
torque-power |
Torque Power | Mechanical |
vibration |
Vibration | Mechanical |
weld-strength |
Weld Strength | Mechanical |
beam-deflection |
Beam Deflection | Structural |
bearing-capacity |
Bearing Capacity | Structural |
column-buckling |
Column Buckling | Structural |
concrete-volume |
Concrete Volume | Structural |
development-length |
Development Length | Structural |
earth-pressure |
Earth Pressure | Structural |
failure-theory |
Failure Theory | Structural |
isolated-footing |
Isolated Footing | Structural |
mohrs-circle |
Mohr's Circle | Structural |
rcc-beam |
RCC Beam Design | Structural |
rcc-column |
RCC Column Design | Structural |
rcc-slab |
RCC Slab Design | Structural |
reinforcement-qty |
Reinforcement Qty | Structural |
settlement |
Settlement | Structural |
soil-properties |
Soil Properties | Structural |
steel-weight |
Steel Weight | Structural |
stress-strain |
Stress Strain | Structural |
Pipe Flow (Detailed Model)
import phaxor
# Pressure-driven solve using NPS + Schedule diameter lookup
result = phaxor.compute('pipe-flow', {
'solveMode': 'known-pressures',
'nps': '4',
'schedule': '40',
'length': 120,
'roughness': 0.000045,
'minorLossK': 6.5,
'elevationChange': 5,
'inletPressure': 220, # kPa gauge
'outletPressure': 0, # kPa gauge
'density': 998,
'viscosity': 0.001002
})
print(f"Q = {result['flowRate']*3600:.2f} m3/h")
print(f"ID source = {result['diameterSource']}")
print(f"Delta P = {result['pressureDeltaKPa']:.2f} kPa")
The pipe-flow engine now supports:
known-flowandknown-pressuresboundary modes- Flow input by volumetric flow, mass flow, or velocity
- Minor loss (
K) and elevation/pump head terms - Pipe sizing by direct diameter or
nps + schedule - Extended outputs (major/minor loss split, power estimates, turbulence initialization fields)
Jupyter Notebooks
In Jupyter, calling phaxor.compute() automatically renders a styled HTML table:
import phaxor
# This renders a beautiful HTML table in Jupyter!
phaxor.compute('ideal-gas', {
'solveFor': 'pressure',
'volume': 0.02241,
'moles': 1,
'temperature': 273.15,
})
API
phaxor.compute(calculator_type, inputs) # Run any calculator
phaxor.convert(category, value, from_unit, to_unit) # Unit conversion
phaxor.list_calculators() # List all available calculators
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phaxor-1.0.1.tar.gz
(69.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
phaxor-1.0.1-py3-none-any.whl
(90.3 kB
view details)
File details
Details for the file phaxor-1.0.1.tar.gz.
File metadata
- Download URL: phaxor-1.0.1.tar.gz
- Upload date:
- Size: 69.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a60b2a5c41dda9932923f17fa47caee8370942685f8373909aff8c49d82c36c4
|
|
| MD5 |
2fcc56b31731891bf34d0ba2f5772fc2
|
|
| BLAKE2b-256 |
a40d141e99dd31f41b8e41499106284878d0638d756b6b1c75e13cb92d0491b6
|
File details
Details for the file phaxor-1.0.1-py3-none-any.whl.
File metadata
- Download URL: phaxor-1.0.1-py3-none-any.whl
- Upload date:
- Size: 90.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03113f05d9a5503d46fc23b7e12ef94de58b9f9eda65eabaaf0002731f8f98cd
|
|
| MD5 |
4eb6785f7277ccfb93b76a92dc8e5b66
|
|
| BLAKE2b-256 |
8cd566e50360787559c515fdeb9f1d4aea198748caab6cfaef59a8e690dab9b3
|