Preliminary sizing for ROV and rocket projects. SI units, the formula in every docstring, a test behind every number.
The calculations a student team redoes from scratch every season, in one place: pressure hulls, O-ring glands, buoyancy and stability, parachute sizing, opening shock, static margin and shear pins.
Written for the first pass of a design report — the numbers you put in the table, with the assumptions stated so a reviewer can check them. Not a substitute for FEA, CFD or a test to failure.
No dependencies. Pure standard library, so it installs anywhere and will still import in five years.
pip install teknocalcA submerged tube is loaded by external pressure, and it does not fail the way internal pressure would. Long before the wall yields, the cylinder buckles. Size on hoop stress alone and you build a housing that implodes at half its design depth:
from teknocalc.rov import pressure_hull as hull
r = hull.collapse_margin(
depth=30.0,
outer_diameter=0.110,
thickness=0.004,
yield_strength=60e6,
youngs_modulus=2.9e9, # cast acrylic
)
r.governing_mode # 'buckling'
r.yield_safety_factor # 15.0 — looks perfectly safe
r.buckling_safety_factor # 1.16 — one metre deeper and it collapsesAsk for a wall thickness instead and both modes are solved together:
hull.required_thickness(30.0, 0.110, yield_strength=60e6, youngs_modulus=2.9e9, safety_factor=2.0)
# 0.00476 → 4.8 mm of acrylicfrom teknocalc.rov import buoyancy, oring
from teknocalc.rocket import parachute, stabilitySeals. Squeeze and gland fill against the 15–30 % / 70–85 % window, with a warning per violation rather than a bare pass/fail:
oring.check_gland(cord_diameter=3.53, gland_depth=3.40, gland_width=4.60).warnings
# ('squeeze 3.7% is below 15% - the seal will leak',
# 'gland fill 62.6% is below 70% - the ring can roll in the groove')
oring.suggest_gland(3.53) # (2.82, 4.44) mm — depth, widthBuoyancy and stability. Net weight in water, and the BG separation that rights the vehicle after a disturbance:
s = buoyancy.assess_stability(mass=21.0, displaced_volume=0.020, bg_separation=0.04)
s.condition, s.is_stable # ('sinks', True)Recovery. A two-stage plan with the opening shock, which is the load that actually breaks eyebolts and bulkheads:
print(parachute.size_recovery(mass=12.0, apogee=3000.0).summary())drogue D = 0.81 m descent 25.0 m/s
main D = 2.94 m descent 6.0 m/s
main deploys at 200 m
opening shock 3065 N
drift under main at 5 m/s wind: 167 m
3065 N on a 12 kg vehicle — twenty-six times its weight. Size the hardware to that number.
Static stability. Barrowman CP, static margin in calibres, and shear pins:
nose = stability.nose_cone_cp(0.5, "ogive")
fins = stability.fin_cp(
4, root_chord=0.20, tip_chord=0.10, semi_span=0.12, sweep_length=0.10, body_radius=0.05, fin_station=1.60
)
r = stability.assess([nose, fins], cg=1.35, body_diameter=0.10)
r.static_margin, r.verdict # 1.38, 'good'
stability.pins_required(separation_force=400.0, diameter=0.002, shear_strength=65e6)
# 3Every function's docstring carries its formula and states what it assumes. Quote both.
- The hull buckling formula is the long-tube (Bryan) result — no end-cap support, which is conservative and correct for a typical electronics tube. Real tubes collapse below it because of out-of-roundness, which is what the safety factor is for.
- Barrowman CP is valid subsonic, below roughly 15° angle of attack. Above Mach 0.8 treat it as an estimate and cross-check against OpenRocket.
- Thin-wall hoop stress holds while mean diameter over thickness is above about 20.
Stating the assumption is what turns a number into an engineering result. A reviewer who sees a bare figure with no method will mark it, correctly.
uv sync --all-extras --dev
uv run pytest # 93 tests, doctests and README examples included
uv run ruff check .Every example in this README and in the docstrings is executed by the test suite, so the numbers above are the numbers the code produces.
MIT — see LICENSE.
🇹🇷 Türkçe: README.tr.md