How the calculator works
ShaftLab is a small finite-element and fatigue engine written from scratch in plain JavaScript. Everything runs in your browser; nothing is sent anywhere.
The mechanics
The shaft is meshed into about 300 Euler–Bernoulli elements, cut at every step boundary, bearing, load and feature so that each element has a single well-defined cross-section. Four decoupled problems are solved on that mesh:
| Problem | Unknowns per node | Gives |
|---|---|---|
| bending in x–y | v, θz | My(x), deflection and slope in that plane |
| bending in x–z | w, θy | Mz(x), deflection and slope |
| axial | u | N(x) |
| torsion | φ | T(x) and the twist |
The two bending planes are combined vectorially afterwards. Because a round shaft has the same I about every axis, they genuinely are independent — this is not an approximation.
The fatigue engine
At every sampled section the tool works out the local diameter and bore, finds which notch (if any) is active there, computes Kt from the geometry, converts it to Kf through the Neuber notch sensitivity, builds Se with the local kb, and evaluates the chosen criterion. The output is a safety factor for every section, not one number for the shaft.
Where the numbers come from
- Shoulder fillets and U-grooves — Peterson’s polynomial curve fits (Pilkey, Peterson’s Stress Concentration Factors), evaluated from the actual D/d and r/d.
- Keyways, ring grooves, press fits — the standard design estimates (Shigley Table 7-1), because the local geometry is set by the tool or the standard rather than by you. Every one of them can be overridden.
- Notch sensitivity, Marin factors, the DE criteria — Shigley, Mechanical Engineering Design, chapters 6 and 7.
- Key sections — DIN 6885-1.
How it was checked
The engine reproduces Shigley’s worked Examples 7-1 to 7-3 — the four fatigue criteria on a shouldered shaft (within 0.7 %), the reactions and moment diagrams of a two-gear countershaft (exactly), and its deflections and slopes (within a few per cent, the residual being how precisely the step positions can be read off the figure). Closed-form cases — simply supported bending, twist of a uniform shaft, and the critical speed of a uniform shaft — match to better than 0.1 %.
What is deliberately not modelled
- Shear deformation — Euler–Bernoulli only. Fine for L/d above about 10.
- Bearing stiffness — bearings are treated as ideal simple supports, which makes the computed slopes slightly pessimistic and the critical speed slightly low.
- Gyroscopic effects and damping in the critical-speed estimate.
- Transverse holes are given a design Kt on the gross section rather than a net-section analysis — override it if the hole is critical.
- Residual stresses, case-hardening depth profiles, welds, and finite-life (< 10⁶ cycle) design.
- Buckling of long slender shafts in compression, and lateral-torsional effects.