@theerapat-s28/ts-structural-eng-tools
ts-structural-eng-tools
A TypeScript library of structural-engineering calculations — reinforced-concrete beam design per ACI 318-19, strengthening methods and 3D frame analysis — with typed inputs, code-clause warnings, and SI units throughout.
The package is organised into layered modules, each published as its own subpath export.
Every calculation returns a result object carrying the design value, the intermediate
calculationDetails, the unit, and a warnings array.
unit field.
warnings array, each citing the exact ACI clause. Broken calculation assumptions throw an RCDesignError (or a FrameAnalysisError in the fea module) instead — a result is never silently returned when its assumptions failed.
# pnpm pnpm add @theerapat-s28/ts-structural-eng-tools # npm npm install @theerapat-s28/ts-structural-eng-tools
Import everything from the package root, or narrow to a module through its subpath export:
import { rectBeamMomentCapacity } from "@theerapat-s28/ts-structural-eng-tools"; import { rectBeamMomentCapacity } from "@theerapat-s28/ts-structural-eng-tools/rc"; import { calculateSteelJacketedBeamMomentCapacity } from "@theerapat-s28/ts-structural-eng-tools/strengthening"; import { analyzeFrame } from "@theerapat-s28/ts-structural-eng-tools/fea"; import { RCDesignError } from "@theerapat-s28/ts-structural-eng-tools/core"; import { roundToDecimalPlaces } from "@theerapat-s28/ts-structural-eng-tools/utils";
Design moment capacity of a singly reinforced rectangular section:
import { rectBeamMomentCapacity } from "@theerapat-s28/ts-structural-eng-tools/rc"; const result = rectBeamMomentCapacity({ Es: 200000, // MPa fy: 400, // MPa fc: 28, // MPa b: 300, // mm h: 500, // mm d: 440, // mm As: 1520, // mm² }); console.log(result.phiMn, result.unit); // design moment capacity, kN·m console.log(result.warnings); // code-clause warnings, if any
Units are implicit in the numbers — no unit objects, no conversion wrappers. Supply SI values and read the unit field of the result.
| Quantity | Unit | Notes |
|---|---|---|
| fc, fy, Es | MPa | Concrete strength, steel yield strength, elastic modulus |
| b, h, d, d′ | mm | Section geometry, measured from the compression face |
| As, As′ | mm² | Reinforcement areas |
| phiMn | kN·m | Design moment capacity (φ applied) |
| phiVc, phiVs | kN | Design shear capacity contributions (φ applied) |
calculationDetails may differ in the last digit.
| Subpath | Module | Contents |
|---|---|---|
| . | root barrel | Re-exports every public function, type, constant, and error below |
| ./rc | RC Beam Design | Moment and shear capacity, stirrup checks, bar layout, section properties for frame analysis, material helpers |
| ./strengthening | Strengthening | Steel-plate jacketing, side plate shear strengthening (non-code models per AISC 360 G2.1 / ACI 440.2R-17 §11.4), and plate-to-concrete interface bolting |
| ./fea | Frame Analysis | 3D direct-stiffness frame analysis with load cases and combinations, member loads, self-weight and releases, force diagrams, envelopes, design demands, reference beam stiffness matrix |
| ./core | Core | Section and result types, ACI constants, frame constants, RCDesignError and Errors, FrameAnalysisError and FrameErrors |
| ./utils | Utils | solveQuadratic, roundToDecimalPlaces, mergeWarnings, matrix helpers (matMul, transpose, choleskySolve, …), skyline (banded) Cholesky solver and reverseCuthillMcKee ordering |