Directory
‹ Back to apps

trainhorn-calc

Skills and rules for correct train horn and air horn math: SPL at distance with the inverse-square law (reference distance, units, air absorption, combining horns), air tank runtime from Boyle's law and compressor recovery. Tested snippets for the trainhorn-calc Python library and plain JavaScript.

What’s inside

2 skills
  • Skillair-system-sizingSize an onboard compressed-air system for an air horn or train horn with Boyle's law. Use when code or a question computes how long a tank of given gallons and PSI can sound a horn rated in CFM, how many blasts fit, how big a tank is needed for a target runtime, or how long a compressor takes to refill the tank between cut-in and cut-out pressure. Covers gauge vs absolute pressure, free-air CFM and compressor derating.
  • Skillsound-level-at-distanceCompute the sound pressure level (SPL, dB) of a horn, siren, speaker or other source at a given distance with the inverse-square law. Use when code or a question converts "X dB at Y ft/m" to another distance, finds the distance where a level drops to a limit, adds several sources together, or compares manufacturer dB claims. Covers the reference distance, ft/m units, optional air absorption, combining levels and the common pitfalls.